diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/game_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb index 0e6e37b..cb9bbcb 100644 --- a/app/controllers/game_controller.rb +++ b/app/controllers/game_controller.rb @@ -14,6 +14,7 @@ class GameController < ApplicationController type = result[:type] case type when "monster" + raise TooManyWoundsError unless current_char.can_fight? next if rand > (result[:chance] || 1) table_roll = rand result[:table].sort_by { |t| -t[:score] }.each do |table_entry| @@ -88,7 +89,10 @@ class GameController < ApplicationController end end rescue ItemQuantityError - @results.replace({ type: "error", message: "You don't have enough items to complete this activity." }) + @results.replace([{ type: "error", message: "You don't have enough items to complete this activity." }]) + rescue TooManyWoundsError + @results.replace([{ type: "error", + message: "You can't fight in your condition. You'll have to heal a wound." }]) end private |