feat: luck bonus, inventory slots bonus, multi-enhancements, magic skill modifier
Release Creation / build (release) Successful in 1m25s

- Add luck.bonus field to character DataModel; included in prepareDerivedData
   (luck.max = fate.rank + bonus); shown as editable +bonus field next to
   luck max in edit mode (same UX as grit bonus)

 - Add inventory.slotsBonus field to character DataModel; Equipment tab now
   shows an editable "Bonus Slots" input that adds to the calculated max slots
   (10 + Might×2 + bonus)

 - Replace single Enhancement <select> in spell cast dialog with a checkbox
   list; multiple enhancements can now be selected simultaneously — stress
   costs, pool penalties, and boolean flags (redDice, noStress) are aggregated
   across all active enhancements

 - Include skills.magic.modifier in basePool for both spell and miracle dialogs
   and in baseDice in rollSpellCast / rollMiracleCast; modifier is shown in
   the dialog pool-info line and in the chat card when non-zero

 - Fix: pool-reduction indicator in rollSpellCast now compares against
   intRank + magicRank + magicMod (was missing magicMod)
This commit is contained in:
2026-05-12 08:16:57 +02:00
parent f67d9079dd
commit 0381e8e024
21 changed files with 192 additions and 39 deletions
+8 -3
View File
@@ -75,7 +75,8 @@ export default class OathHammerCharacter extends foundry.abstract.TypeDataModel
// Luck.max is derived from fate.rank; resets at session start.
schema.luck = new fields.SchemaField({
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
bonus: new fields.NumberField({ ...requiredInteger, initial: 0 })
})
schema.arcaneStress = new fields.SchemaField({
@@ -119,6 +120,10 @@ export default class OathHammerCharacter extends foundry.abstract.TypeDataModel
copper: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
})
schema.inventory = new fields.SchemaField({
slotsBonus: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 }),
})
return schema
}
@@ -128,8 +133,8 @@ export default class OathHammerCharacter extends foundry.abstract.TypeDataModel
super.prepareDerivedData()
// Grit max = Resilience skill rank + Toughness attribute rank + bonus (rulebook p.5)
this.grit.max = this.skills.resilience.rank + this.attributes.toughness.rank + (this.grit.bonus ?? 0)
// Luck max = Fate rank; restores at session start
this.luck.max = this.attributes.fate.rank
// Luck max = Fate rank + bonus; restores at session start
this.luck.max = this.attributes.fate.rank + (this.luck.bonus ?? 0)
// Defense score = 10 + Agility + Armor Rating + bonus
this.defense.value = 10 + this.attributes.agility.rank + this.defense.armorRating + this.defense.bonus
// Stress Threshold = Willpower rank + Magic rank + bonus (rulebook p.101)