diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-04-28 22:20:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-04-28 22:20:46 +0200 |
commit | cfcd2f88681c1576b0ffbda5bb156dfd780b5b22 (patch) | |
tree | 4a2118e23f887efdab3d21e62c6c4f3dc71d2eba /rules.ts | |
parent | b1820588f981c4d6a944460ea1afc36831cd63ed (diff) | |
download | plantagenet-cfcd2f88681c1576b0ffbda5bb156dfd780b5b22.tar.gz |
replace richard 3 at start of muster only
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 45 |
1 files changed, 33 insertions, 12 deletions
@@ -2957,8 +2957,14 @@ states.muster = { log(`Mustered with L${lord}.`) game.state = "muster_lord" game.command = lord - game.actions = data.lords[lord].lordship - apply_lordship_effects(lord) + + // My Kingdom for a Horse! + if (game.scenario === SCENARIO_III && game.command === LORD_GLOUCESTER_2 && get_lord_locale(game.command) == LOC_LONDON) { + game.state = "my_kingdom_for_a_horse_muster" + return + } + + apply_lordship_effects() }, end_muster() { end_muster() @@ -2990,10 +2996,6 @@ states.muster_lord = { let here = get_lord_locale(game.command) - // My Kingdom for a Horse! - if (game.scenario === SCENARIO_III && game.command === LORD_GLOUCESTER_2 && here == LOC_LONDON) - view.actions.richard_iii = 1 - if (game.actions > 0) { if (can_action_parley_levy()) view.actions.parley = 1 @@ -3060,11 +3062,6 @@ states.muster_lord = { view.actions.done = 1 }, - richard_iii() { - push_undo() - replace_gloucester_with_richard_iii() - }, - lord(lord) { push_undo() push_the_kings_name() @@ -9630,6 +9627,27 @@ states.my_kingdom_for_a_horse_setup = { }, } +states.my_kingdom_for_a_horse_muster = { + inactive: "My Kingdom for a Horse", + prompt() { + if (!is_lord_on_map(LORD_RICHARD_III)) { + view.prompt = "My Kingdom for a Horse: You may replace Gloucester with Richard III for one levy action." + view.actions.richard_iii = 1 + view.actions.pass = 1 + } + }, + richard_iii() { + push_undo() + replace_gloucester_with_richard_iii() + game.command = LORD_RICHARD_III + apply_lordship_effects() + game.actions -- + game.state = "muster_lord" + }, + pass() { + game.state = "muster_lord" + }, +} function replace_gloucester_with_richard_iii() { log(`Replaced L${LORD_GLOUCESTER_2} with L${LORD_RICHARD_III}.`) @@ -10407,7 +10425,10 @@ function capability_muster_effects_levy(_lord: Lord, c: Card) { // === LORDSHIP AND THIS LEVY EFFECTS === -function apply_lordship_effects(lord: Lord) { +function apply_lordship_effects() { + let lord = game.command + + game.actions = data.lords[lord].lordship if (is_friendly_locale(get_lord_locale(lord)) && lord_has_capability(lord, AOW_YORK_FAIR_ARBITER)) game.actions += 1 |