summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-28 19:37:27 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-28 19:38:08 +0200
commitcc1f13a7b84d938c0258738bf902b1e9736f922b (patch)
treeafd048bd5da6347064778416f055815429bfe237 /rules.ts
parentc954a7540e3358a28db870224fc4c223bef12720 (diff)
downloadplantagenet-cc1f13a7b84d938c0258738bf902b1e9736f922b.tar.gz
sun in splendour - play during arts of war phase when drawn
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts36
1 files changed, 35 insertions, 1 deletions
diff --git a/rules.ts b/rules.ts
index b6776c8..2fa1213 100644
--- a/rules.ts
+++ b/rules.ts
@@ -2168,8 +2168,17 @@ states.levy_arts_of_war = {
view.actions.discard = 1
break
}
+
+ // allow playing this Held card immediately
+ if (c === EVENT_YORK_SUN_IN_SPLENDOUR) {
+ view.prompt = `Arts of War: Play or hold ${data.cards[c].event}.`
+ view.actions.hold = 1
+ view.actions.play = 1
+ }
},
play() {
+ if (game.arts_of_war[0] === EVENT_YORK_SUN_IN_SPLENDOUR)
+ push_undo()
let c = game.arts_of_war.shift()
log(`${game.active} played E${c}.`)
goto_immediate_event(c)
@@ -10697,6 +10706,10 @@ function goto_immediate_event(c: Card) {
set_add(game.events, c)
game.this_event = c
switch (c) {
+ // Held event played immediately
+ case EVENT_YORK_SUN_IN_SPLENDOUR:
+ return goto_play_sun_in_splendour_now()
+
// This Levy / Campaign
case EVENT_LANCASTER_BE_SENT_FOR:
case EVENT_LANCASTER_SEAMANSHIP:
@@ -12115,8 +12128,9 @@ states.sun_in_splendour = {
gen_action_locale(loc)
},
locale(loc) {
- push_undo()
muster_lord(LORD_EDWARD_IV, loc)
+ set_lord_moved(LORD_EDWARD_IV, 1)
+
logi(`Mustered Edward IV at ${locale_name[loc]}`)
end_held_event()
@@ -12124,6 +12138,26 @@ states.sun_in_splendour = {
},
}
+function goto_play_sun_in_splendour_now() {
+ game.state = "sun_in_splendour_now"
+}
+
+states.sun_in_splendour_now = {
+ inactive: "Sun in Splendour",
+ prompt() {
+ view.prompt = "Sun in Splendour: Muster Edward IV at any friendly locale with no enemy lord."
+ for (let loc of all_locales)
+ if (is_friendly_locale(loc))
+ gen_action_locale(loc)
+ },
+ locale(loc) {
+ muster_lord(LORD_EDWARD_IV, loc)
+ logi(`Mustered Edward IV at ${locale_name[loc]}`)
+ end_immediate_event()
+ },
+}
+
+
// === HELD EVENT: ASPIELLES ===
function can_play_l_aspielles() {