diff options
author | David Gay <david@davidgay.org> | 2021-06-03 21:37:02 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-03 21:37:02 -0400 |
commit | 47bf4a6c8b6054e8df408d8be7bf0d4702542545 (patch) | |
tree | a5f253274914c3ad2a004646f5f958839c3dddd3 /app | |
parent | 0e8f90a95212159ddab64c6249a3da63f918d21d (diff) |
Add blank line to beginning of combat result output instead of end
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/game_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb index 9574f31..62ab77b 100644 --- a/app/controllers/game_controller.rb +++ b/app/controllers/game_controller.rb @@ -62,6 +62,8 @@ class GameController < ApplicationController raise TooManyWoundsError unless current_char.can_fight? next if rand > (result[:chance] || 1) + @results.push({ type: "br" }) + if result[:table].pluck(:gid).include?(current_char.trophy_monster_gid) monster = Monster.find_by_gid(current_char.trophy_monster_gid) @results.push({ type: type, monster: monster }) @@ -195,7 +197,6 @@ class GameController < ApplicationController current_char.stop_activity @results.replace([{ type: "error", message: "You can't fight in your condition. You'll have to heal a wound." }]) - @results.push({ type: "br" }) end private @@ -254,7 +255,6 @@ class GameController < ApplicationController unless char.can_fight? @results.push({ type: "error", message: "You can't fight in your condition. You'll have to heal a wound." }) - @results.push({ type: "br" }) char.stop_activity return end @@ -315,7 +315,6 @@ class GameController < ApplicationController raise "Invalid award type string (#{award_data[:type]})" end end - @results.push({ type: "br" }) end break end |