summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-22 14:01:09 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:38 +0100
commit26220db4d462922e8ab90a91332f43ba63cf695e (patch)
tree0c644dac01b2990ebd8da90ca2d0fdde6e28dbc4 /rules.js
parente7f7b3ca0017a9cd12078d4c842685f5e60f8e84 (diff)
downloadcrusader-rex-26220db4d462922e8ab90a91332f43ba63cf695e.tar.gz
crusader: Show/hide blocks in battle properly.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js7
1 files changed, 6 insertions, 1 deletions
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]));
}