Add icons and background
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user