Files
Paradise/code/game/objects/explosion.dm
vageyenaman@gmail.com b0e69dcd99 Bugfixes:
Fixed a boatload of runtime errors. There's so many I just completely forgot what they all were!

     Explosions / Singularities now do not gib people "one-by-one" as some people may have noticed. This looked absolutely weird.


Sounds:
     I was planning on making sounds become all distorted and whatnot if you were "high", but there were some problems. I've instead just settled with making deaf people not being able to hear non-ambient sounds at all.






git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1941 316c924e-a436-60f5-8080-3fe189b3f50e
2011-07-27 20:57:21 +00:00

73 lines
2.2 KiB
Plaintext

var/roundExplosions = 1
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
if(!epicenter) return
spawn(0)
defer_powernet_rebuild = 1
if (!istype(epicenter, /turf))
epicenter = get_turf(epicenter.loc)
playsound(epicenter.loc, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
playsound(epicenter.loc, "explosion", 100, 1, round(devastation_range,1) )
if (adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
if(heavy_impact_range > 1)
var/datum/effects/system/explosion/E = new/datum/effects/system/explosion()
E.set_up(epicenter)
E.start()
var/list/exTurfs = list()
if(roundExplosions)
for(var/turf/T in circlerange(epicenter,light_impact_range))
exTurfs += T
else
for(var/turf/T in range(light_impact_range, epicenter))
exTurfs += T
for(var/turf/T in exTurfs)
var/distance = 0
if(roundExplosions)
distance = get_dist_euclidian(epicenter, T)
else
distance = get_dist(epicenter, T)
if(distance < 0)
distance = 0
if(distance < devastation_range)
for(var/atom/object in T.contents)
spawn()
object.ex_act(1)
if(prob(5))
T.ex_act(2)
else
T.ex_act(1)
else if(distance < heavy_impact_range)
for(var/atom/object in T.contents)
spawn()
object.ex_act(2)
T.ex_act(2)
else if (distance == heavy_impact_range)
for(var/atom/object in T.contents)
object.ex_act(2)
if(prob(15) && devastation_range > 2 && heavy_impact_range > 2)
secondaryexplosion(T, 1)
else
T.ex_act(2)
else if(distance <= light_impact_range)
for(var/atom/object in T.contents)
spawn()
object.ex_act(3)
T.ex_act(3)
for(var/mob/living/carbon/mob in T)
flick("flash", mob:flash)
sleep(3)
defer_powernet_rebuild = 0
return 1
proc/secondaryexplosion(turf/epicenter, range)
for(var/turf/tile in range(range, epicenter))
tile.ex_act(2)