mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Schema definition for DHSummonAction
This commit is contained in:
parent
52b32a4d12
commit
84b28bd9c9
2 changed files with 11 additions and 3 deletions
|
|
@ -69,7 +69,8 @@
|
|||
},
|
||||
"summon": {
|
||||
"name": "Summon",
|
||||
"tooltip": "Create tokens in the scene."
|
||||
"tooltip": "Create tokens in the scene.",
|
||||
"error": "You do not have permission to summon tokens or there is no active scene."
|
||||
}
|
||||
},
|
||||
"Config": {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { ui } from '../../applications/_module.mjs';
|
||||
import DHBaseAction from './baseAction.mjs';
|
||||
|
||||
export default class DHSummonAction extends DHBaseAction {
|
||||
|
|
@ -5,12 +6,18 @@ export default class DHSummonAction extends DHBaseAction {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
documentUUID: new fields.DocumentUUIDField({ type: 'Actor' })
|
||||
tokenArray: new fields.ArrayField(new fields.SchemaField({
|
||||
actorUUID: new fields.DocumentUUIDField({ type: 'Actor', required: true }),
|
||||
count: new fields.NumberField({ required: true, default: 1, min:1 })
|
||||
}), { required: false })
|
||||
};
|
||||
}
|
||||
|
||||
async trigger(event, ...args) {
|
||||
if (!this.canSummon || !canvas.scene) return;
|
||||
if (!this.canSummon || !canvas.scene){
|
||||
ui.notifications.error(game.i18n.localize("DAGGERHEART.ACTIONS.TYPES.summon.error"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
get canSummon() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue