Combat scenario: parry and low-stamina phases #25

Closed
opened 2026-11-14 08:50:35 +00:00 by claude · 1 comment
Member

Follow-up from #24 and #22. The headless duel (docker/scenarios/combat) covers shield blocks, flinches and staggers. It doesn't yet exercise:

  • Parries (#19 weapon block): a phase where the player unequips the shield and holds Block, expecting Ashlar block: "Player" ... with weapon lines with damage through > 0.
  • Stamina rules (#21): a phase that drains the player's fatigue below [Game] attack fatigue threshold and checks that no attack starts. Then a phase below attack fatigue cap that checks the logged attack strength is capped.
  • ignoreStagger (#22): an NPC-side I.Combat.addOnHitHandler that sets attack.ignoreStagger = true for some hits, checking that those hits don't log a flinch.

Acceptance

  • SCENARIO=combat docker/ashlar-run.sh prints counts for each of these, and a run shows at least one parry, one refused attack and no flinch on ignoreStagger hits.
  • Keep it CC0 and Lua only, with no commercial data. The default boot is unchanged.
Follow-up from #24 and #22. The headless duel (`docker/scenarios/combat`) covers shield blocks, flinches and staggers. It doesn't yet exercise: - **Parries** (#19 weapon block): a phase where the player unequips the shield and holds Block, expecting `Ashlar block: "Player" ... with weapon` lines with damage through > 0. - **Stamina rules** (#21): a phase that drains the player's fatigue below `[Game] attack fatigue threshold` and checks that no attack starts. Then a phase below `attack fatigue cap` that checks the logged attack strength is capped. - **ignoreStagger** (#22): an NPC-side `I.Combat.addOnHitHandler` that sets `attack.ignoreStagger = true` for some hits, checking that those hits don't log a flinch. **Acceptance** - `SCENARIO=combat docker/ashlar-run.sh` prints counts for each of these, and a run shows at least one parry, one refused attack and no flinch on ignoreStagger hits. - Keep it CC0 and Lua only, with no commercial data. The default boot is unchanged.
claude added this to the 2. Feel milestone 2026-11-14 08:50:35 +00:00
eric closed this issue 2026-11-14 20:43:54 +00:00
Author
Member

Done in 70b7ea51e8.

What changed

  • The duel now runs in phases: shield block (2–14 s), parry (14–24 s, shield unequipped, Block held with the blade), attack (24–32 s), ignorestagger (32–40 s, the duelist's own I.Combat.addOnHitHandler sets attack.ignoreStagger = true on hits it takes), tired (40–50 s, player fatigue held at 5%) and capped (50–64 s, fatigue held at 25%, Use held 1.5 s for a full wind-up).
  • Engine: two verbose log lines in character.cpp, Ashlar stamina: <id> too tired to attack (once per press, any actor; the player message box is unchanged) and Ashlar stamina: <id> attack strength X capped to Y. No behavior change.
  • docker/ashlar-run.sh counts parries, refused attacks, capped attacks, ignoreStagger hits, and duelist flinches between its ignoreStagger on/off markers. Scenario run time is now 150 s by default. docs/ashlar/SCENARIOS.md documents the phases and log lines.

Tests

  • Build OK, components-tests 1636 passed, openmw-tests 596 passed. No new unit tests: the engine change is logging only.
  • SCENARIO=combat docker/ashlar-run.sh: 13 player blocks, 6 parries, 13 NPC blocks, 59 flinches, 6 interrupted wind-ups, 8 attacker staggers, 8 refused attacks, 4 capped attacks (0.97–1.0 capped to 0.625, matching the formula at 25% fatigue and cap 0.5; the duelist's handler saw strength=0.63), 5 ignoreStagger hits with 0 duelist flinches in the window (it flinched twice before it).
  • Default boot is unchanged and clean.

Feel still needs Eric's playtest (tracked on #5).

Done in `70b7ea51e8`. **What changed** - The duel now runs in phases: shield `block` (2–14 s), `parry` (14–24 s, shield unequipped, Block held with the blade), `attack` (24–32 s), `ignorestagger` (32–40 s, the duelist's own `I.Combat.addOnHitHandler` sets `attack.ignoreStagger = true` on hits it takes), `tired` (40–50 s, player fatigue held at 5%) and `capped` (50–64 s, fatigue held at 25%, Use held 1.5 s for a full wind-up). - Engine: two verbose log lines in `character.cpp`, `Ashlar stamina: <id> too tired to attack` (once per press, any actor; the player message box is unchanged) and `Ashlar stamina: <id> attack strength X capped to Y`. No behavior change. - `docker/ashlar-run.sh` counts parries, refused attacks, capped attacks, ignoreStagger hits, and duelist flinches between its `ignoreStagger on`/`off` markers. Scenario run time is now 150 s by default. `docs/ashlar/SCENARIOS.md` documents the phases and log lines. **Tests** - Build OK, components-tests 1636 passed, openmw-tests 596 passed. No new unit tests: the engine change is logging only. - `SCENARIO=combat docker/ashlar-run.sh`: 13 player blocks, **6 parries**, 13 NPC blocks, 59 flinches, 6 interrupted wind-ups, 8 attacker staggers, **8 refused attacks**, **4 capped attacks** (0.97–1.0 capped to 0.625, matching the formula at 25% fatigue and cap 0.5; the duelist's handler saw `strength=0.63`), **5 ignoreStagger hits with 0 duelist flinches** in the window (it flinched twice before it). - Default boot is unchanged and clean. Feel still needs Eric's playtest (tracked on #5).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gaming/ashlar#25