diff --git a/css/deltagreen.css b/css/deltagreen.css index 9aed516..09cf6e2 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -1133,3 +1133,16 @@ input.item-sheet-short-input { min-height: 300px; resize: none; } + +.weapon-name-flexcontainer { + display: flex; + justify-content: flex-start; + flex-direction: row; + column-gap: 10px; +} + +.weapon-name-flexitem { + flex: content; + align-self: flex-start; + text-align: left; +} diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 96c14a2..c8a0800 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -15,7 +15,7 @@ export default class DeltaGreenActorSheet extends ActorSheet { return foundry.utils.mergeObject(super.defaultOptions, { classes: ["deltagreen", "sheet", "actor"], template: "systems/deltagreen/templates/actor/actor-sheet.html", - width: 700, + width: 750, height: 770, tabs: [ { @@ -61,9 +61,7 @@ export default class DeltaGreenActorSheet extends ActorSheet { const data = super.getData(); // Prepare items. - if (this.actor.type === "agent") { - this._prepareCharacterItems(data); - } + this._prepareCharacterItems(data); // Make it easy for the sheet handlebars to understand how to sort the skills. data.sortSkillsSetting = game.settings.get("deltagreen", "sortSkills"); @@ -146,6 +144,7 @@ export default class DeltaGreenActorSheet extends ActorSheet { // Initialize containers. const armor = []; const weapons = []; + const gear = []; // Iterate through items, allocating to containers // let totalWeight = 0; @@ -157,12 +156,69 @@ export default class DeltaGreenActorSheet extends ActorSheet { // Append to weapons. else if (i.type === "weapon") { weapons.push(i); + } else if (i.type === "gear") { + gear.push(i); } } + if (actorData.system.settings.sorting.armorSortAlphabetical) { + armor.sort(function (a, b) { + let x = a.name.toLowerCase(); + let y = b.name.toLowerCase(); + if (x < y) { + return -1; + } + if (x > y) { + return 1; + } + return 0; + }); + } else { + armor.sort(function (a, b) { + return a.sort - b.sort; + }); + } + + if (actorData.system.settings.sorting.weaponSortAlphabetical) { + weapons.sort(function (a, b) { + let x = a.name.toLowerCase(); + let y = b.name.toLowerCase(); + if (x < y) { + return -1; + } + if (x > y) { + return 1; + } + return 0; + }); + } else { + weapons.sort(function (a, b) { + return a.sort - b.sort; + }); + } + + if (actorData.system.settings.sorting.gearSortAlphabetical) { + gear.sort(function (a, b) { + let x = a.name.toLowerCase(); + let y = b.name.toLowerCase(); + if (x < y) { + return -1; + } + if (x > y) { + return 1; + } + return 0; + }); + } else { + gear.sort(function (a, b) { + return a.sort - b.sort; + }); + } + // Assign and return actorData.armor = armor; actorData.weapons = weapons; + actorData.gear = gear; } // Can add extra buttons to form header here if necessary @@ -488,6 +544,30 @@ export default class DeltaGreenActorSheet extends ActorSheet { html.find(".clear-all-bond-damage-checks").click((ev) => { this._updateBondsRemoveAllDamagedCheckmarks(); }); + + // item sorting toggles + html.find(".toggle-item-sorting-style").click((event) => { + event.preventDefault(); + + const itemType = event.currentTarget.getAttribute("data-gear-type"); + + if (itemType === "weapon") { + this.actor.update({ + "system.settings.sorting.weaponSortAlphabetical": + !this.actor.system.settings.sorting.weaponSortAlphabetical, + }); + } else if (itemType === "armor") { + this.actor.update({ + "system.settings.sorting.armorSortAlphabetical": + !this.actor.system.settings.sorting.armorSortAlphabetical, + }); + } else if (itemType === "gear") { + this.actor.update({ + "system.settings.sorting.gearSortAlphabetical": + !this.actor.system.settings.sorting.gearSortAlphabetical, + }); + } + }); } // trigger an update on all bonds that have had their damaged flag checked off diff --git a/module/deltagreen.js b/module/deltagreen.js index 175bc10..6bdf9d7 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -13,6 +13,7 @@ import { rollItemMacro, rollItemSkillCheckMacro, rollSkillMacro, + rollSkillTestAndDamageForOwnedItem, } from "./other/macro-functions.js"; Hooks.once("init", async () => { @@ -23,6 +24,7 @@ Hooks.once("init", async () => { rollItemSkillCheckMacro, rollSkillMacro, ParseDeltaGreenStatBlock, + rollSkillTestAndDamageForOwnedItem, }; /** @@ -61,9 +63,16 @@ Hooks.once("init", async () => { Hooks.once("ready", async () => { // Wait to register hotbar drop hook on ready so that modules could register earlier if they want to - Hooks.on("hotbarDrop", (bar, data, slot) => - createDeltaGreenMacro(data, slot), - ); + Hooks.on("hotbarDrop", (bar, data, slot) => { + // note - if we don't limit this logic to just items, we'll break re-ording macros on the bar + if (data.type === "Item") { + // this is async!! + createDeltaGreenMacro(data, slot); + // this must return false here! This stops the default logic on item drop from occuring, + // which is a macro to open an item sheet + return false; + } + }); }); Hooks.on("preCreateItem", (item) => { @@ -80,18 +89,17 @@ Hooks.on("preCreateItem", (item) => { } }); -Hooks.on("renderSidebarTab", async (app, html) => { - if (app.options.id === "actors") { - const button = $( - "", - ); +// Hook into the render call for the Actors Directory to add an extra button +Hooks.on("renderActorDirectory", (app, html) => { + let importButton = $( + '', + ); + html.find(".directory-footer").append(importButton); - button.click(() => { - ParseDeltaGreenStatBlock(); - }); - - html.find(".directory-footer").append(button); - } + // Handle button clicks + importButton.click((ev) => { + ParseDeltaGreenStatBlock(); + }); }); /** diff --git a/module/item/item.js b/module/item/item.js index e0479da..ef40f62 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -22,7 +22,7 @@ export default class DeltaGreenItem extends Item { * @param {Event} event The originating click event * @private */ - async roll() { + async roll(isCrit = false) { // Basic template rendering data const item = this; const { actor } = this; @@ -44,6 +44,10 @@ export default class DeltaGreenItem extends Item { diceFormula += actorSystemData.statistics.str.meleeDamageBonusFormula; } + if (isCrit) { + diceFormula = "2*(" + diceFormula + ")"; + } + roll = new DGDamageRoll( diceFormula, {}, diff --git a/module/other/macro-functions.js b/module/other/macro-functions.js index 0f0f8bd..4b55d29 100644 --- a/module/other/macro-functions.js +++ b/module/other/macro-functions.js @@ -12,29 +12,45 @@ import * as DGRolls from "../roll/roll.js"; * @returns {Promise} */ export async function createDeltaGreenMacro(data, slot) { - // Definitely should not be doing assignments in conditionals but if we fix this, it breaks macro creation. - // eslint-disable-next-line no-cond-assign - if ((data.type = "Item" && data.itemData.type !== "weapon")) return; - // if (!("data" in data)) return ui.notifications.warn("You can only create macro buttons for owned Items"); - const item = data.itemData; + if (data.type !== "Item") { + return; + } - // Create the macro command - let command = "// Uncomment line below to also roll skill check if desired."; - command += `\n//game.deltagreen.rollItemSkillCheckMacro("${item._id}");`; - command += `\ngame.deltagreen.rollItemMacro("${item._id}");`; + if (!data.uuid.includes("Actor.") && !data.uuid.includes("Token.")) { + ui.notifications.warn("You can only create macro buttons for owned Items"); + return; + } - // let macro = game.macros.entities.find(m => (m.name === data.name) && (m.command === command)); - // if (!macro) { + const item = await fromUuid(data.uuid); + + if (item === null || typeof item === "undefined") { + ui.notifications.warn("Bad item passed to macro hotbar."); + return; + } + + let command = ""; + if (item.type !== "weapon") { + // this should just open the item sheet for this item + command = `(await fromUuid("${data.uuid}")).sheet.render(true)`; + } else { + command = + "// If a damage roll on a successful attack should not be automatically rolled, change the last argument from 'true' to 'false':"; + command += `\ngame.deltagreen.rollSkillTestAndDamageForOwnedItem("${data.uuid}", true);`; + } + + // Create the weapon macro command const macro = await Macro.create({ - name: data.itemData.name, + name: item.name, type: "script", - img: data.itemData.img, - command, + img: item.img, + thumbnail: item.img, + command: command, flags: { "deltagreen.itemMacro": true }, }); - // } - game.user.assignHotbarMacro(macro, slot); + await game.user.assignHotbarMacro(macro, slot); + + return; } /** @@ -122,3 +138,52 @@ export function rollSkillMacro(skillName) { return actor.sheet.processRoll({}, roll); // sendPercentileTestToChat(actor, translatedSkillLabel, skill.proficiency); } + +/** + * Roll a skill check for an item that is owned by a specific actor. + * @param {*} itemId + * @param {*} actorId + * @returns {null|Boolean} + */ +export async function rollSkillTestAndDamageForOwnedItem( + itemUuId, + rollDamageOnSuccess, +) { + let item; + + try { + item = await fromUuid(itemUuId); + + if (item == null) { + return ui.notifications.warn("Invalid item targeted in macro."); + } + + if (item.type !== "weapon") { + return ui.notifications.warn( + "Can only roll weapons/attacks as item macros.", + ); + } + } catch { + return ui.notifications.warn("Invalid item targeted in macro."); + } + + const rollOptions = { + rollType: "weapon", + key: item.system.skill, + actor: item.parent, + specialTrainingName: null, // Only applies to Special Training Rolls + item, + }; + + const roll = new DGRolls.DGPercentileRoll("1D100", {}, rollOptions); + + await roll.evaluate(); + + roll.toChat(); + + if (roll.isSuccess && rollDamageOnSuccess) { + item.roll(roll.isCritical); + } + + return roll.isSuccess; +} diff --git a/module/roll/roll.js b/module/roll/roll.js index 5010322..7fd7163 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -132,11 +132,21 @@ export class DGPercentileRoll extends DGRoll { hideSanTarget = true; } + let customModifierTarget = 20; + + if (this.actor != null) { + try { + customModifierTarget = parseInt( + this.actor.system.settings.rolling.defaultPercentileModifier, + ); + } catch {} + } + const backingData = { data: { label: this.localizedKey, originalTarget: this.target, - targetModifier: 20, + targetModifier: customModifierTarget, hideTarget: hideSanTarget, }, }; @@ -172,6 +182,14 @@ export class DGPercentileRoll extends DGRoll { if (plusMinus === "-") { targetModifier *= -1; } + + // update the custom target modifier so it 'persists' between dialogs + if (this.actor != null) { + this.actor.update({ + "system.settings.rolling.defaultPercentileModifier": + targetModifier, + }); + } } resolve({ targetModifier, rollMode }); } catch (ex) { diff --git a/module/templates.js b/module/templates.js index feb7415..980e6ab 100644 --- a/module/templates.js +++ b/module/templates.js @@ -9,10 +9,12 @@ export default async function preloadHandlebarsTemplates() { "systems/deltagreen/templates/actor/limited-sheet.html", "systems/deltagreen/templates/actor/unnatural-sheet.html", "systems/deltagreen/templates/actor/npc-sheet.html", - "systems/deltagreen/templates/actor/cv-partial.html", - "systems/deltagreen/templates/actor/custom-skills-partial.html", "systems/deltagreen/templates/dialog/modify-percentile-roll.html", "systems/deltagreen/templates/actor/vehicle-sheet.html", - "systems/deltagreen/templates/actor/help-and-licensing-partial.html", + "systems/deltagreen/templates/actor/partials/custom-skills-partial.html", + "systems/deltagreen/templates/actor/partials/cv-partial.html", + "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html", + "systems/deltagreen/templates/actor/partials/equipment-partial.html", + "systems/deltagreen/templates/actor/partials/attributes-grid-partial.html", ]); } diff --git a/template.json b/template.json index 611042d..1700db6 100644 --- a/template.json +++ b/template.json @@ -40,6 +40,18 @@ } } }, + "sheet-settings": { + "settings": { + "sorting": { + "weaponSortAlphabetical": false, + "armorSortAlphabetical": false, + "gearSortAlphabetical": false + }, + "rolling": { + "defaultPercentileModifier": 20 + } + } + }, "human_skills": { "skills": { "accounting": { @@ -429,7 +441,7 @@ } }, "unnatural": { - "templates": ["base", "unnatural_skills"], + "templates": ["base", "unnatural_skills", "sheet-settings"], "sanity": { "notes": "", "failedLoss": "1D4", @@ -441,7 +453,7 @@ "showUntrainedSkills": true }, "npc": { - "templates": ["base", "human_skills"], + "templates": ["base", "human_skills", "sheet-settings"], "schemaVersion": 1.0, "sanity": { "value": 100, @@ -452,6 +464,7 @@ "showUntrainedSkills": true }, "vehicle": { + "templates": ["sheet-settings"], "name": "", "description": "", "shortDescription": "", @@ -465,7 +478,7 @@ "passengers": [] }, "agent": { - "templates": ["base", "human_skills"], + "templates": ["base", "human_skills", "sheet-settings"], "schemaVersion": 1.0, "sanity": { "value": 100, diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index c482281..528775b 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -104,15 +104,18 @@ {{#unless skill.proficiency}}title="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"{{/unless}} > {{localizeWithFallback (concat "DG.Skills." key) skill.label }} + {{#if_eq key 'ritual' }} + {{#if (keepSanityPrivate)}} {{/if}} + {{#unless (keepSanityPrivate)}} {{/if_not_eq}} + {{/each}} {{!-- Custom Skills and Special Training --}}
- {{> "systems/deltagreen/templates/actor/custom-skills-partial.html" actorType="agent"}} + {{> "systems/deltagreen/templates/actor/partials/custom-skills-partial.html" actorType="agent"}}
{{!-- Physical Statistics like STR, CON, etc. --}}
+
{{localize "DG.Sheet.BlockHeaders.Attributes"}}
-
- {{#each actor.system.statistics as |statistic key|}} -
-
-
- - - ({{numberFormat statistic.x5 decimals=0 sign=false}}%) -
-
- -
-
-
- {{/each}} -
+ {{> "systems/deltagreen/templates/actor/partials/attributes-grid-partial.html" actorType="agent"}} +
{{localize "DG.Sheet.BlockHeaders.Injuries"}} @@ -283,167 +275,7 @@ {{!-- GEAR Tab --}}
-
- -
- {{localize 'DG.Gear.Weapons'}} -
- -
    - -
  1. -
    - {{localize 'DG.Gear.Name'}} - {{localize 'DG.Gear.DamageOrLethality'}} - {{localize 'DG.Gear.ArmorPiercing'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'weapon'}} - -
  3. -
    - -

    - {{item.name}} -

    -
    - - - {{#unless item.system.isLethal}} - - {{toUpperCase item.system.damage}}{{#if_eq item.system.skill 'unarmed_combat'}}{{actor.system.statistics.str.meleeDamageBonusFormula}}{{/if_eq}}{{#if_eq item.system.skill 'melee_weapons'}}{{actor.system.statistics.str.meleeDamageBonusFormula}}{{/if_eq}} - - {{/unless}} - - {{#if item.system.isLethal}} - - {{item.system.lethality}}% - {{/if}} - - {{#if item.system.lethality}} - - - {{#if item.system.isLethal}} - - {{else}} - - {{/if}} - {{/if}} - - - {{item.system.armorPiercing}} - -
    - - -
    - -
  4. - - {{/if_eq}} - {{/each}} -
-
-
- -
- {{localize 'DG.Gear.Armor'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    - {{localize 'DG.Gear.ArmorRating'}} - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'armor'}} - -
  3. -
    -

    {{item.name}}

    - {{item.system.protection}} - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
-
- -
- {{localize 'DG.Gear.OtherGear'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    - - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - - {{#if_eq item.type 'gear'}} - -
  3. -
    -

    {{item.name}}

    - - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
+ {{> "systems/deltagreen/templates/actor/partials/equipment-partial.html" }}
{{!-- PERSONAL (Biography) Tab --}} @@ -451,7 +283,7 @@
{{localize "DG.Sheet.BlockHeaders.PersonalInfoCV"}}
- {{> "systems/deltagreen/templates/actor/cv-partial.html" }} + {{> "systems/deltagreen/templates/actor/partials/cv-partial.html" }}
{{!-- Bonds Tab --}} @@ -505,7 +337,7 @@ {{!-- About Tab --}}
- {{> "systems/deltagreen/templates/actor/help-and-licensing-partial.html" }} + {{> "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html" }}
diff --git a/templates/actor/limited-sheet.html b/templates/actor/limited-sheet.html index 864c759..fc36c39 100644 --- a/templates/actor/limited-sheet.html +++ b/templates/actor/limited-sheet.html @@ -28,7 +28,7 @@
{{!-- Biography Tab --}}
- {{> "systems/deltagreen/templates/actor/cv-partial.html" }} + {{> "systems/deltagreen/templates/actor/partials/cv-partial.html" }}
diff --git a/templates/actor/npc-sheet.html b/templates/actor/npc-sheet.html index f0d1bd1..e9a84f8 100644 --- a/templates/actor/npc-sheet.html +++ b/templates/actor/npc-sheet.html @@ -49,7 +49,7 @@
+ >{{localize 'DG.Attributes.SAN' }}
{{localize 'DG.NPCSheet.BreakPointAbbreviation'}}: @@ -63,20 +63,9 @@
{{localize "DG.Sheet.BlockHeaders.Statistics"}}
-
- {{#each actor.system.statistics as |statistic key|}} -
-
-
- - - ({{numberFormat statistic.x5 decimals=0 sign=false}}%) -
- {{!--
--}} -
-
- {{/each}} -
+ + {{> "systems/deltagreen/templates/actor/partials/attributes-grid-partial.html" actorType="npc"}} +
@@ -118,6 +107,7 @@ {{#unless skill.proficiency}}title="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"{{/unless}} > {{localizeWithFallback (concat "DG.Skills." key) skill.label }} + @@ -128,7 +118,7 @@

- {{> "systems/deltagreen/templates/actor/custom-skills-partial.html"}} + {{> "systems/deltagreen/templates/actor/partials/custom-skills-partial.html"}}

@@ -144,174 +134,12 @@ {{!-- GEAR --}}
-
- -
- {{localize 'DG.Gear.Weapons'}} -
- -
    - -
  1. -
    - {{localize 'DG.Gear.Name'}} - {{localize 'DG.Gear.DamageOrLethality'}} - {{localize 'DG.Gear.ArmorPiercing'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'weapon'}} - -
  3. -
    - -

    - {{item.name}} -

    - - - {{#unless item.system.isLethal}} - - {{toUpperCase item.system.damage}} - - {{/unless}} - - {{#if item.system.isLethal}} - {{formatLethality item.system.lethality}} - {{/if}} - - {{#if item.system.lethality}} - - - {{#if item.system.isLethal}} - - {{else}} - - {{/if}} - {{/if}} - - - - {{item.system.armorPiercing}} - -
    - - -
    - -
  4. - - {{/if_eq}} - {{/each}} -
-
-
- -
- {{localize 'DG.Gear.Armor'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    - {{localize 'DG.Gear.ArmorRating'}} - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'armor'}} - -
  3. -
    -

    {{item.name}}

    - {{item.system.protection}} - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
-
- -
- {{localize 'DG.Gear.OtherGear'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    -
    - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'gear'}} - -
  3. -
    - -

    {{item.name}}

    - - - - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
+ {{> "systems/deltagreen/templates/actor/partials/equipment-partial.html" }}
{{!-- About Tab --}}
- {{> "systems/deltagreen/templates/actor/help-and-licensing-partial.html" }} + {{> "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html" }}
diff --git a/templates/actor/partials/attributes-grid-partial.html b/templates/actor/partials/attributes-grid-partial.html new file mode 100644 index 0000000..f048a12 --- /dev/null +++ b/templates/actor/partials/attributes-grid-partial.html @@ -0,0 +1,16 @@ +
+ {{#each actor.system.statistics as |statistic key|}} +
+
+
+ + + ({{numberFormat statistic.x5 decimals=0 sign=false}}% ) +
+
+ +
+
+
+ {{/each}} +
\ No newline at end of file diff --git a/templates/actor/custom-skills-partial.html b/templates/actor/partials/custom-skills-partial.html similarity index 97% rename from templates/actor/custom-skills-partial.html rename to templates/actor/partials/custom-skills-partial.html index f51eb43..10fbb52 100644 --- a/templates/actor/custom-skills-partial.html +++ b/templates/actor/partials/custom-skills-partial.html @@ -6,6 +6,7 @@ {{/if_eq}}
+ {{#each actor.system.typedSkills as |skill key|}}
@@ -14,6 +15,7 @@ {{#unless skill.proficiency}}title="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"{{/unless}} > {{skill.group}} ({{skill.label}}) + {{#if_eq ../actorType "agent"}} @@ -26,10 +28,12 @@
{{/each}} + {{#each specialTraining as |training|}}
@@ -37,4 +41,5 @@
{{/each}} +
\ No newline at end of file diff --git a/templates/actor/cv-partial.html b/templates/actor/partials/cv-partial.html similarity index 100% rename from templates/actor/cv-partial.html rename to templates/actor/partials/cv-partial.html diff --git a/templates/actor/partials/equipment-partial.html b/templates/actor/partials/equipment-partial.html new file mode 100644 index 0000000..cc09a90 --- /dev/null +++ b/templates/actor/partials/equipment-partial.html @@ -0,0 +1,214 @@ +{{!-- EQUIPMENT/ATTACKS/ABILITES SECTION USED ON ALL ACTOR SHEETS --}} +{{!-- WEAPONS/ATTACKS --}} +
+ +
+ {{localize 'DG.Gear.Weapons'}} +
+ +
    + +
  1. +
    + {{#if actor.system.settings.sorting.weaponSortAlphabetical}} + + {{else}} + + {{/if}} +
    + + + {{localize 'DG.Gear.Name'}} + + + {{localize 'DG.Gear.DamageOrLethality'}} + {{localize 'DG.Gear.ArmorPiercing'}} + +
  2. + + {{#each actor.weapons as |item id|}} + +
  3. + +
    + + + + + +

    + {{item.name}} +

    + + + + + +
    + +
    + + + + {{#if item.system.lethality}} + {{#if item.system.isLethal}} + + {{else}} + + {{/if}} + {{/if}} + + {{#unless item.system.isLethal}} + + {{toUpperCase item.system.damage}}{{#if_eq item.system.skill 'unarmed_combat'}}{{actor.system.statistics.str.meleeDamageBonusFormula}}{{/if_eq}}{{#if_eq item.system.skill 'melee_weapons'}}{{actor.system.statistics.str.meleeDamageBonusFormula}}{{/if_eq}} + + + {{/unless}} + + {{#if item.system.isLethal}} + + {{item.system.lethality}}% + + + {{/if}} + + + + {{item.system.armorPiercing}} + +
    + + +
    + +
  4. + + {{/each}} + +
+ +
+ +{{!-- ARMOR/DEFENSE --}} +
+ +
+ {{localize 'DG.Gear.Armor'}} +
+ +
    + +
  1. + +
    + {{#if actor.system.settings.sorting.armorSortAlphabetical}} + + {{else}} + + {{/if}} +
    +
    {{localize 'DG.Gear.Name'}}
    + {{localize 'DG.Gear.ArmorRating'}} + {{localize 'DG.Gear.Equipped'}} + + +
  2. + + {{#each actor.armor as |item id|}} + +
  3. + +
    + +

    {{item.name}}

    + + {{item.system.protection}} + + + {{#if item.system.equipped}} + + {{else}} + + {{/if}} + + +
    + + +
    + +
  4. + + {{/each}} + +
+
+ +{{!-- OTHER GEAR/MISC --}} + +
+ +
+ {{localize 'DG.Gear.OtherGear'}} +
+ +
    + +
  1. + +
    + {{#if actor.system.settings.sorting.gearSortAlphabetical}} + + {{else}} + + {{/if}} +
    + +
    {{localize 'DG.Gear.Name'}}
    + + {{localize 'DG.Gear.Equipped'}} + + + +
  2. + + {{#each actor.gear as |item id|}} + +
  3. + +
    + +

    {{item.name}}

    + + + + {{#if item.system.equipped}} + + {{else}} + + {{/if}} + + + +
    + + +
    + +
  4. + + {{/each}} + +
+ +
\ No newline at end of file diff --git a/templates/actor/help-and-licensing-partial.html b/templates/actor/partials/help-and-licensing-partial.html similarity index 100% rename from templates/actor/help-and-licensing-partial.html rename to templates/actor/partials/help-and-licensing-partial.html diff --git a/templates/actor/unnatural-sheet.html b/templates/actor/unnatural-sheet.html index b218063..f5d54cf 100644 --- a/templates/actor/unnatural-sheet.html +++ b/templates/actor/unnatural-sheet.html @@ -57,19 +57,9 @@
{{localize "DG.Sheet.BlockHeaders.Statistics"}}
-
- {{#each actor.system.statistics as |statistic key|}} -
-
-
- - - ({{numberFormat statistic.x5 decimals=0 sign=false}}%) -
-
-
- {{/each}} -
+ + {{> "systems/deltagreen/templates/actor/partials/attributes-grid-partial.html" actorType="unnatural"}} + @@ -111,6 +101,7 @@ {{#unless skill.proficiency}}title="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"{{/unless}} > {{localizeWithFallback (concat "DG.Skills." key) skill.label }} + @@ -121,7 +112,7 @@
- {{> "systems/deltagreen/templates/actor/custom-skills-partial.html"}} + {{> "systems/deltagreen/templates/actor/partials/custom-skills-partial.html"}}

@@ -137,173 +128,12 @@ {{!-- GEAR --}}
-
- -
- {{localize 'DG.Gear.Weapons'}} -
- -
    - -
  1. -
    - {{localize 'DG.Gear.Name'}} - {{localize 'DG.Gear.DamageOrLethality'}} - {{localize 'DG.Gear.ArmorPiercing'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'weapon'}} - -
  3. -
    - -

    - {{item.name}} -

    - - - {{#unless item.system.isLethal}} - - {{toUpperCase item.system.damage}} - - {{/unless}} - - {{#if item.system.isLethal}} - {{formatLethality item.system.lethality}} - {{/if}} - - {{#if item.system.lethality}} - - - {{#if item.system.isLethal}} - - {{else}} - - {{/if}} - {{/if}} - - - {{item.system.armorPiercing}} - -
    - - -
    - -
  4. - - {{/if_eq}} - {{/each}} -
-
-
- -
- {{localize 'DG.Gear.Armor'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    - {{localize 'DG.Gear.ArmorRating'}} - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'armor'}} - -
  3. -
    -

    {{item.name}}

    - {{item.system.protection}} - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
-
- -
- {{localize 'DG.Gear.OtherGear'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    -
    - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'gear'}} - -
  3. -
    - -

    {{item.name}}

    - - - - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
+ {{> "systems/deltagreen/templates/actor/partials/equipment-partial.html" }}
{{!-- About Tab --}}
- {{> "systems/deltagreen/templates/actor/help-and-licensing-partial.html" }} + {{> "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html" }}
diff --git a/templates/actor/vehicle-sheet.html b/templates/actor/vehicle-sheet.html index 57d186c..66a63fc 100644 --- a/templates/actor/vehicle-sheet.html +++ b/templates/actor/vehicle-sheet.html @@ -57,109 +57,18 @@
- {{!-- GEAR --}} + {{!-- GEAR Tab --}}
- -
- -
- {{localize 'DG.Gear.Armor'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    - {{localize 'DG.Gear.ArmorRating'}} - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'armor'}} - -
  3. -
    -

    {{item.name}}

    - {{item.system.protection}} - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
-
- -
- {{localize 'DG.Gear.OtherGear'}} -
- -
    -
  1. -
    -
    {{localize 'DG.Gear.Name'}}
    -
    - {{localize 'DG.Gear.Equipped'}} - -
  2. - - {{#each actor.items as |item id|}} - {{#if_eq item.type 'gear'}} - -
  3. -
    - -

    {{item.name}}

    - - - - - - {{#if item.system.equipped}} - - {{else}} - - {{/if}} - - - -
    - - -
    -
  4. - - {{/if_eq}} - {{/each}} - -
-
+ {{> "systems/deltagreen/templates/actor/equipment-partial.html" }}
- {{!-- About Tab --}} -
- {{> "systems/deltagreen/templates/actor/help-and-licensing-partial.html" }} -
+ {{!-- About Tab --}} +
+ {{> "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html" }} +
+ \ No newline at end of file