Skip to content

dndwright 0.5.0

Choose a tag to compare

@sligara7 sligara7 released this 02 Jun 03:45
· 64 commits to main since this release

[0.5.0] — 2026-06-02

Added

  • Conditions (dndwright.combat.conditions) — pure rules over the bundled SRD
    catalog: condition_effects (effect text + mechanical flags), implied_conditions,
    is_immune, tick_conditions (round/turn duration ticking), and attempt_save
    (save-ends). The 14 SRD conditions + exhaustion are bundled content
    (load_content("conditions")), not hard-coded enums. Frozen ConditionEffect /
    ActiveCondition / ConditionChange / SaveResult value types.
  • Initiative (dndwright.combat.initiative) — pure ordering + turn tracking:
    roll_initiative (1d20 + modifier), order_initiative (total desc, DEX-modifier
    tie-break, stable), and advance_turn / previous_turn (skip inactive, wrap →
    round change). Frozen InitiativeEntry / InitiativeRoll / TurnAdvance value types.
  • Combat rules (dndwright.combat) — pure, identity-free 5e combat over a frozen
    CombatantState value object (no IDs, no persistence). Operations are
    (state, input) -> (new_state, explanation): apply_damage (temp-HP absorption,
    overkill, massive-damage instant death), apply_healing, set_temp_hp (no-stack),
    roll_death_save (takes a DiceEngine; nat 20 regains 1 HP, nat 1 = two failures,
    3 successes stabilise / 3 failures kill), stabilize, reset_death_saves, plus the
    calculate_damage_application helper and DamageApplication/HPChange/DeathSaveResult
    result types. Extracted from a working SQL-bound service; the rules layer is pure.