diff options
author | David Gay <david@davidgay.org> | 2021-07-07 19:44:48 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-07 19:45:30 -0400 |
commit | fae9e55c6df3ec9357647a83a3a78319482a284e (patch) | |
tree | 8e80c941c3efd712a722a344925ab00a95a69613 /app | |
parent | f1386cce19aabd4ad027e6f12be013de8e109493 (diff) |
Change beastslay stat and stance modifiers
Diffstat (limited to 'app')
-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 |