diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index e2975ad9d46..69a5e416687 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -14,14 +14,20 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa epicenter = get_turf(epicenter) if(!epicenter) return + + playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(devastation_range*2,1) ) + playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) ) + + 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 << 'explosionfar.ogg' if(adminlog) message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])") log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") - playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(devastation_range*2,1) ) - playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) ) - - var/lighting_controller_was_processing = lighting_controller.processing //Pause the lighting updates for a bit lighting_controller.processing = 0 var/powernet_rebuild_was_deferred_already = defer_powernet_rebuild @@ -74,4 +80,4 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa proc/secondaryexplosion(turf/epicenter, range) for(var/turf/tile in range(range, epicenter)) - tile.ex_act(2) \ No newline at end of file + tile.ex_act(2)