From bd0d3720b726ca64b95216986cb0b7dc6db9959e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 30 Aug 2022 15:54:42 +0200 Subject: Fix bug with determining which battles are worth VP. Militia and Sorties should also count! --- rules.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/rules.js b/rules.js index da17794..efe3408 100644 --- a/rules.js +++ b/rules.js @@ -4257,6 +4257,20 @@ function goto_battle(where, is_assault) { }) } + if (game.raid) + game.raid.battle = where + + // No Militia take part in assaults + if (!game.battle.assault) + goto_battle_militia() + else + goto_battle_sortie() + + // Pause for foul weather before any battles are resolved... + goto_retroactive_foul_weather() +} + +function determine_battle_vp_worth() { if (!game.battle.assault) { let n_atk = 0 for_each_attacking_piece(p => { @@ -4278,18 +4292,6 @@ function goto_battle(where, is_assault) { if (n_def > 4) game.battle.def_worth_vp = 1 } - - if (game.raid) - game.raid.battle = where - - // No Militia take part in assaults - if (!game.battle.assault) - goto_battle_militia() - else - goto_battle_sortie() - - // Pause for foul weather before any battles are resolved... - goto_retroactive_foul_weather() } function goto_battle_militia() { @@ -4709,6 +4711,7 @@ states.defender_events = { */ function goto_battle_roll() { + determine_battle_vp_worth() if (game.events.ambush === game.battle.attacker) goto_atk_fire() else if (game.events.ambush === game.battle.defender) -- cgit v1.2.3