Masquer attributs magiques si non-magique

This commit is contained in:
Vincent Vandemeulebrouck
2021-05-06 21:36:40 +02:00
parent b531e97fd1
commit 474a6a7ed8
8 changed files with 18 additions and 16 deletions

View File

@ -43,6 +43,9 @@ export class RdDItem extends Item {
return itemData.type == 'objet' && Grammar.toLowerCaseNoAccent(itemData.name) == 'cristal alchimique' && itemData.data.quantite > 0;
}
isMagique(){
return Misc.templateData(this.object).magique;
}
getEnc() {
const itemData = Misc.data(this);
@ -68,8 +71,8 @@ export class RdDItem extends Item {
prepareDataPotion() {
const tplData = Misc.templateData(this);
const categorie = Grammar.toLowerCaseNoAccent(tplData.categorie);
tplData.isEnchante = categorie.includes('enchante');
if (tplData.isEnchante) {
tplData.magique = categorie.includes('enchante');
if (tplData.magique) {
if (categorie.includes('soin') || categorie.includes('repos')) {
tplData.puissance = tplData.herbebonus * tplData.pr;
}