Use case: An enemy starts chasing the player when they come within 5 tiles. A guard only sees the player inside a vision cone. A sensor detects nearby bombs.
checkRange(source, range, target, eyes, blockRegion, exception)
source - Who is looking.
range - Detection radius in tiles (circular).
target - What to look for.
eyes - (Optional) Field of view in degrees.
blockRegion - (Optional) Region ID that blocks line of sight
exception - (Optional) Events with this notetag will be excluded from detection
Examples
checkRange(this, 5, player)This will return true if player is within 5 tiles from the enemy itself. (right side enemy)
checkRange(this, 7, player, 90)The enemy only detects the player within 7 tiles AND inside a 90° cone facing the enemy's current direction. (left side enemy)
checkRange(this, 7, player, 90, 10)
Now the player can hide behind anything painted with region 10, even inside the cone. It's like a wall feature.
