From 12e13e7f6770129d4b1267ad9c8f841e351aeede Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sat, 6 May 2017 21:34:38 -0500 Subject: [PATCH 1/3] Explosion sounds --- code/game/objects/explosion.dm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index dd18925da2..c47a93ede6 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -44,6 +44,13 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa 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) + var/close = range(world.view+round(devastation_range,1), epicenter) + // to all distanced mobs play a different sound + for(var/mob/M in world) if(M.z == epicenter.z) if(!(M in close)) + // check if the mob can hear + if(M.ear_deaf <= 0 || !M.ear_deaf) if(!istype(M.loc,/turf/space)) + M << 'sound/effects/explosionfar.ogg' + if(adminlog) message_admins("Explosion with [shaped ? "shaped" : "non-shaped"] size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (JMP)") log_game("Explosion with [shaped ? "shaped" : "non-shaped"] size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") @@ -80,8 +87,8 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa var/atom/movable/AM = atom_movable if(AM && AM.simulated) AM.ex_act(dist) - T.ex_act(dist) - + T.ex_act(dist) + var/took = (world.timeofday-start)/10 //You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare if(Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds." From 51d07afdc368fd9bca687d4d18ebd9117a965d2b Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 7 May 2017 14:02:43 -0500 Subject: [PATCH 2/3] Dunno how it compiled last time --- code/game/objects/explosion.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index c47a93ede6..97cae60910 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -48,8 +48,9 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa // to all distanced mobs play a different sound for(var/mob/M in world) if(M.z == epicenter.z) if(!(M in close)) // check if the mob can hear - if(M.ear_deaf <= 0 || !M.ear_deaf) if(!istype(M.loc,/turf/space)) - M << 'sound/effects/explosionfar.ogg' + if(M.ear_deaf <= 0 || !M.ear_deaf) + if(!istype(M.loc,/turf/space)) + M << 'sound/effects/explosionfar.ogg' if(adminlog) message_admins("Explosion with [shaped ? "shaped" : "non-shaped"] size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (JMP)") From bce6db1135a50ab64c83284e21742960ccb4363c Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 7 May 2017 18:15:54 -0500 Subject: [PATCH 3/3] Fixes another thing --- code/game/objects/explosion.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 97cae60910..0bf146f037 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -46,11 +46,13 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa var/close = range(world.view+round(devastation_range,1), epicenter) // to all distanced mobs play a different sound - for(var/mob/M in world) if(M.z == epicenter.z) if(!(M in close)) - // check if the mob can hear - if(M.ear_deaf <= 0 || !M.ear_deaf) - if(!istype(M.loc,/turf/space)) - M << 'sound/effects/explosionfar.ogg' + for(var/mob/M in world) + if(M.z == epicenter.z) + if(!(M in close)) + // check if the mob can hear + if(M.ear_deaf <= 0 || !M.ear_deaf) + if(!istype(M.loc,/turf/space)) + M << 'sound/effects/explosionfar.ogg' if(adminlog) message_admins("Explosion with [shaped ? "shaped" : "non-shaped"] size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (JMP)")