mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 12:11:07 +01:00
[Feature] Trigger System (#1500)
* Initial * . * Added StrangePattern trigger * Set command codeblock to expandable * Added automation setting * Added ferocity trigger * Improved StrangePatterns trigger to handle multiple matches
This commit is contained in:
parent
0b343c9f52
commit
454507ba7b
20 changed files with 450 additions and 15 deletions
|
|
@ -2,5 +2,6 @@ export { ActionCollection } from './actionField.mjs';
|
|||
export { default as FormulaField } from './formulaField.mjs';
|
||||
export { default as ForeignDocumentUUIDField } from './foreignDocumentUUIDField.mjs';
|
||||
export { default as ForeignDocumentUUIDArrayField } from './foreignDocumentUUIDArrayField.mjs';
|
||||
export { default as TriggerField } from './triggerField.mjs';
|
||||
export { default as MappingField } from './mappingField.mjs';
|
||||
export * as ActionFields from './action/_module.mjs';
|
||||
|
|
|
|||
24
module/data/fields/triggerField.mjs
Normal file
24
module/data/fields/triggerField.mjs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
export default class TriggerField extends foundry.data.fields.SchemaField {
|
||||
constructor(context) {
|
||||
super(
|
||||
{
|
||||
trigger: new foundry.data.fields.StringField({
|
||||
nullable: false,
|
||||
blank: false,
|
||||
initial: CONFIG.DH.TRIGGER.triggers.dualityRoll.id,
|
||||
choices: CONFIG.DH.TRIGGER.triggers,
|
||||
label: 'DAGGERHEART.CONFIG.Triggers.triggerType'
|
||||
}),
|
||||
triggeringActorType: new foundry.data.fields.StringField({
|
||||
nullable: false,
|
||||
blank: false,
|
||||
initial: CONFIG.DH.TRIGGER.triggerActorTargetType.any.id,
|
||||
choices: CONFIG.DH.TRIGGER.triggerActorTargetType,
|
||||
label: 'DAGGERHEART.CONFIG.Triggers.triggeringActorType'
|
||||
}),
|
||||
command: new foundry.data.fields.JavaScriptField({ async: true })
|
||||
},
|
||||
context
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue