Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -1,24 +1,9 @@
|
||||
//TODO: Flash range does nothing currently
|
||||
|
||||
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0, smoke = 1)
|
||||
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0)
|
||||
set waitfor = 0
|
||||
src = null //so we don't abort once src is deleted
|
||||
src = null //so we don't abort once src is deleted
|
||||
epicenter = get_turf(epicenter)
|
||||
if(!epicenter)
|
||||
return
|
||||
|
||||
// Archive the uncapped explosion for the doppler array
|
||||
var/orig_dev_range = devastation_range
|
||||
var/orig_heavy_range = heavy_impact_range
|
||||
var/orig_light_range = light_impact_range
|
||||
|
||||
if(!ignorecap && epicenter.z != ZLEVEL_MINING)
|
||||
//Clamp all values to MAX_EXPLOSION_RANGE
|
||||
devastation_range = min(MAX_EX_DEVESTATION_RANGE, devastation_range)
|
||||
heavy_impact_range = min(MAX_EX_HEAVY_RANGE, heavy_impact_range)
|
||||
light_impact_range = min(MAX_EX_LIGHT_RANGE, light_impact_range)
|
||||
flash_range = min(MAX_EX_FLASH_RANGE, flash_range)
|
||||
flame_range = min(MAX_EX_FLAME_RANGE, flame_range)
|
||||
|
||||
//DO NOT REMOVE THIS SLEEP, IT BREAKS THINGS
|
||||
//not sleeping causes us to ex_act() the thing that triggered the explosion
|
||||
@@ -29,7 +14,21 @@
|
||||
//and somethings expect us to ex_act them so they can qdel()
|
||||
sleep(1) //tldr, let the calling proc call qdel(src) before we explode
|
||||
|
||||
// Archive the uncapped explosion for the doppler array
|
||||
var/orig_dev_range = devastation_range
|
||||
var/orig_heavy_range = heavy_impact_range
|
||||
var/orig_light_range = light_impact_range
|
||||
|
||||
if(!ignorecap)
|
||||
// Clamp all values to MAX_EXPLOSION_RANGE
|
||||
devastation_range = min (MAX_EX_DEVESTATION_RANGE, devastation_range)
|
||||
heavy_impact_range = min (MAX_EX_HEAVY_RANGE, heavy_impact_range)
|
||||
light_impact_range = min (MAX_EX_LIGHT_RANGE, light_impact_range)
|
||||
flash_range = min (MAX_EX_FLASH_RANGE, flash_range)
|
||||
flame_range = min (MAX_EX_FLAME_RANGE, flame_range)
|
||||
|
||||
var/start = world.timeofday
|
||||
if(!epicenter) return
|
||||
|
||||
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
|
||||
var/list/cached_exp_block = list()
|
||||
@@ -44,6 +43,8 @@
|
||||
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
|
||||
// 3/7/14 will calculate to 80 + 35
|
||||
|
||||
var/skip_shake = 0 //Will not shake screen
|
||||
var/explosion_shake_message_cooldown = 0 //Will not display shaking-related messages
|
||||
var/far_dist = 0
|
||||
far_dist += heavy_impact_range * 5
|
||||
far_dist += devastation_range * 20
|
||||
@@ -63,7 +64,19 @@
|
||||
else if(dist <= far_dist)
|
||||
var/far_volume = Clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
|
||||
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
|
||||
M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
|
||||
if(devastation_range > 0)
|
||||
M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
|
||||
shake_camera(M, 3, 1)
|
||||
else
|
||||
M.playsound_local(epicenter, 'sound/effects/explosionsmallfar.ogg', far_volume, 1, frequency, falloff = 5)
|
||||
skip_shake = 1
|
||||
|
||||
if(!explosion_shake_message_cooldown && devastation_range > 0 && !skip_shake)
|
||||
M << "<span class='danger'>You feel the station's structure shaking all around you.</span>"
|
||||
explosion_shake_message_cooldown = 1
|
||||
spawn(50)
|
||||
explosion_shake_message_cooldown = 0
|
||||
|
||||
|
||||
//postpone processing for a bit
|
||||
var/postponeCycles = max(round(devastation_range/8),1)
|
||||
@@ -71,14 +84,9 @@
|
||||
SSmachine.postpone(postponeCycles)
|
||||
|
||||
if(heavy_impact_range > 1)
|
||||
if(smoke)
|
||||
var/datum/effect_system/explosion/smoke/E = new/datum/effect_system/explosion/smoke()
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
else
|
||||
var/datum/effect_system/explosion/E = new/datum/effect_system/explosion()
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
var/datum/effect_system/explosion/E = new/datum/effect_system/explosion()
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
|
||||
var/x0 = epicenter.x
|
||||
var/y0 = epicenter.y
|
||||
@@ -100,7 +108,7 @@
|
||||
if(W.reinf && W.fulltile)
|
||||
cached_exp_block[T] += W.explosion_block
|
||||
|
||||
for(var/obj/structure/blob/B in T)
|
||||
for(var/obj/effect/blob/B in T)
|
||||
cached_exp_block[T] += B.explosion_block
|
||||
CHECK_TICK
|
||||
|
||||
@@ -134,7 +142,7 @@
|
||||
//------- TURF FIRES -------
|
||||
|
||||
if(T)
|
||||
if(flame_dist && prob(40) && !isspaceturf(T) && !T.density)
|
||||
if(flame_dist && prob(40) && !istype(T, /turf/open/space) && !T.density)
|
||||
PoolOrNew(/obj/effect/hotspot, T) //Mostly for ambience!
|
||||
if(dist > 0)
|
||||
T.ex_act(dist)
|
||||
@@ -227,7 +235,7 @@
|
||||
if(W.explosion_block && W.fulltile)
|
||||
dist += W.explosion_block
|
||||
|
||||
for(var/obj/structure/blob/B in T)
|
||||
for(var/obj/effect/blob/B in T)
|
||||
dist += B.explosion_block
|
||||
|
||||
if(dist < dev)
|
||||
@@ -246,19 +254,3 @@
|
||||
for(var/turf/T in wipe_colours)
|
||||
T.color = null
|
||||
T.maptext = ""
|
||||
|
||||
/proc/dyn_explosion(turf/epicenter, power, flash_range, adminlog = 1, ignorecap = 1, flame_range = 0 ,silent = 0, smoke = 1)
|
||||
if(!power)
|
||||
return
|
||||
var/range = 0
|
||||
range = round((2 * power)**DYN_EX_SCALE)
|
||||
explosion(epicenter, round(range * 0.25), round(range * 0.5), round(range), flash_range*range, adminlog, ignorecap, flame_range*range, silent, smoke)
|
||||
|
||||
// Using default dyn_ex scale:
|
||||
// 100 explosion power is a (5, 10, 20) explosion.
|
||||
// 75 explosion power is a (4, 8, 17) explosion.
|
||||
// 50 explosion power is a (3, 7, 14) explosion.
|
||||
// 25 explosion power is a (2, 5, 10) explosion.
|
||||
// 10 explosion power is a (1, 3, 6) explosion.
|
||||
// 5 explosion power is a (0, 1, 3) explosion.
|
||||
// 1 explosion power is a (0, 0, 1) explosion.
|
||||
Reference in New Issue
Block a user