From 831e3ff7f43ae7acf2aaf589c4f0794649da4f85 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 7 Jun 2021 19:49:17 -0400 Subject: Allow negative resistances, speed, accuracy, power, and evasion --- app/models/character.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/models') 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? -- cgit v1.2.3