feat: add Settlement actor type with Overview/Buildings/Inventory tabs

- New TypeDataModel: archetype, territory, renown, currency (gp/sp/cp),
  garrison, underSiege, isCapital, founded, taxNotes, description, notes
- 3-tab ApplicationV2 sheet with drag & drop for building/weapon/armor/equipment
- Currency steppers (+/−), building constructed toggle, qty controls
- LESS-based CSS (settlement-sheet.less) + base.less updated for shared styles
- Full i18n keys in lang/en.json (8 settlement archetypes)
- system.json: registered settlement actor type

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-20 17:01:38 +01:00
parent b67d85c6be
commit b3fd7e1aa1
28 changed files with 966 additions and 270 deletions

View File

@@ -52,6 +52,22 @@ export default class OathHammerSpellDialog {
return { value: v, label: v > 0 ? `+${v}` : String(v), selected: v === 0 }
})
const availableLuck = actorSys.luck?.value ?? 0
const isHuman = (actorSys.lineage?.name ?? "").toLowerCase() === "human"
const luckDicePerPoint = isHuman ? 3 : 2
const luckOptions = Array.from({ length: availableLuck + 1 }, (_, i) => ({
value: i,
label: i === 0 ? "0" : `${i} (+${i * luckDicePerPoint}d)`,
selected: i === 0,
}))
// Pool size selector: casters may roll fewer dice to reduce Arcane Stress (p.101)
const poolSizeOptions = Array.from({ length: basePool }, (_, i) => ({
value: i + 1,
label: `${i + 1}d`,
selected: i + 1 === basePool,
}))
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes)
const context = {
@@ -70,11 +86,15 @@ export default class OathHammerSpellDialog {
intRank,
magicRank,
basePool,
poolSizeOptions,
currentStress,
stressThreshold,
isOverThreshold,
enhancementOptions,
bonusOptions,
availableLuck,
isHuman,
luckOptions,
rollModes,
visibility: game.settings.get("core", "rollMode"),
}
@@ -116,9 +136,12 @@ export default class OathHammerSpellDialog {
noStress: enh.noStress,
elementalBonus: parseInt(result.elementalBonus) || 0,
bonus: parseInt(result.bonus) || 0,
poolSize: Math.min(Math.max(1, parseInt(result.poolSize) || basePool), basePool),
grimPenalty: parseInt(result.noGrimoire) || 0,
visibility: result.visibility ?? game.settings.get("core", "rollMode"),
explodeOn5: result.explodeOn5 === "true",
luckSpend: Math.min(Math.max(0, parseInt(result.luckSpend) || 0), availableLuck),
luckIsHuman: result.luckIsHuman === "true",
}
}
}