From 7247a6fb0b3b374f3dac651bd2b133bcb5303534 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 26 May 2021 21:26:58 -0400 Subject: Simple effect checking allows listern font level 2 to have an effect --- app/models/built_hearth_amenity.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/built_hearth_amenity.rb') diff --git a/app/models/built_hearth_amenity.rb b/app/models/built_hearth_amenity.rb index 39b6679..a1e35e8 100644 --- a/app/models/built_hearth_amenity.rb +++ b/app/models/built_hearth_amenity.rb @@ -28,4 +28,8 @@ class BuiltHearthAmenity < ApplicationRecord seconds_until_cooled_down = cooldown - (Time.now - self.last_used_at) [0, seconds_until_cooled_down].max end + + def effects + self.hearth_amenity.whatnot[:effects]&.reject { |e| e[:level] > self.level } + end end -- cgit v1.2.3