diff --git a/.gitignore b/.gitignore index 76add87..e5cebe8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -dist \ No newline at end of file +dist +foundryconfig.json diff --git a/src/module/actor/entity.js b/src/module/actor/entity.js index 0b7d1f0..fe5031b 100644 --- a/src/module/actor/entity.js +++ b/src/module/actor/entity.js @@ -53,15 +53,15 @@ export class OseActor extends Actor { isNew() { const data = this.data.data; - if (this.data.type == 'character') { + if (this.data.type == "character") { let ct = 0; Object.values(data.scores).forEach((el) => { ct += el.value; - }) + }); return ct == 0 ? true : false; - } else if (this.data.type == 'monster') { + } else if (this.data.type == "monster") { let ct = 0; - Object.values(data.saves).forEach(el => { + Object.values(data.saves).forEach((el) => { ct += el.value; }); return ct == 0 ? true : false; @@ -79,21 +79,21 @@ export class OseActor extends Actor { this.update({ "data.saves": { death: { - value: saves.d + value: saves.d, }, wand: { - value: saves.w + value: saves.w, }, paralysis: { - value: saves.p + value: saves.p, }, breath: { - value: saves.b + value: saves.b, }, spell: { - value: saves.s - } - } + value: saves.s, + }, + }, }); } @@ -270,7 +270,7 @@ export class OseActor extends Actor { rollHitDice(options = {}) { const label = game.i18n.localize(`OSE.roll.hd`); const rollParts = [this.data.data.hp.hd]; - if (this.data.type == 'character') { + if (this.data.type == "character") { rollParts.push(this.data.data.scores.con.mod); } @@ -436,6 +436,7 @@ export class OseActor extends Actor { rollData: { type: "attack", thac0: thac0, + save: attData.save, weapon: { parts: dmgParts, }, @@ -522,7 +523,7 @@ export class OseActor extends Actor { value: totalWeight, }; - if (data.config.movementAuto && option != 'disabled') { + if (data.config.movementAuto && option != "disabled") { this._calculateMovement(); } } @@ -545,7 +546,7 @@ export class OseActor extends Actor { data.movement.base = 120; } } else if (option == "basic") { - const armors = this.data.items.filter(i => i.type == "armor"); + const armors = this.data.items.filter((i) => i.type == "armor"); let heaviest = 0; armors.forEach((a) => { if (a.data.equipped) { @@ -580,7 +581,9 @@ export class OseActor extends Actor { const data = this.data.data; // Compute treasure let total = 0; - let treasure = this.data.items.filter(i => (i.type == "item" && i.data.treasure)) + let treasure = this.data.items.filter( + (i) => i.type == "item" && i.data.treasure + ); treasure.forEach((item) => { total += item.data.quantity.value * item.data.cost; }); diff --git a/src/module/dice.js b/src/module/dice.js index 8b003bf..008214f 100644 --- a/src/module/dice.js +++ b/src/module/dice.js @@ -165,6 +165,7 @@ export class OseDice { title: title, flavor: flavor, data: data, + config: CONFIG.OSE, }; // Optionally include a situational bonus diff --git a/src/module/item/entity.js b/src/module/item/entity.js index 1fb576b..2ccdf71 100644 --- a/src/module/item/entity.js +++ b/src/module/item/entity.js @@ -4,7 +4,6 @@ import { OseDice } from "../dice.js"; * Override and extend the basic :class:`Item` implementation */ export class OseItem extends Item { - /* -------------------------------------------- */ /* Data Preparation */ /* -------------------------------------------- */ @@ -82,6 +81,7 @@ export class OseItem extends Item { this.actor.rollAttack( { type: "melee", + save: this.data.data.save, label: this.name, dmg: this.data.data.damage, bonus: data.bonus, @@ -98,6 +98,7 @@ export class OseItem extends Item { { type: "missile", label: this.name, + save: this.data.data.save, dmg: this.data.data.damage, }, options @@ -114,7 +115,13 @@ export class OseItem extends Item { type = "melee"; } this.actor.rollAttack( - { type: type, label: this.name, dmg: data.damage, bonus: data.bonus }, + { + type: type, + label: this.name, + save: data.save, + dmg: data.damage, + bonus: data.bonus, + }, options ); @@ -166,29 +173,42 @@ export class OseItem extends Item { } getTags() { - let formatTag = (tag) => { + let formatTag = (tag, icon) => { if (!tag) return ""; - return `