diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-28 19:08:14 -0700 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-28 19:08:14 -0700 |
commit | 6b287a229fbb4459e5ca3ab88407b88b426c180a (patch) | |
tree | 7b46102159e2666cc792856008d1e37f5e9cff31 /hex_engine.rb | |
parent | 0f0b83fa79f32704045fdc91aef837a74730235c (diff) |
Display damage as affected by magic bonuses
Diffstat (limited to 'hex_engine.rb')
-rw-r--r-- | hex_engine.rb | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/hex_engine.rb b/hex_engine.rb index 3f3dbbc..34b80b6 100644 --- a/hex_engine.rb +++ b/hex_engine.rb @@ -118,25 +118,9 @@ class Hex < Engine @messages.push(message) end - def update_with_bonus current, update, bonus - if update < 0 - current + [update + bonus, 0].min - else - current + update - end - end - - def update_health health - @health = update_with_bonus @health, health, @magic_armor - end - - def update_endurance endurance - @endurance = update_with_bonus @endurance, endurance, @magic_weapon - end - def update_hex health, endurance, xp - update_health health - update_endurance endurance + @health += health + @endurance += endurance @xp += xp end |