diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character.rb | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/app/models/character.rb b/app/models/character.rb index 96dafd0..655bb82 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -389,6 +389,14 @@ class Character < ApplicationRecord self.wounds < max_wounds end + def beastslay_stat_modifier + (beastslay_level / 2).ceil + end + + def beastslay_stance_modifier + (beastslay_level / 4).ceil + end + def resistance(damage_type) unless %w[slash pierce bash arcane fire frost lightning acid thunder radiant necrotic poison bleed physical energy].include?(damage_type) @@ -402,8 +410,8 @@ class Character < ApplicationRecord res += resistance("energy") end - res -= (beastslay_level / 5).ceil if elusive? && !%w[physical energy].include?(damage_type) - res += (beastslay_level / 5).ceil if protective? && !%w[physical energy].include?(damage_type) + res -= beastslay_stance_modifier if elusive? && !%w[physical energy].include?(damage_type) + res += beastslay_stance_modifier if protective? && !%w[physical energy].include?(damage_type) res end @@ -416,35 +424,35 @@ class Character < ApplicationRecord end def speed - self.beastslay_level + total_stat_change("speed") + beastslay_stat_modifier + total_stat_change("speed") end def accuracy(with_combat_style: false) - base = self.beastslay_level + total_stat_change("accuracy") + base = beastslay_stat_modifier + total_stat_change("accuracy") if with_combat_style && self.precise? - base += (beastslay_level / 5).ceil + base += beastslay_stance_modifier elsif with_combat_style && self.brutal? - base -= (beastslay_level / 5).ceil + base -= beastslay_stance_modifier end base end def power(with_combat_style: false) - base = self.beastslay_level + total_stat_change("power") + base = beastslay_stat_modifier + total_stat_change("power") if with_combat_style && self.precise? - base -= (beastslay_level / 5).ceil + base -= beastslay_stance_modifier elsif with_combat_style && self.brutal? - base += (beastslay_level / 5).ceil + base += beastslay_stance_modifier end base end def evasion(with_combat_style: false) - base = self.beastslay_level + total_stat_change("evasion") + base = beastslay_stat_modifier + total_stat_change("evasion") if with_combat_style && self.elusive? - base += (beastslay_level / 5).ceil + base += beastslay_stance_modifier elsif with_combat_style && self.protective? - base -= (beastslay_level / 5).ceil + base -= beastslay_stance_modifier end base end |