mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-20 23:21:20 +00:00
Adding a reporting function, available in the debug menu, which tracks some crude statistics for the current round and attempts to estimate the round's current level of stuff happening (or lack thereof) for more consistent and focused badminnery. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2329 316c924e-a436-60f5-8080-3fe189b3f50e
87 lines
2.5 KiB
Plaintext
87 lines
2.5 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)
|
|
if(defer_powernet_rebuild != 2)
|
|
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] ")
|
|
|
|
tension_master.explosion()
|
|
|
|
if(heavy_impact_range > 1)
|
|
var/datum/effect/system/explosion/E = new/datum/effect/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()
|
|
if(object)
|
|
object.ex_act(1)
|
|
if(prob(5))
|
|
if(T)
|
|
T.ex_act(2)
|
|
else
|
|
if(T)
|
|
T.ex_act(1)
|
|
else if(distance < heavy_impact_range)
|
|
for(var/atom/object in T.contents)
|
|
spawn()
|
|
if(object)
|
|
object.ex_act(2)
|
|
if(T)
|
|
T.ex_act(2)
|
|
else if (distance == heavy_impact_range)
|
|
for(var/atom/object in T.contents)
|
|
if(object)
|
|
object.ex_act(2)
|
|
if(prob(15) && devastation_range > 2 && heavy_impact_range > 2)
|
|
secondaryexplosion(T, 1)
|
|
else
|
|
if(T)
|
|
T.ex_act(2)
|
|
else if(distance <= light_impact_range)
|
|
for(var/atom/object in T.contents)
|
|
spawn()
|
|
if(object)
|
|
object.ex_act(3)
|
|
if(T)
|
|
T.ex_act(3)
|
|
for(var/mob/living/carbon/mob in T)
|
|
flick("flash", mob:flash)
|
|
|
|
sleep(-1)
|
|
sleep(20)
|
|
if(defer_powernet_rebuild != 2)
|
|
defer_powernet_rebuild = 0
|
|
return 1
|
|
|
|
|
|
|
|
proc/secondaryexplosion(turf/epicenter, range)
|
|
for(var/turf/tile in range(range, epicenter))
|
|
tile.ex_act(2) |