Bug hunt + 5e/PF2e parity + character-build UX overhaul
Audited every calculation (26-agent adversarial workflow + hand-verification). Core math was sound; fixed real bugs, closed parity gaps, and overhauled the character-build UX. 396 -> 424 tests; lint clean; build green. Correctness fixes: - Heavy armor no longer applies a negative DEX penalty to AC (3 paths + default) - 5e Exhaustion 4 (HP-max halved) implemented via deriveEffectiveMaxHp + badge - PF2e dazzled no longer makes a creature easier to hit - PF2e immunity 'all' zeroes all damage (was misfiled as a condition immunity) - Director schema bounds; PF2e spell-save basis from the `basic` flag; 5e disadvantage-only save guard; remove bogus Concentrating, add Broken/Quickened - Fix 3 lint errors (useCloud hooks naming, useless escape, explicit any) PF2e survival subsystem (parity with 5e death saves): - mechanics/dying.ts (maxDying/isDead/knockOut/applyRecovery/pf2eRestDecay) - DefensesSection knock-out + recovery-check + death UI; rest-decay in applyRest; drained HP reduction Character-build UX: - Persisted abilityBuild (base + per-source contributions); sheet & wizard show every ability source; higher-level PF2e gains L5/10/15/20 boosts - Creation surfaces granted skills (incl. new PF2e background skill parsing) - LevelUpModal enumerates features gained + prompts every owed choice (subclass, feats, fighting style, ...) via collectChoices/collectFeatures/subclassPrompt Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -72,6 +72,16 @@ describe('5e derived stats', () => {
|
||||
const ac = dnd5e.baseArmorClass(input);
|
||||
expect(ac).toBe(10 + 2);
|
||||
});
|
||||
|
||||
it('heavy armor (dexCap 0) ignores a negative DEX rather than penalising AC', () => {
|
||||
// regression: Math.min(dexMod, 0) wrongly applied a negative DEX to heavy armor.
|
||||
const lowDex: CharacterRulesInput = {
|
||||
level: 1,
|
||||
abilities: { str: 16, dex: 8, con: 14, int: 10, wis: 12, cha: 8 }, // DEX 8 = -1
|
||||
equippedArmor: { baseAc: 18, dexCap: 0 }, // plate
|
||||
};
|
||||
expect(dnd5e.baseArmorClass(lowDex)).toBe(18); // not 17
|
||||
});
|
||||
});
|
||||
|
||||
describe('pf2e proficiency', () => {
|
||||
|
||||
Reference in New Issue
Block a user