With compendiums + talent management

This commit is contained in:
2022-11-05 10:03:23 +01:00
parent 6551a93791
commit 3718749519
17 changed files with 629 additions and 285 deletions

View File

@@ -317,10 +317,18 @@ export class HawkmoonUtility {
if ( rollData.selectedTalents && rollData.selectedTalents.length > 0) {
for (let id of rollData.selectedTalents) {
let talent = actor.items.find(t => t.id == id)
let bonus = talent.system.automations.find( a => a.eventtype == "roll-bonus")
if (bonus) {
rollData.diceFormula += `+${bonus.value}`
let talent = rollData.talents.find(t => t._id == id)
let bonusOK = true
if ( talent.system.baCost ) {
bonusOK = actor.checkBonneAventure( talent.system.baCost)
if ( bonusOK ) {
actor.changeBonneAventure( -talent.system.baCost )
} else {
ui.notifications.warn("Vous n'avez pas assez de points de Bonne Aventure !")
}
}
if (bonusOK) {
rollData.diceFormula += `+${talent.system.bonus}`
}
}
}