Now only targets cells that are not blocked by transparent walls etc. find_ray can't currently check for real visibility.
HGRNDCERM2W2A325DKKWPWP7ZJVBS4IPY6QIR4A4QA7KIZ7NHSSAC
T7CCGLOZ25B7BQKKGR6IA6LWBRKUWTXLTIRXUQ4YKQRVAA7AHZKQC
4NRM3KWVHQ46WAIF2OF33JUDVTR67ADIDXCOV2AB2R3QVUMWAG5AC
local FAILMAP = 'losfail.map'
local FAILMAP = 'rayfail.map'
local function test_losight_symmetry()
local function test_findray()
checks = checks + 1
if you.see_grid(px, py) then
if you.see_grid_no_trans(px, py) then
" although it's in view.")
" although it's in unobstructed view. (#" .. checks .. ")")
" although it's in unobstructed view. (#" ..
checks .. ")")
local function run_los_tests(depth, nlevels, tests_per_level)
local function run_findray_tests(depth, nlevels, tests_per_level)
crawl.mpr("Running LOS tests on " .. place)
crawl.mpr("Running find_ray tests on " .. place)
test_losight_symmetry()
test_findray()
run_los_tests(depth, 1, 10)
run_findray_tests(depth, 1, 10)
COORDS(a, 1, 2); COORDS(b, 3, 4);
COORDS(a, 1, 2);
COORDS(b, 3, 4);
GETCOORD(a, 1, 2, map_bounds); GETCOORD(b, 3, 4, map_bounds);
GETCOORD(a, 1, 2, map_bounds);
GETCOORD(b, 3, 4, map_bounds);
if (find_ray(a, b, false, *ray, 0, true))
if (find_ray(a, b, false, *ray))