This commit is contained in:
François-Xavier Guillois
2023-09-06 17:18:58 +02:00
parent c19a351622
commit 55c3d09490
14 changed files with 107 additions and 64 deletions
+18
View File
@@ -11,6 +11,24 @@ export class VermineItem extends Item {
// preparation methods overridden (such as prepareBaseData()).
super.prepareData();
}
prepareBaseData(){
const actorType = (this.actor !== null) ? this.actor.type : 'character';
switch (this.type){
case 'ability':
if (this.system.type == "") {
// console.log('je suis une capacité, avec pour sous-type', this.system.type, actorType);
this.system.type = actorType;
}
if (this.system.totem == "" && this.actor !== null && this.actor.system.identity.totem != "") {
// console.log('je suis une capacité, avec pour sous-type', this.system.type, actorType);
this.system.totem = this.actor.system.identity.totem;
}
break;
default:
break;
}
}
/**
* Prepare a data object which is passed to any Roll formulas which are created related to this Item