Add 2014 DMG encounter difficulty calculation
CI / check (push) Successful in 2m18s
CI / build-image (push) Successful in 17s

Support the 2014 DMG encounter difficulty as an alternative to the 5.5e
system behind the existing Rules Edition toggle. The 2014 system uses
Easy/Medium/Hard/Deadly thresholds, an encounter multiplier based on
monster count, and party size adjustment (×0.5–×5 range).

- Extract RulesEdition to its own domain module
- Refactor DifficultyTier to abstract numeric values (0–3)
- Restructure DifficultyResult with thresholds array
- Add 2014 XP thresholds table and encounter multiplier logic
- Wire edition from context into difficulty hooks
- Edition-aware labels in indicator and breakdown panel
- Show multiplier, adjusted XP, and party size note for 2014
- Rename settings label from "Conditions" to "Rules Edition"
- Update spec 008 with issue #23 requirements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-04-04 14:52:23 +02:00
co-authored by Claude Opus 4.6
parent 94e1806112
commit 817cfddabc
17 changed files with 892 additions and 257 deletions
+2 -1
View File
@@ -16,7 +16,6 @@ export {
type ConditionId,
getConditionDescription,
getConditionsForEdition,
type RulesEdition,
VALID_CONDITION_IDS,
} from "./conditions.js";
export {
@@ -53,6 +52,7 @@ export {
calculateEncounterDifficulty,
crToXp,
type DifficultyResult,
type DifficultyThreshold,
type DifficultyTier,
VALID_CR_VALUES,
} from "./encounter-difficulty.js";
@@ -110,6 +110,7 @@ export {
rollInitiative,
selectRoll,
} from "./roll-initiative.js";
export type { RulesEdition } from "./rules-edition.js";
export { type SetAcSuccess, setAc } from "./set-ac.js";
export { type SetCrSuccess, setCr } from "./set-cr.js";
export { type SetHpSuccess, setHp } from "./set-hp.js";