diff --git a/app/models/item.rb b/app/models/item.rb index 353e4f4a..ea399cb3 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -12,7 +12,8 @@ class Item < ActiveRecord::Base NCRarities = [0, 500] PAINTBRUSH_SET_DESCRIPTION = 'This item is part of a deluxe paint brush set!' - SPECIAL_COLOR_DESCRIPTION_REGEX = /This item is only wearable by Neopets painted ([a-zA-Z]+)\./ + SPECIAL_COLOR_DESCRIPTION_REGEX = + /This item is only wearable by Neopets painted ([a-zA-Z]+)\.|WARNING: This [a-zA-Z]+ can be worn by ([a-zA-Z]+) [a-zA-Z]+ ONLY!/ SPECIAL_PAINTBRUSH_COLORS_PATH = Rails.root.join('config', 'colors_with_unique_bodies.txt') SPECIAL_PAINTBRUSH_COLORS = File.read(SPECIAL_PAINTBRUSH_COLORS_PATH).split("\n").map { |name| Color.find_by_name(name) } @@ -102,7 +103,8 @@ class Item < ActiveRecord::Base match = description.match(SPECIAL_COLOR_DESCRIPTION_REGEX) if match - return Color.find_by_name(match[1].downcase) + color = match[1] || match[2] + return Color.find_by_name(color.downcase) end end public diff --git a/config/basic_type_hashes.yml b/config/basic_type_hashes.yml index cbd741f5..166654ea 100644 --- a/config/basic_type_hashes.yml +++ b/config/basic_type_hashes.yml @@ -54,6 +54,7 @@ chia: yellow: oqs3kzmf baby: kvm8jr9k mutant: mnf38rsr + pea: mn53trx7 chomby: blue: h3qctoxg green: 552mzx7r