v10/v11 compatibility
This commit is contained in:
@ -325,7 +325,7 @@ export class HawkmoonUtility {
|
||||
let pa = Math.floor((valueSC - (po * 400)) / 20)
|
||||
let sc = valueSC - (po * 400) - (pa * 20)
|
||||
return {
|
||||
po: po, pa: pa, sc: sc, valueSC: valueSC
|
||||
po, pa, sc, valueSC
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ export class HawkmoonUtility {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
|
||||
if (rollData.arme && rollData.arme.system.isDistance) {
|
||||
if (rollData.arme?.system.isDistance) {
|
||||
rollData.difficulte = __distanceDifficulte[rollData.distanceTir]
|
||||
rollData.difficulte += __tireurDeplacement[rollData.tireurDeplacement]
|
||||
rollData.difficulte += __cibleCouvert[rollData.cibleCouvert]
|
||||
@ -427,6 +427,10 @@ export class HawkmoonUtility {
|
||||
rollData.difficulte += rollData.cibleDeplace ? 3 : 0
|
||||
rollData.difficulte += rollData.cibleCaC ? 3 : 0
|
||||
}
|
||||
if (rollData.attaqueDesarme) {
|
||||
rollData.difficulte += 10
|
||||
}
|
||||
|
||||
// Ajout adversités
|
||||
rollData.diceFormula += `-${rollData.nbAdversites}`
|
||||
|
||||
@ -436,7 +440,7 @@ export class HawkmoonUtility {
|
||||
|
||||
let myRoll = new Roll(rollData.diceFormula).roll({ async: false })
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
rollData.roll = myRoll
|
||||
rollData.roll = duplicate(myRoll)
|
||||
console.log(">>>> ", myRoll)
|
||||
|
||||
rollData.finalResult = myRoll.total
|
||||
@ -457,7 +461,7 @@ export class HawkmoonUtility {
|
||||
|
||||
let bonusRoll = new Roll(rollData.bonusFormula).roll({ async: false })
|
||||
await this.showDiceSoNice(bonusRoll, game.settings.get("core", "rollMode"));
|
||||
rollData.bonusRoll = bonusRoll
|
||||
rollData.bonusRoll = duplicate(bonusRoll)
|
||||
|
||||
rollData.finalResult += rollData.bonusRoll.total
|
||||
|
||||
@ -571,7 +575,9 @@ export class HawkmoonUtility {
|
||||
tailleCible: "normal",
|
||||
tireurDeplacement: "immobile",
|
||||
cibleCouvert: "aucun",
|
||||
distanceTir: "porteemoyenne"
|
||||
distanceTir: "porteemoyenne",
|
||||
attaqueCharge: false,
|
||||
attaqueDesarme: false
|
||||
}
|
||||
return rollData
|
||||
}
|
||||
|
Reference in New Issue
Block a user