Sync effetcts + initiative

This commit is contained in:
sladecraven 2022-01-28 11:41:19 +01:00
parent 68d7344e90
commit c9261a713a
12 changed files with 34 additions and 102 deletions

View File

@ -556,25 +556,26 @@ export class PegasusActor extends Actor {
effect = duplicate(effect) effect = duplicate(effect)
if ( !effect.data.hindrance if ( !effect.data.hindrance
&& effect.data.stataffected != "notapplicable" && effect.data.stataffected != "notapplicable"
&& effect.data.stataffected != "special" && effect.data.stataffected != "special") {
&& effect.data.stataffected != "all") {
rollData.effectsList.push( { label: effect.name, type: "effect", applied: false, effect: effect, value: effect.data.effectlevel } ) rollData.effectsList.push( { label: effect.name, type: "effect", applied: false, effect: effect, value: effect.data.effectlevel } )
} }
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
addArmorsShields( rollData) { addArmorsShields( rollData, useShield = false) {
let armors = this.getArmors() let armors = this.getArmors()
let armorLevel = 0 let armorLevel = 0
for (let armor of armors) { for (let armor of armors) {
armorLevel += armor.data.resistance armorLevel += armor.data.resistance
} }
rollData.armorsList.push( {label: 'Total armor level', type: "other", applied: false, value: armorLevel } ) rollData.armorsList.push( {label: 'Total armor level', type: "other", applied: false, value: armorLevel } )
if (useShield ) {
rollData.armorsList.push( {label: 'Shield level', type: "other", applied: false, value: this.getShieldValue() } ) rollData.armorsList.push( {label: 'Shield level', type: "other", applied: false, value: this.getShieldValue() } )
} }
}
/* -------------------------------------------- */ /* -------------------------------------------- */
getCommonRollData(statKey = undefined) { getCommonRollData(statKey = undefined, useShield = false) {
let rollData = PegasusUtility.getBasicRollData() let rollData = PegasusUtility.getBasicRollData()
rollData.alias = this.name rollData.alias = this.name
rollData.actorImg = this.img rollData.actorImg = this.img
@ -592,7 +593,7 @@ export class PegasusActor extends Actor {
} }
this.addEffects( rollData) this.addEffects( rollData)
this.addArmorsShields(rollData) this.addArmorsShields(rollData, useShield)
return rollData return rollData
} }
@ -611,7 +612,7 @@ export class PegasusActor extends Actor {
rollPool(statKey, useShield = false) { rollPool(statKey, useShield = false) {
let stat = this.getStat(statKey); let stat = this.getStat(statKey);
if (stat) { if (stat) {
let rollData = this.getCommonRollData(statKey) let rollData = this.getCommonRollData(statKey, useShield)
rollData.mode = "stat" rollData.mode = "stat"
this.startRoll(rollData) this.startRoll(rollData)
@ -657,7 +658,8 @@ export class PegasusActor extends Actor {
rollData.mode = "spec" rollData.mode = "spec"
rollData.title = `Spec. : ${spec.name} ` rollData.title = `Spec. : ${spec.name} `
rollData.specList = [ spec ] rollData.specList = [ spec ]
rollData.selectedSpec = spec._id
rollData.specDicesLevel = spec.data.level
this.startRoll(rollData) this.startRoll(rollData)
} else { } else {
ui.notifications.warn("Specialisation not found !"); ui.notifications.warn("Specialisation not found !");

View File

@ -78,14 +78,13 @@ function welcomeMessage() {
content: `<div id="welcome-message-pegasus"><span class="rdd-roll-part"> content: `<div id="welcome-message-pegasus"><span class="rdd-roll-part">
<strong>Welcome to the Pegasus Engine CORE RPG.</strong> <strong>Welcome to the Pegasus Engine CORE RPG.</strong>
<br>Created by GMD Online <br>Created by GMD Online
<p>The Pegasus Engine is a available for free on our website. It is also available as a PDF and in Print format at an affordable price on our website.</p> <p>The Pegasus Engine is a available for free on our website. It is also available as a PDF and in Print format at an affordable price.</p>
<p>It is thanks to all my Official GMD Members and Patreon Members that have made this project possible and allowed for this interface to be provided for free.</p> <p>This project has been made possible thanks to all the Official GMD Members and Patreon Members that have supported me and as a result made it possible to supply this interface for free.</p>
<p>In return I have made available a fully detailed Compendium for FREE for all members, which can be obtained from the Members page on my website.</p> <p>In return I have made available a fully detailed Compendium for FREE for all members, which can be obtained from the Members page on my website.</p>
You too can become a supporter for future projects. <p>You too can become a supporter for future projects and enjoy amazing rewards.
<br>Sign up Here: <br>Sign up Here: https://www.gmdonline.co.uk/gmdmemberspage/</p>
https://www.gmdonline.co.uk/gmdmemberspage/
<p>GMD Online, GMD CORE RPG logo are © 2018 CORE Worlds and Game Rules © 2001. Interface © 2021 All rights reserved.</p> <p>GMD Online, GMD CORE RPG logo are © 2018 CORE Worlds and Game Rules © 2001. Interface © 2021 All rights reserved.</p>
<p>Enjoy and become the hero you were born to be!</p></div> <p>Enjoy and become the hero you were born to be!</p>
` }); ` });
} }

View File

@ -131,6 +131,8 @@ export class PegasusRollDialog extends Dialog {
if ( spec) { if ( spec) {
this.rollData.specDiceLevel = spec.data.level this.rollData.specDiceLevel = spec.data.level
$('#specDicesLevel').val(this.rollData.specDiceLevel) $('#specDicesLevel').val(this.rollData.specDiceLevel)
} else {
$('#specDicesLevel').val(0)
} }
}); });
html.find('#statDicesLevel').change((event) => { html.find('#statDicesLevel').change((event) => {

View File

@ -81,7 +81,7 @@
{"_id":"iBdtbvylkhVl0eU0","name":"Astrogation [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.u87qu06ijxKcku7W"}}} {"_id":"iBdtbvylkhVl0eU0","name":"Astrogation [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.u87qu06ijxKcku7W"}}}
{"_id":"iJ0U3nDmEI6yoSNm","name":"2-H Crushing [COM]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"com","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.91Coi2zt8i74ULdP"}}} {"_id":"iJ0U3nDmEI6yoSNm","name":"2-H Crushing [COM]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"com","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.91Coi2zt8i74ULdP"}}}
{"_id":"irT5gNk4TBpbDez5","name":"Chemistry [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.k6Q9TBqFpxgCAypY"}}} {"_id":"irT5gNk4TBpbDez5","name":"Chemistry [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.k6Q9TBqFpxgCAypY"}}}
{"_id":"jKNmPQJtjCNOstwt","name":"Initiative [MR]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"agi","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.e13r56dJ1LYnUHve"}}} {"_id":"jKNmPQJtjCNOstwt","name":"Initiative [MR]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mr","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.e13r56dJ1LYnUHve"}}}
{"_id":"jvxMDUisjP8mi1Fi","name":"Culture [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p style=\"box-sizing: border-box; user-select: text; color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</p>\n<p style=\"box-sizing: border-box; user-select: text; color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">Create a Different Lore for each Lore Specialisations</p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.LGbXIAnyCvSYJjKJ"}}} {"_id":"jvxMDUisjP8mi1Fi","name":"Culture [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p style=\"box-sizing: border-box; user-select: text; color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</p>\n<p style=\"box-sizing: border-box; user-select: text; color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">Create a Different Lore for each Lore Specialisations</p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.LGbXIAnyCvSYJjKJ"}}}
{"_id":"l92nudtJI1cedk4q","name":"Cryptography [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.k6Q9TBqFpxgCAypY"}}} {"_id":"l92nudtJI1cedk4q","name":"Cryptography [MND]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"mnd","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.k6Q9TBqFpxgCAypY"}}}
{"_id":"lJNPLMRHTK9bsX21","name":"Track [PER]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"per","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.h65ID9PFleXY2iXJ"}}} {"_id":"lJNPLMRHTK9bsX21","name":"Track [PER]","type":"specialisation","img":"systems/fvtt-pegasus-rpg/images/icons/icon_spec.webp","data":{"statistic":"per","level":1,"ispowergroup":false,"powersource":"","powers":[],"description":"<p><span style=\"color: #191813; font-size: 12.8px; letter-spacing: 1px; text-align: justify;\">See Pegasus Engine CORE RPG</span></p>"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"iNL4aGohJ8v6YrUk":3},"flags":{"core":{"sourceId":"Compendium.fvtt-pegasus-rpg.specialisations.h65ID9PFleXY2iXJ"}}}

View File

@ -183,6 +183,6 @@
"templateVersion": 63, "templateVersion": 63,
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.2.0", "version": "0.2.1",
"background" : "./images/ui/pegasus_welcome_page.webp" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

@ -47,10 +47,6 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if linkedRollId}}
<li><button class="chat-card-button apply-defense-roll" data-roll-score="{{finalScore}}" data-roll-id="{{@root.rollId}}" data-actor-id="{{actorId}}" data-defender-id="{{defenseAttackerId}}">Use this Roll as defense</button></li>
{{/if}}
</ul> </ul>
</div> </div>

View File

@ -1,6 +1,17 @@
<ul> <ul>
{{#each effectsList as |effect idx|}} {{#each effectsList as |effect idx|}}
{{#if (eq effect.effect.data.stataffected "all")}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
{{#if effect.effect}}
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
{{else}}
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
{{/if}}
</li>
{{/if}}
{{#if (eq @root.statKey effect.effect.data.stataffected)}} {{#if (eq @root.statKey effect.effect.data.stataffected)}}
<li class="flex-group-left"> <li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label> <label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>

View File

@ -23,9 +23,9 @@
{{#if specList}} {{#if specList}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label" >Specialisation : </span> <span class="roll-dialog-label" >Spec Name : </span>
<select class="competence-base" id="specList" type="text" name="selectedSpec" value="{{selectedSpec}}" data-dtype="String"> <select class="competence-base" id="specList" type="text" name="selectedSpec" value="{{selectedSpec}}" data-dtype="String">
{{#select selectedSpecIndex}} {{#select selectedSpec}}
<option value="0">None</option> <option value="0">None</option>
{{#each specList as |spec idx|}} {{#each specList as |spec idx|}}
<option value="{{spec._id}}">{{spec.name}}</option> <option value="{{spec._id}}">{{spec.name}}</option>

View File

@ -1,29 +0,0 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="grid grid-2col">
<div class="floxrow">
<div class="flexrow">
<span class="roll-dialog-label" >{{stat.label}} : <span id="stat-dice">{{stat.dice}}</span> (+{{stat.mod}})</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >{{spec.name}} : {{spec.data.dice}}</span>
</div>
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-common-dices.html}}
</div>
<div>
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}}
</div>
</div>
</form>

View File

@ -1,24 +0,0 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="grid grid-2col">
<div class="floxrow">
<div class="flexrow">
<span class="roll-dialog-label">{{stat.label}} : <span id="stat-dice">{{stat.dice}}</span> (+{{stat.mod}})</span>
</div>
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-common-dices.html}}
</div>
<div>
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}}
</div>
</div>
</form>

View File

@ -1,25 +0,0 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="grid grid-2col">
<div class="floxrow">
<div class="flexrow">
<span class="roll-dialog-label">{{stat.label}} : <span id="stat-dice">{{stat.dice}}</span> (+{{stat.mod}})</span>
</div>
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-common-dices.html}}
</div>
<div>
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}}
</div>
</div>
</form>