summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-01 21:04:44 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-01 21:04:44 +0200
commitcdf79c9498e7657ad4031b86e9c26dbc86c4126c (patch)
tree5617ab4704fc461e1cc828b7522cbf9c01f9b3ea /rules.ts
parentb0011c4740285410e7df13e7c99c28755e2164ee (diff)
downloadplantagenet-cdf79c9498e7657ad4031b86e9c26dbc86c4126c.tar.gz
swift maneuver again
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts43
1 files changed, 34 insertions, 9 deletions
diff --git a/rules.ts b/rules.ts
index e27a12c..4f09186 100644
--- a/rules.ts
+++ b/rules.ts
@@ -6215,6 +6215,9 @@ function action_battle_events(c: Card) {
case EVENT_YORK_SWIFT_MANEUVER:
resume_battle_events()
break
+ case EVENT_YORK_PATRICK_DE_LA_MOTE:
+ resume_battle_events()
+ break
}
}
@@ -6586,17 +6589,36 @@ function is_swift_maneuver_in_play() {
return is_event_in_play(EVENT_YORK_SWIFT_MANEUVER)
}
-states.swift_maneuver = {
- inactive: "Swift Maneuver",
+states.swift_maneuver_1 = {
+ get inactive() {
+ view.engaged = game.battle.engagements[0]
+ return format_strike_step()
+ },
prompt() {
- view.prompt = "Swift Maneuver: You may end the battle round immediately."
- view.actions.end_battle_round = 1
+ view.prompt = "Swift Maneuver: Reroll routed retinue?"
view.actions.pass = 1
- if (view.battle.reroll)
- gen_action_routed_retinue(game.who)
+ gen_action_routed_retinue(game.who)
},
routed_retinue(lord) {
action_spend_valour(lord, RETINUE)
+ if (lord_has_routed_retinue(lord))
+ this.pass()
+ else
+ finish_action_assign_hits(game.who)
+ },
+ pass() {
+ game.battle.reroll = 0
+ set_active_enemy()
+ game.state = "swift_maneuver_2"
+ },
+}
+
+states.swift_maneuver_2 = {
+ inactive: "Swift Maneuver",
+ prompt() {
+ view.prompt = "Swift Maneuver: You may end the battle round immediately."
+ view.actions.end_battle_round = 1
+ view.actions.pass = 1
},
end_battle_round() {
logevent(EVENT_YORK_SWIFT_MANEUVER)
@@ -7044,7 +7066,6 @@ const ENGAGEMENTS = [[],[],[],[],[],[],[],[],[],[[0,3]],[[3,1]],[[0,1,3]],[[2,3]
const ENGAGEMENTS_61 = [[[0,3,4],[2,5]],[[0,3],[2,4,5]]]
const ENGAGEMENTS_47 = [[[0,1,3],[2,5]],[[0,3],[1,2,5]]]
-
function pack_battle_array() {
let bits = 0
for (let p = 0; p < 6; ++p)
@@ -7563,8 +7584,12 @@ function action_assign_hits(lord: Lord, type: Force, v=NOVASSAL) {
// Swift Maneuver event
if (is_swift_maneuver_in_play() && type === RETINUE) {
- set_active_enemy()
- game.state = "swift_maneuver"
+ if (game.battle.reroll) {
+ game.state = "swift_maneuver_1"
+ } else {
+ set_active_enemy()
+ game.state = "swift_maneuver_2"
+ }
return
}
}