diff --git a/css/deltagreen.css b/css/deltagreen.css index 2f581bb..f6e0f69 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -621,7 +621,7 @@ div.motivation-editor-container div.editor{ } .deltagreen .editor-host .editor { - min-height: 35px; + min-height: 50px; } .deltagreen .editor-host .tox { diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 201570b..0dafc5b 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -37,6 +37,9 @@ export class DeltaGreenActorSheet extends ActorSheet { else if(this.actor.type === 'npc'){ return `systems/deltagreen/templates/actor/npc-sheet.html`; } + else if(this.actor.type === 'vehicle'){ + return `systems/deltagreen/templates/actor/vehicle-sheet.html`; + } else{ return "systems/deltagreen/templates/actor/limited-sheet.html"; } diff --git a/module/actor/actor.js b/module/actor/actor.js index 17f2a5b..c0f377f 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -28,12 +28,35 @@ export class DeltaGreenActor extends Actor { else if(actorData.type === 'npc'){ this._prepareNpcData(this); } + else if(actorData.type === 'vehicle'){ + this._prepareVehicleData(this); + } } /** * * @param {*} agent */ + + _prepareVehicleData(actor){ + let actorData = actor; + //const data = actorData.data; + + // calculate total armor rating + let protection = 0; + for (let i of actor.items) { + if (i.type === 'armor') { + if(i.data.data.equipped === true){ + protection += i.data.data.protection; + } + } + } + + actorData.system.health.protection = protection; + + console.log(actor); + } + _prepareNpcData(actor){ const { system } = actor; diff --git a/module/templates.js b/module/templates.js index daa5c0b..41eedf4 100644 --- a/module/templates.js +++ b/module/templates.js @@ -11,6 +11,7 @@ export const preloadHandlebarsTemplates = async function() { "systems/deltagreen/templates/actor/unnatural-sheet.html", "systems/deltagreen/templates/actor/npc-sheet.html", "systems/deltagreen/templates/actor/cv-partial.html", - "systems/deltagreen/templates/dialog/modify-percentile-roll.html" + "systems/deltagreen/templates/dialog/modify-percentile-roll.html", + "systems/deltagreen/templates/actor/vehicle-sheet.html" ]); }; \ No newline at end of file diff --git a/template.json b/template.json index 4ef4c83..41dc998 100644 --- a/template.json +++ b/template.json @@ -3,7 +3,8 @@ "types": [ "agent", "unnatural", - "npc" + "npc", + "vehicle" ], "templates": { "base": { @@ -461,6 +462,19 @@ "shortDescription": "", "showUntrainedSkills": true }, + "vehicle":{ + "name": "", + "description": "", + "shortDescription": "", + "health": { + "value": 10, + "min": 0, + "max": 10 + }, + "speed": "", + "expense": "Standard", + "passengers": [] + }, "agent": { "templates": [ "base", diff --git a/templates/actor/vehicle-sheet.html b/templates/actor/vehicle-sheet.html new file mode 100644 index 0000000..aea7e65 --- /dev/null +++ b/templates/actor/vehicle-sheet.html @@ -0,0 +1,274 @@ +
+ + {{!-- Sheet Header --}} +
+ +
+ + {{!-- Name, Portrait --}} +
+ +
+
+

+
+
+

+
+
+
+ +
+ + {{!-- HP --}} +
+ +
+ + / + +
+
+
+ +
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ + {{!-- Descriptions --}} +
+
+ {{localize 'DG.UnnaturalSheet.NotesLabel'}} +
+
+
+ {{editor actor.system.notes target="system.notes" button=true owner=owner editable=editable}} +
+
+ +
+ + {{!-- 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.data.data.isLethal}} + + {{toUpperCase item.data.data.damage}} + {{/unless}} + + {{#if item.data.data.isLethal}} + {{formatLethality item.data.data.lethality}} + {{/if}} + + {{item.data.data.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.data.data.protection}} + + + {{#if item.data.data.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.data.data.equipped}} + + {{else}} + + {{/if}} + + + +
    + + +
    +
  4. + + {{/if_eq}} + {{/each}} + +
+
+
+ + {{!-- About Tab --}} +
+
+ +
+
+
+ + {{localize 'DG.About.OnlineHelp'}} + +
+
+ + {{localize 'DG.About.OnlineBugTracker'}} + +
+
+ + CHANGELOG (ONLINE) + +
+
+
+ This is an unofficial fan work, it is not affiliated with or endorsed by Shaney Ivey or Arc Dream Publishing. +
+
+
+ Delta Green Community License (NONCOMMERCIAL) +

+ Published by arrangement with the Delta Green Partnership. + The intellectual property known as Delta Green is a trademark and copyright owned by the Delta Green Partnership, who has licensed its use here. +

+

+ The contents of this system are licensed per the terms of the included license file, excepting those elements that are components of the Delta Green intellectual property. +

+

+ Some content may additionally also be covered under the terms of the Open Game License (Copyright 2000 Wizards of the Coast, Inc.). +

+
+
+
+ +
+
+ + \ No newline at end of file