Add icons and background

This commit is contained in:
2022-11-09 23:39:55 +01:00
parent 3718749519
commit 4f04a3c97b
18 changed files with 25 additions and 8 deletions

View File

@ -228,12 +228,18 @@ export class HawkmoonActor extends Actor {
return {isValid: false}
}
/* -------------------------------------------- */
checkCompetenceLevel(compName, minLevel) {
checkAttributOrCompetenceLevel(compName, minLevel) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase() && i.system.niveau >= minLevel)
if ( comp) {
return {isValid: true, item: duplicate(comp) }
} else {
for (let attrKey in this.system.attributs) {
if ( this.system.attributs[attrKey].label.toLowerCase() == compName.toLowerCase() && this.system.attributs[attrKey].value >= minLevel ) {
return {isValid: true, item: duplicate(this.system.attributs[attrKey]) }
}
}
}
return {isValid: false, warningMessage: `Prérequis insuffisant : la compétence ${compName} doit être de niveau ${minLevel} au minimum`}
return {isValid: false, warningMessage: `Prérequis insuffisant : la compétence/attribut ${compName} doit être de niveau ${minLevel} au minimum`}
}
/* -------------------------------------------- */
addCompetenceBonus(compName, bonus, baCost) {