mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
f
This commit is contained in:
parent
17dd9b1f61
commit
479e147640
25 changed files with 339 additions and 289 deletions
7
module/data/fields/action/_module.mjs
Normal file
7
module/data/fields/action/_module.mjs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export { default as CostField } from './costField.mjs';
|
||||
export { default as UsesField } from './usesField.mjs';
|
||||
export { default as RangeField } from './rangeField.mjs';
|
||||
export { default as TargetField } from './targetField.mjs';
|
||||
export { default as EffectField } from './effectField.mjs';
|
||||
export { default as SaveField } from './saveField.mjs';
|
||||
export { default as BeastformField } from './beastformField.mjs';
|
||||
12
module/data/fields/action/beastformField.mjs
Normal file
12
module/data/fields/action/beastformField.mjs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class BeastformField extends fields.SchemaField {
|
||||
constructor(options={}, context={}) {
|
||||
const beastformFields = {
|
||||
tierAccess: new fields.SchemaField({
|
||||
exact: new fields.NumberField({ integer: true, nullable: true, initial: null })
|
||||
})
|
||||
};
|
||||
super(beastformFields, options, context);
|
||||
}
|
||||
}
|
||||
18
module/data/fields/action/costField.mjs
Normal file
18
module/data/fields/action/costField.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class CostField extends fields.ArrayField {
|
||||
constructor(options={}, context={}) {
|
||||
const element = new fields.SchemaField({
|
||||
key: new fields.StringField({
|
||||
nullable: false,
|
||||
required: true,
|
||||
initial: 'hope'
|
||||
}),
|
||||
keyIsID: new fields.BooleanField(),
|
||||
value: new fields.NumberField({ nullable: true, initial: 1 }),
|
||||
scalable: new fields.BooleanField({ initial: false }),
|
||||
step: new fields.NumberField({ nullable: true, initial: null })
|
||||
});
|
||||
super(element, options, context);
|
||||
}
|
||||
}
|
||||
0
module/data/fields/action/damageField.mjs
Normal file
0
module/data/fields/action/damageField.mjs
Normal file
11
module/data/fields/action/effectField.mjs
Normal file
11
module/data/fields/action/effectField.mjs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class EffectField extends fields.ArrayField {
|
||||
constructor(options={}, context={}) {
|
||||
const element = new fields.SchemaField({
|
||||
_id: new fields.DocumentIdField(),
|
||||
onSave: new fields.BooleanField({ initial: false })
|
||||
});
|
||||
super(element, options, context);
|
||||
}
|
||||
}
|
||||
0
module/data/fields/action/healingField.mjs
Normal file
0
module/data/fields/action/healingField.mjs
Normal file
12
module/data/fields/action/rangeField.mjs
Normal file
12
module/data/fields/action/rangeField.mjs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class RangeField extends fields.StringField {
|
||||
constructor(context={}) {
|
||||
const options = {
|
||||
choices: CONFIG.DH.GENERAL.range,
|
||||
required: false,
|
||||
blank: true
|
||||
};
|
||||
super(options, context);
|
||||
}
|
||||
}
|
||||
0
module/data/fields/action/rollField.mjs
Normal file
0
module/data/fields/action/rollField.mjs
Normal file
19
module/data/fields/action/saveField.mjs
Normal file
19
module/data/fields/action/saveField.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class SaveField extends fields.SchemaField {
|
||||
constructor(options={}, context={}) {
|
||||
const saveFields = {
|
||||
trait: new fields.StringField({
|
||||
nullable: true,
|
||||
initial: null,
|
||||
choices: CONFIG.DH.ACTOR.abilities
|
||||
}),
|
||||
difficulty: new fields.NumberField({ nullable: true, initial: 10, integer: true, min: 0 }),
|
||||
damageMod: new fields.StringField({
|
||||
initial: CONFIG.DH.ACTIONS.damageOnSave.none.id,
|
||||
choices: CONFIG.DH.ACTIONS.damageOnSave
|
||||
})
|
||||
};
|
||||
super(saveFields, options, context);
|
||||
}
|
||||
}
|
||||
16
module/data/fields/action/targetField.mjs
Normal file
16
module/data/fields/action/targetField.mjs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class TargetField extends fields.SchemaField {
|
||||
constructor(options={}, context={}) {
|
||||
const targetFields = {
|
||||
type: new fields.StringField({
|
||||
choices: CONFIG.DH.ACTIONS.targetTypes,
|
||||
initial: CONFIG.DH.ACTIONS.targetTypes.any.id,
|
||||
nullable: true,
|
||||
initial: null
|
||||
}),
|
||||
amount: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 })
|
||||
};
|
||||
super(targetFields, options, context);
|
||||
}
|
||||
}
|
||||
16
module/data/fields/action/usesField.mjs
Normal file
16
module/data/fields/action/usesField.mjs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class UsesField extends fields.SchemaField {
|
||||
constructor(options={}, context={}) {
|
||||
const usesFields = {
|
||||
value: new fields.NumberField({ nullable: true, initial: null }),
|
||||
max: new fields.NumberField({ nullable: true, initial: null }),
|
||||
recovery: new fields.StringField({
|
||||
choices: CONFIG.DH.GENERAL.refreshTypes,
|
||||
initial: null,
|
||||
nullable: true
|
||||
})
|
||||
};
|
||||
super(usesFields, options, context);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue