nerfs far explosions a little harder, uses sqrt for shake calculation, and uses CLAMP instead of min

This commit is contained in:
deathride58
2018-01-01 22:58:55 -05:00
committed by GitHub
parent 7b81380572
commit 07bbaaab27
+3 -2
View File
@@ -118,16 +118,17 @@ GLOBAL_LIST_EMPTY(explosions)
var/turf/M_turf = get_turf(M)
if(M_turf && M_turf.z == z0)
var/dist = get_dist(M_turf, epicenter)
var/baseshakeamount = sqrt((orig_max_distance - dist)*0.1)
// If inside the blast radius + world.view - 2
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound)
shake_camera(M, 25, min((orig_max_distance - dist)*0.01, 2))
shake_camera(M, 25, CLAMP(baseshakeamount, 0, 10))
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
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, null, far_volume, 1, frequency, falloff = 5, S = far_explosion_sound)
shake_camera(M, 10, min((orig_max_distance - dist)*0.005, 1))
shake_camera(M, 10, CLAMP(baseshakeamount*0.25, 0, 2.5))
EX_PREPROCESS_CHECK_TICK
//postpone processing for a bit