Repository navigation
v0.8.0
Lockstep release of dnd5e-srd-data, dnd5e-engine and nat20-bridge 0.8.0, an additive minor release. Encounter members can fight on the party's side, a host can choose a monster's target, melee attacks can knock a creature out (SRD 5.2), item casts place their spell's area, a monster's closing walk honours occupancy, a move takes a detour around walls, and walled grids are faster. Every new name and field is defaulted, and a payload stored under 0.7.0 still validates. The dataset is unchanged. Upgrade notes: docs/migration/v0.7-to-v0.8.md.
What a host may notice
KnockedOutjoins the closedCombatEventunion, andknock_out_not_meleejoins the rejection reasons. Both appear only when a host asks for a knock-out.- A
movetakes a detour. A move to an adjacent cell whose direct step crosses a wall or cuts a blocked corner walks the shortest legal route around, priced and provoking like any route.blocked_pathnow means no route exists; a detour that costs more than the movement left isinsufficient_movement. - The monster AI's closing walk honours occupancy. It passes through allies, never ends on another creature and never enters an enemy's cell. A walk with no creature in the way is unchanged.
- An item that casts a spell targets as that spell. A Wand of Fireballs places Fireball's Sphere, and a Wand of Magic Missiles splits its darts at the item's cast level.
DeathRecord.killer_idnames the creature that dealt the killing damage, whoever's turn it was (an opportunity attack's reactor, a legendary action's monster, a summon). It used to name the creature whose turn it was.- XP goes to surviving characters only, and a foe still knocked out at the end is worth its XP.
dnd5e-engine
Added
- Sides:
EncounterMemberSpec.side("encounter"by default, or"party") andSide. A party-side member fights the encounter side, is fought by it, and dies at 0 Hit Points as a monster does. A standing ally keeps the party in the fight, so a combat ended after every character has died while an ally stands readsforced(orflee), notdefeat_tpk. - A host-chosen monster target:
advance_monster_turn(..., target_id=None). An id outside the monster's target pool, or any id on a summon's turn, raisesIntentRejectedError("target_invalid")before the turn starts, with nothing rolled, spent or emitted. - Knocking out a creature:
PlayerIntent.knock_out. A melee blow that would drop a creature to 0 Hit Points leaves it at 1 Hit Point and Unconscious. New:KnockedOut,DamageApplied.knock_out,KnockOutRecord,CombatOutcome.knock_outs, andLiveCombatView.knocked_out_ids. LiveCombatView.deaths: the deaths so far, with their killers.dnd5e_engine.testing.rng_factory: a test-support context manager that scripts or records every die a combat draws, Initiative included.
Changed
- Wall segments are indexed by the cells they touch. Step and sight tests read only nearby walls, so their cost no longer grows with the wall count. Every answer is unchanged.
end_combatandLiveCombatView.final_outcomereturn a copy of the kept outcome each time.
Fixed
- A character already Unconscious from an effect (a sleep) that drops to 0 Hit Points now emits the
Unconsciousdying marker. It no longer wakes at 0 Hit Points when that effect ends.
Full details: CHANGELOG.
dnd5e-srd-data
No content change: the canonical corpus is byte-identical to 0.7.0. The version moves in lockstep, and dnd5e-engine 0.8.0 requires dnd5e-srd-data>=0.8.0.
nat20-bridge
POST /v1/combattakesallies: monster slugs seated on the party's side.POST /v1/combat/{cid}/advance-monstertakes an optional{"target_id": ...}body.- An intent body accepts
knock_out. target_invalidandknock_out_not_meleeanswer 409.GET /v1/combat/{cid}addsparty_ids,encounter_ids,knocked_out_idsanddeaths.- Narration covers every engine event type. 18 types, including spell casts, effects, concentration, movement, death saves, temporary Hit Points, reactions, recharge and legendary actions, used to fall through to a raw
[type] key=valuedump. Each now renders as a sentence, and intent types read as words (attempts cast spell). A knock-out narrates as a line. (#47)
Upgrade checklist
- Upgrade
dnd5e-srd-data,dnd5e-engineandnat20-bridgetogether:dnd5e-enginerequiresdnd5e-srd-data>=0.8.0, andnat20-bridgerequires both at>=0.8.0. - If you match
CombatEventexhaustively, handleKnockedOut. If you match the rejection reasons exhaustively, handleknock_out_not_melee. - If you pre-validate moves, stop rejecting an adjacent move behind a wall; the engine now walks around it when it can.
- List an item that casts a spell with that spell's targeting.
- Read
DeathRecord.killer_idas the creature that dealt the blow. - If you parse the bridge's narration text, expect sentences where
[type] key=valuelines used to be.
Every step, with its detail and the three moved seeded pins: docs/migration/v0.7-to-v0.8.md.