Enhance perks
This commit is contained in:
@ -289,6 +289,12 @@ 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} );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDrop(event) {
|
||||
//console.log(event);
|
||||
@ -302,6 +308,18 @@ export class PegasusItemSheet extends ItemSheet {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.object.type == 'perk' ) {
|
||||
let data = event.dataTransfer.getData('text/plain');
|
||||
if (data) {
|
||||
let dataItem = JSON.parse( data );
|
||||
let item = await this.searchItem( dataItem);
|
||||
if ( item.data.type == 'specialisation') {
|
||||
return this.addPerkSpecialisation( event, item, dataItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.object.type == 'specialisation' ) {
|
||||
let data = event.dataTransfer.getData('text/plain');
|
||||
if (data) {
|
||||
@ -326,16 +344,6 @@ export class PegasusItemSheet extends ItemSheet {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.object.type == 'perk' || this.object.type == 'ability') {
|
||||
let data = event.dataTransfer.getData('text/plain');
|
||||
if (data) {
|
||||
let dataItem = JSON.parse( data );
|
||||
let item = await this.searchItem( dataItem);
|
||||
if ( item.data.type == 'specialisation') {
|
||||
return this.addSpecialisation( item, dataItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.object.type == 'role' ) {
|
||||
let data = event.dataTransfer.getData('text/plain');
|
||||
if (data) {
|
||||
|
Reference in New Issue
Block a user