From 26220db4d462922e8ab90a91332f43ba63cf695e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 22 Jun 2021 14:01:09 +0200 Subject: crusader: Show/hide blocks in battle properly. --- rules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 0ea4fb8..335cc1d 100644 --- a/rules.js +++ b/rules.js @@ -2148,6 +2148,9 @@ function resume_field_battle() { return goto_regroup(); } + if (!is_contested_battle_field()) + return next_combat_round(); + game.state = 'field_battle'; pump_battle_step(is_field_attacker, is_field_defender); } @@ -2643,6 +2646,8 @@ function make_battle_view() { sallying: game.sallying, halfhit: game.halfhit, flash: game.flash, + round: game.combat_round, + show_castle: game.storming.length > 0 && game.state != 'declare_storm', }; battle.title = game.attacker[game.where] + " attack " + game.where; @@ -2653,7 +2658,7 @@ function make_battle_view() { function fill_cell(cell, owner, fn) { for (let b in BLOCKS) if (game.location[b] == game.where & block_owner(b) == owner && fn(b)) - cell.push([b, game.steps[b], game.moved[b]?1:0]) + cell.push(b) // cell.sort((a,b) => compare_block_initiative(a[0], b[0])); } -- cgit v1.2.3