From 9c015e16340c80a35aad1cde299218c650f5ba35 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 7 Jul 2021 21:10:29 -0400 Subject: Lusterlight brand omen, and make lusterlight tincture only craftable during firstlight --- app/models/character.rb | 2 ++ app/models/concerns/has_costs_and_requirements.rb | 2 ++ 2 files changed, 4 insertions(+) (limited to 'app') 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 -- cgit v1.2.3