summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-07-20 20:38:03 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:39 +0100
commit022e525c09f2d724a55d2a4400d682c61aed1ade (patch)
tree4d8acbf71214c2d9c277503683665a57ddcf26ef
parentdc075673b258e4138eed8030da778daea61f2dfa (diff)
downloadcrusader-rex-022e525c09f2d724a55d2a4400d682c61aed1ade.tar.gz
crusader: Skip sally declaration first field battle of new siege.
-rw-r--r--rules.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 6c86e04..dd18dbf 100644
--- a/rules.js
+++ b/rules.js
@@ -2138,12 +2138,14 @@ function start_combat() {
game.castle_owner = enemy(game.attacker[game.where]);
game.active = game.castle_owner;
game.state = 'combat_deployment';
+ game.is_existing_siege = 0;
} else {
game.castle_owner = besieged_player(game.where);
if (!game.attacker[game.where])
game.attacker[game.where] = enemy(game.castle_owner);
console.log("CONTINUE SIEGE", game.attacker[game.where]);
log("Existing siege continues.");
+ game.is_existing_siege = 1;
next_combat_round();
}
} else {
@@ -2163,6 +2165,7 @@ function end_combat() {
if (game.jihad === game.where)
game.jihad = null;
+ delete game.is_existing_siege;
delete game.castle_owner;
delete game.storming;
delete game.sallying;
@@ -2399,7 +2402,9 @@ function goto_combat_round(new_combat_round) {
log(game.attacker[game.where] + " are now the attacker.");
}
}
- return goto_declare_sally();
+ // No sally first round after combat deployment.
+ if (game.combat_round > 1 || game.is_existing_siege)
+ return goto_declare_sally();
}
return goto_field_battle();
}