From 918d69e677ae562f7f503267643eb2b3ccad23d1 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Mon, 25 Jul 2022 19:13:52 +0200 Subject: [PATCH] Data model change --- modules/crucible-actor.js | 5 +- modules/crucible-utility.js | 2 + template.json | 7 ++ templates/actor-sheet.html | 133 ++++++++---------------- templates/partial-actor-stat-block.html | 16 --- 5 files changed, 55 insertions(+), 108 deletions(-) delete mode 100644 templates/partial-actor-stat-block.html diff --git a/modules/crucible-actor.js b/modules/crucible-actor.js index 422ece4..2ef342f 100644 --- a/modules/crucible-actor.js +++ b/modules/crucible-actor.js @@ -80,7 +80,7 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ getEncumbranceCapacity() { - return this.data.data.statistics.str.value * 25 + return 1; } /* -------------------------------------------- */ @@ -129,9 +129,6 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ getSkills() { let comp = duplicate(this.data.items.filter(item => item.type == 'skill') || []); - for (let c of comp) { - c.data.dice = CrucibleUtility.getDiceFromLevel(c.data.level); - } return comp; } diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index 3822efa..a59c449 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -86,6 +86,8 @@ export class CrucibleUtility { const templatePaths = [ 'systems/fvtt-crucible-rpg/templates/editor-notes-gm.html', + 'systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html', + 'systems/fvtt-crucible-rpg/templates/partial-actor-status.html', 'systems/fvtt-crucible-rpg/templates/partial-options-abilities.html', 'systems/fvtt-crucible-rpg/templates/partial-item-nav.html', 'systems/fvtt-crucible-rpg/templates/partial-item-description.html', diff --git a/template.json b/template.json index 1285798..2ae6527 100644 --- a/template.json +++ b/template.json @@ -22,36 +22,43 @@ "str":{ "label": "Strength", "abbrev": "str", + "col": 1, "value": 1 }, "agi":{ "label": "Agility", "abbrev": "agi", + "col": 1, "value": 1 }, "dex":{ "label": "Dexterity", "abbrev": "dex", + "col": 1, "value": 1 }, "con":{ "label": "Constitution", "abbrev": "con", + "col": 1, "value": 1 }, "int":{ "label": "Intelligence", "abbrev": "int", + "col": 2, "value": 1 }, "wit":{ "label": "Wits", "abbrev": "wit", + "col": 2, "value": 1 }, "cha":{ "label": "Charisma", "abbrev": "cha", + "col": 2, "value": 1 } }, diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index ce52805..780761e 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -11,60 +11,28 @@
    - {{#each data.statistics as |stat key|}} - {{#if (eq stat.col 1)}} - {{> systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html stat=stat key=key}} + {{#each data.abilities as |ability key|}} + {{#if (eq ability.col 1)}} + {{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}} {{/if}} {{/each}} -
  • - - - - -

    Dice Pool

    -
    -
    - {{#each data.statistics as |stat key|}} - {{#if (eq stat.col 2)}} - {{> systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html stat=stat key=key}} + {{#each data.abilities as |ability key|}} + {{#if (eq ability.col 2)}} + {{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}} {{/if}} {{/each}} -
  • - - - - -

    MR -

    -
    - - -
- {{> systems/fvtt-pegasus-rpg/templates/partial-actor-status.html}} + {{> systems/fvtt-crucible-rpg/templates/partial-actor-status.html}}
- -
@@ -73,9 +41,9 @@ {{!-- Sheet Tab Navigation --}} @@ -83,6 +51,41 @@ {{!-- Sheet Body --}}
+ {{!-- Skills Tab --}} +
+ +
    +
  • + +

    +
    + + + + + + + + + +
  • + {{#each skills as |skill key|}} +
  • + + {{skill.name}} + {{upper skill.data.ability}} + {{skill.data.dice}} +  -  +
     
    +
    + +
    +
  • + {{/each}} +
+
+ {{!-- Combat Tab --}}
@@ -317,55 +320,9 @@
- {{!-- Other Tab --}} -
- -
    -
  • - -

    -
    - - - - - - - - - -
  • - {{#each specs as |spec key|}} -
  • - - {{spec.name}} - {{upper spec.data.statistic}} - {{spec.data.dice}} - {{#if spec.data.ispowergroup}} - {{#if spec.data.powersactivated}} - Deactivate - {{else}} - Activate - {{/if}} - {{else}} -  -  - {{/if}} -
     
    -
    - -
    -
  • - {{/each}} -
-
- - - - {{!-- Powers Tab --}} -
+
diff --git a/templates/partial-actor-stat-block.html b/templates/partial-actor-stat-block.html deleted file mode 100644 index d2cdb82..0000000 --- a/templates/partial-actor-stat-block.html +++ /dev/null @@ -1,16 +0,0 @@ -
  • - - - - -

    {{stat.abbrev}}

    -
    - - -
  • \ No newline at end of file