diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index f4835f34..0992350b 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -110,11 +110,6 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel return this._id; } - /** Returns true if the current user is the owner of the containing item */ - get isOwner() { - return this.item?.isOwner ?? true; - } - /** * Return Item the action is attached too. */ @@ -148,12 +143,6 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel : null; } - /** Returns true if the action is usable */ - get usable() { - const actor = this.actor; - return this.isOwner && actor?.type === 'character'; - } - static getRollType(parent) { return 'trait'; } diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index cc198dc4..72718c5e 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -108,8 +108,6 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { } get actionsList() { - // No actions on non-characters - if (this.actor && this.actor.type !== 'character') return []; return this.actions; } diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index 75e6dc8e..9335037c 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -99,9 +99,7 @@ export default class DHWeapon extends AttachableItem { /* -------------------------------------------- */ get actionsList() { - // No actions on non-characters - if (this.actor && this.actor.type !== 'character') return []; - return [this.attack, ...super.actionsList]; + return [this.attack, ...this.actions]; } get customActions() { diff --git a/module/documents/item.mjs b/module/documents/item.mjs index 8ece56fa..a8b41b05 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -76,13 +76,6 @@ export default class DHItem extends foundry.documents.Item { return this.system.metadata.isInventoryItem ?? false; } - /** Returns true if the item can be used */ - get usable() { - const actor = this.actor; - const actionsList = this.system.actionsList; - return this.isOwner && actor?.type === 'character' && (actionsList?.size || actionsList?.length); - } - /** @inheritdoc */ static async createDialog(data = {}, createOptions = {}, options = {}) { const { folders, types, template, context = {}, ...dialogOptions } = options; diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index d76f2897..ed029475 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -25,11 +25,11 @@ Parameters: >
{{!-- Image --}} -
- {{#if item.usable}} + {{#if (or item.system.actionsList.size item.system.actionsList.length item.actionType)}} {{#if @root.isNPC}} d20 {{else}}