summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-28 10:03:22 -0400
committerDavid Gay <david@davidgay.org>2021-05-28 10:03:22 -0400
commita446171c956adf5763267f1c4800d96d7920014e (patch)
tree70271d0ba00c2ad1611f3b4972ffda0fe4356cf2
parentdc01fb947510ef44298ebfa078a9e08e2febfc25 (diff)
Show error result message when stopping combat due to max wounds
-rw-r--r--app/controllers/game_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index b785b25..588c502 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -185,7 +185,11 @@ class GameController < ApplicationController
@results.push({ type: "message", body: "You were defeated! You retreat, wounded." })
char.wounds += 1
char.save!
- char.stop_activity unless char.can_fight?
+ unless char.can_fight?
+ @results.push([{ type: "error",
+ message: "You can't fight in your condition. You'll have to heal a wound." }])
+ char.stop_activity unless char.can_fight?
+ end
else
@results.push({ type: "message", body: "You slew the #{mon.name}." })
mon.whatnot[:awards]&.each do |award_data|