Minor fixes

This commit is contained in:
sladecraven 2022-07-26 22:38:04 +02:00
parent e7f5a17096
commit 40a8406761
8 changed files with 37 additions and 12 deletions

View File

@ -203,11 +203,17 @@ export class PegasusActorSheet extends ActorSheet {
html.find('.quantity-minus').click(event => { html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 ); this.actor.incDecQuantity( li.data("item-id"), -1 );
} ); } )
html.find('.quantity-plus').click(event => { html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 ); this.actor.incDecQuantity( li.data("item-id"), +1 );
} ); } )
html.find('.current-nrg-minus').click(event => {
this.actor.incDecNRG( -1 );
} )
html.find('.current-nrg-plus').click(event => {
this.actor.incDecNRG( 1 );
} )
html.find('.ammo-minus').click(event => { html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item") const li = $(event.currentTarget).parents(".item")

View File

@ -820,6 +820,15 @@ export class PegasusActor extends Actor {
} }
} }
/* -------------------------------------------- */
incDecNRG( value) {
let nrg = duplicate(this.data.data.nrg)
nrg.value += value
if (nrg.value >= 0 && nrg.value <= nrg.max) {
this.update({ 'data.nrg': nrg })
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async updatePerkStatus(itemId, status) { async updatePerkStatus(itemId, status) {
let item = this.items.get(itemId) let item = this.items.get(itemId)
@ -871,8 +880,7 @@ export class PegasusActor extends Actor {
this.disableWeaverPerk(item) this.disableWeaverPerk(item)
PegasusUtility.createChatWithRollMode(item.name, { PegasusUtility.createChatWithRollMode(item.name, {
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: item }) content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: item })
}); })
} }
if (status == "activated") { if (status == "activated") {
// Add effects linked to the perk // Add effects linked to the perk
@ -916,6 +924,9 @@ export class PegasusActor extends Actor {
nrg.max += Number(item.data.data.features.bonusnrg.value) || 0 nrg.max += Number(item.data.data.features.bonusnrg.value) || 0
await this.update({ 'data.nrg': nrg }) await this.update({ 'data.nrg': nrg })
} }
PegasusUtility.createChatWithRollMode(item.name, {
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-activated.html`, { name: this.name, perk: item })
})
this.enableWeaverPerk(item) this.enableWeaverPerk(item)
} }
if (updateOK) { if (updateOK) {
@ -1029,8 +1040,7 @@ export class PegasusActor extends Actor {
} }
let moralitythreshold = Number(PegasusUtility.getDiceValue(this.data.data.statistics.foc.value)) + Number(this.data.data.statistics.foc.mod) let moralitythreshold = - (Number(PegasusUtility.getDiceValue(this.data.data.statistics.foc.value)) + Number(this.data.data.statistics.foc.mod) )
moralitythreshold = (moralitythreshold < 1) ? 1 : moralitythreshold;
if (moralitythreshold != this.data.data.biodata.moralitythreshold) { if (moralitythreshold != this.data.data.biodata.moralitythreshold) {
updates['data.biodata.moralitythreshold'] = moralitythreshold updates['data.biodata.moralitythreshold'] = moralitythreshold
} }

View File

@ -1164,7 +1164,7 @@ ul, li {
box-shadow: inset 0px 1px 0px 0px #a6827e; box-shadow: inset 0px 1px 0px 0px #a6827e;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%); background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
background-color: #7d5d3b00; background-color: #7d5d3b00;
border-radius: 2px; border-radius: 4px;
border: 1px ridge #846109; border: 1px ridge #846109;
display: inline-block; display: inline-block;
cursor: pointer; cursor: pointer;
@ -1174,6 +1174,7 @@ ul, li {
text-decoration: none; text-decoration: none;
text-shadow: 0px 1px 0px #4d3534; text-shadow: 0px 1px 0px #4d3534;
position: relative; position: relative;
max-width:16px;
margin:0px; margin:0px;
} }

View File

@ -183,6 +183,6 @@
"templateVersion": 96, "templateVersion": 96,
"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.6.3", "version": "0.6.4",
"background" : "./images/ui/pegasus_welcome_page.webp" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

@ -384,6 +384,7 @@
<span class="small-label padd-right packed-left">&nbsp;Current</span><input type="text" <span class="small-label padd-right packed-left">&nbsp;Current</span><input type="text"
class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}" class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}"
data-dtype="Number" /> data-dtype="Number" />
<a class="current-nrg-minus plus-minus-button">&nbsp;-</a>/<a class="current-nrg-plus plus-minus-button">+</a>
<span class="small-label padd-right packed-left">&nbsp;Mod</span><input type="text" <span class="small-label padd-right packed-left">&nbsp;Mod</span><input type="text"
class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}" class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}"
data-dtype="Number" /> data-dtype="Number" />

View File

@ -30,8 +30,8 @@
{{#if stat}} {{#if stat}}
<li>Statistic : {{stat.label}}</li> <li>Statistic : {{stat.label}}</li>
{{/if}} {{/if}}
{{#if spec}} {{#if specName}}
<li>Specialisation : {{spec.name}}</li> <li>Specialisation : {{specName}}</li>
{{/if}} {{/if}}
{{#if weaponName}} {{#if weaponName}}

View File

@ -0,0 +1,7 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
<div>{{name}} has just activated the Perk: {{perk.name}}.</div>
</div>

View File

@ -3,5 +3,5 @@
{{#if img}} {{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" /> <img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}} {{/if}}
<div>{{name}} has Just Deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.</div> <div>{{name}} has just deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.</div>
</div> </div>