From 01f6e5e561b167f817fcbb4b9fd3c1ecde36ba44 Mon Sep 17 00:00:00 2001 From: teisuru <31881306+teisuru@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:58:06 +0100 Subject: Y10 agitators --- play.js | 1 + rules.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/play.js b/play.js index 5b01b91..ebd1f89 100644 --- a/play.js +++ b/play.js @@ -1625,6 +1625,7 @@ function on_update() { action_button("supply", "Supply") action_button("tax", "Tax") action_button("merchants", "Merchants") + action_button("agitators", "Agitators") // Muster & Spoils action_button("take_prov", "Provender") diff --git a/rules.js b/rules.js index 4a55e7c..8f1b0ea 100644 --- a/rules.js +++ b/rules.js @@ -3618,6 +3618,8 @@ states.command = { view.actions.heralds = 1 if (can_action_merchants()) view.actions.merchants = 1 + if (can_action_agitators()) + view.actions.agitators = 1 }, pass() { @@ -3637,6 +3639,7 @@ states.command = { sail: goto_sail, heralds: goto_heralds, merchants: goto_merchants, + agitators: goto_agitators, locale: goto_march, @@ -5182,6 +5185,56 @@ function can_levy_burgundians(lord) { } } +// === CAPABILITY : AGITATORS === + +function can_action_agitators() { + if (game.actions <= 0) + return false + + if (lord_has_capability(game.command, AOW_YORK_AGITATORS)) + return true + else + return false +} + +function goto_agitators() { + game.count = count_deplete(get_lord_locale(game.command)) + game.state = "agitators" +} + + +states.agitators = { + inactive: "Agitators", + prompt() { + view.prompt = "Agitators: Add a depleted marker or flip to exhausted adjacent" + deplete_agitators() + }, + locale(loc) { + push_undo() + if (has_depleted_marker(loc)) { + add_exhausted_marker(loc) + } + else { + add_depleted_marker(loc) + } + end_agitators() + } + } + +function deplete_agitators(){ + let here = get_lord_locale(game.command) + for (let next of data.locales[here].adjacent) { + if (!has_exhausted_marker(next)) + gen_action_locale(next) + } +} + +function end_agitators() { + spend_action(1) + push_undo() + resume_command() +} + // === CAPABILITY : HERALDS === function can_action_heralds() { -- cgit v1.2.3