Skip to content

End the game when the whole party is turned to stone - #200

Merged
mmacy merged 3 commits into
mainfrom
chunk/petrified-party
Oct 31, 2026
Merged

mmacy merged 3 commits into
mainfrom
chunk/petrified-party

Conversation

@mmacy

@mmacy mmacy commented Oct 31, 2026

Copy link
Copy Markdown
Owner

A basilisk's surprise gaze can turn the whole party to stone. Before, the session then stayed in the encounter, or in a battle against statues, with nobody able to act, because game over came only from a death. Following the owner's decision, a party turned wholly to stone now ends the game.

What changed

  • A member stands while they're neither dead nor petrified. When a command kills or petrifies a member and nobody is left standing, the session moves to game_over with the usual GameOverEvent. In a battle, battle.ended.defeat comes just before it.
  • When the surprise gaze turns everyone to stone as an encounter opens, the session ends right after the reaction, and no round runs against the statues. With the attacks stance, the battle opens and ends in defeat before any round, because an existing test needs that battle to start.
  • Party.living_members() is unchanged. A statue still counts, keeps its rank, and can still be attacked when only statues are in reach.
  • The check still follows the events that killed or petrified a member, not the party's state, so carrying the statues to town with PlaceParty doesn't end the game again. The way back is a magic-user who joins with AddMember and casts stone to flesh. A test covers it.

What to check

  • No golden file changed. A test confirms the ending makes no draws.

https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD

mmacy added 3 commits October 30, 2026 17:10
A basilisk that surprises the party can turn every member to stone, and the session then stayed in the encounter with nobody able to act. The wipe check ran only after a death and asked only whether a member lived.

These are the contract stubs and acceptance tests for the petrified-party chunk. A member stands while they are neither dead nor petrified. When a command's events kill or petrify a member and nobody is left standing, the session ends in game_over as a death wipe does, with battle.ended.defeat first in a battle. Party.living_members() keeps its meaning, and the check stays tied to the event, so a stone party placed in town stays there and stone to flesh from a magic-user who joins with AddMember brings a statue back.

The acceptance tests in tests/test_petrified_party.py are marked xfail for the chunk. The tests that pass today are unmarked guards for a party with a member still standing.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
A party turned wholly to stone has fallen. A member stands while they are neither dead nor petrified, which the new private helper _anyone_standing in party.py tests. Party.living_members() keeps its meaning, so a statue still holds its rank.

The session runs its wipe check when a command's events kill a member or give one the petrified condition, and the check ends the session when nobody stands. A battle's defeat check uses the same test, so battle.ended.defeat comes just before the ending.

When a basilisk's surprise gaze leaves nobody standing as an encounter opens, no round runs against the statues. An attacking stance still opens its battle, because test_avert_eyes.py requires battle.started there, but the battle ends in defeat as it opens, before the monsters' free round. Any other stance stops at the stance. No golden file changes.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
@mmacy
mmacy force-pushed the chunk/petrified-party branch from e2e26eb to c03624d Compare October 31, 2026 00:10
@mmacy
mmacy merged commit e641b57 into main Oct 31, 2026
5 checks passed
@mmacy
mmacy deleted the chunk/petrified-party branch October 31, 2026 00:12
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