summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-31 20:12:09 -0400
committerDavid Gay <david@davidgay.org>2021-05-31 20:12:09 -0400
commit3b3d0ddaaa368359a474b60c79771406168e7e1e (patch)
treee723cedae7ad89a3efa60db20f107fd28e12cbce
parentd187b3e5f640a3524bd4d648dbec30a07335d41e (diff)
Change rested time mechanic to require more active play, and update changelog for 0.1.4.1 release
-rw-r--r--CHANGELOG.md6
-rw-r--r--app/models/character.rb5
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3981c11..20dcb7b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.
+## [0.1.4.1] - 2021-05-31
+
+### Changed
+- Max rested time reduced from 10 days to 12 hours
+- Rested time is now used to cut your timer in half, rather than reduce it by a flat amount
+
## [0.1.4] - 2021-05-31
### Added
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