Files
CHOMPStation2/code/game/objects/empulse.dm
baloh.matevz e8c6b08419 - Object tree grouped a bit more.
Two new categories were made: station_objects and effects. station_objects, which I'm sure someone will want renamed to 'structures' contains the objects which don't need process() or power code.

Effects contains objects which are either landmarks, triggers, spawners or decal.

Screenshot:
http://www.kamletos.si/new%20object%20tree.PNG

I didn't notice any bugs, but with a revision editing 276 files of byond code, you never know.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2323 316c924e-a436-60f5-8080-3fe189b3f50e
2011-10-03 06:54:28 +00:00

36 lines
997 B
Plaintext

proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(!epicenter) return
if(!istype(epicenter, /turf))
epicenter = get_turf(epicenter.loc)
if(log)
message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
if(heavy_range > 1)
var/obj/effects/overlay/pulse = new/obj/effects/overlay ( epicenter )
pulse.icon = 'effects.dmi'
pulse.icon_state = "emppulse"
pulse.name = "emp pulse"
pulse.anchored = 1
spawn(20)
del(pulse)
if(heavy_range > light_range)
light_range = heavy_range
for(var/atom/T in range(light_range, epicenter))
var/distance = get_dist(epicenter, T)
if(distance < 0)
distance = 0
if(distance < heavy_range)
T.emp_act(1)
else if(distance == heavy_range)
if(prob(50))
T.emp_act(1)
else
T.emp_act(2)
else if(distance <= light_range)
T.emp_act(2)
return 1