diff options
author | David Gay <david@davidgay.org> | 2021-05-24 17:37:30 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-24 17:37:30 -0400 |
commit | b0a966a8c27996d78414ef9293b3a44219609b70 (patch) | |
tree | 98c328afcf0eb35c2df9707e3c29237634262fcb | |
parent | de43ddf481dfdaa57c3b0183fa7f8d7d94eb80a7 (diff) |
Improve combat damage text
-rw-r--r-- | app/controllers/game_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 |