From d5996cfe2b76d16d4619d1c786bc91c34be00139 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 20 Apr 2024 15:25:42 +0200 Subject: Fix Regroup trigger. --- rules.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/rules.ts b/rules.ts index d1bfa6c..ff13d38 100644 --- a/rules.ts +++ b/rules.ts @@ -2,6 +2,7 @@ // TODO: log end victory conditions at scenario start // TODO: check all who = NOBODY etc resets +// TODO: show fled retinue backsides // TODO - show held events when played for effect @@ -5862,9 +5863,11 @@ states.ravine = { function is_regroup_in_play() { if (is_event_in_play(EVENT_YORK_REGROUP)) { - for (let lord of all_york_lords) - if (lord_has_routed_troops(lord)) + for (let p of battle_strike_positions) { + let lord = game.battle.array[p] + if (is_york_lord(lord) && lord_has_routed_troops(lord) && get_lord_forces(lord, RETINUE)) return true + } } return false } @@ -5877,12 +5880,16 @@ function goto_regroup() { states.regroup = { prompt() { view.prompt = "Regroup: Use Regroup event?" - for (let lord of all_york_lords) - if (lord_has_routed_troops(lord)) + for (let p of battle_strike_positions) { + let lord = game.battle.array[p] + if (is_york_lord(lord) && lord_has_routed_troops(lord) && get_lord_forces(lord, RETINUE)) gen_action_lord(lord) + } }, lord(lord) { push_undo() + logevent(EVENT_YORK_REGROUP) + logi("L" + lord) game.who = lord game.state = "regroup_roll_protection" game.event_regroup = [ -- cgit v1.2.3