diff --git a/system/scripts/dice/roll.js b/system/scripts/dice/roll.js index f056fe9..57fb258 100644 --- a/system/scripts/dice/roll.js +++ b/system/scripts/dice/roll.js @@ -187,6 +187,12 @@ export class RollL5r5e extends Roll { * @override */ get total() { + // Return null to trigger the L5R template. + // This beak inline roll, but as we need RnK to really resolve the roll, this is acceptable... + if (this.l5r5e.dicesTypes.l5r) { + return null; + } + if (!this._evaluated) { return null; } @@ -199,15 +205,15 @@ export class RollL5r5e extends Roll { } // Add L5R summary - if (this.l5r5e.dicesTypes.l5r) { - const summary = this.l5r5e.summary; - total += - (this.l5r5e.dicesTypes.std ? " | " : "") + - ["success", "explosive", "opportunity", "strife"] - .map((props) => (summary[props] > 0 ? ` ${summary[props]}` : null)) - .filter((c) => !!c) - .join(" | "); - } + // if (this.l5r5e.dicesTypes.l5r) { + // const summary = this.l5r5e.summary; + // total += + // (this.l5r5e.dicesTypes.std ? " | " : "") + + // ["success", "explosive", "opportunity", "strife"] + // .map((props) => (summary[props] > 0 ? ` ${summary[props]}` : null)) + // .filter((c) => !!c) + // .join(" | "); + // } return total; } @@ -356,11 +362,10 @@ export class RollL5r5e extends Roll { messageData.roll = this; // Either create the message or just return the chat data - const message = await ChatMessage.implementation.create(messageData, { + return ChatMessage.implementation.create(messageData, { rollMode: rMode, temporary: !create, }); - return message; } /** @override */ diff --git a/system/scripts/item.js b/system/scripts/item.js index 3c10adb..18fad37 100644 --- a/system/scripts/item.js +++ b/system/scripts/item.js @@ -21,16 +21,18 @@ export class ItemL5r5e extends Item { * @memberof ClientDocumentMixin# */ get uuid() { - const uuid = []; const parents = this.system.parent_id; - - if (parents?.item_id) { - if (parents?.actor_id) { - uuid.push(`Actor.${parents.actor_id}`); - } - uuid.push(`Item.${parents.item_id}`); + if (!parents?.item_id) { + return super.uuid; } - uuid.push(super.uuid); + + // Embedded item + const uuid = []; + if (parents?.actor_id) { + uuid.push(`Actor.${parents.actor_id}`); + } + uuid.push(`Item.${parents.item_id}`); + uuid.push(`Item.${this._id}`); return uuid.join("."); }