diff --git a/modules/warhero-actor-sheet.js b/modules/warhero-actor-sheet.js index b9e4850..9d0b7ca 100644 --- a/modules/warhero-actor-sheet.js +++ b/modules/warhero-actor-sheet.js @@ -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(), diff --git a/modules/warhero-actor.js b/modules/warhero-actor.js index 6e7ed5a..c27d983 100644 --- a/modules/warhero-actor.js +++ b/modules/warhero-actor.js @@ -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) { diff --git a/system.json b/system.json index ca6d263..d5c3dae 100644 --- a/system.json +++ b/system.json @@ -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" diff --git a/template.json b/template.json index 13e6452..73de2bb 100644 --- a/template.json +++ b/template.json @@ -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 }, diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index bcb666d..bba5539 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -27,7 +27,8 @@ - {{#each classes as |class idx|}} + {{#if (count classes)}} + {{#each classes as |class idx|}}