Minor fixes
This commit is contained in:
@@ -412,6 +412,11 @@ export class MournbladeActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollRune(runeId) {
|
||||
let comp = this.items.find(comp => comp.type == "competence" && comp.name.toLowerCase() == "savoir : runes")
|
||||
if ( !comp) {
|
||||
ui.notifications.warn("La compétence Savoirs : Runes n'a pas été trouvée, abandon.")
|
||||
return
|
||||
}
|
||||
let rollData = this.getCommonRollData("cla", undefined, "Savoir : Runes")
|
||||
rollData.rune = duplicate(this.items.get(runeId) || {})
|
||||
rollData.difficulte = rollData.rune?.system?.seuil || 0
|
||||
|
||||
@@ -281,10 +281,11 @@ export class MournbladeUtility {
|
||||
}
|
||||
}
|
||||
|
||||
//console.log("Result : ", rollData)
|
||||
if (rollData.difficulte > 0 && !rollData.isDramatique) {
|
||||
rollData.isSuccess = (rollData.roll.finalResult >= rollData.difficulte)
|
||||
rollData.isHeroique = ((rollData.roll.finalResult - rollData.difficulte) >= 10)
|
||||
rollData.isDramatique = ((rollData.roll.finalResult - rollData.difficulte) <= -10)
|
||||
rollData.isSuccess = (rollData.finalResult >= rollData.difficulte)
|
||||
rollData.isHeroique = ((rollData.finalResult - rollData.difficulte) >= 10)
|
||||
rollData.isDramatique = ((rollData.finalResult - rollData.difficulte) <= -10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,6 +308,7 @@ export class MournbladeUtility {
|
||||
actor.changeEclat(-1)
|
||||
}
|
||||
}
|
||||
//console.log("BEFORE COMP", rollData)
|
||||
if (rollData.competence) {
|
||||
rollData.predilections = duplicate( rollData.competence.system.predilections.filter( pred => !pred.used) || [] )
|
||||
let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0
|
||||
@@ -324,6 +326,9 @@ export class MournbladeUtility {
|
||||
if ( rollData.runemode == "inscrire") {
|
||||
rollData.runeduree *= 2
|
||||
}
|
||||
if ( rollData.runemode == "prononcer") {
|
||||
rollData.runeduree = 1
|
||||
}
|
||||
}
|
||||
|
||||
let myRoll = new Roll(rollData.diceFormula).roll({ async: false })
|
||||
|
||||
Reference in New Issue
Block a user