summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-07-07 21:10:29 -0400
committerDavid Gay <david@davidgay.org>2021-07-07 21:11:20 -0400
commit9c015e16340c80a35aad1cde299218c650f5ba35 (patch)
treeb471b8ea53f801d01b2cb5706d93aec3a1aadc6e /app
parent8c93c5e29eceb9e85cb3eaa7ecc25653ffc50189 (diff)
Lusterlight brand omen, and make lusterlight tincture only craftable during firstlight
Diffstat (limited to 'app')
-rw-r--r--app/models/character.rb2
-rw-r--r--app/models/concerns/has_costs_and_requirements.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/app/models/character.rb b/app/models/character.rb
index 655bb82..4237d50 100644
--- a/app/models/character.rb
+++ b/app/models/character.rb
@@ -306,6 +306,8 @@ class Character < ApplicationRecord
return false unless self.skill_level(requirement[:gid]) >= requirement[:level]
when "hearth_amenity"
return false unless self.hearth.has_amenity?(requirement[:gid], requirement[:level])
+ when "time_of_day"
+ return false unless requirement[:times].include? World.time_of_day.to_s
else
raise "Invalid requirement type string (#{requirement[:type]})"
end
diff --git a/app/models/concerns/has_costs_and_requirements.rb b/app/models/concerns/has_costs_and_requirements.rb
index 9c4abf8..61ce461 100644
--- a/app/models/concerns/has_costs_and_requirements.rb
+++ b/app/models/concerns/has_costs_and_requirements.rb
@@ -29,6 +29,8 @@ module HasCostsAndRequirements
end
when "hearth_amenity"
requirements.push "level #{req[:level]} #{HearthAmenity.find_by_gid(req[:gid]).name}"
+ when "time_of_day"
+ requirements.push "a certain time of day (#{req[:times].join(", ")})"
else
raise "Invalid requirement type string (#{req[:type]})"
end