diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-22 14:24:23 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:19:38 +0100 |
commit | 822e4c4932ea93e031fc031618e895eef6bbbd01 (patch) | |
tree | 34e9a6d4ca1d17eb70c17a377f42facea5e08395 /rules.js | |
parent | 3320cc77f28d56c33f7af492f87b4f06012937e3 (diff) | |
download | crusader-rex-822e4c4932ea93e031fc031618e895eef6bbbd01.tar.gz |
crusader: End storming when all withdraw.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1600,7 +1600,8 @@ states.combat_phase = { }, town: function (where) { remove_from_array(game.combat_list, where); - if (game.attacker[where] == game.jihad) { + let attacker = game.attacker[where] || besieging_player(where); + if (attacker == game.jihad) { game.active = game.attacker[where]; game.state = 'use_jihad_event'; game.where = where; @@ -2225,6 +2226,13 @@ function resume_storm_battle() { return next_combat_round(); } + if (game.storming.length == 0) { + console.log("STORM BATTLE WON BY DEFENDER", ENEMY[game.active]); + game.halfhit = null; + log("Storming repulsed."); + return next_combat_round(); + } + game.state = 'storm_battle'; pump_battle_step(is_storm_attacker, is_storm_defender); } |