Fix #81
This commit is contained in:
parent
5fb0221007
commit
00761d57d3
@ -1344,6 +1344,7 @@ export class PegasusActor extends Actor {
|
|||||||
this.getTraumaState()
|
this.getTraumaState()
|
||||||
this.cleanupPerksIfTrauma()
|
this.cleanupPerksIfTrauma()
|
||||||
this.parseStatEffects()
|
this.parseStatEffects()
|
||||||
|
this.parseStatusEffects()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1365,6 +1366,37 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
parseStatusEffects() {
|
||||||
|
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && (Number(effect.system.effectlevel) > 0) )
|
||||||
|
for (let statusKey in this.system.secondary) {
|
||||||
|
let status = duplicate(this.system.secondary[statusKey])
|
||||||
|
let bonus = 0
|
||||||
|
for (let effect of effects) {
|
||||||
|
if ( effect.system.affectedstatus && effect.system.affectedstatus == statusKey) {
|
||||||
|
bonus += Number(effect.system.effectlevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( bonus != status.bonus) {
|
||||||
|
status.bonus = bonus
|
||||||
|
this.update( { [`system.secondary.${statusKey}`]: status} )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let nrg = duplicate(this.system.nrg)
|
||||||
|
let bonus = 0
|
||||||
|
for (let effect of effects) {
|
||||||
|
if ( effect.system.affectedstatus && effect.system.affectedstatus == "nrg") {
|
||||||
|
bonus += Number(effect.system.effectlevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( bonus != nrg.mod) {
|
||||||
|
nrg.mod = bonus
|
||||||
|
this.update( { [`system.nrg`]: nrg} )
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async modStat(key, inc = 1) {
|
async modStat(key, inc = 1) {
|
||||||
let stat = duplicate(this.system.statistics[key])
|
let stat = duplicate(this.system.statistics[key])
|
||||||
|
@ -253,7 +253,7 @@
|
|||||||
],
|
],
|
||||||
"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": "10.0.26",
|
"version": "10.0.28",
|
||||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.26.zip",
|
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.28.zip",
|
||||||
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
||||||
}
|
}
|
@ -413,6 +413,9 @@
|
|||||||
"physicalimmunity": false,
|
"physicalimmunity": false,
|
||||||
"nobonusdice": false,
|
"nobonusdice": false,
|
||||||
"noperksallowed": false,
|
"noperksallowed": false,
|
||||||
|
"affectstatus": false,
|
||||||
|
"affectedstatus": "",
|
||||||
|
"locked": false,
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"race": {
|
"race": {
|
||||||
|
@ -302,18 +302,30 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{#each effects as |effect key|}}
|
{{#each effects as |effect key|}}
|
||||||
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}"
|
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}">
|
||||||
data-item-id="{{effect._id}}">
|
{{#if effect.system.locked}}
|
||||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
{{#if @root.isGM}}
|
||||||
src="{{effect.img}}" /></a>
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{effect.img}}" /></a>
|
||||||
|
{{else}}
|
||||||
|
<img class="sheet-competence-img" src="{{effect.img}}" />
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{effect.img}}" /></a>
|
||||||
|
{{/if}}
|
||||||
<span class="item-name-label-long2">{{effect.name}}</span>
|
<span class="item-name-label-long2">{{effect.name}}</span>
|
||||||
<span class="item-field-label-short">{{effect.system.effectlevel}}</span>
|
<span class="item-field-label-short">{{effect.system.effectlevel}}</span>
|
||||||
<span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
|
<span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
|
||||||
<span class="item-field-label-short">{{upperFirst effect.datsystema.genre}}</span>
|
<span class="item-field-label-short">{{upperFirst effect.system.genre}}</span>
|
||||||
<span class="item-field-label-short">{{upper effect.system.stataffected}}</span>
|
<span class="item-field-label-short">{{upper effect.system.stataffected}}</span>
|
||||||
<div class="item-filler"> </div>
|
<div class="item-filler"> </div>
|
||||||
<div class="item-controls item-controls-fixed">
|
<div class="item-controls item-controls-fixed">
|
||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
{{#if effect.system.locked}}
|
||||||
|
{{#if @root.isGM}}
|
||||||
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
@ -61,11 +61,13 @@
|
|||||||
<li class="flexrow"><label class="generic-label">No perks allowed ?</label>
|
<li class="flexrow"><label class="generic-label">No perks allowed ?</label>
|
||||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.noperksallowed" {{checked data.noperksallowed}}/></label>
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.noperksallowed" {{checked data.noperksallowed}}/></label>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="flexrow"><label class="generic-label">Locked (Only GM can change/edit) ?</label>
|
||||||
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.locked" {{checked data.locked}}/></label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="generic-label">Effect Level is a Stat?</label>
|
<li class="flexrow"><label class="generic-label">Effect Level is a Stat?</label>
|
||||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.effectstatlevel" {{checked data.effectstatlevel}}/></label>
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.effectstatlevel" {{checked data.effectstatlevel}}/></label>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{#if data.effectstatlevel}}
|
{{#if data.effectstatlevel}}
|
||||||
<li class="flexrow"><label class="generic-label">Stat to use for Effect Level</label>
|
<li class="flexrow"><label class="generic-label">Stat to use for Effect Level</label>
|
||||||
<select class="competence-base flexrow" type="text" name="system.effectstat" value="{{data.effectstat}}" data-dtype="String">
|
<select class="competence-base flexrow" type="text" name="system.effectstat" value="{{data.effectstat}}" data-dtype="String">
|
||||||
@ -83,6 +85,23 @@
|
|||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
<li class="flexrow"><label class="generic-label">Affect Status?</label>
|
||||||
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label>
|
||||||
|
</li>
|
||||||
|
{{#if data.affectstatus}}
|
||||||
|
<li class="flexrow"><label class="generic-label">Affected status</label>
|
||||||
|
<select class="competence-base flexrow" type="text" name="system.affectedstatus" value="{{data.affectedstatus}}" data-dtype="String">
|
||||||
|
{{#select data.affectedstatus}}
|
||||||
|
<option value="health">Health</option>
|
||||||
|
<option value="delirium">Delirium</option>
|
||||||
|
<option value="socialhealth">Social Health</option>
|
||||||
|
<option value="stealthhealth">Stealth Health</option>
|
||||||
|
<option value="nrg">NRG</option>
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
|
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
|
||||||
<li class="flexrow">
|
<li class="flexrow">
|
||||||
<ul class="ul-level1">
|
<ul class="ul-level1">
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number" disabled/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
|
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number" disabled/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||||
<span class="small-label status-small-label"> / {{data.nrg.absolutemax}}</span>
|
<span class="small-label status-small-label"> / {{data.nrg.absolutemax}}</span>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user