From d399b29d845dea518c0dbe08fec5d5e29dab44d3 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 21 Mar 2023 14:01:27 +0100 Subject: [PATCH] WIP Hero 6 --- lang/en.json | 3 +- modules/hero6-actor-sheet.js | 5 +- modules/hero6-actor.js | 10 +- modules/hero6-config.js | 3 +- modules/hero6-main.js | 6 - modules/hero6-utility.js | 5 +- styles/simple.css | 7 +- system.json | 4 +- template.json | 100 +++++++-- templates/actors/actor-sheet.hbs | 197 +++++++++--------- templates/items/item-maneuver-sheet.hbs | 40 ++++ .../partial-actor-equipment-section.hbs | 4 +- .../partials/partial-actor-full-charac.hbs | 6 +- 13 files changed, 256 insertions(+), 134 deletions(-) create mode 100644 templates/items/item-maneuver-sheet.hbs diff --git a/lang/en.json b/lang/en.json index 0973a13..b6bfba9 100644 --- a/lang/en.json +++ b/lang/en.json @@ -12,6 +12,7 @@ "TypeLimitation": "Limitation", "TypeComplication": "Complication", "TypeEquipment": "Equipment", - "TypeCurrency": "Currency" + "TypeCurrency": "Currency", + "TypeManeuver": "Maneuver" } } \ No newline at end of file diff --git a/modules/hero6-actor-sheet.js b/modules/hero6-actor-sheet.js index fe3e682..9dc26ad 100644 --- a/modules/hero6-actor-sheet.js +++ b/modules/hero6-actor-sheet.js @@ -36,6 +36,7 @@ export class Hero6ActorSheet extends ActorSheet { cssClass: this.isEditable ? "editable" : "locked", system: objectData, characteristics: this.actor.prepareCharac(), + defenses: duplicate(this.actor.system.defenses), limited: this.object.limited, skills: this.actor.getSkills( ), perks: this.actor.getPerks( ), @@ -43,13 +44,13 @@ export class Hero6ActorSheet extends ActorSheet { talents: this.actor.getTalents( ), complications: this.actor.getComplications( ), martialarts: this.actor.getMartialArts( ), + maneuvers: this.actor.getManeuvers( ), weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ), armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())), shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())), - equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ), + equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsMoneys()) ), subActors: duplicate(this.actor.getSubActors()), race: duplicate(this.actor.getRace()), - moneys: duplicate(this.actor.getMoneys()), encCapacity: this.actor.getEncumbranceCapacity(), description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}), motivation: await TextEditor.enrichHTML(this.object.system.biodata.motivation, {async: true}), diff --git a/modules/hero6-actor.js b/modules/hero6-actor.js index c20cb3b..efcbdd3 100644 --- a/modules/hero6-actor.js +++ b/modules/hero6-actor.js @@ -274,8 +274,10 @@ export class Hero6Actor extends Actor { } return 0; } - /* ------------------------------------------- */ + getManeuvers() { + return this.items.filter(item => item.type == "maneuver" ); + } getEquipments() { return this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment"); } @@ -288,7 +290,9 @@ export class Hero6Actor extends Actor { getShields() { return this.items.filter(item => item.type == "equipment" && item.system.subtype == "shield"); } - /* ------------------------------------------- */ + getEquipmentsMoneys() { + return duplicate(this.items.filter(item => item.type == "equipment" && (item.system.subtype == "equipment" || item.system.subtype == "money")) || []) + } getEquipmentsOnly() { return duplicate(this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment") || []) } @@ -529,7 +533,7 @@ export class Hero6Actor extends Actor { let rollData = this.getCommonRollData() rollData.mode = "item" rollData.item = duplicate(item) - if ( item.type == "skill") { + if (item.type == "skill") { this.prepareSkill(rollData.item) } this.startRoll(rollData) diff --git a/modules/hero6-config.js b/modules/hero6-config.js index 82967a9..64cce82 100644 --- a/modules/hero6-config.js +++ b/modules/hero6-config.js @@ -4,7 +4,8 @@ export const Hero6_CONFIG = { equipment: "Equipment", weapon: "Weapon", armor: "Armor", - shield: "Shield" + shield: "Shield", + money: "Money" }, rollCharac : { "str": "Strength", diff --git a/modules/hero6-main.js b/modules/hero6-main.js index 8507e35..bd49680 100644 --- a/modules/hero6-main.js +++ b/modules/hero6-main.js @@ -91,12 +91,6 @@ Hooks.once("ready", function () { }); } - // CSS patch for v9 - if (game.version) { - let sidebar = document.getElementById("sidebar"); - sidebar.style.width = "min-content"; - } - welcomeMessage(); Hero6Utility.ready() Hero6Commands.init() diff --git a/modules/hero6-utility.js b/modules/hero6-utility.js index a55b5d5..b6b7e7b 100644 --- a/modules/hero6-utility.js +++ b/modules/hero6-utility.js @@ -298,7 +298,7 @@ export class Hero6Utility { let actor = game.actors.get(rollData.actorId) // ability/save/size => 0 - let diceFormula = "3d6+" + rollData.bonusMalus + let diceFormula = "3d6" let target = 10 if (rollData.charac) { target = rollData.charac.roll @@ -306,7 +306,8 @@ export class Hero6Utility { if (rollData.item) { target = rollData.item.roll || rollData.item.system.roll } - + target += rollData.bonusMalus + // Performs roll console.log("Roll formula", diceFormula) let myRoll = rollData.roll diff --git a/styles/simple.css b/styles/simple.css index 6233119..f73d74a 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -954,7 +954,7 @@ ul, li { #sidebar #sidebar-tabs i{ 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); @@ -1420,6 +1420,11 @@ Focus FOC: #ff0084 max-width: 8rem; min-width: 8rem; } +.item-field-label-long-img { + flex-grow:1; + max-width: 10rem; + min-width: 10rem; +} .item-field-label-long2 { flex-grow:1; max-width: 16rem; diff --git a/system.json b/system.json index bd3fbff..7044bac 100644 --- a/system.json +++ b/system.json @@ -91,7 +91,7 @@ "styles": [ "styles/simple.css" ], - "version": "10.0.14", + "version": "10.0.20", "compatibility": { "minimum": "10", "verified": "10", @@ -99,7 +99,7 @@ }, "title": "Hero System v6 for FoundrtVTT (Official)", "manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.14.zip", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.17.zip", "url": "https://www.uberwald.me/gitea/uberwald/", "background": "images/ui/hro6_welcome_page.webp", "id": "fvtt-hero-system-6" diff --git a/template.json b/template.json index c1af951..b8484df 100644 --- a/template.json +++ b/template.json @@ -36,6 +36,7 @@ "value": 10, "base": 10, "category": "main", + "hasroll": true, "realcost": 0, "activecost": 0 }, @@ -43,34 +44,40 @@ "label": "Dexterity", "value": 10, "base": 10, + "hasroll": true, "category": "main" }, "con": { "label": "Constitution", + "hasroll": true, "category": "main", "value": 10, "base": 10 }, "int": { "label": "Intelligence", + "hasroll": true, "category": "main", "value": 10, "base": 10 }, "ego": { "label": "Ego", + "hasroll": true, "category": "main", "value": 10, "base": 10 }, "pre": { "label": "Presence", + "hasroll": true, "category": "main", "value": 10, "base": 10 }, "ocv": { "label": "OCV", + "hasroll": false, "base": 3, "autoMod": "0", "userMod": "0", @@ -79,6 +86,7 @@ }, "dcv": { "label": "DCV", + "hasroll": false, "base": 3, "autoMod": "0", "userMod": "0", @@ -87,6 +95,7 @@ }, "omcv": { "label": "OMCV", + "hasroll": false, "base": 3, "autoMod": "0", "userMod": "0", @@ -95,6 +104,7 @@ }, "dmcv": { "label": "DMCV", + "hasroll": false, "base": 3, "autoMod": "0", "userMod": "0", @@ -103,11 +113,14 @@ }, "spd": { "label": "Speed", + "hasroll": false, "value": 2, "base": 2 }, "pd": { "label": "PD", + "hasroll": false, + "isdefense": true, "value": 2, "base": 2, "pd_nonresistant_total": 0, @@ -117,6 +130,8 @@ }, "ed": { "label": "ED", + "hasroll": false, + "isdefense": true, "value": 2, "base": 2, "ed_nonresistant_total": 0, @@ -126,21 +141,39 @@ }, "rec": { "label": "REC", + "hasroll": false, "value": 4, "base": 4 }, "end": { "label": "END", + "hasroll": false, + "isvital": true, + "damage": 0, "value": 20, "max": 20 }, "stun": { "label": "STUN", + "hasroll": false, + "isvital": true, + "damage": 0, + "value": 20, + "max": 20 + }, + "other": { + "label": "OTHER", + "hasroll": false, + "isvital": true, + "damage": 0, "value": 20, "max": 20 }, "body": { - "label": "Body", + "label": "BODY", + "hasroll": false, + "isvital": true, + "damage": 0, "value": 10, "max": 10, "loc": { @@ -164,27 +197,59 @@ }, "running": { "label": "Running", + "hasroll": false, "value": 12, "base": 12 }, "swimming": { "label": "Swimming", + "hasroll": false, "value": 4, "base": 4 }, "leaping": { "label": "Leaping", + "hasroll": false, "value": 4, "base": 4, "leaping_horizontal_base": 0, "leaping_horizontal_total": 0, "leaping_vertical_base": 0, "leaping_vertical_total": 0 - }, - "flying": { - "label": "Flying", + } + } + }, + "defenses": { + "defenses": { + "mental": { + "label": "Mental", "value": 0, - "base": 0 + "resistant": "" + }, + "power": { + "label": "Power", + "value": 0, + "resistant": "" + }, + "flash": { + "label": "Flash", + "value": 0, + "resistant": "" + }, + "def1": { + "label": "N/A", + "value": 0, + "resistant": "" + }, + "def2": { + "label": "N/A", + "value": 0, + "resistant": "" + }, + "def3": { + "label": "N/A", + "value": 0, + "resistant": "" } } }, @@ -193,7 +258,8 @@ "character": { "templates": [ "biodata", - "characteristics" + "characteristics", + "defenses" ], "subactors": [] } @@ -205,11 +271,11 @@ "talent", "power", "advantage", + "maneuver", "martialart", "limitation", "complication", - "equipment", - "currency" + "equipment" ], "templates": { "common": { @@ -239,11 +305,14 @@ "items": {} } }, - "currency": { - "quantity": 0, + "maneuver": { "templates": [ "common" - ] + ], + "pha": "", + "ocv": 0, + "dcv" : 0, + "active": false }, "advantage": { "templates": [ @@ -314,15 +383,6 @@ "impenetrable": 0, "value": 0 }, - "maneuver": { - "templates": [ - "common" - ], - "phase": 0, - "ocv": "+0", - "dcv": "+0", - "active": false - }, "movement": { "templates": [ "common" diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index 2b91dd7..9185a62 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -89,32 +89,39 @@ {{!-- Combat Tab --}}
-
- + +
  • - -

    + + - + + + + + + + - +
  • - {{#each equippedWeapons as |weapon key|}} -
  • + {{#each maneuvers as |maneuver key|}} +
  • - {{weapon.name}} + src="{{maneuver.img}}" /> + {{maneuver.name}} - {{weapon.system.ability}} + {{maneuver.system.pha}} + {{maneuver.system.ocv}} + {{maneuver.system.dcv}} - {{perk.system.range}} + {{maneuver.system.effects}} -
     
    @@ -124,40 +131,74 @@
-
    -
  • - -

    -
    - - - - - - - - - +
      +
    • +
    • - {{#each feats as |feat key|}} -
    • - - {{feat.name}} - - {{upperFirst feat.system.isfeatdie}} - {{upperFirst feat.system.issl}} - {{feat.system.sl}} - -
       
      -
      - -
      -
    • - {{/each}}
    -
+
+
+
    +
  • + + + + + + + + + +
  • + {{#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|}} +
  • + {{def.label}} + {{def.value}} + +
  • + {{/each}} +
+ +
+ +
+
+
@@ -167,11 +208,11 @@