From b0a966a8c27996d78414ef9293b3a44219609b70 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 24 May 2021 17:37:30 -0400 Subject: Improve combat damage text --- app/controllers/game_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb index 152e856..39bb940 100644 --- a/app/controllers/game_controller.rb +++ b/app/controllers/game_controller.rb @@ -134,7 +134,9 @@ class GameController < ApplicationController 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)") + damage_text = "#{resolved_damage} damage." + damage_text += " (#{dealt_damage} - #{blocked_damage} blocked)" if blocked_damage > 0 + combat_message.call("#{actor.name} hit for #{damage_text}") elsif evasion_roll > accuracy_roll combat_message.call("#{target.name} evaded #{actor.name}'s attack.") end -- cgit v1.2.3