daggerheart/module/data/action/effectAction.mjs
Dapoulp 0632a8c6bb
Refactor/actions v2 (#402)
* Action Refactor Part #1

* Fixed Weapon/Armor features. Fixed Feature actions

* f

* Action Refactor Part #2

* Fixes

* Remove ActionsField from Companion

* Fixes

* Localization fix

* BaseDataItem hasActions false

---------

Co-authored-by: WBHarry <williambjrklund@gmail.com>
2025-07-25 01:10:49 +02:00

18 lines
547 B
JavaScript

import DHBaseAction from './baseAction.mjs';
export default class DHEffectAction extends DHBaseAction {
static extraSchemas = [...super.extraSchemas, 'effects', 'target'];
async trigger(event, data) {
if(this.effects.length) {
const cls = getDocumentClass('ChatMessage'),
msg = {
type: 'applyEffect',
user: game.user.id,
system: data
};
return await cls.create(msg);
} else this.toChat(this.id);
}
}