Repository navigation
Fizzle a turning with no monster left, keep the staff of striking in the front rank, and fix two drain event fields - #198
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from round 3 of playtesting a game built on osrlib.
What changed
magic.turning.turnedwith 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 withmagic.turning.fizzledand reasonbattle.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.LevelDrainedEvent.hp_lostis 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_consequenceappears only when the drain kills.What to check
tests/goldens/phase2_wight_battle.jsonchanges by one line:spawn_consequencegoes tonullon the drain the fighter survives.DrainResult.hp_loststill 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