diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-09 00:44:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-09 00:45:28 +0200 |
commit | a9ad49b147faa4bfaf43ab4b4ad5a66541a1ad0a (patch) | |
tree | 86650d6728e38ab483f707bc12d512eb366a6702 | |
parent | 55c7b4ce80dfb49ee2452e56271bd78833e227d1 (diff) | |
download | time-of-crisis-a9ad49b147faa4bfaf43ab4b4ad5a66541a1ad0a.tar.gz |
Fix Triumph.
-rw-r--r-- | rules.js | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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() |