Added the ability for effects to automatically activate/deactivate depending on range between tokens

This commit is contained in:
WBHarry 2025-07-29 14:50:14 +02:00
parent 4defe69c21
commit b80f598625
13 changed files with 218 additions and 30 deletions

View file

@ -0,0 +1,33 @@
export default class BaseEffect extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
rangeDependence: new fields.SchemaField({
enabled: new fields.BooleanField({
required: true,
initial: false,
label: 'DAGGERHEART.GENERAL.enabled'
}),
type: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.compareOperator,
initial: CONFIG.DH.GENERAL.compareOperator.lessThanEqual.id,
label: 'DAGGERHEART.GENERAL.type'
}),
target: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.otherTargetTypes,
initial: CONFIG.DH.GENERAL.otherTargetTypes.hostile.id,
label: 'DAGGERHEART.GENERAL.Target.single'
}),
range: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.range,
initial: CONFIG.DH.GENERAL.range.melee.id,
label: 'DAGGERHEART.GENERAL.range'
})
})
};
}
}