Update perks

This commit is contained in:
2021-12-23 15:31:56 +01:00
parent ac6f71de65
commit 7a06989d87
5 changed files with 22 additions and 7 deletions

View File

@ -292,7 +292,15 @@ export class PegasusItemSheet extends ItemSheet {
/* -------------------------------------------- */
async addPerkSpecialisation( event, item, dataItem) {
let newItem = duplicate(item.data);
await this.object.update( { 'data.features.affectedspec.value': newItem.name} );
if ( event.toElement.className == 'drop-spec-perk') {
//console.log("PER SPEC", event)
let key = event.toElement.dataset["key"];
if ( key == 'affectedspec') {
await this.object.update( { 'data.features.affectedspec.value': newItem.name} );
} else {
await this.object.update( { 'data.features.gainspecdice.value': newItem.name} );
}
}
}
/* -------------------------------------------- */