mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Feature] Active Effects toggle effects based in token distance (#452)
* Added the ability for effects to automatically activate/deactivate depending on range between tokens * Fixed to use Foundry's measuring instead. * .
This commit is contained in:
parent
18fac18df3
commit
46baef65a6
12 changed files with 162 additions and 29 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import BaseEffect from './baseEffect.mjs';
|
||||
import BeastformEffect from './beastformEffect.mjs';
|
||||
|
||||
export { BeastformEffect };
|
||||
export { BaseEffect, BeastformEffect };
|
||||
|
||||
export const config = {
|
||||
base: BaseEffect,
|
||||
beastform: BeastformEffect
|
||||
};
|
||||
|
|
|
|||
33
module/data/activeEffect/baseEffect.mjs
Normal file
33
module/data/activeEffect/baseEffect.mjs
Normal 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.rangeInclusion,
|
||||
initial: CONFIG.DH.GENERAL.rangeInclusion.withinRange.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'
|
||||
})
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { updateActorTokens } from '../../helpers/utils.mjs';
|
||||
import BaseEffect from './baseEffect.mjs';
|
||||
|
||||
export default class BeastformEffect extends foundry.abstract.TypeDataModel {
|
||||
export default class BeastformEffect extends BaseEffect {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue