-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
382697c
commit dc48651
Showing
8 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"compatibility": { | ||
"minimum": "11.299", | ||
"verified": "11.304" | ||
|
@@ -47,8 +47,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/v1.5.1/module.zip", | ||
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.5.1", | ||
"download": "https://github.com/dev7355608/vision-5e/releases/download/v1.6.0/module.zip", | ||
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.6.0", | ||
"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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* The detection mode for Divine Sense. | ||
*/ | ||
export class DetectionModeDivineSense extends DetectionMode { | ||
sourceType = "sight"; | ||
wallDirectionMode = PointSourcePolygon.WALL_DIRECTION_MODES.NORMAL; | ||
useThreshold = false; | ||
imprecise = true; | ||
important = true; | ||
priority = -3000; | ||
|
||
constructor() { | ||
super({ | ||
id: "divineSense", | ||
label: "VISION5E.DivineSense", | ||
type: DetectionMode.DETECTION_TYPES.OTHER, | ||
walls: true, | ||
angle: false | ||
}); | ||
} | ||
|
||
/** @override */ | ||
static getDetectionFilter() { | ||
return this._detectionFilter ??= GlowOverlayFilter.create({ | ||
glowColor: [1, 1, 0, 1] | ||
}); | ||
} | ||
|
||
/** @override */ | ||
_canDetect(visionSource, target) { | ||
if (!(target instanceof Token)) return false; | ||
if (target.document.hasStatusEffect(CONFIG.specialStatusEffects.BURROW)) return true; | ||
const actor = target.actor; | ||
if (!(actor && actor.type === "npc")) return false; | ||
const type = actor.system.details.type.value; | ||
return type === "celestial" | ||
|| type === "fiend" | ||
|| type === "undead"; | ||
} | ||
|
||
/** @override */ | ||
_testLOS(visionSource, mode, target, test) { | ||
if (!this._testAngle(visionSource, mode, target, test)) return false; | ||
if (!this.walls) return true; | ||
return !CONFIG.Canvas.polygonBackends.sight.testCollision( | ||
{ x: visionSource.x, y: visionSource.y }, | ||
test.point, | ||
{ | ||
type: "sight", | ||
mode: "any", | ||
source: visionSource, | ||
wallDirectionMode: this.wallDirectionMode, | ||
useThreshold: this.useThreshold | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { DetectColorationVisionShader } from "./shaders/detect.mjs"; | ||
import { VoidBackgroundVisionShader, VoidIlluminationVisionShader, VoidSamplerShader } from "./shaders/void.mjs"; | ||
|
||
/** | ||
* The vision mode for Divine Sense. | ||
*/ | ||
export class VisionModeDivineSense extends VisionMode { | ||
detectionMode = "divineSense" | ||
|
||
constructor() { | ||
super({ | ||
id: "divineSense", | ||
label: "VISION5E.DivineSense", | ||
canvas: { | ||
shader: VoidSamplerShader, | ||
uniforms: { contrast: 0, saturation: 0, exposure: 0 } | ||
}, | ||
lighting: { | ||
background: { visibility: VisionMode.LIGHTING_VISIBILITY.DISABLED }, | ||
illumination: { visibility: VisionMode.LIGHTING_VISIBILITY.DISABLED }, | ||
coloration: { visibility: VisionMode.LIGHTING_VISIBILITY.DISABLED } | ||
}, | ||
vision: { | ||
darkness: { adaptive: false }, | ||
defaults: { attenuation: 1, contrast: 0, saturation: 0, brightness: 0 }, | ||
background: { shader: VoidBackgroundVisionShader }, | ||
illumination: { shader: VoidIlluminationVisionShader }, | ||
coloration: { | ||
shader: DetectColorationVisionShader, | ||
uniforms: { colorDetection: [1, 1, 0] } | ||
} | ||
} | ||
}, { animated: true }); | ||
} | ||
} |