diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js
index d4e98e4..18070af 100644
--- a/module/actor/actor-sheet.js
+++ b/module/actor/actor-sheet.js
@@ -115,7 +115,7 @@ export class BoLActorSheet extends ActorSheet {
formData.details = this.actor.details;
formData.attributes = this.actor.attributes;
formData.aptitudes = this.actor.aptitudes;
- formData.resources = this.actor.resources;
+ formData.resources = this.actor.getResourcesFromType();
formData.equipment = this.actor.equipment;
formData.weapons = this.actor.weapons;
formData.protections = this.actor.protections;
diff --git a/module/actor/actor.js b/module/actor/actor.js
index 1eeda1d..7ddc704 100644
--- a/module/actor/actor.js
+++ b/module/actor/actor.js
@@ -12,7 +12,12 @@ export class BoLActor extends Actor {
// const flags = actorData.flags;
// Make separate methods for each Actor type (character, npc, etc.) to keep things organized.
if (actorData.type === 'character') {
- //this._prepareCharacterData(actorData);
+ actorData.type = 'player';
+ actorData.villainy = false;
+ }
+ if (actorData.type === 'encounter') {
+ actorData.type = 'tough';
+ actorData.villainy = true;
}
super.prepareData();
}
@@ -24,13 +29,15 @@ export class BoLActor extends Actor {
/* -------------------------------------------- */
updateResourcesData( ) {
- let newVitality = 10 + this.data.data.attributes.vigor.value + this.data.data.resources.hp.bonus
- if ( this.data.data.resources.hp.max != newVitality) {
- this.update( {'data.resources.hp.max': newVitality} );
- }
- let newPower = 10 + this.data.data.attributes.mind.value + this.data.data.resources.power.bonus
- if ( this.data.data.resources.power.max != newPower) {
- this.update( {'data.resources.power.max': newPower} );
+ if ( this.type == 'character') {
+ let newVitality = 10 + this.data.data.attributes.vigor.value + this.data.data.resources.hp.bonus
+ if ( this.data.data.resources.hp.max != newVitality) {
+ this.update( {'data.resources.hp.max': newVitality} );
+ }
+ let newPower = 10 + this.data.data.attributes.mind.value + this.data.data.resources.power.bonus
+ if ( this.data.data.resources.power.max != newPower) {
+ this.update( {'data.resources.power.max': newPower} );
+ }
}
}
@@ -127,6 +134,24 @@ export class BoLActor extends Actor {
return this.itemData.filter(i => i.type === "item" && i.data.category === "equipment" && (i.data.subtype === "other" ||i.data.subtype === "container" ||i.data.subtype === "scroll" || i.data.subtype === "jewel"));
}
+ getResourcesFromType() {
+ let resources = {};
+ if (this.type == 'encounter') {
+ resources['hp'] = this.data.data.resources.hp;
+ if (this.data.data.type != 'base') {
+ resources['faith'] = this.data.data.resources.faith
+ resources['power'] = this.data.data.resources.power
+ }
+ if (this.data.data.type == 'adversary') {
+ resources['hero'] = duplicate(this.data.data.resources.hero)
+ resources['hero'].label = "BOL.resources.villainy"
+ }
+ } else {
+ resources = this.data.data.resources;
+ }
+ return resources
+ }
+
buildFeatures(){
return {
"careers": {
diff --git a/system.json b/system.json
index a4f0249..f6fc827 100644
--- a/system.json
+++ b/system.json
@@ -7,8 +7,8 @@
"url": "https://github.com/ZigmundKreud/bol",
"license": "LICENSE.txt",
"flags": {},
- "version": "0.8.9.4",
- "templateVersion": 13,
+ "version": "0.8.9.5",
+ "templateVersion": 14,
"minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "9",
"scripts": [],
diff --git a/template.json b/template.json
index 5dde955..16645eb 100644
--- a/template.json
+++ b/template.json
@@ -117,7 +117,7 @@
},
"character": {
"templates": [ "base" ],
- "type": "npc",
+ "type": "player",
"villainy": false,
"xp": {
"key": "xp",
@@ -135,6 +135,7 @@
"encounter": {
"templates": [ "base" ],
"type": "tough",
+ "villainy": false,
"size": "",
"environment": ""
}
diff --git a/templates/actor/parts/actor-header.hbs b/templates/actor/parts/actor-header.hbs
index 4a867b8..49b9937 100644
--- a/templates/actor/parts/actor-header.hbs
+++ b/templates/actor/parts/actor-header.hbs
@@ -5,6 +5,8 @@
+
+ {{#if (eq data.type "player")}}