Fix PF2e rules math: AC proficiency, weapon damage, MAP, striking, slots, Refocus

Confirmed accuracy defects from the audit:
- AC now scales with level + armor proficiency (10 + Dex + (level+rank) + item),
  defaulting to trained; was 10 + Dex only, wrong by +3..+28.
- Weapon potency (itemBonus) applies to the attack roll ONLY, not flat damage.
- weaponAttack now reports the Multiple Attack Penalty (-5/-10, agile -4/-8) and
  expands striking runes into extra weapon dice; AttacksSection surfaces MAP.
- Full-caster spell slots: 2 at the rank's unlock level, 3 thereafter (was a flat 3,
  giving a level-1 caster 3 first-rank slots instead of 2).
- PF2e Refocus restores one Focus Point (recoverStep), not the whole pool.

Adds 6 regression tests. types.ts gains WeaponInput.agile/striking, WeaponResult.map,
CharacterRulesInput.acRank, RestOption.recoverStep.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 17:11:00 +02:00
parent 45d74ce5d7
commit da3dbbedba
8 changed files with 966 additions and 17 deletions
@@ -77,6 +77,11 @@ export function AttacksSection({ c, update }: SectionProps) {
>
{formatModifier(result.toHit)}
</button>
{result.map && (
<span className="text-[11px] text-muted" title="Multiple Attack Penalty (2nd / 3rd attack this turn)">
/{formatModifier(result.map.second)}/{formatModifier(result.map.third)}
</span>
)}
<span className="text-muted">to hit ·</span>
<button
onClick={() => rollAndShow({ expression: result.damage, label: `${a.name} — damage` })}