mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
@@ -1089,6 +1089,25 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/teleport_radius(var/range)
|
||||
var/list/best_options = list()
|
||||
var/list/backup_options = list()
|
||||
var/turf/picked
|
||||
for(var/turf/T in orange(range, src))
|
||||
if(T.x>world.maxx-6 || T.x<6 || T.y>world.maxy-6 || T.y<6) //Conditions we will NEVER accept: too close to edge
|
||||
continue
|
||||
if(istype(T,/turf/space) || T.density) //Only as a fallback: dense turf or space
|
||||
backup_options += T
|
||||
continue
|
||||
best_options += T
|
||||
if(best_options.len)
|
||||
picked = pick(best_options)
|
||||
else if(backup_options.len)
|
||||
picked = pick(backup_options)
|
||||
else
|
||||
return
|
||||
forceMove(picked)
|
||||
|
||||
// -- trackers
|
||||
|
||||
/atom/movable/proc/add_tracker(var/datum/tracker/T)
|
||||
|
||||
@@ -513,25 +513,9 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/storage/lockbox/advanced/proc/react()
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/T in orange(6, loc))
|
||||
if(istype(T,/turf/space))
|
||||
continue
|
||||
if(T.density)
|
||||
continue
|
||||
if(T.x>world.maxx-6 || T.x<6)
|
||||
continue
|
||||
if(T.y>world.maxy-6 || T.y<6)
|
||||
continue
|
||||
turfs += T
|
||||
if(!turfs.len)
|
||||
turfs += pick(/turf in orange(6))
|
||||
var/turf/picked = pick(turfs)
|
||||
if(!isturf(picked))
|
||||
return
|
||||
teleport_radius(6)
|
||||
visible_message("<span class='danger'>\The [src] displaces itself with its reactive teleport system!</span>")
|
||||
playsound(src, 'sound/effects/teleport.ogg', 30, 1)
|
||||
forceMove(picked)
|
||||
playsound(src, 'sound/effects/teleport.ogg', 50, 1)
|
||||
|
||||
/obj/item/weapon/storage/lockbox/advanced/energyshotgun/New()
|
||||
..()
|
||||
|
||||
@@ -296,29 +296,9 @@
|
||||
if(L.wear_suit != src) //Not worn
|
||||
return 0 //Don't do anything
|
||||
|
||||
var/list/turfs = new/list()
|
||||
|
||||
for(var/turf/T in orange(6, loc))
|
||||
if(istype(T,/turf/space))
|
||||
continue
|
||||
if(T.density)
|
||||
continue
|
||||
if(T.x>world.maxx-6 || T.x<6)
|
||||
continue
|
||||
if(T.y>world.maxy-6 || T.y<6)
|
||||
continue
|
||||
turfs += T
|
||||
if(!turfs.len)
|
||||
turfs += pick(/turf in orange(6))
|
||||
var/turf/picked = pick(turfs)
|
||||
if(!isturf(picked))
|
||||
return
|
||||
|
||||
L.teleport_radius(6)
|
||||
L.visible_message("<span class='danger'>The reactive teleport system flings [L] clear of \the [blocked]!</span>", "<span class='notice'>The reactive teleport system flings you clear of \the [blocked].</span>")
|
||||
|
||||
playsound(L, 'sound/effects/teleport.ogg', 30, 1)
|
||||
|
||||
L.forceMove(picked)
|
||||
playsound(L, 'sound/effects/teleport.ogg', 50, 1)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user