Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions icons/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The dnd5e system for Foundry Virtual Tabletop includes icon artwork licensed fro
/svg/actors/group.svg - "Tattered banner" by Lorc under CC BY 3.0
/svg/actors/npc.svg - "Spiked dragon head" by Delapouite under CC BY 3.0
/svg/actors/vehicle.svg - "Ship's wheel" by Delapouite under CC BY 3.0
/svg/behaviors/apply-active-effect.svg - "Aura" by Lorc under CC BY 3.0
/svg/behaviors/difficult-terrain.svg - "Falling rocks" by Delapouite under CC BY 3.0
/svg/damage/acid.svg - "Fizzling flask" by Lorc under CC BY 3.0
/svg/damage/all.svg - "Triple plier" by Lorc under CC BY 3.0
Expand Down
6 changes: 6 additions & 0 deletions icons/svg/behaviors/apply-active-effect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3610,6 +3610,14 @@
"DND5E.RecoveryFormula": "Recovery Formula",

"DND5E.REGIONBEHAVIORS": {
"APPLYACTIVEEFFECT": {
"FIELDS": {
"effects": {
"hint": "The effects that are applied to Tokens within the area of effect.",
"label": "Effects"
}
}
},
"DIFFICULTTERRAIN": {
"FIELDS": {
"ignoredDispositions": {
Expand Down
5 changes: 5 additions & 0 deletions module/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,11 @@ preLocalize("activityActivationTypes", { key: "label" });
* @enum {ActivityBehaviorConfiguration}
*/
DND5E.activityBehaviorTypes = {
appylActiveEffect: {
label: "TYPES.RegionBehavior.applyActiveEffect",
icon: "systems/dnd5e/icons/svg/behaviors/apply-active-effect.svg",
model: regionBehaviors.ApplyActiveEffectActivityBehavior
},
difficultTerrain: {
label: "TYPES.RegionBehavior.dnd5e.difficultTerrain",
icon: "systems/dnd5e/icons/svg/behaviors/difficult-terrain.svg",
Expand Down
1 change: 1 addition & 0 deletions module/data/region-behavior/_module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export {
DifficultTerrainRegionBehaviorType,
RotateAreaRegionBehaviorType
};
export * from "./apply-active-effect.mjs";
export {default as BaseActivityBehavior} from "./base-activity-behavior.mjs";

export const config = {
Expand Down
7 changes: 7 additions & 0 deletions module/data/region-behavior/_types.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* @typedef ApplyActiveEffectActivityBehaviorData
* @property {Set<string>} effects UUIDs of effects to apply.
*/

/* -------------------------------------------- */

/**
* @typedef DifficultTerrainRegionBehaviorSystemData
* @property {boolean} magical This difficult terrain is caused by magic.
Expand Down
42 changes: 42 additions & 0 deletions module/data/region-behavior/apply-active-effect.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import BaseActivityBehavior from "./base-activity-behavior.mjs";

const { DocumentUUIDField, SetField } = foundry.data.fields;

/**
* @import { ApplyActiveEffectActivityBehaviorData } from "./_types.mjs";
*/

/**
* Data model representing the difficult terrain activity behavior configuration.
* @extends {foundry.abstract.DataModel<ApplyActiveEffectActivityBehaviorData>}
* @mixes ApplyActiveEffectActivityBehaviorData
*/
export class ApplyActiveEffectActivityBehavior extends BaseActivityBehavior {

/** @override */
static LOCALIZATION_PREFIXES = ["DND5E.REGIONBEHAVIORS.APPLYACTIVEEFFECT"];

/* -------------------------------------------- */

/** @override */
static defineSchema() {
return {
effects: new SetField(new DocumentUUIDField())
};
}

/* -------------------------------------------- */
/* Methods */
/* -------------------------------------------- */

/** @override */
createBehaviorData(activity, options={}) {
return {
system: {
effects: this.effects
},
type: "applyActiveEffect"
};
}

}