mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
get_areas_in_range()
nospace wormhole
This commit is contained in:
@@ -1175,6 +1175,19 @@ B --><-- A
|
||||
|
||||
return L
|
||||
|
||||
/proc/get_areas_in_range(dist=0, atom/center=usr)
|
||||
if(!dist)
|
||||
var/turf/T = get_turf(center)
|
||||
return T ? list(T.loc) : list()
|
||||
if(!center)
|
||||
return list()
|
||||
|
||||
var/list/turfs = RANGE_TURFS(dist, center)
|
||||
var/list/areas = list()
|
||||
for(var/V in turfs)
|
||||
var/turf/T = V
|
||||
areas |= T.loc
|
||||
return areas
|
||||
|
||||
/atom/proc/contains(var/atom/A)
|
||||
if(!A)
|
||||
|
||||
@@ -87,10 +87,9 @@ STI KALY - blind
|
||||
|
||||
|
||||
/datum/disease/wizarditis/proc/teleport()
|
||||
var/list/theareas = list()
|
||||
for(var/area/AR in ultra_range(80, affected_mob, 1))
|
||||
if(theareas.Find(AR) || istype(AR,/area/space)) continue
|
||||
theareas += AR
|
||||
var/list/theareas = get_areas_in_range(80, affected_mob)
|
||||
for(var/area/space/S in theareas)
|
||||
theareas -= S
|
||||
|
||||
if(!theareas||!theareas.len)
|
||||
return
|
||||
|
||||
@@ -35,11 +35,9 @@
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target)
|
||||
if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) return
|
||||
var/list/theareas = list()
|
||||
for(var/area/AR in ultra_range(100, chassis, 1))
|
||||
if(AR in theareas) continue
|
||||
theareas += AR
|
||||
if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM)
|
||||
return
|
||||
var/list/theareas = get_areas_in_range(100, chassis)
|
||||
if(!theareas.len)
|
||||
return
|
||||
var/area/thearea = pick(theareas)
|
||||
|
||||
Reference in New Issue
Block a user