diff options
author | teisuru <31881306+teisuru@users.noreply.github.com> | 2023-12-06 12:58:06 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-10 18:16:55 +0100 |
commit | 01f6e5e561b167f817fcbb4b9fd3c1ecde36ba44 (patch) | |
tree | 45a5fbc84e4d724b69ac33e78569665dc933fc52 | |
parent | f9265b22d989031351af3c667d5af44a56ad376b (diff) | |
download | plantagenet-01f6e5e561b167f817fcbb4b9fd3c1ecde36ba44.tar.gz |
Y10 agitators
-rw-r--r-- | play.js | 1 | ||||
-rw-r--r-- | rules.js | 53 |
2 files changed, 54 insertions, 0 deletions
@@ -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") @@ -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() { |