diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/character.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/character.rb b/app/models/character.rb index 25a4ac5..b7b323d 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -207,7 +207,7 @@ class Character < ApplicationRecord def rested_duration_to_spend_on_activity return nil unless self.activity - [duration_of_activity - 10, self.rested_duration].min + [(duration_of_activity / 2).floor, self.rested_duration].min end def can_do_activity?(activity, ignore_cost: false, ignore_requirements: false) @@ -264,8 +264,7 @@ class Character < ApplicationRecord return false unless self.started_resting_at Character.transaction do seconds_of_this_rest = (Time.now - self.started_resting_at).to_i - # Maximum rested duration is 10 days. - new_rested_duration = [(seconds_of_this_rest + self.rested_duration), (60 * 60 * 24 * 10)].min + new_rested_duration = [(seconds_of_this_rest + self.rested_duration), (60 * 60 * 12)].min self.update(started_resting_at: nil, rested_duration: new_rested_duration) end end |