start work on v10

This commit is contained in:
TheLastScrub
2022-09-04 11:44:49 -07:00
parent d37039a226
commit d18a690177
6 changed files with 326 additions and 10 deletions
+7 -4
View File
@@ -22,7 +22,7 @@ export class DeltaGreenActorSheet extends ActorSheet {
get template() {
if(this.actor !== null){
if(this.actor.data.type === 'agent'){
if(this.actor.type === 'agent'){
if ( !game.user.isGM && this.actor.limited ) {
return "systems/deltagreen/templates/actor/limited-sheet.html";
}
@@ -31,12 +31,15 @@ export class DeltaGreenActorSheet extends ActorSheet {
return `systems/deltagreen/templates/actor/actor-sheet.html`;
}
}
else if(this.actor.data.type === 'unnatural'){
else if(this.actor.type === 'unnatural'){
return `systems/deltagreen/templates/actor/unnatural-sheet.html`;
}
else if(this.actor.data.type === 'npc'){
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";
}
@@ -51,7 +54,7 @@ export class DeltaGreenActorSheet extends ActorSheet {
const data = super.getData();
// Prepare items.
if (this.actor.data.type == 'agent') {
if (this.actor.type == 'agent') {
this._prepareCharacterItems(data);
}
+27 -3
View File
@@ -10,9 +10,10 @@ export class DeltaGreenActor extends Actor {
prepareData() {
super.prepareData();
const actorData = this.data;
const data = actorData.data;
const flags = actorData.flags;
const actorData = this;
//const actorData = this.data;
//const data = actorData.data;
//const flags = actorData.flags;
//console.log('actor.js prepareData');
//console.log(this);
@@ -28,12 +29,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){
let actorData = actor.data;
const data = actorData.data;
+2 -1
View File
@@ -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"
]);
};