Skip to content

Helpless sides do not run: morale needs someone awake, flight needs legs - #38

Merged
mmacy merged 1 commit into
mainfrom
helpless-sides-do-not-run
Jul 30, 2026
Merged

Helpless sides do not run: morale needs someone awake, flight needs legs#38
mmacy merged 1 commit into
mainfrom
helpless-sides-do-not-run

Conversation

@mmacy

@mmacy mmacy commented Jul 30, 2026

Copy link
Copy Markdown
Owner

The bug

A monster group put entirely to sleep still checked morale: the asleep members raised the half_incapacitated trigger (correct — the fallen count), nobody asked whether anyone was awake to make the check, and the flee branch then moved the whole group at full rate. Five slept kobolds opened the next round with "break and flee", ran off the field unconscious, and were classified routed — escaping with their carried treasure instead of lying at the party's mercy.

The fix

  • Morale is a decision. A group whose members are all incapacitated (asleep, paralysed, petrified) makes no morale check. The triggers are left pending — not consumed — so a member who can act again judges them then (_group_morale).
  • Fleeing is movement. Only members who can move run. A broken side with no one able to move stays where it lies; a mixed side leaves its helpless behind as a new stay-behind group at the break distance — announced by the new player-visible MonstersLeftBehindEvent (battle.group.left_behind), individual treasure bundles staying with the abandoned while the runners carry off the shared group bundle (_leave_helpless_behind). Dead members stay with the runners' group record: outcome classification and loot drops key off the dead condition before any group flag.
  • Pursuit needs legs. A party retreat (_check_ends) or evasion (_handle_evade pursuers) is no longer chased by a group with no mobile living member — nor by a group itself fleeing or all shaken — the flight simply succeeds, ending the encounter evaded.

The new event is registered in the discriminated union, the message catalog, and the round-trip samples, all pinned by the existing exhaustiveness tests.

Verification

  • Six new tests (TestHelplessSidesDoNotRun): no check and no movement for an all-asleep group, the pending trigger judged once someone wakes, the mid-rout split, a fully slept fleeing group stopping where it is, retreat without pursuit, and evasion succeeding outright — the last on hell hounds so the party cannot simply outrun them. Each fails against the unfixed engine.
  • Full suite: 1636 passed.
  • Driven live through osr-web on the seed-42 kobold route: sleep lands round 1, round 2 is a silent hold at 10 feet, and the helpless auto-kill still works.

https://claude.ai/code/session_01EbAHoQCazPyXqzfEMR56EZ

A monster group put entirely to sleep raised the half-incapacitated morale
trigger, failed the check, and sprinted off the field unconscious — exiting
past 120 feet as "routed", its treasure escaping with it (found in osr-web
play: five slept kobolds opened round 2 with "break and flee").

- Morale is a decision: a group whose members are all incapacitated (asleep,
  paralysed, petrified) makes no morale check. The triggers are left pending,
  not consumed, so a member who can act again judges them then.
- Fleeing is movement: only members who can move run. A broken side with no
  one able to move stays where it lies, and a mixed side leaves its helpless
  behind as a new stay-behind group at the break distance
  (MonstersLeftBehindEvent, battle.group.left_behind), individual treasure
  bundles staying with the abandoned while the runners carry off the shared
  group bundle.
- Pursuit needs legs: a party retreat or evasion is no longer chased by a
  group with no mobile living member — nor by a group itself fleeing or all
  turned — the flight simply succeeds.

Six new tests (TestHelplessSidesDoNotRun) each fail against the unfixed
engine, the evade case on hell hounds so the party cannot simply outrun them.

Claude-Session: https://claude.ai/code/session_01EbAHoQCazPyXqzfEMR56EZ
@mmacy
mmacy merged commit b661118 into main Jul 30, 2026
4 checks passed
@mmacy
mmacy deleted the helpless-sides-do-not-run branch July 30, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant