From 822e4c4932ea93e031fc031618e895eef6bbbd01 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 22 Jun 2021 14:24:23 +0200 Subject: crusader: End storming when all withdraw. --- ui.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'ui.js') diff --git a/ui.js b/ui.js index 7b73462..b5a0e02 100644 --- a/ui.js +++ b/ui.js @@ -119,8 +119,10 @@ function on_focus_battle_block(evt) { if (game.actions && game.actions.battle_fire && game.actions.battle_fire.includes(b)) msg = "Fire with " + msg; - else if (game.actions && game.actions.battle_retreat && game.actions.battle_retreat.includes(b)) - msg = "Retreat with " + msg; + else if (game.actions && game.actions.battle_storm && game.actions.battle_storm.includes(b)) + msg = "Storm with " + msg; + else if (game.actions && game.actions.battle_sally && game.actions.battle_sally.includes(b)) + msg = "Sally with " + msg; else if (game.actions && game.actions.battle_hit && game.actions.battle_hit.includes(b)) msg = "Take hit on " + msg; @@ -142,8 +144,12 @@ function on_focus_battle_fire(evt) { } function on_focus_battle_retreat(evt) { - document.getElementById("status").textContent = - "Retreat with " + block_name(evt.target.block); + if (game.battle.storming.includes(evt.target.block)) + document.getElementById("status").textContent = + "Withdraw with " + block_name(evt.target.block); + else + document.getElementById("status").textContent = + "Retreat with " + block_name(evt.target.block); } function on_focus_battle_harry(evt) { -- cgit v1.2.3