ID:152306
 
obj
misc
icon = 'misc.dmi'
selected
icon_state = "selected"
possible_move
icon_state = "possible move"
mouse_opacity = 2
layer = MOB_LAYER + 1
var
atom/click_wait = null
clicked = 0
Click()
if(click_wait == usr)
clicked = 1
target
icon_state = "target"
atom
var
move_on = 1
turf
icon = 'tiles.dmi'
icon_state = "black"
proc
possible(atom/center, range)
var
dx = x - center.x
dy = y - center.y
if(((dx * dx) + (dy * dy)) > (range * range)) return
for(var/atom/a in src) if(istype(a, /mob)) return
if(density || !move_on) return
return 1
world
mob = /mob/player/magic_user
mob
player
icon = 'chars.dmi'
magic_user
icon_state = "magic user"
verb
test()
var/turf/move = select_move(3, 60)
if(move) Move(move)
else world << "Times up!"
proc
select_move(range, tick_limit)
var
list/moves = list()
turf/selected_move = null
turf/cur_loc = loc
for(var/turf/t in range(range, src))
if(t.possible(src, range))
var/obj/misc/possible_move/p = new(t)
p.click_wait = src
moves += p
while(tick_limit && (cur_loc == loc))
sleep(1)
for(var/obj/misc/possible_move/p in moves)
if(p.clicked)
selected_move = p.loc
tick_limit = 1
tick_limit --
for(var/obj/misc/possible_move/p in moves) del(p)
return selected_move

The select_move proc highlights possible moves in the specified range, and halts processing until either the time limit is up, returning null, or until the player clicks one of the possible tiles, returning that tile.

Do you think I'm going about it in a good way?
I would do.
proc
circle(atom/center, radius)
var/list/circle = new
var/dx
var/dy
var/dist
for(var/turf/T in range(center,radius))
dx = abs(T.x - center.x)
dy = abs(T.y - center.y)
dist = sqrt(dx * dx + dy * dy)
if(dist >= radius && !T.dedsity)
circle += T
return circle
// and in select move do
for(var/turf/T in circle(src,range))
possible += T