Files
Paradise/code/game/objects/empulse.dm
morikou@gmail.com a697428db7 Y2K update:
- New "empulse" proc. Works similarly to "explode" proc. It triggers the "emp_act" proc on everything within range. emp_act are effects similar or identical to the effects of the emp grenade. Any major changes to emp effects listed below. Note: EMPs now affect items in your backpack.
- New admin right-click command: EM Pulse. You can create an empulse at the desired location with a size you choose. Similar to Explosion command.
- disable device spell, emp grenade, and disable tech rune all use empulse now.
- New "disable device" spell datum added.
- EMP'ed gas canisters no longer drain the station of power.
- When a borg is EMP'ed, all objects in their module get their emp_act proc triggered.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1018 316c924e-a436-60f5-8080-3fe189b3f50e
2011-02-11 03:01:12 +00:00

34 lines
917 B
Plaintext

proc/empulse(turf/epicenter, heavy_range, light_range)
if(!epicenter) return
message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
if (!istype(epicenter, /turf))
epicenter = epicenter.loc
return empulse(epicenter, heavy_range, light_range)
if(heavy_range > 1)
var/obj/overlay/pulse = new/obj/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