diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index 3fcb9cc3410..e18cb4b3212 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -70,3 +70,47 @@ 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg', 'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',\ 'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\ 'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg') + +//default byond sound environments +#define SOUND_ENVIRONMENT_NONE -1 +#define SOUND_ENVIRONMENT_GENERIC 0 +#define SOUND_ENVIRONMENT_PADDED_CELL 1 +#define SOUND_ENVIRONMENT_ROOM 2 +#define SOUND_ENVIRONMENT_BATHROOM 3 +#define SOUND_ENVIRONMENT_LIVINGROOM 4 +#define SOUND_ENVIRONMENT_STONEROOM 5 +#define SOUND_ENVIRONMENT_AUDITORIUM 6 +#define SOUND_ENVIRONMENT_CONCERT_HALL 7 +#define SOUND_ENVIRONMENT_CAVE 8 +#define SOUND_ENVIRONMENT_ARENA 9 +#define SOUND_ENVIRONMENT_HANGAR 10 +#define SOUND_ENVIRONMENT_CARPETED_HALLWAY 11 +#define SOUND_ENVIRONMENT_HALLWAY 12 +#define SOUND_ENVIRONMENT_STONE_CORRIDOR 13 +#define SOUND_ENVIRONMENT_ALLEY 14 +#define SOUND_ENVIRONMENT_FOREST 15 +#define SOUND_ENVIRONMENT_CITY 16 +#define SOUND_ENVIRONMENT_MOUNTAINS 17 +#define SOUND_ENVIRONMENT_QUARRY 18 +#define SOUND_ENVIRONMENT_PLAIN 19 +#define SOUND_ENVIRONMENT_PARKING_LOT 20 +#define SOUND_ENVIRONMENT_SEWER_PIPE 21 +#define SOUND_ENVIRONMENT_UNDERWATER 22 +#define SOUND_ENVIRONMENT_DRUGGED 23 +#define SOUND_ENVIRONMENT_DIZZY 24 +#define SOUND_ENVIRONMENT_PSYCHOTIC 25 +//If we ever make custom ones add them here + +//"sound areas": easy way of keeping different types of areas consistent. +#define SOUND_AREA_STANDARD_STATION SOUND_ENVIRONMENT_PARKING_LOT +#define SOUND_AREA_LARGE_ENCLOSED SOUND_ENVIRONMENT_QUARRY +#define SOUND_AREA_SMALL_ENCLOSED SOUND_ENVIRONMENT_BATHROOM +#define SOUND_AREA_TUNNEL_ENCLOSED SOUND_ENVIRONMENT_STONEROOM +#define SOUND_AREA_LARGE_SOFTFLOOR SOUND_ENVIRONMENT_CARPETED_HALLWAY +#define SOUND_AREA_MEDIUM_SOFTFLOOR SOUND_ENVIRONMENT_LIVINGROOM +#define SOUND_AREA_SMALL_SOFTFLOOR SOUND_ENVIRONMENT_ROOM +#define SOUND_AREA_ASTEROID SOUND_ENVIRONMENT_CAVE +#define SOUND_AREA_SPACE SOUND_ENVIRONMENT_UNDERWATER +#define SOUND_AREA_LAVALAND SOUND_ENVIRONMENT_MOUNTAINS +#define SOUND_AREA_ICEMOON SOUND_ENVIRONMENT_CAVE +#define SOUND_AREA_WOODFLOOR SOUND_ENVIRONMENT_CITY diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index b35140c14e4..0ee5aa6c427 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -67,7 +67,7 @@ H.dna.species.stamina_mod *= 0.1 add_attack_logs(owner, owner, "gained blood-drunk stun immunity", ATKLOG_ALL) owner.add_stun_absorption("blooddrunk", INFINITY, 4) - owner.playsound_local(get_turf(owner), 'sound/effects/singlebeat.ogg', 40, 1) + owner.playsound_local(get_turf(owner), 'sound/effects/singlebeat.ogg', 40, TRUE, use_reverb = FALSE) /datum/status_effect/blooddrunk/on_remove() if(ishuman(owner)) diff --git a/code/game/area/ai_monitored.dm b/code/game/area/ai_monitored.dm index abfcb7210b0..074164b5805 100644 --- a/code/game/area/ai_monitored.dm +++ b/code/game/area/ai_monitored.dm @@ -2,6 +2,7 @@ name = "AI Monitored Area" var/list/motioncameras = list() var/list/motionTargets = list() + sound_environment = SOUND_ENVIRONMENT_ROOM /area/ai_monitored/Initialize(mapload) . = ..() diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 1e7147c8a53..da72cea50df 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -67,6 +67,8 @@ var/moving = FALSE /// "Haunted" areas such as the morgue and chapel are easier to boo. Because flavor. var/is_haunted = FALSE + ///Used to decide what kind of reverb the area makes sound have + var/sound_environment = SOUND_ENVIRONMENT_NONE /area/Initialize(mapload) GLOB.all_areas += src diff --git a/code/game/area/areas/mining.dm b/code/game/area/areas/mining.dm index b621bade493..a1de206a0db 100644 --- a/code/game/area/areas/mining.dm +++ b/code/game/area/areas/mining.dm @@ -16,6 +16,7 @@ outdoors = TRUE ambientsounds = MINING_SOUNDS flags = NONE + sound_environment = SOUND_AREA_STANDARD_STATION /area/mine/dangerous/explored/golem name = "Small Asteroid" @@ -90,6 +91,7 @@ /area/lavaland icon_state = "mining" has_gravity = TRUE + sound_environment = SOUND_AREA_LAVALAND /area/lavaland/surface name = "Lavaland" diff --git a/code/game/area/ss13_areas.dm b/code/game/area/ss13_areas.dm index 4e75ae5c577..2879bedafdc 100644 --- a/code/game/area/ss13_areas.dm +++ b/code/game/area/ss13_areas.dm @@ -42,6 +42,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station valid_territory = FALSE outdoors = TRUE ambientsounds = SPACE_SOUNDS + sound_environment = SOUND_AREA_SPACE /area/space/nearstation icon_state = "space_near" @@ -66,6 +67,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station valid_territory = FALSE dynamic_lighting = DYNAMIC_LIGHTING_FORCED parallax_movedir = NORTH + sound_environment = SOUND_ENVIRONMENT_ROOM /area/shuttle/arrival name = "\improper Arrival Shuttle" @@ -477,6 +479,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station valid_territory = FALSE dynamic_lighting = DYNAMIC_LIGHTING_FORCED ambientsounds = MINING_SOUNDS + sound_environment = SOUND_AREA_ASTEROID /area/asteroid/cave // -- TLE name = "\improper Asteroid - Underground" @@ -594,6 +597,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/maintenance ambientsounds = MAINTENANCE_SOUNDS valid_territory = FALSE + sound_environment = SOUND_AREA_TUNNEL_ENCLOSED /area/maintenance/atmos_control name = "Atmospherics Maintenance" @@ -696,6 +700,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/hallway valid_territory = FALSE //too many areas with similar/same names, also not very interesting summon spots + sound_environment = SOUND_AREA_STANDARD_STATION /area/hallway/primary/fore name = "\improper Fore Primary Hallway" @@ -762,14 +767,17 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "\improper Bridge" icon_state = "bridge" ambientsounds = list('sound/ambience/signal.ogg') + sound_environment = SOUND_AREA_STANDARD_STATION /area/bridge/meeting_room name = "\improper Heads of Staff Meeting Room" icon_state = "meeting" + sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR /area/crew_quarters/captain name = "\improper Captain's Office" icon_state = "captain" + sound_environment = SOUND_AREA_WOODFLOOR /area/crew_quarters/captain/bedroom name = "\improper Captain's Bedroom" @@ -826,10 +834,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/comms name = "\improper Communications Relay" icon_state = "tcomsatcham" + sound_environment = SOUND_AREA_STANDARD_STATION /area/server name = "\improper Messaging Server Room" icon_state = "server" + sound_environment = SOUND_AREA_STANDARD_STATION /area/ntrep name = "\improper Nanotrasen Representative's Office" @@ -848,10 +858,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/crew_quarters name = "\improper Dormitories" icon_state = "Sleep" + sound_environment = SOUND_AREA_STANDARD_STATION /area/crew_quarters/toilet name = "\improper Dormitory Toilets" icon_state = "toilet" + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/crew_quarters/sleep name = "\improper Dormitories" @@ -905,6 +917,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/crew_quarters/bar name = "\improper Bar" icon_state = "bar" + sound_environment = SOUND_AREA_WOODFLOOR /area/crew_quarters/bar/atrium name = "Atrium" @@ -913,6 +926,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/crew_quarters/theatre name = "\improper Theatre" icon_state = "Theatre" + sound_environment = SOUND_AREA_WOODFLOOR /area/crew_quarters/mrchangs name = "\improper Mr Chang's" @@ -921,6 +935,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/library name = "\improper Library" icon_state = "library" + sound_environment = SOUND_AREA_LARGE_SOFTFLOOR /area/library/abandoned name = "\improper Abandoned Library" @@ -930,6 +945,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon_state = "chapel" ambientsounds = HOLY_SOUNDS is_haunted = TRUE + sound_environment = SOUND_AREA_LARGE_ENCLOSED /area/chapel/main name = "\improper Chapel" @@ -945,10 +961,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/lawoffice name = "\improper Law Office" icon_state = "law" + sound_environment = SOUND_AREA_SMALL_SOFTFLOOR /area/magistrateoffice name = "\improper Magistrate's Office" icon_state = "magistrate" + sound_environment = SOUND_AREA_SMALL_SOFTFLOOR /area/clownoffice name = "\improper Clown's Office" @@ -974,6 +992,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "\improper Holodeck" icon_state = "Holodeck" dynamic_lighting = DYNAMIC_LIGHTING_DISABLED + sound_environment = SOUND_ENVIRONMENT_PADDED_CELL /area/holodeck/alphadeck name = "\improper Holodeck Alpha" @@ -1068,6 +1087,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station //Engineering /area/engine ambientsounds = ENGINEERING_SOUNDS + sound_environment = SOUND_AREA_LARGE_ENCLOSED /area/engine/engine_smes name = "\improper Engineering SMES" @@ -1082,10 +1102,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/engine/break_room name = "\improper Engineering Foyer" icon_state = "engine" + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/engine/equipmentstorage name = "\improper Engineering Equipment Storage" icon_state = "storage" + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/engine/hardsuitstorage name = "\improper Engineering Hardsuit Storage" @@ -1114,6 +1136,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/engine/supermatter name = "\improper Supermatter Engine" icon_state = "engine" + sound_environment = SOUND_AREA_SMALL_ENCLOSED //Solars @@ -1122,6 +1145,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station valid_territory = FALSE dynamic_lighting = DYNAMIC_LIGHTING_IFSTARLIGHT ambientsounds = ENGINEERING_SOUNDS + sound_environment = SOUND_AREA_SPACE /area/solar/auxport name = "\improper Fore Port Solar Array" @@ -1194,6 +1218,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "\improper Gateway" icon_state = "teleporter" ambientsounds = ENGINEERING_SOUNDS + sound_environment = SOUND_AREA_STANDARD_STATION /area/AIsattele name = "\improper Abandoned Teleporter" @@ -1213,6 +1238,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/medical ambientsounds = MEDICAL_SOUNDS + sound_environment = SOUND_AREA_STANDARD_STATION /area/medical/medbay name = "\improper Medbay" @@ -1247,6 +1273,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/medical/patients_rooms name = "\improper Patient's Rooms" icon_state = "patients" + sound_environment = SOUND_AREA_SMALL_SOFTFLOOR /area/medical/ward name = "\improper Medbay Patient Ward" @@ -1301,6 +1328,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon_state = "morgue" ambientsounds = SPOOKY_SOUNDS is_haunted = TRUE + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/medical/chemistry name = "\improper Chemistry" @@ -1350,6 +1378,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/security ambientsounds = HIGHSEC_SOUNDS + sound_environment = SOUND_AREA_STANDARD_STATION /area/security/main name = "\improper Security Office" @@ -1432,6 +1461,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/security/courtroomdandp name = "\improper Courtroom Defense and Prosecution" icon_state = "seccourt" + sound_environment = SOUND_AREA_LARGE_ENCLOSED /area/security/interrogationobs name = "\improper Interrogation Observation" @@ -1459,6 +1489,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/security/warden name = "\improper Warden's Office" icon_state = "Warden" + sound_environment = SOUND_AREA_SMALL_SOFTFLOOR /area/security/armoury name = "\improper Armory" @@ -1536,12 +1567,14 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/quartermaster name = "\improper Quartermasters" icon_state = "quart" + sound_environment = SOUND_AREA_STANDARD_STATION ///////////WORK IN PROGRESS////////// /area/quartermaster/sorting name = "\improper Delivery Office" icon_state = "quartstorage" + sound_environment = SOUND_AREA_STANDARD_STATION ////////////WORK IN PROGRESS////////// @@ -1552,6 +1585,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/quartermaster/storage name = "\improper Cargo Bay" icon_state = "quartstorage" + sound_environment = SOUND_AREA_LARGE_ENCLOSED /area/quartermaster/qm name = "\improper Quartermaster's Office" @@ -1572,17 +1606,23 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/janitor name = "\improper Custodial Closet" icon_state = "janitor" + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/hydroponics name = "\improper Hydroponics" icon_state = "hydro" + sound_environment = SOUND_AREA_STANDARD_STATION /area/hydroponics/abandoned_garden name = "\improper Abandoned Garden" icon_state = "hydro" + sound_environment = SOUND_AREA_SMALL_ENCLOSED //Toxins +/area/toxins + sound_environment = SOUND_AREA_STANDARD_STATION + /area/toxins/lab name = "\improper Research and Development" icon_state = "toxlab" @@ -1650,6 +1690,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon_state = "toxmisc" //Storage +/area/storage + sound_environment = SOUND_AREA_STANDARD_STATION /area/storage/tools name = "Auxiliary Tool Storage" @@ -1837,6 +1879,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "\improper Construction Area" icon_state = "yellow" ambientsounds = ENGINEERING_SOUNDS + sound_environment = SOUND_AREA_STANDARD_STATION /area/mining_construction name = "Auxillary Base Construction" @@ -1925,6 +1968,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station //AI +/area/ai_monitored + sound_environment = SOUND_AREA_STANDARD_STATION /area/ai_monitored/storage/eva name = "EVA Storage" @@ -1945,10 +1990,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/turret_protected/ai_upload name = "\improper AI Upload Chamber" icon_state = "ai_upload" + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/turret_protected/ai_upload_foyer name = "AI Upload Access" icon_state = "ai_foyer" + sound_environment = SOUND_AREA_SMALL_ENCLOSED /area/turret_protected/ai name = "\improper AI Chamber" @@ -1957,6 +2004,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/turret_protected/aisat name = "\improper AI Satellite" icon_state = "ai" + sound_environment = SOUND_ENVIRONMENT_ROOM /area/aisat name = "\improper AI Satellite Exterior" @@ -1973,6 +2021,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/turret_protected/aisat_interior name = "\improper AI Satellite Antechamber" icon_state = "ai" + sound_environment = SOUND_AREA_LARGE_ENCLOSED //Misc @@ -2033,6 +2082,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/tcommsat/computer name = "\improper Telecoms Control Room" icon_state = "tcomsatcomp" + sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR /area/tcommsat/server name = "\improper Telecoms Server Room" @@ -2052,6 +2102,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon_state = "away" report_alerts = FALSE ambientsounds = AWAY_MISSION_SOUNDS + sound_environment = SOUND_ENVIRONMENT_ROOM /area/awaymission/example name = "\improper Strange Station" diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 01b27018972..8388e182989 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -170,7 +170,7 @@ AM.upgrade(A) possible_modules -= AM to_chat(A, AM.unlock_text) - A.playsound_local(A, AM.unlock_sound, 50, 0) + A.playsound_local(A, AM.unlock_sound, 50, FALSE, use_reverb = FALSE) else if(AM.power_type) if(!action) //Unlocking for the first time @@ -183,7 +183,7 @@ if(AM.unlock_text) to_chat(A, AM.unlock_text) if(AM.unlock_sound) - A.playsound_local(A, AM.unlock_sound, 50, 0) + A.playsound_local(A, AM.unlock_sound, 50, FALSE, use_reverb = FALSE) else //Adding uses to an existing module action.uses += initial(action.uses) action.desc = "[initial(action.desc)] It has [action.uses] use\s remaining." @@ -394,7 +394,7 @@ RCD.detonate_pulse() to_chat(owner, "RCD detonation pulse emitted.") - owner.playsound_local(owner, 'sound/machines/twobeep.ogg', 50, 0) + owner.playsound_local(owner, 'sound/machines/twobeep.ogg', 50, FALSE, use_reverb = FALSE) //Unlock Mech Domination: Unlocks the ability to dominate mechs. Big shocker, right? /datum/AI_Module/large/mecha_domination @@ -433,7 +433,7 @@ continue F.emagged = TRUE to_chat(owner, "All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.") - owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0) + owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, FALSE, use_reverb = FALSE) //Air Alarm Safety Override: Unlocks the ability to enable flooding on all air alarms. /datum/AI_Module/large/break_air_alarms @@ -458,7 +458,7 @@ continue AA.emagged = TRUE to_chat(owner, "All air alarm safeties on the station have been overriden. Air alarms may now use the Flood environmental mode.") - owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0) + owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, FALSE, use_reverb = FALSE) //Overload Machine: Allows the AI to overload a machine, detonating it after a delay. Two uses per purchase. @@ -504,7 +504,7 @@ to_chat(ranged_ability_user, "You can only overload machines!") return - ranged_ability_user.playsound_local(ranged_ability_user, "sparks", 50, 0) + ranged_ability_user.playsound_local(ranged_ability_user, "sparks", 50, FALSE, use_reverb = FALSE) attached_action.adjust_uses(-1) if(attached_action && attached_action.uses) attached_action.desc = "[initial(attached_action.desc)] It has [attached_action.uses] use\s remaining." @@ -559,7 +559,7 @@ to_chat(ranged_ability_user, "That machine can't be overridden!") return - ranged_ability_user.playsound_local(ranged_ability_user, 'sound/misc/interference.ogg', 50, 0) + ranged_ability_user.playsound_local(ranged_ability_user, 'sound/misc/interference.ogg', 50, FALSE, use_reverb = FALSE) attached_action.adjust_uses(-1) if(attached_action && attached_action.uses) attached_action.desc = "[initial(attached_action.desc)] It has [attached_action.uses] use\s remaining." @@ -673,7 +673,7 @@ else apc.overload++ to_chat(owner, "Overcurrent applied to the powernet.") - owner.playsound_local(owner, "sparks", 50, 0) + owner.playsound_local(owner, "sparks", 50, FALSE, use_reverb = FALSE) adjust_uses(-1) if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe desc = "[initial(desc)] It has [uses] use\s remaining." @@ -714,7 +714,7 @@ fixed_cameras++ uses-- //Not adjust_uses() so it doesn't automatically delete or show a message to_chat(owner, "Diagnostic complete! Cameras reactivated: [fixed_cameras]. Reactivations remaining: [uses].") - owner.playsound_local(owner, 'sound/items/wirecutter.ogg', 50, 0) + owner.playsound_local(owner, 'sound/items/wirecutter.ogg', 50, FALSE, use_reverb = FALSE) adjust_uses(0, TRUE) //Checks the uses remaining if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe desc = "[initial(desc)] It has [uses] use\s remaining." diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index c071b473216..319e8035df1 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -467,7 +467,7 @@ if(!M.client || M.client.prefs.sound & SOUND_DISCO) if(!(M in rangers)) rangers[M] = TRUE - M.playsound_local(get_turf(M), null, 100, channel = CHANNEL_JUKEBOX, S = song_played) + M.playsound_local(get_turf(M), null, 100, channel = CHANNEL_JUKEBOX, S = song_played, use_reverb = FALSE) for(var/mob/L in rangers) if(get_dist(src, L) > 10) rangers -= L diff --git a/code/game/sound.dm b/code/game/sound.dm index 2801863db7d..dbd8022c2b8 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -1,4 +1,29 @@ -/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE) + +///Default override for echo +/sound + echo = list( + 0, // Direct + 0, // DirectHF + -10000, // Room, -10000 means no low frequency sound reverb + -10000, // RoomHF, -10000 means no high frequency sound reverb + 0, // Obstruction + 0, // ObstructionLFRatio + 0, // Occlusion + 0.25, // OcclusionLFRatio + 1.5, // OcclusionRoomRatio + 1.0, // OcclusionDirectRatio + 0, // Exclusion + 1.0, // ExclusionLFRatio + 0, // OutsideVolumeHF + 0, // DopplerFactor + 0, // RolloffFactor + 0, // RoomRolloffFactor + 1.0, // AirAbsorptionFactor + 0, // Flags (1 = Auto Direct, 2 = Auto Room, 4 = Auto RoomHF) + ) + environment = SOUND_ENVIRONMENT_NONE //Default to none so sounds without overrides dont get reverb + +/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, use_reverb = TRUE) if(isarea(source)) error("[source] is an area and is trying to make the sound: [soundin]") return @@ -32,9 +57,9 @@ var/distance = get_dist(M, turf_source) if(distance <= maxdistance) - M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S) + M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, 1, use_reverb) -/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, channel = 0, pressure_affected = TRUE, sound/S, distance_multiplier = 1) +/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, channel = 0, pressure_affected = TRUE, sound/S, distance_multiplier = 1, use_reverb = TRUE) if(!client || !can_hear()) return @@ -90,6 +115,19 @@ S.y = 1 S.falloff = (falloff ? falloff : FALLOFF_SOUNDS) + // Sounds can't have their own environment. A sound's environment will be: + // 1. the mob's + // 2. the area's (defaults to SOUND_ENVRIONMENT_NONE) + if(sound_environment_override != SOUND_ENVIRONMENT_NONE) + S.environment = sound_environment_override + else + var/area/A = get_area(src) + S.environment = A.sound_environment + + if(use_reverb && S.environment != SOUND_ENVIRONMENT_NONE) //We have reverb, reset our echo setting + S.echo[3] = 0 //Room setting, 0 means normal reverb + S.echo[4] = 0 //RoomHF setting, 0 means normal reverb. + SEND_SOUND(src, S) /proc/sound_to_playing_players(soundin, volume = 100, vary = FALSE, frequency = 0, falloff = FALSE, channel = 0, pressure_affected = FALSE, sound/S) diff --git a/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm b/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm index fcb86a9ce43..aefe73f6258 100644 --- a/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm +++ b/code/modules/antagonists/traitor/contractor/datums/contractor_hub.dm @@ -75,7 +75,7 @@ /datum/contractor_hub/proc/first_login(mob/user) if(!is_user_authorized(user)) return - user.playsound_local(user, 'sound/effects/contractstartup.ogg', 30, FALSE) + user.playsound_local(user, 'sound/effects/contractstartup.ogg', 30, FALSE, use_reverb = FALSE) generate_contracts() SStgui.update_uis(src) diff --git a/code/modules/antagonists/traitor/contractor/items/contractor_uplink.dm b/code/modules/antagonists/traitor/contractor/items/contractor_uplink.dm index e3798896d9a..5ad7375c556 100644 --- a/code/modules/antagonists/traitor/contractor/items/contractor_uplink.dm +++ b/code/modules/antagonists/traitor/contractor/items/contractor_uplink.dm @@ -39,4 +39,4 @@ to_chat(M, "[bicon(src)] Incoming encrypted transmission from your handlers. Message as follows:
"\ + "[text]") if(sndfile) - M.playsound_local(get_turf(M), sndfile, 30, FALSE) + M.playsound_local(get_turf(M), sndfile, 30, FALSE, use_reverb = FALSE) diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm index adffc39ee09..d3d663d90a7 100644 --- a/code/modules/antagonists/traitor/datum_traitor.dm +++ b/code/modules/antagonists/traitor/datum_traitor.dm @@ -272,13 +272,13 @@ switch(traitor_kind) if(TRAITOR_AI) add_law_zero() - owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/malf.ogg', 100, FALSE, pressure_affected = FALSE) + owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/malf.ogg', 100, FALSE, pressure_affected = FALSE, use_reverb = FALSE) var/mob/living/silicon/ai/A = owner.current A.show_laws() if(TRAITOR_HUMAN) if(should_equip) equip_traitor() - owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/tatoralert.ogg', 100, FALSE, pressure_affected = FALSE) + owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/tatoralert.ogg', 100, FALSE, pressure_affected = FALSE, use_reverb = FALSE) /datum/antagonist/traitor/proc/give_codewords() diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index fe0800b952f..fceffecbffc 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -340,8 +340,10 @@ if(slurring && drunk) throw_alert("drunk", /obj/screen/alert/drunk) + sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC else clear_alert("drunk") + sound_environment_override = SOUND_ENVIRONMENT_NONE /mob/living/AdjustSlur(amount, bound_lower = 0, bound_upper = INFINITY) var/new_value = directional_bounded_sum(slurring, amount, bound_lower, bound_upper) diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm index 317d6068514..2c25e4d7613 100644 --- a/code/modules/mob/living/update_status.dm +++ b/code/modules/mob/living/update_status.dm @@ -20,9 +20,11 @@ if(druggy) overlay_fullscreen("high", /obj/screen/fullscreen/high) throw_alert("high", /obj/screen/alert/high) + sound_environment_override = SOUND_ENVIRONMENT_DRUGGED else clear_fullscreen("high") clear_alert("high") + sound_environment_override = SOUND_ENVIRONMENT_NONE /mob/living/update_nearsighted_effects() if(HAS_TRAIT(src, TRAIT_NEARSIGHT)) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 3bfce8f3555..48cbfb69386 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -115,6 +115,8 @@ var/has_enabled_antagHUD = 0 // Whether antagHUD was ever enabled. Not a true boolean - sometimes it is set to 2, because reasons. var/antagHUD = FALSE // Whether AntagHUD is active right now var/can_change_intents = 1 //all mobs can change intents by default. + ///Override for sound_environments. If this is set the user will always hear a specific type of reverb (Instead of the area defined reverb) + var/sound_environment_override = SOUND_ENVIRONMENT_NONE //Generic list for proc holders. Only way I can see to enable certain verbs/procs. Should be modified if needed. var/proc_holder_list[] = list() diff --git a/code/modules/ruins/ruin_areas.dm b/code/modules/ruins/ruin_areas.dm index cf3b08aa0f2..0e16b54c90e 100644 --- a/code/modules/ruins/ruin_areas.dm +++ b/code/modules/ruins/ruin_areas.dm @@ -7,6 +7,7 @@ there_can_be_many = TRUE dynamic_lighting = DYNAMIC_LIGHTING_FORCED ambientsounds = RUINS_SOUNDS + sound_environment = SOUND_ENVIRONMENT_STONEROOM /area/ruin/unpowered always_unpowered = FALSE