From a9ad49b147faa4bfaf43ab4b4ad5a66541a1ad0a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 9 Jul 2023 00:44:46 +0200 Subject: Fix Triumph. --- rules.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 4f0717d..df8834d 100644 --- a/rules.js +++ b/rules.js @@ -3702,6 +3702,7 @@ function goto_battle(type, where, attacker, target, is_force_march) { dtaken: 0, ataken: 0, staken: 0, dhits: 0, ahits: 0, shits: 0, killed: 0, + victory: 0, militia: can_militia_battle_with_army(where, attacker, is_force_march) } game.state = "initiate_battle" @@ -4230,7 +4231,7 @@ states.assign_hits_on_defender = { states.assign_spiculum_hits = { show_battle: true, - get inactive() { return "Spiculum. " + game.combat.shits + " hits." }, + get inactive() { return "Spiculum. " + game.combat.shits + " hits" }, prompt() { prompt("Spiculum: " + game.combat.shits + " hits.") switch (game.combat.type) { @@ -4355,11 +4356,13 @@ function award_combat_legacy(p, reason, n) { function goto_combat_no_victory() { log("Both sides eliminated.") game.combat.killed = 0 + game.combat.victory = 0 goto_post_combat() } function goto_combat_victory_defender() { game.combat.killed = 0 + game.combat.victory = 0 if (game.combat.type === "general") { if (game.emperor === ARMY + game.combat.target) award_legacy(game.combat.target / 6 | 0, "Military Emperor Victory", 4) @@ -4375,6 +4378,8 @@ function goto_combat_victory_defender() { } function goto_combat_victory_attacker() { + game.combat.victory = 1 + if (game.combat.type === "barbarians") { let inflicted = game.combat.dtaken + game.combat.staken if (game.emperor === ARMY + game.combat.attacker) @@ -4474,7 +4479,13 @@ function goto_free_increase_support_level() { } } - if (game.combat.type === "barbarians" && !game.combat.own_military_emperor_died && has_card_event(CARD_S4X)) + if ( + game.combat.victory && + game.combat.type === "barbarians" && + game.combat.dtaken + game.combat.staken > 0 && + !game.combat.own_military_emperor_died && + has_card_event(CARD_S4X) + ) game.state = "triumph" else end_combat() -- cgit v1.2.3