From 6b287a229fbb4459e5ca3ab88407b88b426c180a Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Wed, 28 Aug 2019 19:08:14 -0700 Subject: Display damage as affected by magic bonuses --- hex_engine.rb | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'hex_engine.rb') 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 -- cgit v1.2.3