With compendiums + talent management
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user