Commit Graph

14 Commits

Author SHA1 Message Date
ctan bb53d049ee feat(combat): grant soft cover (+4 AC) to ranged attacks through creatures 2026-08-17 22:49:50 +02:00
ctan f67cd017e4 feat(combat): apply cumulative -2 range penalties per increment 2026-08-17 22:49:50 +02:00
ctan b748980423 feat(combat): honor AttackSpec.count for multi-swing attacks
A weapon with count>1 ('2x Talons') now resolves one independent attack
roll per swing in the same attack action (label '#N'), aggregating stats
per swing. Remaining swings are lost if the target drops mid-routine.
BAB iterative attacks remain out of Phase 0 scope.
2026-08-17 22:49:50 +02:00
ctan 950b53c54e chore(fiches): rename Foundry sheets (drop 'randu' suffix) 2026-08-17 22:49:50 +02:00
ctan 7297494e56 feat(data): transpose Foundry PC sheets into data/pcs
All 8 sheets from fiches_personnages/ converted to the strict Combatant
JSON schema (data/monsters convention) so the CLI can run PCs directly:

  --side players data/pcs/esha.json

- id derived from the file stem; source field points at the original sheet
- oni: placeholder attacks without encoded damage ('une Pioche', 'Weapon')
  left out, documented in notes (pick stats ambiguous light/heavy in the
  rules KB; no identification possible for 'Weapon')
- README: PC section now documents data/pcs usage
- tests: parametrized load check + golden spots for the 8 PC files
2026-08-17 22:49:50 +02:00
ctan cd7f4f7042 test(foundry): point golden tests at renamed sheet files
The 8 sheets in fiches_personnages/ were renamed (dropped the 'randu'
suffix); the golden tests referenced the old filenames and failed.
2026-08-17 22:49:50 +02:00
ctan e17c571d7e feat(combat): wire corner-rule LoS/cover into attack resolution
- weapon_for: gate attacks on has_line_of_effect (no LoE -> policy moves)
- resolve_attack: +4 AC cover bonus on hit and crit-confirm (ranged flag)
- tests: cover bonus (ranged pillar, melee wall corner), no-LoE move/attack,
  no-LoE unreachable wait; 11 resolve_attack call sites updated
- README: quick-start and verified example re-measured (55.7% 1x2), rules
  and architecture updated (los.py wired)
2026-08-17 22:49:50 +02:00
ctan a21e234b41 feat(runner): Monte Carlo runner, closed-form metrics and balance CLI
Adds the S6 layer on top of the deterministic combat engine:
- metrics.py: closed-form binomial statistics (win rate, standard error,
  3-sigma confidence band) with clamped degenerate proportions.
- runner.py: EncounterSpec/Side definitions, per-run SeededRng streams,
  global duplicate-id disambiguation, attrition averages per combatant.
- cli.py: pf1e-sim entry point producing a French balance report with
  win rates, 3-sigma bands, draws, rounds, and attrition.
- Movement fix: greedy straight-line heuristic could oscillate at walls;
  _step_toward now follows the true shortest path via an unbounded
  Dijkstra cost field from the target (Grid.reachable budget=None).
- Regression tests: melee unit routes around a wall and engages; grid
  unbounded-budget coverage.
2026-08-17 22:49:50 +02:00
ctan 577aec33c4 feat(combat): deterministic engine with attacks, crits, DR, hp states, initiative, rounds, basic policies 2026-08-17 22:49:50 +02:00
ctan 21698d76c6 feat(grid): map YAML schema, 5-10-5 grid, Dijkstra movement, corner LoS/cover 2026-08-17 22:49:50 +02:00
ctan 6ad37ae9ec feat(models): combatant schema, Foundry sheet loader, monster JSON schema 2026-08-17 22:49:50 +02:00
ctan 2a58826bd4 feat(dice): seeded RNG protocol and dice notation parser
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-17 22:49:50 +02:00
ctan 35068c4a65 chore: scaffold pf1e_simulator package (uv, ruff, basedpyright, pytest)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-17 22:49:50 +02:00
ctan 8c9d95ec61 first commit 2026-08-17 22:49:50 +02:00