From 91ab8286810d25c517f70331b651537ee753feba Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 8 Jan 2022 10:49:08 +0100 Subject: [PATCH] Char creation --- modules/pegasus-actor.js | 44 +++++++++++ modules/pegasus-create-char.js | 127 +++++++++++++++++++++++++++++++ packs/role.db | 2 +- system.json | 4 +- templates/chat-create-actor.html | 45 +++++++++++ 5 files changed, 219 insertions(+), 3 deletions(-) diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 22928f6..a845895 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -483,6 +483,24 @@ export class PegasusActor extends Actor { await this.deleteEmbeddedDocuments( 'Item', items); } + /* -------------------------------------------- */ + async addItemWithoutDuplicate( newItem ) { + let item = this.data.items.filter( item => item.type == newItem.type && item.name.toLowerCase() == newItem.name.toLowerCase() ) + if ( !item ) { + await this.createEmbeddedDocuments( 'Item', [newItem]); + } + } + + /* -------------------------------------------- */ + computeNRGHealth( ) { + let focValue = this.data.data.statistics.foc.value; + this.update( {'data.secondary.nrg.max': focValue, 'data.secondary.nrg.value': focValue} ) + let phyValue = this.data.data.statistics.phy.value; + this.update( {'data.secondary.health.max': phyValue, 'data.secondary.health.value': phyValue} ) + let mndValue = this.data.data.statistics.mnd.value; + this.update( {'data.secondary.delirium.max': mndValue, 'data.secondary.delirium.value': mndValue} ) + } + /* -------------------------------------------- */ async modStat( key, inc=1) { let stat = duplicate(this.data.data.statistics[key]) @@ -490,6 +508,29 @@ export class PegasusActor extends Actor { await this.update( { [`data.statistics.${key}`] : stat } ) } + /* -------------------------------------------- */ + async valueStat( key, inc=1) { + key = key.toLowerCase() + let stat = duplicate( this.data.data.statistics[key] ) + stat.value += parseInt(inc) + await this.update( { [`data.statistics.${key}`] : stat } ) + } + + /* -------------------------------------------- */ + async addIncSpec( spec, inc=1) { + console.log("Using spec : ", spec, inc) + let specExist = this.data.items.find( item => item.type == 'specialisation' && item.name.toLowerCase() == spec.name.toLowerCase()) + if (specExist) { + specExist = duplicate(specExist) + specExist.data.level += inc; + let update = { _id: specExist._id, "data.level": specExist.data.level }; + await this.updateEmbeddedDocuments('Item', [ update ]); + } else { + spec.data.level += inc; + await this.createEmbeddedDocuments( 'Item', [ spec ]); + } + } + /* -------------------------------------------- */ async applyRace( race ) { let updates = { 'data.racename':race.name } @@ -533,6 +574,9 @@ export class PegasusActor extends Actor { this.getIncreaseStatValue( updates, role.data.statincrease1) this.getIncreaseStatValue( updates, role.data.statincrease2) + newItems = newItems.concat(duplicate(role.data.specialisationsplus1)) + newItems = newItems.concat(duplicate(role.data.specialperk)) + await this.update( updates ) await this.createEmbeddedDocuments('Item', newItems) } diff --git a/modules/pegasus-create-char.js b/modules/pegasus-create-char.js index e4cfb62..d0a4e19 100644 --- a/modules/pegasus-create-char.js +++ b/modules/pegasus-create-char.js @@ -79,7 +79,66 @@ export class PegasusActorCreate { if ( step == 'select-role') { let role = this.roles.find( item => item._id == itemId); + PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget)); this.actor.applyRole( role ); + this.currentRole = role; + this.nbRoleStat = 2; + this.roleStats = duplicate(role.data.statincreasechoice) + this.showRoleStat( ); + } + + if ( step == 'select-role-stat') { + PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget)); + let statKey = $(event.currentTarget).data("stat-key"); + this.actor.valueStat( statKey, 1); + + for (let stat of this.roleStats ) { + if ( stat.name.toLowerCase() == statKey.toLowerCase()) { + stat.flag = false + } + } + this.nbRoleStat--; + if ( this.nbRoleStat == 0 || this.roleStats.length == 0) { + this.roleSpec = duplicate(this.currentRole.data.specincrease) + this.nbDT2 = 1; + this.nbDT1 = 2; + this.showRoleSpecialisations() + } else{ + this.showRoleStat( ); + } + } + + if (step == 'select-role-spec') { + PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget)); + let spec = this.roleSpec.find( item => item._id == itemId); + if (this.nbDT2 > 0) { + this.actor.addIncSpec(spec, 2) + this.nbDT2--; + } else { + this.actor.addIncSpec(spec, 1) + this.nbDT1--; + } + this.roleSpec = this.roleSpec.filter( item => item._id != itemId);//Remove selected spec + if ( this.nbDT1 == 0 || this.roleSpec.length == 0) { + this.rolePerks = duplicate(this.currentRole.data.perks) + this.nbPerks = 2; + this.showRolePerks() + } else { + this.showRoleSpecialisations() + } + } + + if (step == 'select-role-perk') { + PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget)); + let perk = this.rolePerks.find( item => item._id == itemId); + this.actor.addItemWithoutDuplicate(perk) + this.nbPerks--; + this.rolePerks = this.rolePerks.filter( item => item._id != itemId);//Remove selected perk + if (this.nbPerks == 0 || this.rolePerks.length == 0) { + this.showCharacterEnd() + } else { + this.showRolePerks() + } } } @@ -171,4 +230,72 @@ export class PegasusActorCreate { }; await ChatMessage.create( chatData ); } + + /* -------------------------------------------- */ + async showRoleStat( ) { + let formData = this.createFormData("select-role-stat") + formData.rolestats = [] + for(let stat of this.roleStats) { + if (stat.flag) { + formData.rolestats.push( duplicate(this.actor.data.data.statistics[stat.name.toLowerCase()]) ) + } + } + console.log("STAT", this.roleStats, formData) + let chatData = { + user: game.user.id, + alias : this.actor.name, + rollMode: game.settings.get("core", "rollMode"), + whisper: [game.user.id].concat( ChatMessage.getWhisperRecipients('GM') ), + content: await renderTemplate('systems/fvtt-pegasus-rpg/templates/chat-create-actor.html', formData) + }; + await ChatMessage.create( chatData ); + } + + /* -------------------------------------------- */ + async showRoleSpecialisations() { + let formData = this.createFormData("select-role-spec") + formData.rolespec = duplicate(this.roleSpec) + formData.dt = 1 + if (this.nbDT2 > 0 ) { + formData.dt = 2 + } + let chatData = { + user: game.user.id, + alias : this.actor.name, + rollMode: game.settings.get("core", "rollMode"), + whisper: [game.user.id].concat( ChatMessage.getWhisperRecipients('GM') ), + content: await renderTemplate('systems/fvtt-pegasus-rpg/templates/chat-create-actor.html', formData) + }; + await ChatMessage.create( chatData ); + } + + /* -------------------------------------------- */ + async showRolePerks() { + let formData = this.createFormData("select-role-perk") + formData.roleperks = duplicate(this.rolePerks) + formData.nbperks = this.nbPerks + let chatData = { + user: game.user.id, + alias : this.actor.name, + rollMode: game.settings.get("core", "rollMode"), + whisper: [game.user.id].concat( ChatMessage.getWhisperRecipients('GM') ), + content: await renderTemplate('systems/fvtt-pegasus-rpg/templates/chat-create-actor.html', formData) + }; + await ChatMessage.create( chatData ); + } + + /* -------------------------------------------- */ + async showCharacterEnd() { + this.actor.computeNRGHealth() + let formData = this.createFormData("character-end") + let chatData = { + user: game.user.id, + alias : this.actor.name, + rollMode: game.settings.get("core", "rollMode"), + whisper: [game.user.id].concat( ChatMessage.getWhisperRecipients('GM') ), + content: await renderTemplate('systems/fvtt-pegasus-rpg/templates/chat-create-actor.html', formData) + }; + await ChatMessage.create( chatData ); + } + } diff --git a/packs/role.db b/packs/role.db index 31a886a..aa08b8e 100644 --- a/packs/role.db +++ b/packs/role.db @@ -2,5 +2,5 @@ {"_id":"QzQgkZs8PrmuOvpq","name":"Scrapper","type":"role","img":"systems/fvtt-pegasus-rpg/images/icons/icon_scrapper.webp","data":{"statincrease1":"agi","statincrease2":"agi","messagespecplus1":"","specialisationsplus1":[],"powers1":[],"MR":0,"specialperk":[{"_id":"p51kmrejc1hs7sh9","name":"Scrapper","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"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 Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":false,"type":"dropspec","value":""},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":true,"type":"string","value":"1"},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"string","value":""},"targethindrance":{"label":"Apply Hindrance Level to Target","flag":false,"type":"string","value":""},"sufferindrance":{"label":"Perk User suffers Hindrance","flag":false,"type":"string","value":""},"affectedstat":{"label":"Affected Stat","flag":true,"type":"string","value":"COM"},"affectedspec":{"label":"Affected Specialisation","flag":false,"type":"dropspec","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":null,"description":"

SCRAPPERs Only

\n

See Pegasus Engine CORE RPG

"},"effects":[],"folder":"WlYWEUbL9pkp4A8B","sort":500000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}}],"statincreasechoice":[{"name":"AGI","flag":false},{"name":"MND","flag":false},{"name":"SOC","flag":false},{"name":"STR","flag":false},{"name":"PHY","flag":false},{"name":"COM","flag":false},{"name":"DEF","flag":false},{"name":"STL","flag":false},{"name":"PER","flag":false},{"name":"FOC","flag":false}],"specincrease":[],"perks":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}} {"_id":"Z6b7JC9bZMjud3Zq","name":"Ranged","type":"role","img":"systems/fvtt-pegasus-rpg/images/icons/icon_ranged.webp","data":{"statincrease1":"agi","statincrease2":"per","messagespecplus1":"","specialisationsplus1":[],"powers1":[],"MR":0,"specialperk":[{"_id":"rmh53065zb66nk4f","name":"Ranged","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"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 Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":false,"type":"dropspec","value":""},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":true,"type":"string","value":"1"},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"string","value":""},"targethindrance":{"label":"Apply Hindrance Level to Target","flag":false,"type":"string","value":""},"sufferindrance":{"label":"Perk User suffers Hindrance","flag":false,"type":"string","value":""},"affectedstat":{"label":"Affected Stat","flag":true,"type":"string","value":"DMG"},"affectedspec":{"label":"Affected Specialisation","flag":false,"type":"dropspec","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":null,"description":"

RANGED Only

\n

See Pegasus Engine CORE RPG

"},"effects":[],"folder":"WlYWEUbL9pkp4A8B","sort":400000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}}],"statincreasechoice":[{"name":"AGI","flag":false},{"name":"MND","flag":false},{"name":"SOC","flag":false},{"name":"STR","flag":false},{"name":"PHY","flag":false},{"name":"COM","flag":false},{"name":"DEF","flag":false},{"name":"STL","flag":false},{"name":"PER","flag":false},{"name":"FOC","flag":false}],"specincrease":[],"perks":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}} {"_id":"rjpoLFtj5mjkKJxb","name":"Enhancer","type":"role","img":"systems/fvtt-pegasus-rpg/images/icons/enhancer.webp","data":{"statincrease1":"mnd","statincrease2":"soc","messagespecplus1":"","specialisationsplus1":[],"powers1":[],"MR":0,"specialperk":[{"_id":"9gspzij0ng7ujjrg","name":"Enhancer","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"level":1,"active":false,"duration":"","features":{"nrgcost":{"label":"NRG cost to use","flag":false,"type":"number","value":0},"range":{"label":"Range","flag":true,"type":"range","value":"close"},"nbtargets":{"label":"# Targets","flag":false,"type":"string","value":""},"gainstatdice":{"label":"Gain Stat Dice Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":false,"type":"dropspec","value":""},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":true,"type":"string","value":"1"},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"string","value":""},"targethindrance":{"label":"Apply Hindrance Level 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":"dropspec","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":null,"description":"

ENHANCERs Only

\n

See Pegasus Engine CORE RPG

"},"effects":[],"folder":"WlYWEUbL9pkp4A8B","sort":300000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}}],"statincreasechoice":[{"name":"AGI","flag":false},{"name":"MND","flag":false},{"name":"SOC","flag":false},{"name":"STR","flag":false},{"name":"PHY","flag":false},{"name":"COM","flag":false},{"name":"DEF","flag":false},{"name":"STL","flag":false},{"name":"PER","flag":false},{"name":"FOC","flag":false}],"specincrease":[],"perks":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}} -{"_id":"tlC8scOhR2qP8GiW","name":"Agitator","type":"role","img":"systems/fvtt-pegasus-rpg/images/icons/agitator.webp","data":{"statincrease1":"soc","statincrease2":"phy","messagespecplus1":"","specialisationsplus1":[],"powers1":[],"MR":0,"specialperk":[{"_id":"4ttvnrrvjll3dlv5","name":"Agitator","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"level":1,"active":false,"duration":"","features":{"nrgcost":{"label":"NRG cost to use","flag":false,"type":"number","value":0},"range":{"label":"Range","flag":true,"type":"range","value":"close"},"nbtargets":{"label":"# Targets","flag":false,"type":"string","value":""},"gainstatdice":{"label":"Gain Stat Dice Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":false,"type":"dropspec","value":""},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":false,"type":"string","value":""},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"string","value":""},"targethindrance":{"label":"Apply Hindrance Level to Target","flag":true,"type":"string","value":"1"},"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":"dropspec","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":null,"description":"

AGITATORs ONLY

\n

See Pegasus Engine CORE RPG

"},"effects":[],"folder":"WlYWEUbL9pkp4A8B","sort":100000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}}],"statincreasechoice":[{"name":"AGI","flag":false},{"name":"MND","flag":false},{"name":"SOC","flag":false},{"name":"STR","flag":false},{"name":"PHY","flag":false},{"name":"COM","flag":false},{"name":"DEF","flag":false},{"name":"STL","flag":false},{"name":"PER","flag":false},{"name":"FOC","flag":false}],"specincrease":[],"perks":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}} +{"name":"Agitator","type":"role","img":"systems/fvtt-pegasus-rpg/images/icons/agitator.webp","data":{"statincrease1":"soc","statincrease2":"phy","messagespecplus1":"","specialisationsplus1":[{"_id":"z0i93xfzabdivg8i","name":"Fast Talk [SOC]","type":"specialisation","img":"icons/svg/item-bag.svg","data":{"statistic":"soc","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":900000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3,"hmgQYmqJMH3vUOoa":3},"flags":{"core":{"sourceId":"Item.r4UBikkWrryeN0DR"}}}],"powers1":[],"MR":0,"specialperk":[{"_id":"4ttvnrrvjll3dlv5","name":"Agitator","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"level":1,"active":false,"duration":"","features":{"nrgcost":{"label":"NRG cost to use","flag":false,"type":"number","value":0},"range":{"label":"Range","flag":true,"type":"range","value":"close"},"nbtargets":{"label":"# Targets","flag":false,"type":"string","value":""},"gainstatdice":{"label":"Gain Stat Dice Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":false,"type":"dropspec","value":""},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":false,"type":"string","value":""},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"string","value":""},"targethindrance":{"label":"Apply Hindrance Level to Target","flag":true,"type":"string","value":"1"},"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":"dropspec","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":null,"description":"

AGITATORs ONLY

\n

See Pegasus Engine CORE RPG

"},"effects":[],"folder":"WlYWEUbL9pkp4A8B","sort":100000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}}],"statincreasechoice":[{"name":"AGI","flag":false},{"name":"MND","flag":false},{"name":"SOC","flag":true},{"name":"STR","flag":false},{"name":"PHY","flag":true},{"name":"COM","flag":true},{"name":"DEF","flag":false},{"name":"STL","flag":false},{"name":"PER","flag":false},{"name":"FOC","flag":false}],"specincrease":[{"_id":"l3q6izjvvqhse4zu","name":"Fast Talk [SOC]","type":"specialisation","img":"icons/svg/item-bag.svg","data":{"statistic":"soc","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":900000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3,"hmgQYmqJMH3vUOoa":3},"flags":{"core":{"sourceId":"Item.r4UBikkWrryeN0DR"}}},{"_id":"ml5cegn74bgu0wgu","name":"Spec Fly","type":"specialisation","img":"icons/svg/item-bag.svg","data":{"statistic":"phy","level":5,"ispowergroup":true,"powersource":"","powers":[{"_id":"s1cs5seavxfwz6ov","name":"Power1","type":"power","img":"icons/svg/item-bag.svg","data":{"rollneeded":true,"statistic":"str","cost":2,"costtype":"once","range":null,"action":"soft","type":"permanent","effects":"","purchasedeffects":""},"effects":[],"folder":null,"sort":800000,"permission":{"default":0,"hmgQYmqJMH3vUOoa":3},"flags":{}}],"description":"","specialties":"","MR":0},"effects":[],"folder":null,"sort":1000000,"permission":{"default":0,"hmgQYmqJMH3vUOoa":3},"flags":{}}],"perks":[{"_id":"n20yy4d7h28454lx","name":"Perk02","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"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 Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":true,"type":"dropspec","value":"Fast Talk [SOC]"},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":false,"type":"string","value":""},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"statdice","value":""},"targethindrance":{"label":"Apply Hindrance Level 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":true,"type":"dropspec","value":"Spec Fly"},"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":null},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"hmgQYmqJMH3vUOoa":3},"flags":{}}],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":0,"permission":{"hmgQYmqJMH3vUOoa":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.role.tlC8scOhR2qP8GiW"}},"_id":"xUyNSZJP8eOQLLoq"} {"_id":"zczNQ3zUrGMVDgji","name":"Tactician","type":"role","img":"systems/fvtt-pegasus-rpg/images/icons/tactician.webp","data":{"statincrease1":"mnd","statincrease2":"com","messagespecplus1":"","specialisationsplus1":[],"powers1":[],"MR":0,"specialperk":[{"_id":"bvokhcp625o0pbog","name":"Tactician","type":"perk","img":"systems/fvtt-pegasus-rpg/images/icons/icon_perk.webp","data":{"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":"notapplicable"},"nbtargets":{"label":"# Targets","flag":false,"type":"string","value":""},"gainstatdice":{"label":"Gain Stat Dice Level to Pool","flag":false,"type":"string","value":""},"gainspecdice":{"label":"Gain Specialisation Dice Level","flag":false,"type":"dropspec","value":""},"gainbonusdice":{"label":"Gain Bonus Dice Level to Pool","flag":true,"type":"string","value":"1"},"gainotherdice":{"label":"Gain Other Dice Level","flag":false,"type":"string","value":""},"targethindrance":{"label":"Apply Hindrance Level to Target","flag":false,"type":"string","value":""},"sufferindrance":{"label":"Perk User suffers Hindrance","flag":false,"type":"string","value":""},"affectedstat":{"label":"Affected Stat","flag":true,"type":"string","value":"MR"},"affectedspec":{"label":"Affected Specialisation","flag":false,"type":"dropspec","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":null,"description":"

TACTICIANs Only

\n

See Pegasus Engine CORE RPG

"},"effects":[],"folder":"WlYWEUbL9pkp4A8B","sort":600000,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}}],"statincreasechoice":[{"name":"AGI","flag":false},{"name":"MND","flag":false},{"name":"SOC","flag":false},{"name":"STR","flag":false},{"name":"PHY","flag":false},{"name":"COM","flag":false},{"name":"DEF","flag":false},{"name":"STL","flag":false},{"name":"PER","flag":false},{"name":"FOC","flag":false}],"specincrease":[],"perks":[],"description":"

See Pegasus Engine CORE RPG

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{}} diff --git a/system.json b/system.json index fe81ab9..8ce2c65 100644 --- a/system.json +++ b/system.json @@ -100,9 +100,9 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 33, + "templateVersion": 34, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.0.33", + "version": "0.0.34", "background" : "./images/ui/pegasus_welcome_page.webp" } \ No newline at end of file diff --git a/templates/chat-create-actor.html b/templates/chat-create-actor.html index 0d0ff5c..4f79113 100644 --- a/templates/chat-create-actor.html +++ b/templates/chat-create-actor.html @@ -70,4 +70,49 @@ {{/if}} + {{#if (eq step "select-role-stat")}} +
Choose 1 Stat at +1DT : +
+ + {{#each rolestats as |rolestat key|}} + + + + + {{/each}} +
{{rolestat.label}}Select it !
+ {{/if}} + + {{#if (eq step "select-role-spec")}} +
Now select a specialisation at +{{dt}}DT. +
+ + {{#each rolespec as |spec index|}} + + + + + {{/each}} +
{{spec.name}}Select it !
+ {{/if}} + + {{#if (eq step "select-role-perk")}} +
Now select a Perk. +
+ + {{#each roleperks as |perk index|}} + + + + + {{/each}} +
{{perk.name}}Select it !
+ {{/if}} + + {{#if (eq step "character-end")}} +
Follow the next steps from the rulebook page 50 !. You can now spend 150 CDPs to customise your character. +
+ {{/if}} + +