diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/game_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb index cb9bbcb..152e856 100644 --- a/app/controllers/game_controller.rb +++ b/app/controllers/game_controller.rb @@ -30,6 +30,7 @@ class GameController < ApplicationController monster = Monster.find_by_gid(table_entry[:gid]) @results.push({ type: type, monster: monster }) resolve_combat_with(monster) + break end end when "item" @@ -130,7 +131,7 @@ class GameController < ApplicationController combat_message.call("#{actor.name} landed a critical hit!") dealt_damage = dealt_damage * 2 end - blocked_damage = (accuracy_roll >= (roll(20) + mon.block)) ? 0 : mon.block_value + blocked_damage = (accuracy_roll >= (roll(20) + target.block)) ? 0 : target.block_value resolved_damage = dealt_damage - blocked_damage actor == char ? mon_hp -= resolved_damage : char_hp -= resolved_damage combat_message.call("#{actor.name} hit for #{resolved_damage} (#{dealt_damage} - #{blocked_damage} blocked)") |