fix: ReferenceError success is not defined dans boutons sousTension/oppose
This commit is contained in:
+4
-3
@@ -325,11 +325,12 @@ $(document).on("click", "[data-action='sousTension']", async function () {
|
|||||||
deckManager.addToDiscard(card)
|
deckManager.addToDiscard(card)
|
||||||
await deckManager.saveDeckState()
|
await deckManager.saveDeckState()
|
||||||
|
|
||||||
|
const successA = totalJoueur >= valeurMJ
|
||||||
const content = await foundry.applications.handlebars.renderTemplate(
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
"systems/fvtt-hamalron/templates/chat-tension.hbs",
|
"systems/fvtt-hamalron/templates/chat-tension.hbs",
|
||||||
{ cssClass: "fvtt-hamalron tension-roll", icon: "fa-bolt", label: game.i18n.localize("HAMALRON.Label.sousTension"),
|
{ cssClass: "fvtt-hamalron tension-roll", icon: "fa-bolt", label: game.i18n.localize("HAMALRON.Label.sousTension"),
|
||||||
joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurMJ})`, mjScore: valeurMJ,
|
joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurMJ})`, mjScore: valeurMJ,
|
||||||
isSuccess: success, isMJ: totalJoueur < valeurMJ, isSousTension: true })
|
isSuccess: successA, isMJ: totalJoueur < valeurMJ, isSousTension: true })
|
||||||
ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER })
|
ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER })
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -354,12 +355,12 @@ $(document).on("click", "[data-action='oppose']", async function () {
|
|||||||
deckManager.addToDiscard(card)
|
deckManager.addToDiscard(card)
|
||||||
await deckManager.saveDeckState()
|
await deckManager.saveDeckState()
|
||||||
|
|
||||||
const success = totalJoueur >= valeurOpposant
|
const successB = totalJoueur >= valeurOpposant
|
||||||
const content = await foundry.applications.handlebars.renderTemplate(
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
"systems/fvtt-hamalron/templates/chat-tension.hbs",
|
"systems/fvtt-hamalron/templates/chat-tension.hbs",
|
||||||
{ cssClass: "fvtt-hamalron tension-roll", icon: "fa-shield-halved", label: game.i18n.localize("HAMALRON.Label.oppose"),
|
{ cssClass: "fvtt-hamalron tension-roll", icon: "fa-shield-halved", label: game.i18n.localize("HAMALRON.Label.oppose"),
|
||||||
joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurOpposant})`, mjScore: valeurOpposant,
|
joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurOpposant})`, mjScore: valeurOpposant,
|
||||||
isSuccess: success, isMJ: totalJoueur < valeurOpposant, isSousTension: false })
|
isSuccess: successB, isMJ: totalJoueur < valeurOpposant, isSousTension: false })
|
||||||
ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER })
|
ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user