summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorteisuru <31881306+teisuru@users.noreply.github.com>2023-12-06 12:58:06 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commit01f6e5e561b167f817fcbb4b9fd3c1ecde36ba44 (patch)
tree45a5fbc84e4d724b69ac33e78569665dc933fc52 /rules.js
parentf9265b22d989031351af3c667d5af44a56ad376b (diff)
downloadplantagenet-01f6e5e561b167f817fcbb4b9fd3c1ecde36ba44.tar.gz
Y10 agitators
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js53
1 files changed, 53 insertions, 0 deletions
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() {