MAnage spell/miracle spending points and favor/disfavor for shield rolls
Release Creation / build (release) Successful in 43s

This commit is contained in:
2026-05-10 17:49:53 +02:00
parent ac44419b7a
commit 54421e4a83
4 changed files with 85 additions and 1 deletions
+16
View File
@@ -198,6 +198,22 @@ export default class LethalFantasyActor extends Actor {
case "miracle-power":
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey)
rollTarget.rollKey = rollKey
if (rollType === "spell-attack" || rollType === "spell-power") {
const cost = Number(rollTarget.system?.cost) || 0
const currentAether = Number(this.system.aetherPoints?.value) || 0
if (cost > currentAether) {
ui.notifications.warn(`${this.name} cannot cast ${rollTarget.name}: insufficient Aether (needs ${cost}, has ${currentAether}).`)
return
}
}
if (rollType === "miracle-attack" || rollType === "miracle-power") {
const cost = Number(rollTarget.system?.level) || 0
const currentGrace = Number(this.system.divinityPoints?.value) || 0
if (cost > currentGrace) {
ui.notifications.warn(`${this.name} cannot invoke ${rollTarget.name}: insufficient Grace (needs ${cost}, has ${currentGrace}).`)
return
}
}
break
case "shield-roll": {
rollTarget = this.items.find((i) => i.type === "shield" && i.id === rollKey)
+1
View File
@@ -272,6 +272,7 @@ export default class LethalFantasyRoll extends Roll {
hasChangeDice = false
hasMaxValue = false
hasExplode = false
hasFavor = true
options.rollTarget.value = 0
} else if (options.rollType.includes("weapon-damage")) {