diff --git a/README.md b/README.md index b4d2404..01b1d53 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ The automation detects relevant feats and effects that affect the creatures sens - Is not restricted by walls or blocked by darkness sources. - Configured automatically for NPC actors that have the `Life Sense`[\*](#translations) feat. - **Light Perception** - - Detects tokens, notes, and door controls that are illuminated a light source. + - Detects tokens, notes, and door controls that are illuminated a light source or are _burning_. - Cannot detect actors that are _burrowing_, _ethereal_ (from the the material plane unless the `Etherealness`[\*](#translations) _(Monster Feature, e.g. SRD / MM 147)_ NPC feat says otherwise), or _invisible_. - Disabled while _blinded_, _burrowing_, _defeated_ (_dead_), _petrified_, _sleeping_, or _unconscious_. - Is restricted by sight-blocking walls and is blocked by darkness sources. diff --git a/module.json b/module.json index 1a3ef87..a535395 100644 --- a/module.json +++ b/module.json @@ -8,7 +8,7 @@ "email": "dev7355608@gmail.com" } ], - "version": "2.4.1", + "version": "2.4.2", "compatibility": { "minimum": "12", "verified": "12" @@ -60,8 +60,8 @@ }, "url": "https://github.com/dev7355608/vision-5e", "manifest": "https://github.com/dev7355608/vision-5e/releases/latest/download/module.json", - "download": "https://github.com/dev7355608/vision-5e/releases/download/v2.4.1/module.zip", - "changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v2.4.1", + "download": "https://github.com/dev7355608/vision-5e/releases/download/v2.4.2/module.zip", + "changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v2.4.2", "bugs": "https://github.com/dev7355608/vision-5e/issues", "readme": "https://raw.githubusercontent.com/dev7355608/vision-5e/main/README.md", "license": "https://raw.githubusercontent.com/dev7355608/vision-5e/main/LICENSE" diff --git a/scripts/detection-modes/light-perception.mjs b/scripts/detection-modes/light-perception.mjs index d092048..8ba56df 100644 --- a/scripts/detection-modes/light-perception.mjs +++ b/scripts/detection-modes/light-perception.mjs @@ -15,8 +15,9 @@ export default class DetectionModeLightPerception extends DetectionMode { } /** @override */ - static getDetectionFilter(visionSource) { - if (visionSource?.visionMode.perceivesLight) { + static getDetectionFilter(visionSource, object) { + if (visionSource?.visionMode.perceivesLight && (!object.document.hasStatusEffect(CONFIG.specialStatusEffects.BURNING) + || canvas.effects.testInsideLight(object.center, object.document.elevation))) { return; } @@ -52,6 +53,7 @@ export default class DetectionModeLightPerception extends DetectionMode { /** @override */ _testPoint(visionSource, mode, target, test) { return super._testPoint(visionSource, mode, target, test) - && canvas.effects.testInsideLight(test.point, test.elevation); + && (canvas.effects.testInsideLight(test.point, test.elevation) + || target instanceof Token && target.document.hasStatusEffect(CONFIG.specialStatusEffects.BURNING)); } } diff --git a/scripts/main.mjs b/scripts/main.mjs index 15738eb..05f3809 100644 --- a/scripts/main.mjs +++ b/scripts/main.mjs @@ -56,6 +56,7 @@ Hooks.once("init", () => { CONFIG.specialStatusEffects.BLEEDING = "bleeding"; CONFIG.specialStatusEffects.BLIND_SENSES = "blindSenses"; CONFIG.specialStatusEffects.BLINDED = "blinded"; + CONFIG.specialStatusEffects.BURNING = "burning"; CONFIG.specialStatusEffects.BURROWING = "burrowing"; CONFIG.specialStatusEffects.DEAFENED = "deafened"; CONFIG.specialStatusEffects.DEVILS_SIGHT = "devilsSight";