diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/character.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/has_costs_and_requirements.rb | 2 |
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 |