DataModels + Appv2 migration : OK
This commit is contained in:
@@ -249,7 +249,7 @@ export class BoLUtility {
|
||||
payload: chatData,
|
||||
});
|
||||
|
||||
renderTemplate('systems/bol/templates/item/post-item.hbs', chatData).then(html => {
|
||||
foundry.applications.handlebars.renderTemplate('systems/bol/templates/item/post-item.hbs', chatData).then(html => {
|
||||
let chatOptions = BoLUtility.chatDataSetup(html);
|
||||
ChatMessage.create(chatOptions)
|
||||
});
|
||||
@@ -487,13 +487,17 @@ export class BoLUtility {
|
||||
|
||||
if (defenseMode == 'damage-with-armor') {
|
||||
let armorFormula = defender.getArmorFormula()
|
||||
rollData.rollArmor = new Roll(armorFormula)
|
||||
await rollData.rollArmor.roll()
|
||||
let msg = await rollData.rollArmor.toMessage({ flavor: game.i18n.localize("BOL.chat.armorRoll") + " : " + armorFormula });
|
||||
if (game.dice3d) { // wait animation end when DsN is there
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id);
|
||||
if (armorFormula === "0") {
|
||||
rollData.armorProtect = 0
|
||||
} else {
|
||||
rollData.rollArmor = new Roll(armorFormula)
|
||||
await rollData.rollArmor.roll()
|
||||
let msg = await rollData.rollArmor.toMessage({ flavor: game.i18n.localize("BOL.chat.armorRoll") + " : " + armorFormula })
|
||||
if (game.dice3d && msg) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
}
|
||||
rollData.armorProtect = (rollData.rollArmor.total < 0) ? 0 : rollData.rollArmor.total
|
||||
}
|
||||
rollData.armorProtect = (rollData.rollArmor.total < 0) ? 0 : rollData.rollArmor.total
|
||||
rollData.finalDamage = rollData.damageTotal - rollData.armorProtect
|
||||
rollData.finalDamage = (rollData.finalDamage < 0) ? 0 : rollData.finalDamage
|
||||
await defender.sufferDamage(rollData.finalDamage)
|
||||
@@ -505,9 +509,17 @@ export class BoLUtility {
|
||||
}
|
||||
if (defenseMode == 'hero-reduce-damage') {
|
||||
let armorFormula = defender.getArmorFormula()
|
||||
rollData.rollArmor = new Roll(armorFormula)
|
||||
await rollData.rollArmor.roll()
|
||||
rollData.armorProtect = (rollData.rollArmor.total < 0) ? 0 : rollData.rollArmor.total
|
||||
if (armorFormula === "0") {
|
||||
rollData.armorProtect = 0
|
||||
} else {
|
||||
rollData.rollArmor = new Roll(armorFormula)
|
||||
await rollData.rollArmor.roll()
|
||||
let msg = await rollData.rollArmor.toMessage({ flavor: game.i18n.localize("BOL.chat.armorRoll") + " : " + armorFormula })
|
||||
if (game.dice3d && msg) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
}
|
||||
rollData.armorProtect = (rollData.rollArmor.total < 0) ? 0 : rollData.rollArmor.total
|
||||
}
|
||||
rollData.rollHero = new Roll("1d6")
|
||||
await rollData.rollHero.roll()
|
||||
rollData.finalDamage = rollData.damageTotal - rollData.rollHero.total - rollData.armorProtect
|
||||
@@ -542,13 +554,13 @@ export class BoLUtility {
|
||||
ChatMessage.create({
|
||||
alias: defender.name,
|
||||
whisper: BoLUtility.getWhisperRecipientsAndGMs(defender.name),
|
||||
content: await renderTemplate('systems/bol/templates/chat/rolls/defense-result-card.hbs', damageResults)
|
||||
content: await foundry.applications.handlebars.foundry.applications.handlebars.renderTemplate('systems/bol/templates/chat/rolls/defense-result-card.hbs', damageResults)
|
||||
})
|
||||
console.log("Defender data : ", defenderUser)
|
||||
ChatMessage.create({
|
||||
alias: defender.name,
|
||||
whisper: BoLUtility.getOtherWhisperRecipients(defenderUser?.name),
|
||||
content: await renderTemplate('systems/bol/templates/chat/rolls/defense-summary-card.hbs', damageResults)
|
||||
content: await foundry.applications.handlebars.foundry.applications.handlebars.renderTemplate('systems/bol/templates/chat/rolls/defense-summary-card.hbs', damageResults)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -635,7 +647,7 @@ export class BoLUtility {
|
||||
let msg = await ChatMessage.create({
|
||||
alias: defender.name,
|
||||
whisper: BoLUtility.getWhisperRecipientsAndGMs(defender.name),
|
||||
content: await renderTemplate('systems/bol/templates/chat/rolls/defense-request-card.hbs', {
|
||||
content: await foundry.applications.handlebars.foundry.applications.handlebars.renderTemplate('systems/bol/templates/chat/rolls/defense-request-card.hbs', {
|
||||
attackId: rollData.id,
|
||||
attacker: rollData.attacker,
|
||||
defender: defender,
|
||||
|
||||
@@ -188,25 +188,25 @@ BOL.rangeModifiers = {
|
||||
"-8": "BOL.dialog.utmost"
|
||||
}
|
||||
|
||||
BOL.difficultyModifiers = {
|
||||
"4": "BOL.dialog.soeasy",
|
||||
"3": "BOL.dialog.soeasy3",
|
||||
"2": "BOL.dialog.veryeasy",
|
||||
"1": "BOL.dialog.easy",
|
||||
"0": "BOL.dialog.moderate",
|
||||
"-1": "BOL.dialog.hard",
|
||||
"-2": "BOL.dialog.tough",
|
||||
"-3": "BOL.dialog.tough3",
|
||||
"-4": "BOL.dialog.demanding",
|
||||
"-5": "BOL.dialog.demanding5",
|
||||
"-6": "BOL.dialog.formidable",
|
||||
"-7": "BOL.dialog.formidable7",
|
||||
"-8": "BOL.dialog.heroic",
|
||||
"-9": "BOL.dialog.heroic9",
|
||||
"-10": "BOL.dialog.mythic",
|
||||
"-11": "BOL.dialog.mythic11",
|
||||
"-12": "BOL.dialog.divine"
|
||||
}
|
||||
BOL.difficultyModifiers = [
|
||||
{ value: "-12", label: "BOL.dialog.divine" },
|
||||
{ value: "-11", label: "BOL.dialog.mythic11" },
|
||||
{ value: "-10", label: "BOL.dialog.mythic" },
|
||||
{ value: "-9", label: "BOL.dialog.heroic9" },
|
||||
{ value: "-8", label: "BOL.dialog.heroic" },
|
||||
{ value: "-7", label: "BOL.dialog.formidable7" },
|
||||
{ value: "-6", label: "BOL.dialog.formidable" },
|
||||
{ value: "-5", label: "BOL.dialog.demanding5" },
|
||||
{ value: "-4", label: "BOL.dialog.demanding" },
|
||||
{ value: "-3", label: "BOL.dialog.tough3" },
|
||||
{ value: "-2", label: "BOL.dialog.tough" },
|
||||
{ value: "-1", label: "BOL.dialog.hard" },
|
||||
{ value: "0", label: "BOL.dialog.moderate" },
|
||||
{ value: "1", label: "BOL.dialog.easy" },
|
||||
{ value: "2", label: "BOL.dialog.veryeasy" },
|
||||
{ value: "3", label: "BOL.dialog.soeasy3" },
|
||||
{ value: "4", label: "BOL.dialog.soeasy" },
|
||||
]
|
||||
|
||||
BOL.alchemyModifiers = {
|
||||
"2": "BOL.dialog.veryeasy",
|
||||
|
||||
@@ -52,6 +52,7 @@ export const preloadHandlebarsTemplates = async function () {
|
||||
"systems/bol/templates/chat/rolls/alchemy-roll-card.hbs",
|
||||
"systems/bol/templates/chat/rolls/selected-horoscope-roll-card.hbs",
|
||||
"systems/bol/templates/chat/rolls/horoscope-roll-card.hbs",
|
||||
"systems/bol/templates/chat/chat-welcome.hbs",
|
||||
"systems/bol/templates/dialogs/aptitude-roll-part.hbs",
|
||||
"systems/bol/templates/dialogs/attribute-roll-part.hbs",
|
||||
"systems/bol/templates/dialogs/mod-roll-part.hbs",
|
||||
@@ -62,7 +63,8 @@ export const preloadHandlebarsTemplates = async function () {
|
||||
"systems/bol/templates/dialogs/flaws-roll-part.hbs",
|
||||
"systems/bol/templates/dialogs/total-roll-part.hbs",
|
||||
"systems/bol/templates/dialogs/fightoptions-roll-part.hbs",
|
||||
"systems/bol/templates/dialogs/horoscope-roll-part.hbs"
|
||||
"systems/bol/templates/dialogs/horoscope-roll-part.hbs",
|
||||
"systems/bol/templates/apps/character-summary-template.html"
|
||||
];
|
||||
|
||||
// Load the template parts
|
||||
|
||||
Reference in New Issue
Block a user