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 @@ +
+ + \ No newline at end of file