Be case-insensitive when checking Owls values for Dyeworks status

Just to be a bit more resilient! I'm not aware of any issues rn but
this seems wise!
This commit is contained in:
Emi Matchu 2024-06-18 15:20:27 -07:00
parent 015010345a
commit 98ecbf029d

View file

@ -14,16 +14,18 @@ class Item
# Whether this is one of the few Dyeworks items that can be dyed in the NC # Whether this is one of the few Dyeworks items that can be dyed in the NC
# Mall at any time, rather than as part of a limited-time event. (Owls tracks # Mall at any time, rather than as part of a limited-time event. (Owls tracks
# this, not us!) # this, not us!)
DYEWORKS_PERMANENT_PATTERN = /Permanent Dyeworks/i
def dyeworks_permanent? def dyeworks_permanent?
return false if nc_trade_value.nil? return false if nc_trade_value.nil?
nc_trade_value.value_text.include?("Permanent Dyeworks") nc_trade_value.value_text.match?(DYEWORKS_PERMANENT_PATTERN)
end end
# Whether this is a Dyeworks item that can be dyed in the NC Mall ~right now, # Whether this is a Dyeworks item that can be dyed in the NC Mall ~right now,
# but only as part of a limited-time event. (Owls tracks this, not us!) # but only as part of a limited-time event. (Owls tracks this, not us!)
DYEWORKS_LIMITED_PATTERN = /Limited Dyeworks/i
def dyeworks_limited? def dyeworks_limited?
return false if nc_trade_value.nil? return false if nc_trade_value.nil?
nc_trade_value.value_text.include?("Limited Dyeworks") nc_trade_value.value_text.match?(DYEWORKS_LIMITED_PATTERN)
end end
# Whether this is a Dyeworks item that can be dyed in the NC Mall ~right now, # Whether this is a Dyeworks item that can be dyed in the NC Mall ~right now,