Update for Foundry v13
This commit is contained in:
@@ -305,7 +305,7 @@ export class BoLRoll {
|
||||
// Keep track of the final effect modifier
|
||||
this.rollData.effectModifier = effectModifier
|
||||
|
||||
// Final number of dices
|
||||
// Final number of dices
|
||||
this.rollData.nbDice = 2 + Math.abs(this.rollData.bmDice)
|
||||
// Bonus or Malus ?
|
||||
if (this.rollData.bmDice == 0) {
|
||||
@@ -489,7 +489,7 @@ export class BoLRoll {
|
||||
if (defender) { // If target is selected
|
||||
rollData.defence = defender.defenseValue
|
||||
rollData.armorMalus = defender.armorMalusValue
|
||||
rollData.defenderHeroPoints = defender.getHeroPoints()
|
||||
rollData.defenderHeroPoints = defender.getHeroPoints()
|
||||
rollData.shieldBlock = 'none'
|
||||
let shields = defender.shields
|
||||
//console.log("Defender stats", defender)
|
||||
@@ -535,7 +535,7 @@ export class BoLRoll {
|
||||
rollData.weaponModifier = 0
|
||||
rollData.attackBonusDice = false
|
||||
rollData.armorMalus = 0
|
||||
// Specific stuff
|
||||
// Specific stuff
|
||||
this.preProcessWeapon(rollData, defender)
|
||||
this.preProcessFightOption(rollData)
|
||||
this.updateArmorMalus(rollData)
|
||||
@@ -551,7 +551,7 @@ export class BoLRoll {
|
||||
console.log("ROLLDATA", rollData)
|
||||
|
||||
// Then display+process the dialog
|
||||
const rollOptionContent = await renderTemplate(rollOptionTpl, rollData);
|
||||
const rollOptionContent = await foundry.applications.handlebars.renderTemplate(rollOptionTpl, rollData);
|
||||
let d = new Dialog({
|
||||
title: rollData.label,
|
||||
content: rollOptionContent,
|
||||
@@ -582,7 +582,7 @@ export class BoLRoll {
|
||||
rollbase = 0
|
||||
}
|
||||
let diceData = BoLUtility.getDiceData()
|
||||
let malusInit = rollData.combatData?.malusInit || 0
|
||||
let malusInit = rollData.combatData?.malusInit || 0
|
||||
const modifiers = rollbase + rollData.careerBonus + rollData.mod + rollData.weaponModifier - rollData.defence - rollData.modArmorMalus + rollData.shieldMalus + rollData.attackModifier + rollData.appliedArmorMalus + rollData.effectModifier - malusInit
|
||||
const formula = (isMalus) ? rollData.nbDice + "d" + diceData.diceFormula + "kl2 + " + modifiers : rollData.nbDice + "d" + diceData.diceFormula + "kh2 + " + modifiers
|
||||
rollData.formula = formula
|
||||
@@ -635,15 +635,15 @@ export class BoLDefaultRoll {
|
||||
this.rollData.roll = r
|
||||
this.rollData.isFumble = (diceTotal <= diceData.criticalFailureValue)
|
||||
if ( this.rollData.isFumble ) {
|
||||
this.rollData.isSuccess = false
|
||||
this.rollData.isSuccess = false
|
||||
this.rollData.isCritical = false
|
||||
this.rollData.isRealCritical = false
|
||||
this.rollData.isHeroic = false
|
||||
this.rollData.isFailure = true
|
||||
this.rollData.isFailure = true
|
||||
} else {
|
||||
this.rollData.isCritical = (diceTotal >= diceData.criticalSuccessValue)
|
||||
if ( this.rollData.isCritical) {
|
||||
this.rollData.isSuccess = true
|
||||
this.rollData.isSuccess = true
|
||||
} else {
|
||||
this.rollData.isSuccess = (r.total >= diceData.successValue)
|
||||
}
|
||||
@@ -805,13 +805,13 @@ export class BoLDefaultRoll {
|
||||
/* -------------------------------------------- */
|
||||
_buildDamageChatMessage(rollData) {
|
||||
const rollMessageTpl = 'systems/bol/templates/chat/rolls/damage-roll-card.hbs';
|
||||
return renderTemplate(rollMessageTpl, rollData)
|
||||
return foundry.applications.handlebars.renderTemplate(rollMessageTpl, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_buildChatMessage(rollData) {
|
||||
const rollMessageTpl = 'systems/bol/templates/chat/rolls/default-roll-card.hbs'
|
||||
return renderTemplate(rollMessageTpl, rollData)
|
||||
return foundry.applications.handlebars.renderTemplate(rollMessageTpl, rollData)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user