From 4dfb296816fd1c817b9f85db749604c790620b0a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 26 Apr 2024 13:21:38 +0200 Subject: fix victory check --- rules.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'rules.ts') diff --git a/rules.ts b/rules.ts index e1fa407..b13b336 100644 --- a/rules.ts +++ b/rules.ts @@ -8896,12 +8896,12 @@ function is_waste_turn() { } function goto_victory_check() { - if (check_scenario_end_victory()) - return if (check_campaign_victory()) return if (check_threshold_victory()) return + if (check_scenario_end_victory()) + return if (is_grow_turn()) do_grow() @@ -9000,21 +9000,25 @@ function end_reset() { // === 5.1 CAMPAIGN VICTORY === function check_campaign_victory_york() { + let next_turn = current_turn() + 1 for (let lord of all_lancaster_lords) { if (is_lord_on_map(lord)) return false - if (is_lord_in_exile(lord) && get_lord_calendar(lord) === current_turn() + 1) - return false + if (next_turn <= 15) + if (is_lord_in_exile(lord) && get_lord_calendar(lord) === next_turn) + return false } return true } function check_campaign_victory_lancaster() { + let next_turn = current_turn() + 1 for (let lord of all_york_lords) { if (is_lord_on_map(lord)) return false - if (is_lord_in_exile(lord) && get_lord_calendar(lord) === current_turn() + 1) - return false + if (next_turn <= 15) + if (is_lord_in_exile(lord) && get_lord_calendar(lord) === next_turn) + return false } return true } -- cgit v1.2.3