diff --git a/module/blades-item.js b/module/blades-item.js index a7b1ced..979552e 100644 --- a/module/blades-item.js +++ b/module/blades-item.js @@ -28,14 +28,14 @@ export class BladesItem extends Item { prepareData() { super.prepareData(); - + const item_data = this.data; const data = item_data.data; if (item_data.type === "cohort") { - + this._prepareCohort(data); - + } if (item_data.type === "faction") { @@ -52,7 +52,7 @@ export class BladesItem extends Item { /** * Prepares Cohort data * - * @param {object} data + * @param {object} data */ _prepareCohort(data) { @@ -60,22 +60,22 @@ export class BladesItem extends Item { let scale = 0; // Adds Scale and Quality - if (this.actor) { - switch (data.cohort[0]) { + if (this.actor.data) { + switch (data.cohort) { case "Gang": - scale = parseInt(this.actor.data.data.tier[0]); - quality = parseInt(this.actor.data.data.tier[0]); + scale = parseInt(this.actor.data.data.tier); + quality = parseInt(this.actor.data.data.tier); break; case "Expert": - scale = 1; - quality = parseInt(this.actor.data.data.tier[0]) + 1; + scale = 0; + quality = parseInt(this.actor.data.data.tier) + 1; break; } } data.scale = scale; data.quality = quality; - + this.data.data = data; } } diff --git a/template.json b/template.json index 88abeb0..781092b 100644 --- a/template.json +++ b/template.json @@ -136,7 +136,7 @@ "name": "", "reputation": [0], "lair": "", - "tier": [0], + "tier": "", "deity": "", "hold": ["strong"], "experience": [0], diff --git a/templates/items/cohort.html b/templates/items/cohort.html index 88bc1b8..6533cae 100644 --- a/templates/items/cohort.html +++ b/templates/items/cohort.html @@ -6,7 +6,7 @@
- +