From e0adf04753048663ebb958c17ec6da4e4ec71c4e Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 21 Mar 2023 20:43:41 +0100 Subject: [PATCH] Combat tab --- modules/hero6-actor-sheet.js | 11 +- modules/hero6-actor.js | 8 +- modules/hero6-config.js | 5 + styles/simple.css | 4 +- system.json | 2 +- template.json | 45 ++++- templates/actors/actor-sheet.hbs | 255 ++++++++++++++++++------ templates/items/item-maneuver-sheet.hbs | 10 + 8 files changed, 268 insertions(+), 72 deletions(-) diff --git a/modules/hero6-actor-sheet.js b/modules/hero6-actor-sheet.js index 9dc26ad..5443d1c 100644 --- a/modules/hero6-actor-sheet.js +++ b/modules/hero6-actor-sheet.js @@ -14,8 +14,8 @@ export class Hero6ActorSheet extends ActorSheet { return mergeObject(super.defaultOptions, { classes: ["fvtt-hero-system-6", "sheet", "actor"], template: "systems/fvtt-hero-system-6/templates/actors/actor-sheet.hbs", - width: 960, - height: 720, + width: 1124, + height: 916, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "main" }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], editScore: true @@ -37,6 +37,7 @@ export class Hero6ActorSheet extends ActorSheet { system: objectData, characteristics: this.actor.prepareCharac(), defenses: duplicate(this.actor.system.defenses), + movements: duplicate(this.actor.system.movements), limited: this.object.limited, skills: this.actor.getSkills( ), perks: this.actor.getPerks( ), @@ -180,7 +181,11 @@ export class Hero6ActorSheet extends ActorSheet { html.find('.update-field').change(ev => { const fieldName = $(ev.currentTarget).data("field-name"); - let value = Number(ev.currentTarget.value); + const fieldType = $(ev.currentTarget).data("dtype"); + let value = ev.currentTarget.value + if (fieldType.toLowerCase() == "Number") { + value = Number(value) + } this.actor.update( { [`${fieldName}`]: value } ); }); } diff --git a/modules/hero6-actor.js b/modules/hero6-actor.js index efcbdd3..6835934 100644 --- a/modules/hero6-actor.js +++ b/modules/hero6-actor.js @@ -274,9 +274,13 @@ export class Hero6Actor extends Actor { } return 0; } - /* ------------------------------------------- */ getManeuvers() { - return this.items.filter(item => item.type == "maneuver" ); + let maneuvers = { + general: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "general"), + offensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "offensive"), + defensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "defensive") + } + return maneuvers } getEquipments() { return this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment"); diff --git a/modules/hero6-config.js b/modules/hero6-config.js index 64cce82..7ba5b9b 100644 --- a/modules/hero6-config.js +++ b/modules/hero6-config.js @@ -7,6 +7,11 @@ export const Hero6_CONFIG = { shield: "Shield", money: "Money" }, + maneuverTypes: { + "general": "General", + "offensive": "Offensive", + "defensive": "Defensive" + }, rollCharac : { "str": "Strength", "dex": "Dexterity", diff --git a/styles/simple.css b/styles/simple.css index f73d74a..439a106 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -952,9 +952,9 @@ ul, li { } #sidebar #sidebar-tabs i{ - width: 25px; + /*width: 25px;*/ height: 25px; - /*display: inline-block;*/ + display: inline-block; background-position:center; background-size:cover; text-shadow: 1px 1px 0 rgba(0,0,0,0.75); diff --git a/system.json b/system.json index 7044bac..c112067 100644 --- a/system.json +++ b/system.json @@ -91,7 +91,7 @@ "styles": [ "styles/simple.css" ], - "version": "10.0.20", + "version": "10.0.28", "compatibility": { "minimum": "10", "verified": "10", diff --git a/template.json b/template.json index b8484df..5cfd1f1 100644 --- a/template.json +++ b/template.json @@ -26,6 +26,12 @@ "appearance": "", "description": "", "notes": "", + "points": 0, + "complications": 0, + "xpearned": 0, + "xpspent": 0, + "combatskills": "", + "presenceattack": "", "gmnotes": "" } }, @@ -36,6 +42,9 @@ "value": 10, "base": 10, "category": "main", + "strdice": "", + "lift": "", + "strend": 0, "hasroll": true, "realcost": 0, "activecost": 0 @@ -197,18 +206,21 @@ }, "running": { "label": "Running", + "ismovement": true, "hasroll": false, "value": 12, "base": 12 }, "swimming": { "label": "Swimming", + "ismovement": true, "hasroll": false, "value": 4, "base": 4 }, "leaping": { "label": "Leaping", + "ismovement": true, "hasroll": false, "value": 4, "base": 4, @@ -219,6 +231,32 @@ } } }, + "movements": { + "movements": { + "fly": { + "label": "Fly", + "value": 0 + }, + "teleport": { + "label": "Teleport", + "value": 0 + }, + "tunnel": { + "label": "Tunnel", + "value": 0 + }, + "move1": { + "label": "N/A", + "iseditable": true, + "value": 0 + }, + "move2": { + "label": "N/A", + "iseditable": true, + "value": 0 + } + } + }, "defenses": { "defenses": { "mental": { @@ -239,16 +277,19 @@ "def1": { "label": "N/A", "value": 0, + "iseditable": true, "resistant": "" }, "def2": { "label": "N/A", "value": 0, + "iseditable": true, "resistant": "" }, "def3": { "label": "N/A", "value": 0, + "iseditable": true, "resistant": "" } } @@ -259,7 +300,8 @@ "templates": [ "biodata", "characteristics", - "defenses" + "defenses", + "movements" ], "subactors": [] } @@ -309,6 +351,7 @@ "templates": [ "common" ], + "maneuvertype": "general", "pha": "", "ocv": 0, "dcv" : 0, diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index 9185a62..d2ee682 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -40,29 +40,51 @@ - -
- -
+ +
+
+ +
+ +
+ @@ -91,49 +113,69 @@
-
-
    -
  • - - - - - - - - - - - - - - - +
    +
      +
    • + + + + + + + +
    • - {{#each maneuvers as |maneuver key|}} -
    • - - {{maneuver.name}} - - {{maneuver.system.pha}} - {{maneuver.system.ocv}} - {{maneuver.system.dcv}} - - {{maneuver.system.effects}} - -
      - -
      +
    • + +
    • - {{/each}}
    -
    + {{#each maneuvers as |mlist key|}} +
      +
    • + + + + + + + + + + + + + + + +
    • + {{#each mlist as |maneuver key|}} +
    • + + {{maneuver.name}} + + {{maneuver.system.pha}} + {{maneuver.system.ocv}} + {{maneuver.system.dcv}} + + {{maneuver.system.effects}} + +
      + +
      +
    • + {{/each}} +
    + {{/each}} +
+
  • - + +
@@ -148,47 +190,53 @@ - + {{#each characteristics as |char key|}} {{#if char.isvital}}
  • {{char.label}} - {{char.value}} +
  • {{/if}} {{/each}} +
    +
    • - + - +
    • {{#each characteristics as |char key|}} {{#if char.isdefense}}
    • {{char.label}} - {{char.value}} +
    • {{/if}} {{/each}} {{#each defenses as |def key|}}
    • + {{#if def.iseditable}} + + {{else}} {{def.label}} - {{def.value}} + {{/if}} +
    • {{/each}} @@ -197,6 +245,87 @@
    + +
    + + + + + + + + + + + + + + +
    + +
    + + +
    + +
    +
    +
      +
    • + + + + + + +
    • + {{#each senses as |sense key|}} +
    • + {{sense.label}} + {{sense.value}} +
    • + {{/each}} +
    +
    + +
    +
      +
    • + + + + + + + + + +
    • + {{#each characteristics as |char key|}} + {{#if char.ismovement}} +
    • + {{char.label}} + + +
    • + {{/if}} + {{/each}} + {{#each movements as |move key|}} +
    • + {{#if move.iseditable}} + + {{else}} + {{move.label}} + {{/if}} + + +
    • + {{/each}} +
    + +
    +
    diff --git a/templates/items/item-maneuver-sheet.hbs b/templates/items/item-maneuver-sheet.hbs index 4e7ad97..dec22de 100644 --- a/templates/items/item-maneuver-sheet.hbs +++ b/templates/items/item-maneuver-sheet.hbs @@ -16,6 +16,16 @@