summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-07 19:49:17 -0400
committerDavid Gay <david@davidgay.org>2021-06-07 19:49:17 -0400
commit831e3ff7f43ae7acf2aaf589c4f0794649da4f85 (patch)
tree0b456dc5c05fa4e631085a560dc2ab78fbe77f19 /app/models
parent39ff6a5146cd81c5d6c245b2ceb2ec14d0693520 (diff)
Allow negative resistances, speed, accuracy, power, and evasion
Diffstat (limited to 'app/models')
-rw-r--r--app/models/character.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/character.rb b/app/models/character.rb
index 15169a4..f2c450e 100644
--- a/app/models/character.rb
+++ b/app/models/character.rb
@@ -339,7 +339,7 @@ class Character < ApplicationRecord
res = (res * 0.75).ceil if elusive?
res = (res * 1.25).floor if protective?
- [res, 0].max
+ res
end
def max_wounds
@@ -351,11 +351,11 @@ class Character < ApplicationRecord
end
def speed
- [self.beastslay_level + total_stat_change("speed"), 0].max
+ self.beastslay_level + total_stat_change("speed")
end
def accuracy(with_combat_style: false)
- base = [self.beastslay_level + total_stat_change("accuracy"), 0].max
+ base = self.beastslay_level + total_stat_change("accuracy")
if with_combat_style && self.precise?
base = (base * 1.25).floor
elsif with_combat_style && self.brutal?
@@ -365,7 +365,7 @@ class Character < ApplicationRecord
end
def power(with_combat_style: false)
- base = [self.beastslay_level + total_stat_change("power"), 0].max
+ base = self.beastslay_level + total_stat_change("power")
if with_combat_style && self.precise?
base = (base * 0.75).ceil
elsif with_combat_style && self.brutal?
@@ -375,7 +375,7 @@ class Character < ApplicationRecord
end
def evasion(with_combat_style: false)
- base = [self.beastslay_level + total_stat_change("evasion"), 0].max
+ base = self.beastslay_level + total_stat_change("evasion")
if with_combat_style && self.elusive?
base = (base * 1.25).floor
elsif with_combat_style && self.protective?