Fix prayer roll
All checks were successful
Release Creation / build (release) Successful in 45s

This commit is contained in:
2025-04-23 16:05:01 +02:00
parent 16959dd52e
commit ebb7bfe3d6
24 changed files with 84 additions and 74 deletions

View File

@ -743,14 +743,15 @@ export default class LethalFantasyRoll extends Roll {
if (currentAction) {
if (rollContext === "rollLethargyDice") {
if (currentAction.spellStatus === "castingTime") {
if (currentAction.castingTime < currentAction.system.castingTime) {
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${currentAction.system.castingTime}`
let time = currentAction.type === "spell" ? currentAction.system.castingTime : currentAction.system.prayerTime
if (currentAction.castingTime < time) {
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${time}`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
currentAction.castingTime += 1
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
return
} else {
let message = `Spell ${currentAction.name} ready to be cast on next second !`
let message = `Spell/Miracle ${currentAction.name} ready to be cast on next second !`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
currentAction.castingTime = 1
currentAction.spellStatus = "toBeCasted"
@ -890,7 +891,7 @@ export default class LethalFantasyRoll extends Roll {
},
{
action: "cast",
label: "Cast a spell",
label: "Cast a spell/Miracle",
callback: (event, button, dialog) => {
return "casting"
},