First PC sheet, WIP

This commit is contained in:
2025-12-20 17:20:01 +01:00
parent 189b03ca91
commit e75824cd20
19 changed files with 961 additions and 600 deletions
+20 -1
View File
@@ -94,6 +94,17 @@ export default class PrismRPGActor extends Actor {
name: game.i18n.localize(`PRISMRPG.Label.${rollKey}`)
}
break
case "sub-attribute":
if (!this.system.subAttributes || !this.system.subAttributes[rollKey]) {
ui.notifications.error(`Sub-attribute ${rollKey} not found`)
return
}
rollTarget = {
...foundry.utils.duplicate(this.system.subAttributes[rollKey]),
rollKey: rollKey,
name: game.i18n.localize(SYSTEM.SUB_ATTRIBUTES[rollKey].label)
}
break
case "granted":
rollTarget = {
name: rollKey,
@@ -112,6 +123,10 @@ export default class PrismRPGActor extends Actor {
rollTarget = foundry.utils.duplicate(this.system.saves[rollKey])
rollTarget.rollKey = rollKey
rollTarget.rollDice = rollDice
// Pass the characteristic value for D&D 5e modifier calculation
rollTarget.characteristicValue = this.system.characteristics[rollKey].value
// The save bonus is the proficiency modifier (value stored in saves)
rollTarget.saveBonus = this.system.saves[rollKey].value
break
case "spell":
rollTarget = this.items.find((i) => i.type === "spell" && i.id === rollKey)
@@ -128,12 +143,16 @@ export default class PrismRPGActor extends Actor {
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.rollFromWeapon"))
return
}
// Get the primary attribute for D&D 5e style rolls
const attrKey = rollTarget.system.primaryAttribute || "dex"
rollTarget.characteristicValue = this.system.characteristics[attrKey].value
rollTarget.proficiencyBonus = rollTarget.system.modifier
break
case "spell-attack":
case "spell-power":
case "miracle-attack":
case "miracle-power":
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey)
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type === "spell") && i.id === rollKey)
rollTarget.rollKey = rollKey
break
case "shield-roll": {