From a446171c956adf5763267f1c4800d96d7920014e Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 28 May 2021 10:03:22 -0400 Subject: Show error result message when stopping combat due to max wounds --- app/controllers/game_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') 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| -- cgit v1.2.3