diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index 491ac40..dfca7dc 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -7,7 +7,7 @@ export class KidsOnBroomsActor extends Actor { /** * Override getRollData() that's supplied to rolls. */ - getRollData() { + getRollDataPC() { let data = { ...this.system }; // Wand bonuses @@ -18,6 +18,12 @@ export class KidsOnBroomsActor extends Actor { return data; } + + getRollDataNPC() { + let data = { ...this.system}; + + return data; + } _getWandBonus(type) { const bonuses = { diff --git a/module/sheets/actor-sheet.mjs b/module/sheets/actor-sheet.mjs index 87e7f42..7de4c75 100644 --- a/module/sheets/actor-sheet.mjs +++ b/module/sheets/actor-sheet.mjs @@ -40,8 +40,6 @@ async getData() // Add roll data for TinyMCE editors. context.rollData = context.actor.getRollData(); - // Add roll data for TinyMCE editors. - context.rollData = context.actor.getRollData(); console.log(context); @@ -87,7 +85,16 @@ async getData() if (dataset.roll) { let label = dataset.label ? `${dataset.label}` : ''; // Get the roll data and include wand bonuses - let rollData = this.actor.getRollData(); + + let rollData; + if(this.actor.type == "character") { + rollData = this.actor.getRollDataPC(); + } else if (this.actor.type == "npc") { + rollData = this.actor.getRollDataNPC(); + } else { + console.log("ERROR: UNKNOWN AUTHOR TYPE"); + return; + } let totalBonus = 0; console.log(dataset.roll); // Apply wood bonus if it matches the stat being rolled for diff --git a/templates/actor/parts/actor-stats.html b/templates/actor/parts/actor-stats.html index 9541059..94f8032 100644 --- a/templates/actor/parts/actor-stats.html +++ b/templates/actor/parts/actor-stats.html @@ -25,7 +25,7 @@
Magic - +