some re-org

This commit is contained in:
LeRatierBretonnien 2023-03-20 21:01:00 +01:00
parent 09974cd323
commit 2813e5a694
5 changed files with 164 additions and 73 deletions

View File

@ -51,6 +51,9 @@ export class WarheroActorSheet extends ActorSheet {
conditions: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getConditions()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
equippedWeapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getEquippedWeapons())),
equippedArmors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getEquippedArmors())),
equippedShields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getEquippedShields())),
powers: this.actor.sortPowers(),
subActors: duplicate(this.actor.getSubActors()),
competency: this.actor.getCompetency(),

View File

@ -123,6 +123,11 @@ export class WarheroActor extends Actor {
return comp;
}
/* -------------------------------------------- */
getEquippedArmors() {
let comp = duplicate(this.items.filter(item => item.type == 'armor' && item.system.slotlocation == 'armor') || []);
WarheroUtility.sortArrayObjectsByName(comp)
return comp;
}
getArmors() {
let comp = duplicate(this.items.filter(item => item.type == 'armor') || []);
WarheroUtility.sortArrayObjectsByName(comp)
@ -147,6 +152,11 @@ export class WarheroActor extends Actor {
return schools
}
/* -------------------------------------------- */
getEquippedShields() {
let comp = duplicate(this.items.filter(item => item.type == 'shield' && item.system.slotlocation == "shield") || []);
WarheroUtility.sortArrayObjectsByName(comp)
return comp;
}
getShields() {
let comp = duplicate(this.items.filter(item => item.type == 'shield') || []);
WarheroUtility.sortArrayObjectsByName(comp)
@ -282,6 +292,14 @@ export class WarheroActor extends Actor {
weapon.damageFormula = formula
}
/* -------------------------------------------- */
getEquippedWeapons() {
let comp = duplicate(this.items.filter(item => item.type == 'weapon' && (item.system.slotlocation == "weapon1" || item.system.slotlocation == "weapon2") ) || []);
for (let weapon of comp) {
this.prepareWeapon(weapon)
}
WarheroUtility.sortArrayObjectsByName(comp)
return comp;
}
getWeapons() {
let comp = duplicate(this.items.filter(item => item.type == 'weapon') || []);
for (let weapon of comp) {

View File

@ -107,7 +107,7 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.41",
"version": "10.0.43",
"compatibility": {
"minimum": "10",
"verified": "10",
@ -115,7 +115,7 @@
},
"title": "Warhero RPG",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.41.zip",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.43.zip",
"url": "https://www.uberwald.me/gitea/public/fvtt-warhero",
"background": "images/ui/warhero_welcome_page.webp",
"id": "fvtt-warhero"

View File

@ -62,8 +62,8 @@
"style": "edit",
"hasmax": true,
"isheader": true,
"max": 1,
"value": 1
"max": 30,
"value": 30
},
"knowledge": {
"label": "WH.ui.Knowledge",
@ -71,15 +71,16 @@
"style": "edit",
"hasmax": false,
"roll": true,
"max": 1,
"value": 1
"max": 0,
"value": 0
},
"def": {
"label": "WH.ui.Defence",
"abbrev": "def",
"style": "edit",
"max": 1,
"value": 1
"iscombat": true,
"max": 12,
"value": 12
},
"txcm": {
"label": "WH.ui.Throw2HitM",
@ -87,8 +88,9 @@
"istxc": true,
"style": "edit",
"roll": true,
"max": 1,
"value": 1
"iscombat": true,
"max": 0,
"value": 0
},
"txcr": {
"label": "WH.ui.Throw2HitR",
@ -96,8 +98,9 @@
"istxc": true,
"style": "edit",
"roll": true,
"max": 1,
"value": 1
"iscombat": true,
"max": 0,
"value": 0
},
"mana": {
"label": "WH.ui.Mana",
@ -105,37 +108,38 @@
"style": "edit",
"hasmax": true,
"isheader": true,
"max": 1,
"value": 1
"max": 3,
"value": 3
},
"ini": {
"label": "WH.ui.Initiative",
"abbrev": "ini",
"style": "edit",
"iscombat": true,
"roll": true,
"max": 1,
"value": 1
"max": 0,
"value": 0
},
"movearth": {
"label": "WH.ui.Movement",
"abbrev": "mov",
"style": "edit",
"max": 1,
"value": 1
"max": 6,
"value": 6
},
"movswim": {
"label": "WH.ui.MovementSwim",
"abbrev": "mov",
"style": "edit",
"max": 1,
"value": 1
"max": 0,
"value": 0
},
"movfly": {
"label": "WH.ui.MovementFly",
"abbrev": "mov",
"style": "edit",
"max": 1,
"value": 1
"max": 0,
"value": 0
}
},
"secondary": {
@ -149,6 +153,7 @@
"malusmultiweapon": {
"label": "WH.ui.malusmultiweapon",
"abbrev": "malusmultiweapon",
"iscombat": true,
"style": "edit",
"value": 0
},
@ -156,6 +161,7 @@
"label": "WH.ui.drbonus",
"abbrev": "drbonus",
"style": "edit",
"iscombat": true,
"value": 0
},
"drbonustotal": {
@ -163,12 +169,14 @@
"abbrev": "drbonustotal",
"disabled": true,
"style": "edit",
"iscombat": true,
"value": 0
},
"parrybonus": {
"label": "WH.ui.parrybonus",
"abbrev": "parrybonus",
"isparrybonus": true,
"iscombat": true,
"style": "edit",
"value": 0
},
@ -177,6 +185,7 @@
"abbrev": "parrybonustotal",
"disabled": true,
"style": "edit",
"iscombat": true,
"roll": true,
"value": 0
},

View File

@ -27,7 +27,8 @@
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{#each classes as |class idx|}}
{{#if (count classes)}}
{{#each classes as |class idx|}}
<li class="item flexrow list-item" data-item-id="{{class._id}}">
<label class="item-field-label-medium">{{localize "WH.ui.class"}}</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a>
@ -36,7 +37,17 @@
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
{{/each}}
{{else}}
<li class="item flexrow list-item" data-item-id="{{class._id}}">
<label class="item-field-label-medium">{{localize "WH.ui.class"}}</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{class.name}}" data-dtype="String" />
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/if}}
<li class="item flexrow list-item" >
<label class="item-field-label-medium">{{localize "WH.ui.religion"}}</label>
<input type="text" class="item-field-label-medium" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" />
@ -85,56 +96,13 @@
<div class="ability-item">
<ul>
{{#each system.attributes as |attr key|}}
{{#if (not attr.iscombat)}}
{{#if (not attr.isheader)}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=attr key=key path="attributes" fieldClass="item-field-label-vlong"}}
{{/if}}
{{/if}}
{{/each}}
</ul>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">{{localize "WH.ui.competency"}}</label></h3>
</span>
</li>
{{#each competency.weapons as |cdata key|}}
{{#if cdata}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<span class="item-name-label-long">{{localize "WH.ui.weapons"}} {{localize cdata.label}}</span>
</li>
{{/if}}
{{/each}}
{{#each competency.shields as |cdata key|}}
{{#if cdata}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<span class="item-name-label-long">{{localize "WH.ui.shields"}} {{localize cdata.label}}</span>
</li>
{{/if}}
{{/each}}
{{#each competency.armors as |cdata key|}}
{{#if cdata}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<span class="item-name-label-long">{{localize "WH.ui.armors"}} {{localize cdata.label}}</span>
</li>
{{/if}}
{{/each}}
{{#each compentencyItems as |comp key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{comp._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{comp.img}}" /></a>
<span class="item-name-label-long">{{comp.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
@ -151,7 +119,9 @@
{{#each system.secondary as |second key|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=second key=key path="secondary" fieldClass="item-field-label-vlong"}}
{{#if (not second.iscombat)}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=second key=key path="secondary" fieldClass="item-field-label-vlong"}}
{{/if}}
{{/each}}
</ul>
@ -186,8 +156,28 @@
{{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat">
<div class="flexcol">
<div class="grid grid2col">
<ul class="stat-list alternate-list">
{{#with system.attributes.def as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="def" path="attributes" fieldClass="item-field-label-vlong"}}
{{/with}}
{{#with system.attributes.ini as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="ini" path="attributes" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul>
<ul class="stat-list alternate-list">
{{#with system.attributes.txcm as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="txcm" path="attributes" fieldClass="item-field-label-vlong"}}
{{/with}}
{{#with system.attributes.txcr as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="txch" path="attributes" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
@ -201,7 +191,7 @@
<label class="short-label">{{localize "WH.ui.Damage"}}</label>
</span>
</li>
{{#each weapons as |weapon key|}}
{{#each equippedWeapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
@ -228,6 +218,19 @@
</ul>
</div>
<div class="grid grid2col">
<ul class="stat-list alternate-list">
{{#with system.secondary.parrybonus as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="parrybonus" path="secondary" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul>
<ul class="stat-list alternate-list">
{{#with system.secondary.parrybonustotal as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="parrybonustotal" path="secondary" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
@ -241,7 +244,7 @@
<label class="short-label">{{localize "WH.ui.parrybonus"}}</label>
</span>
</li>
{{#each shields as |shield key|}}
{{#each equippedShields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{shield.img}}" /></a>
@ -259,6 +262,19 @@
{{/each}}
</ul>
</div>
<div class="grid grid2col">
<ul class="stat-list alternate-list">
{{#with system.secondary.drbonus as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="drbonus" path="secondary" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul>
<ul class="stat-list alternate-list">
{{#with system.secondary.drbonustotal as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="drbonustotal" path="secondary" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
@ -273,7 +289,7 @@
<label class="short-label">{{localize "WH.ui.damagereduction"}}</label>
</span>
</li>
{{#each armors as |armor key|}}
{{#each equippedArmors as |armor key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{armor._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{armor.img}}" /></a>
@ -292,6 +308,51 @@
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">{{localize "WH.ui.competency"}}</label></h3>
</span>
</li>
{{#each competency.weapons as |cdata key|}}
{{#if cdata}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<span class="item-name-label-long">{{localize "WH.ui.weapons"}} {{localize cdata.label}}</span>
</li>
{{/if}}
{{/each}}
{{#each competency.shields as |cdata key|}}
{{#if cdata}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<span class="item-name-label-long">{{localize "WH.ui.shields"}} {{localize cdata.label}}</span>
</li>
{{/if}}
{{/each}}
{{#each competency.armors as |cdata key|}}
{{#if cdata}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{language._id}}">
<span class="item-name-label-long">{{localize "WH.ui.armors"}} {{localize cdata.label}}</span>
</li>
{{/if}}
{{/each}}
{{#each compentencyItems as |comp key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{comp._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{comp.img}}" /></a>
<span class="item-name-label-long">{{comp.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>