summaryrefslogtreecommitdiff
path: root/app/models/built_hearth_amenity.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-26 21:26:58 -0400
committerDavid Gay <david@davidgay.org>2021-05-26 21:26:58 -0400
commit7247a6fb0b3b374f3dac651bd2b133bcb5303534 (patch)
treeb8d27ff62025494ce39fed0cc9b3f77309658cab /app/models/built_hearth_amenity.rb
parent8cec9b3f6f277399c6da23a04d8afb0c68cf8a2b (diff)
Simple effect checking allows listern font level 2 to have an effect
Diffstat (limited to 'app/models/built_hearth_amenity.rb')
-rw-r--r--app/models/built_hearth_amenity.rb4
1 files changed, 4 insertions, 0 deletions
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