diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 12d1935..a6c4469 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -139,6 +139,8 @@ export class BoLActorSheet extends ActorSheet { formData.owner = this.document.isOwner formData.editScore = this.options.editScore formData.useBougette = BoLUtility.getUseBougette() + formData.charType = this.actor.getCharType() + formData.villainy = this.actor.getVillainy() formData.isSorcerer = this.actor.isSorcerer() formData.isAlchemist = this.actor.isAlchemist() diff --git a/module/actor/actor.js b/module/actor/actor.js index 53bda5f..dde119c 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -11,14 +11,29 @@ export class BoLActor extends Actor { prepareData() { if (this.type === 'character') { - this.chartype = 'player'; - this.villainy = false; + this.chartype = 'player' + this.villainy = false } if (this.type === 'encounter') { - this.chartype = 'tough'; - this.villainy = true; + this.chartype = 'tough' + this.villainy = true } - super.prepareData(); + super.prepareData() + } + + /* -------------------------------------------- */ + getCharType() { + if (this.type === 'character') { + return 'player' + } + return 'tough' + } + /* -------------------------------------------- */ + getVillainy() { + if (this.type === 'character') { + return false + } + return true } /* -------------------------------------------- */ diff --git a/module/controllers/bol-rolls.js b/module/controllers/bol-rolls.js index 3a24c76..09ca6fb 100644 --- a/module/controllers/bol-rolls.js +++ b/module/controllers/bol-rolls.js @@ -92,7 +92,7 @@ export class BoLRoll { targetId: target?.id, fightOption: fightOption, careerBonus: 0, - defenderId: target?.data?.actorId, + defenderId: target?.actor.id, attribute: attribute, aptitude: aptitude, attrValue: attribute.value, diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index bd1b4c8..7439f6d 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -26,6 +26,7 @@ export class BoLItemSheet extends ItemSheet { data.item = itemData data.category = itemData.system.category data.isGM = game.user.isGM; + data.itemProperties = this.item.itemProperties; // Dynamic default data fix/adapt if (itemData.type == "item") { diff --git a/module/system/bol-utility.js b/module/system/bol-utility.js index 5d9be6b..baae321 100644 --- a/module/system/bol-utility.js +++ b/module/system/bol-utility.js @@ -414,8 +414,8 @@ export class BoLUtility { } // Build and send the defense message to the relevant people (ie GM + defender) let defender = game.actors.get(attackDef.defenderId) - let defenderWeapons = defender.weapons - console.log("DEF WEP", attackDef) + console.log("DEF WEP", attackDef, defender) + let defenderWeapons = defender.weapons || [] this.attackStore[attackDef.id] = attackDef // Store ! ChatMessage.create({ alias: defender.name, diff --git a/templates/actor/parts/tabs/actor-actions.hbs b/templates/actor/parts/tabs/actor-actions.hbs index 80c74ee..76c1195 100644 --- a/templates/actor/parts/tabs/actor-actions.hbs +++ b/templates/actor/parts/tabs/actor-actions.hbs @@ -12,7 +12,7 @@