MAnage spell/miracle spending points and favor/disfavor for shield rolls
Release Creation / build (release) Successful in 43s
Release Creation / build (release) Successful in 43s
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user