diff --git a/modules/pegasus-item-sheet.js b/modules/pegasus-item-sheet.js index 727af97..5b71a27 100644 --- a/modules/pegasus-item-sheet.js +++ b/modules/pegasus-item-sheet.js @@ -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) { diff --git a/system.json b/system.json index 46af4cc..58f9462 100644 --- a/system.json +++ b/system.json @@ -50,9 +50,9 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 18, + "templateVersion": 20, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.0.18", + "version": "0.0.20", "background" : "./images/ui/pegasus_welcome_page.webp" } \ No newline at end of file diff --git a/template.json b/template.json index df90cf6..f20006e 100644 --- a/template.json +++ b/template.json @@ -174,22 +174,137 @@ "perk": { "level": 1, "active": false, + "duration": "", + "features": { + "nrgcost": { + "label": "NRG cost to use", + "flag": false, + "type": "number", + "value": 0 + }, + "range": { + "label": "Range", + "flag": false, + "type": "range", + "value": "" + }, + "nbtargets": { + "label": "# Targets", + "flag": false, + "type": "string", + "value": "" + }, + "gainstatdice": { + "label": "Gain Stat Dice to Pool", + "flag": false, + "type": "statdice", + "value": "" + }, + "gainspecdice": { + "label": "Gain Specialisation Dice", + "flag": false, + "type": "statdice", + "value": "" + }, + "gainbonusdice": { + "label": "Gain Bonus Dice to Pool", + "flag": false, + "type": "string", + "value": "" + }, + "gainotherdice": { + "label": "Gain Other Dice to Pool", + "flag": false, + "type": "statdice", + "value": "" + }, + "targethindrance": { + "label": "Apply Hindrance to Target", + "flag": false, + "type": "string", + "value": "" + }, + "sufferindrance": { + "label": "Perk User suffers Hindrance", + "flag": false, + "type": "string", + "value": "" + }, + "affectedstat": { + "label": "Affected Stat", + "flag": false, + "type": "string", + "value": "" + }, + "affectedspec": { + "label": "Affected Specialisation", + "flag": false, + "type": "string", + "value": "" + }, + "affectspecial": { + "label": "Affects Special", + "flag": false, + "type": "string", + "value": "" + }, + "bonushealth": { + "label": "Bonus to Health", + "flag": false, + "type": "string", + "value": "" + }, + "bonusnrg": { + "label": "Bonus to NRG", + "flag": false, + "type": "string", + "value": "" + }, + "bonusdelirium": { + "label": "Bonus to Delirium", + "flag": false, + "type": "string", + "value": "" + }, + "gainmomentum": { + "label": "Gain Momentum", + "flag": false, + "type": "string", + "value": "" + }, + "applyeffect": { + "label": "Apply Effect", + "flag": false, + "type": "string", + "value": "" + }, + "removeeffect": { + "label": "Remove Effect", + "flag": false, + "type": "string", + "value": "" + }, + "specialrule": { + "label": "Special Rule", + "flag": false, + "type": "text", + "value": "" + }, + "upgrade1": { + "label": "Upgrade 1", + "flag": false, + "type": "string", + "value": "" + }, + "upgrade2": { + "label": "Upgrade 2", + "flag": false, + "type": "string", + "value": "" + } + }, "roundcount": 0, - "nbuse": "", - "gainstatdice": "", - "gainbonusdice": 0, - "gainotherdice": 0, - "specialisation": [ {"name": "None"}], - "range": "", - "aoe": "", - "nbtargets": 0, - "nrgcost": 0, - "effectscaused": "", - "stataffected": "", - "targetresists": "", - "description": "", - "upgrades": "", - "rules": "" + "nbuse": "" }, "power": { "rollneeded": false, diff --git a/templates/item-ability-sheet.html b/templates/item-ability-sheet.html index 92dca23..76b8781 100644 --- a/templates/item-ability-sheet.html +++ b/templates/item-ability-sheet.html @@ -18,17 +18,7 @@