Skip to content

Fizzle a turning with no monster left, keep the staff of striking in the front rank, and fix two drain event fields - #198

Merged
mmacy merged 3 commits into
mainfrom
chunk/turning-and-staff
Oct 30, 2026
Merged

mmacy merged 3 commits into
mainfrom
chunk/turning-and-staff

Conversation

@mmacy

@mmacy mmacy commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Fixes from round 3 of playtesting a game built on osrlib.

What changed

  • Turning. A turning reaches only the living monsters of the groups that haven't fled, in a battle round and outside one. Before, a skeleton shot dead in the missile phase was still read on the turning table, so a turning could report magic.turning.turned with no monster affected. The SRD says "At least one undead monster will always be affected on a successful turning". When the magic phase finds no monster left, the turning fizzles with magic.turning.fizzled and reason battle.declaration.no_target, and draws nothing. The check asks whether any monster is left, not whether any undead is, so it doesn't reveal which monsters are undead.
  • Staff of striking. The staff is "Used as a magical melee weapon", so only a member in the front rank can strike with it, as with a melee attack. A replacement stepping up this round may strike. If the swap doesn't happen, the use fizzles and the staff keeps its charge. A missed strike still spends its charge ("Only one charge may be spent per strike").
  • Drain event. LevelDrainedEvent.hp_lost is how far the victim's maximum hit points fell, not the hit points rolled, so it no longer overstates the loss when the maximum stops at 1. spawn_consequence appears only when the drain kills.

What to check

  • tests/goldens/phase2_wight_battle.json changes by one line: spawn_consequence goes to null on the drain the fighter survives.
  • A 2.0.1 log in which a back-rank member strikes with a staff now raises on replay. The changelog's replay bullet lists it.
  • DrainResult.hp_lost still reports the hit points rolled, so it can now differ from the event. I'll look at aligning them with the API hygiene items.

https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD

mmacy added 3 commits October 30, 2026 15:35
…code

A playtest of a game built on osrlib found three faults. These are the acceptance tests and docstring contracts for them, written before the implementation.

A battle turning reaches only the living monsters of groups that haven't fled. When none remain at the magic phase, the turning fizzles with battle.declaration.no_target and draws nothing. A staff of striking is a melee weapon, so only the front rank may strike with it, at acceptance and in the magic-phase re-check. A drain event's hp_lost is the drop in maximum hit points, and spawn_consequence is set only on a drain that kills.

Four existing test files encoded the old behavior. The staff tests now put the staff in a front-rank member's hands, and the drain tests assert the spawn consequence only on a killing drain. The phase 2 wight golden will move by one field when the chunk lands: its surviving fighter's drain event loses spawn_consequence.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
…nk, and fix two drain event fields

A battle turning now reaches only the living monsters of groups that haven't fled. When the magic phase finds none left, the turning fizzles at magic.turning.fizzled with reason battle.declaration.no_target and draws nothing. The TurnUndead command before a battle uses the same candidate filter, because a wand fired in an earlier encounter round can leave a dead monster in a group, and the turning read that monster's kind on the table.

A staff of striking use needs the member in the front rank while formation_width_limit is on: the projected rank at acceptance and the rank as it stands in the magic phase's re-check.

A drain event's hp_lost is now the maximum hit points before the drain less the maximum after, and spawn_consequence is set only on a combat.drain.slain event. DrainResult.hp_lost is still the hit points rolled.

The phase 2 wight golden moves by one field: the surviving fighter's combat.drain.drained event now has spawn_consequence null, because the fighter survived the drain and became nothing. The troll golden is unchanged.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
…f markers

The coder applied the living-candidate filter to TurnUndead outside a
battle as well. This adds the test for it: it fails on the code before
the fix and passes after.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
@mmacy
mmacy merged commit e0e4f4e into main Oct 30, 2026
5 checks passed
@mmacy
mmacy deleted the chunk/turning-and-staff branch October 30, 2026 22:46
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