Fix #19 - Horoscope majeur

This commit is contained in:
2023-04-29 21:48:51 +02:00
parent 41fbc094bb
commit 59ee6684ab
10 changed files with 66 additions and 38 deletions

View File

@ -220,6 +220,9 @@ export class BoLRoll {
/* -------------------------------------------- */
static horoscopeCheck(actor, event, horoscopeType) {
let target = BoLUtility.getTarget()
let cost = (horoscopeType == "minor") ? 1 : 2
if (cost > actor.getAstrologyPoints()) {
ui.notifications.warn(game.i18n.localize("BOL.ui.astrologyNoPoints"))
@ -233,6 +236,7 @@ export class BoLRoll {
rollData.astrologyPointsCost = cost
rollData.label = game.i18n.localize('BOL.ui.makeHoroscope')
rollData.description = game.i18n.localize('BOL.ui.makeHoroscope') + " " + game.i18n.localize(rollData.horoscopeTypeLabel)
rollData.targetId = target?.id
console.log("HOROSCOPE!", rollData);
return this.displayRollDialog(rollData);
@ -685,6 +689,7 @@ export class BoLDefaultRoll {
flavor: msgFlavor,
speaker: ChatMessage.getSpeaker({ actor: actor }),
})
this.rollData.roll = duplicate(this.rollData.roll) // Remove object, keep data (v111 ready)
msg.setFlag("world", "bol-roll-data", this.rollData)
})
}