summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorteisuru <31881306+teisuru@users.noreply.github.com>2023-11-20 08:13:59 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commita7037e3fc89b7317ba7ad3c35e100c5c69d0680c (patch)
tree135bb60f4b7e857f11b566b1d90fd955950fddae /rules.js
parent9eca88cffd4e0c0a79d33db5b0a5304b91dfb2e8 (diff)
downloadplantagenet-a7037e3fc89b7317ba7ad3c35e100c5c69d0680c.tar.gz
cap we done
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js40
1 files changed, 38 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 33a51ed..b527694 100644
--- a/rules.js
+++ b/rules.js
@@ -5040,6 +5040,38 @@ states.confirm_approach_sail = {
goto_battle()
},
}
+// === CAPABILITY : WE DONE DEEDS OF CHARITY ===
+
+function tow_extra_ip() {
+ for (let lord = first_york_lord; lord <= last_york_lord; ++lord) {
+ if (lord_has_capability(lord, AOW_YORK_WE_DONE_DEEDS_OF_CHARITY) && (get_lord_assets(lord, PROV) > 0 || get_shared_assets(lord, PROV) > 0))
+ console.log("lord " + lord)
+ return true
+ }
+ return false
+}
+
+
+states.tow_extra_ip = {
+ inactive: "We done needs of charity",
+ prompt() {
+ view.prompt = "We done deeds of charity, spend one or two Provender to add one or two influence points"
+ let done = true
+ let pay_ip = 0
+ for (let lord = first_friendly_lord; lord <= last_friendly_lord; ++lord) {
+ let here = get_lord_locale(lord)
+ if (pay_ip < 2 && get_lord_locale(lord) === here && (get_lord_assets(lord, PROV) > 0)) {
+ gen_action_prov(lord)
+ done = false
+ }
+ }
+ },
+ prov(lord) {
+ push_undo()
+ add_lord_assets(lord, PROV, -1)
+ pay_ip += 1
+ },
+}
// === CAPABILITY : MERCHANTS ===
@@ -8047,9 +8079,13 @@ function tides_of_war() {
add_lord_assets(LORD_BUCKINGHAM, COIN, 1)
add_lord_assets(LORD_BUCKINGHAM, PROV, 1)
}
-
tides_calc()
- goto_disembark()
+ if (tow_extra_ip()) {
+ set_active(YORK)
+ game.state = "tow_extra_ip"
+ }
+ else
+ goto_disembark()
}
// === END CAMPAIGN: DISEMBARK ===