Files
Paradise/code/game/objects/empulse.dm
AffectedArc07 04ba5c1cc9 File standardisation (#13131)
* Adds the check components

* Adds in trailing newlines

* Converts all CRLF to LF

* Post merge EOF

* Post merge line endings

* Final commit
2020-03-17 18:08:51 -04:00

33 lines
1021 B
Plaintext

/proc/empulse(turf/epicenter, heavy_range, light_range, log=0, cause = null)
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] [cause ? "(Cause: [cause])": ""] [ADMIN_COORDJMP(epicenter)]</a>")
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] [cause ? "(Cause: [cause])" : ""] [COORD(epicenter)]")
if(heavy_range > 1)
new/obj/effect/temp_visual/emp/pulse(epicenter)
if(heavy_range > light_range)
light_range = heavy_range
for(var/mob/M in range(heavy_range, epicenter))
M << 'sound/effects/empulse.ogg'
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