ImmursionAudio(TM)

This commit is contained in:
Letter N
2020-12-21 19:47:11 +08:00
parent a808f805d4
commit 98ff0a080e
29 changed files with 493 additions and 176 deletions
+62 -5
View File
@@ -44,6 +44,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
ambientsounds = SPACE
blob_allowed = FALSE //Eating up space doesn't count for victory as a blob.
considered_hull_exterior = TRUE
sound_environment = SOUND_AREA_SPACE
/area/space/nearstation
icon_state = "space_near"
@@ -69,6 +70,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
blob_allowed = FALSE //Nope, no winning on the asteroid as a blob. Gotta eat the station.
valid_territory = FALSE
ambientsounds = MINING
sound_environment = SOUND_AREA_ASTEROID
/area/asteroid/nearstation
dynamic_lighting = DYNAMIC_LIGHTING_FORCED
@@ -106,7 +108,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/maintenance
ambientsounds = MAINTENANCE
valid_territory = FALSE
sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
//Departments
@@ -121,6 +123,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/maintenance/department/crew_quarters/bar
name = "Bar Maintenance"
icon_state = "maint_bar"
sound_environment = SOUND_AREA_WOODFLOOR
/area/maintenance/department/crew_quarters/dorms
name = "Dormitory Maintenance"
@@ -264,6 +267,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/hallway
nightshift_public_area = NIGHTSHIFT_AREA_PUBLIC
sound_environment = SOUND_AREA_STANDARD_STATION
/area/hallway/primary/aft
name = "Aft Primary Hallway"
@@ -336,30 +340,36 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Bridge"
icon_state = "bridge"
music = "signal"
sound_environment = SOUND_AREA_STANDARD_STATION
/area/bridge/meeting_room
name = "Heads of Staff Meeting Room"
icon_state = "meeting"
music = null
sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/bridge/meeting_room/council
name = "Council Chamber"
icon_state = "meeting"
music = null
sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/bridge/showroom/corporate
name = "Corporate Showroom"
icon_state = "showroom"
music = null
sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/crew_quarters/heads/captain
name = "Captain's Office"
icon_state = "captain"
clockwork_warp_allowed = FALSE
sound_environment = SOUND_AREA_WOODFLOOR
/area/crew_quarters/heads/captain/private
name = "Captain's Quarters"
icon_state = "captain"
sound_environment = SOUND_AREA_WOODFLOOR
/area/crew_quarters/heads/chief
name = "Chief Engineer's Office"
@@ -404,10 +414,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/comms
name = "Communications Relay"
icon_state = "tcomsatcham"
sound_environment = SOUND_AREA_STANDARD_STATION
/area/server
name = "Messaging Server Room"
icon_state = "server"
sound_environment = SOUND_AREA_STANDARD_STATION
//Crew
@@ -416,6 +428,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "Sleep"
safe = TRUE
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
sound_environment = SOUND_AREA_STANDARD_STATION
/area/crew_quarters/dorms/male
name = "Male Dorm"
@@ -434,6 +447,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/crew_quarters/toilet
name = "Dormitory Toilets"
icon_state = "toilet"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/crew_quarters/toilet/auxiliary
name = "Auxiliary Restrooms"
@@ -468,6 +482,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Lounge"
icon_state = "yellow"
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/crew_quarters/fitness
name = "Fitness Room"
@@ -496,15 +511,18 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/crew_quarters/kitchen/backroom
name = "Kitchen Coldroom"
icon_state = "kitchen"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/crew_quarters/bar
name = "Bar"
icon_state = "bar"
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
sound_environment = SOUND_AREA_WOODFLOOR
/area/crew_quarters/bar/atrium
name = "Atrium"
icon_state = "bar"
sound_environment = SOUND_AREA_WOODFLOOR
/area/crew_quarters/electronic_marketing_den
name = "Electronic Marketing Den"
@@ -520,6 +538,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/crew_quarters/theatre
name = "Theatre"
icon_state = "Theatre"
sound_environment = SOUND_AREA_WOODFLOOR
/area/crew_quarters/theatre/abandoned
name = "Abandoned Theatre"
@@ -540,10 +559,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "library"
flags_1 = NONE
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
sound_environment = SOUND_AREA_LARGE_SOFTFLOOR
/area/library/lounge
name = "Library Lounge"
icon_state = "library"
sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/library/abandoned
name = "Abandoned Library"
@@ -558,6 +579,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
clockwork_warp_allowed = FALSE
clockwork_warp_fail = "The consecration here prevents you from warping in."
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/chapel/main
name = "Chapel"
@@ -573,6 +595,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/chapel/asteroid
name = "Chapel Asteroid"
icon_state = "explored"
sound_environment = SOUND_AREA_ASTEROID
/area/chapel/asteroid/monastery
name = "Monastery Asteroid"
@@ -584,12 +607,14 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/lawoffice
name = "Law Office"
icon_state = "law"
sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
//Engineering
/area/engine
ambientsounds = ENGINEERING
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/engine/engine_smes
name = "Engineering SMES"
@@ -607,14 +632,17 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/engine/atmospherics_engine
name = "Atmospherics Engine"
icon_state = "atmos_engine"
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/engine/supermatter
name = "Supermatter Engine"
icon_state = "engine_sm"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engine/break_room
name = "Engineering Foyer"
icon_state = "engine_foyer"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engine/gravity_generator
name = "Gravity Generator Room"
@@ -629,6 +657,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/engine/storage
name = "Engineering Storage"
icon_state = "engi_storage"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engine/storage_shared
name = "Shared Engineering Storage"
@@ -648,10 +677,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
blob_allowed = FALSE
flags_1 = NONE
ambientsounds = ENGINEERING
sound_environment = SOUND_AREA_SPACE
/area/solar/fore
name = "Fore Solar Array"
icon_state = "yellow"
sound_environment = SOUND_AREA_STANDARD_STATION
/area/solar/aft
name = "Aft Solar Array"
@@ -757,6 +788,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "gateway"
music = "signal"
ambientsounds = ENGINEERING
sound_environment = SOUND_AREA_STANDARD_STATION
//MedBay
@@ -764,11 +796,13 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Medical"
icon_state = "medbay3"
ambientsounds = MEDICAL
sound_environment = SOUND_AREA_STANDARD_STATION
/area/medical/abandoned
name = "Abandoned Medbay"
icon_state = "medbay3"
music = 'sound/ambience/signal.ogg'
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/medical/medbay/central
name = "Medbay Central"
@@ -810,6 +844,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/medical/patients_rooms
name = "Patients' Rooms"
icon_state = "patients"
sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/medical/patients_rooms/room_a
name = "Patient Room A"
@@ -828,6 +863,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Morgue"
icon_state = "morgue"
ambientsounds = SPOOKY
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/medical/chemistry
name = "Chemistry"
@@ -868,6 +904,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Security"
icon_state = "security"
ambientsounds = HIGHSEC
sound_environment = SOUND_AREA_STANDARD_STATION
/area/security/main
name = "Security Office"
@@ -880,6 +917,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/courtroom
name = "Courtroom"
icon_state = "courtroom"
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/security/prison
name = "Prison Wing"
@@ -892,10 +930,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/processing/cremation
name = "Security Crematorium"
icon_state = "sec_prison"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/security/warden
name = "Brig Control"
icon_state = "Warden"
sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/security/armory
name = "Armory"
@@ -909,6 +949,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/detectives_office/private_investigators_office
name = "Private Investigator's Office"
icon_state = "detective"
sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/security/range
name = "Firing Range"
@@ -986,18 +1027,17 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/quartermaster
name = "Quartermasters"
icon_state = "quart"
///////////WORK IN PROGRESS//////////
sound_environment = SOUND_AREA_STANDARD_STATION
/area/quartermaster/sorting
name = "Delivery Office"
icon_state = "cargo_delivery"
sound_environment = SOUND_AREA_STANDARD_STATION
/area/quartermaster/warehouse
name = "Warehouse"
icon_state = "cargo_warehouse"
////////////WORK IN PROGRESS//////////
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/quartermaster/office
name = "Cargo Office"
@@ -1006,6 +1046,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/quartermaster/storage
name = "Cargo Bay"
icon_state = "cargo_bay"
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/quartermaster/qm
name = "Quartermaster's Office"
@@ -1035,10 +1076,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Custodial Closet"
icon_state = "janitor"
flags_1 = NONE
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/hydroponics
name = "Hydroponics"
icon_state = "hydro"
sound_environment = SOUND_AREA_STANDARD_STATION
/area/hydroponics/garden
name = "Garden"
@@ -1047,6 +1090,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/hydroponics/garden/abandoned
name = "Abandoned Garden"
icon_state = "abandoned_garden"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/hydroponics/garden/monastery
name = "Monastery Garden"
@@ -1057,6 +1101,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/science
name = "Science Division"
icon_state = "toxlab"
sound_environment = SOUND_AREA_STANDARD_STATION
/area/science/lab
name = "Research and Development"
@@ -1139,12 +1184,15 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/science/research/abandoned
name = "Abandoned Research Lab"
icon_state = "medresearch"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/science/nanite
name = "Nanite Lab"
icon_state = "toxmisc"
//Storage
/area/storage
sound_environment = SOUND_AREA_STANDARD_STATION
/area/storage/tools
name = "Auxiliary Tool Storage"
@@ -1210,6 +1258,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "Construction Area"
icon_state = "yellow"
ambientsounds = ENGINEERING
sound_environment = SOUND_AREA_STANDARD_STATION
/area/construction/minisat_exterior
name = "Minisat Exterior"
@@ -1218,6 +1267,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/construction/mining/aux_base
name = "Auxiliary Base Construction"
icon_state = "yellow"
sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/construction/mining/aux_base/closet
name = "Auxiliary Closet Construction"
@@ -1273,6 +1323,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/security/armory
name = "Armory"
@@ -1297,10 +1349,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/ai_monitored/turret_protected/ai_upload
name = "AI Upload Chamber"
icon_state = "ai_upload"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ai_monitored/turret_protected/ai_upload_foyer
name = "AI Upload Access"
icon_state = "ai_foyer"
sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ai_monitored/turret_protected/ai
name = "AI Chamber"
@@ -1309,6 +1363,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/ai_monitored/turret_protected/aisat
name = "AI Satellite"
icon_state = "ai"
sound_environment = SOUND_ENVIRONMENT_ROOM
/area/ai_monitored/turret_protected/aisat/atmos
name = "AI Satellite Atmos"
@@ -1333,6 +1388,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/ai_monitored/turret_protected/aisat_interior
name = "AI Satellite Antechamber"
icon_state = "ai"
sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/ai_monitored/turret_protected/AIsatextFP
name = "AI Sat Ext"
@@ -1386,6 +1442,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/tcommsat/computer
name = "Telecomms Control Room"
icon_state = "tcomsatcomp"
sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/tcommsat/server
name = "Telecomms Server Room"
+1
View File
@@ -3,6 +3,7 @@
clockwork_warp_allowed = FALSE
var/list/obj/machinery/camera/motioncameras = list()
var/list/datum/weakref/motionTargets = list()
sound_environment = SOUND_ENVIRONMENT_ROOM
/area/ai_monitored/Initialize(mapload)
. = ..()
+157 -62
View File
@@ -1,16 +1,72 @@
// Areas.dm
/**
* # area
*
* A grouping of tiles into a logical space, mostly used by map editors
*/
/area
level = null
name = "Space"
icon = 'icons/turf/areas.dmi'
icon_state = "unknown"
layer = AREA_LAYER
plane = BLACKNESS_PLANE //Keeping this on the default plane, GAME_PLANE, will make area overlays fail to render on FLOOR_PLANE.
//Keeping this on the default plane, GAME_PLANE, will make area overlays fail to render on FLOOR_PLANE.
plane = BLACKNESS_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
invisibility = INVISIBILITY_LIGHTING
var/fire = null
///Whether there is an atmos alarm in this area
var/atmosalm = FALSE
var/poweralm = FALSE
var/lightswitch = TRUE
/// All beauty in this area combined, only includes indoor area.
var/totalbeauty = 0
/// Beauty average per open turf in the area
var/beauty = 0
/// If a room is too big it doesn't have beauty.
var/beauty_threshold = 150
/// For space, the asteroid, lavaland, etc. Used with blueprints or with weather to determine if we are adding a new area (vs editing a station room)
var/outdoors = FALSE
/// Size of the area in open turfs, only calculated for indoors areas.
var/areasize = 0
/// Bonus mood for being in this area
var/mood_bonus = 0
/// Mood message for being here, only shows up if mood_bonus != 0
var/mood_message = "<span class='nicegreen'>This area is pretty nice!\n</span>"
///Will objects this area be needing power?
var/requires_power = TRUE
/// This gets overridden to 1 for space in area/Initialize().
var/always_unpowered = FALSE
var/power_equip = TRUE
var/power_light = TRUE
var/power_environ = TRUE
var/has_gravity = FALSE
var/parallax_movedir = 0
var/list/ambientsounds = GENERIC
flags_1 = CAN_BE_DIRTY_1
var/list/firedoors
var/list/cameras
var/list/firealarms
var/firedoors_last_closed_on = 0
///This datum, if set, allows terrain generation behavior to be ran on Initialize()
// var/datum/map_generator/map_generator
///Used to decide what kind of reverb the area makes sound have
var/sound_environment = SOUND_ENVIRONMENT_NONE
/// CIT SPECIFIC VARS
/// Set in New(); preserves the name set by the map maker, even if renamed by the Blueprints.
var/map_name
@@ -37,29 +93,8 @@
/// Considered space for hull shielding
var/considered_hull_exterior = FALSE
var/fire = null
var/atmos = TRUE
var/atmosalm = FALSE
var/poweralm = TRUE
var/lightswitch = TRUE
var/totalbeauty = 0 //All beauty in this area combined, only includes indoor area.
var/beauty = 0 // Beauty average per open turf in the area
var/beauty_threshold = 150 //If a room is too big it doesn't have beauty.
var/requires_power = TRUE
/// This gets overridden to 1 for space in area/Initialize().
var/always_unpowered = FALSE
/// For space, the asteroid, lavaland, etc. Used with blueprints to determine if we are adding a new area (vs editing a station room)
var/outdoors = FALSE
/// Size of the area in open turfs, only calculated for indoors areas.
var/areasize = 0
var/power_equip = TRUE
var/power_light = TRUE
var/power_environ = TRUE
var/music = null
var/used_equip = 0
var/used_light = 0
@@ -68,7 +103,6 @@
var/static_light = 0
var/static_environ
var/has_gravity = 0
/// Are you forbidden from teleporting to the area? (centcom, mobs, wizard, hand teleporter)
var/noteleport = FALSE
/// Hides area from player Teleport function.
@@ -80,15 +114,6 @@
var/no_air = null
var/parallax_movedir = 0
var/list/ambientsounds = GENERIC
flags_1 = CAN_BE_DIRTY_1
var/list/firedoors
var/list/cameras
var/list/firealarms
var/firedoors_last_closed_on = 0
var/xenobiology_compatible = FALSE //Can the Xenobio management console transverse this area by default?
var/list/canSmoothWithAreas //typecache to limit the areas that atoms in this area can smooth with
@@ -107,10 +132,24 @@
var/nightshift_public_area = NIGHTSHIFT_AREA_NONE //considered a public area for nightshift
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
/**
* A list of teleport locations
*
* Adding a wizard area teleport list because motherfucking lag -- Urist
* I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game
*/
GLOBAL_LIST_EMPTY(teleportlocs)
/**
* Generate a list of turfs you can teleport to from the areas list
*
* Includes areas if they're not a shuttle or not not teleport or have no contents
*
* The chosen turf is the first item in the areas contents that is a station level
*
* The returned list of turfs is sorted by name
*/
/proc/process_teleport_locs()
for(var/V in GLOB.sortedAreas)
var/area/AR = V
@@ -124,11 +163,19 @@ GLOBAL_LIST_EMPTY(teleportlocs)
if (picked && is_station_level(picked.z))
GLOB.teleportlocs[AR.name] = AR
sortTim(GLOB.teleportlocs, /proc/cmp_text_dsc)
// ===
sortTim(GLOB.teleportlocs, /proc/cmp_text_asc)
/**
* Called when an area loads
*
* Adds the item to the GLOB.areas_by_type list based on area type
*/
/area/New()
// This interacts with the map loader, so it needs to be set immediately
// rather than waiting for atoms to initialize.
if (unique)
GLOB.areas_by_type[type] = src
if(!minimap_color) // goes in New() because otherwise it doesn't fucking work
// generate one using the icon_state
if(icon_state && icon_state != "unknown")
@@ -137,14 +184,18 @@ GLOBAL_LIST_EMPTY(teleportlocs)
minimap_color = I.GetPixel(1,1)
else // no icon state? use random.
minimap_color = rgb(rand(50,70),rand(50,70),rand(50,70)) // This interacts with the map loader, so it needs to be set immediately
// rather than waiting for atoms to initialize.
if (unique)
GLOB.areas_by_type[type] = src
return ..()
/**
* Initalize this area
*
* intializes the dynamic area lighting and also registers the area with the z level via
* reg_in_areas_in_z
*
* returns INITIALIZE_HINT_LATELOAD
*/
/area/Initialize()
icon_state = ""
layer = AREA_LAYER
map_name = name // Save the initial (the name set in the map) name of the area.
canSmoothWithAreas = typecacheof(canSmoothWithAreas)
@@ -198,29 +249,55 @@ GLOBAL_LIST_EMPTY(teleportlocs)
return INITIALIZE_HINT_LATELOAD
/**
* Sets machine power levels in the area
*/
/area/LateInitialize()
if(!base_area) //we don't want to run it twice.
power_change() // all machines set to current power level, also updates icon
update_beauty()
/area/proc/reg_in_areas_in_z()
if(contents.len)
var/list/areas_in_z = SSmapping.areas_in_z
var/z
update_areasize()
for(var/i in 1 to contents.len)
var/atom/thing = contents[i]
if(!thing)
continue
z = thing.z
break
if(!z)
WARNING("No z found for [src]")
return
if(!areas_in_z["[z]"])
areas_in_z["[z]"] = list()
areas_in_z["[z]"] += src
/// Soon &trade;
/area/proc/RunGeneration()
// if(map_generator)
// map_generator = new map_generator()
// var/list/turfs = list()
// for(var/turf/T in contents)
// turfs += T
// map_generator.generate_terrain(turfs)
/area/proc/test_gen()
// if(map_generator)
// var/list/turfs = list()
// for(var/turf/T in contents)
// turfs += T
// map_generator.generate_terrain(turfs)
/**
* Register this area as belonging to a z level
*
* Ensures the item is added to the SSmapping.areas_in_z list for this z
*/
/area/proc/reg_in_areas_in_z()
if(!length(contents))
return
var/list/areas_in_z = SSmapping.areas_in_z
update_areasize()
if(!z)
WARNING("No z found for [src]")
return
if(!areas_in_z["[z]"])
areas_in_z["[z]"] = list()
areas_in_z["[z]"] += src
/**
* Destroy an area and clean it up
*
* Removes the area from GLOB.areas_by_type and also stops it processing on SSobj
*
* This is despite the fact that no code appears to put it on SSobj, but
* who am I to argue with old coders
*/
/area/Destroy()
if(GLOB.areas_by_type[type] == src)
GLOB.areas_by_type[type] = null
@@ -240,6 +317,11 @@ GLOBAL_LIST_EMPTY(teleportlocs)
STOP_PROCESSING(SSobj, src)
return ..()
/**
* Generate a power alert for this area
*
* Sends to all ai players, alert consoles, drones and alarm monitor programs in the world
*/
/area/proc/poweralert(state, obj/source)
if (state != poweralm)
poweralm = state
@@ -521,6 +603,13 @@ GLOBAL_LIST_EMPTY(teleportlocs)
used_environ += amount
/**
* Call back when an atom enters an area
*
* Sends signals COMSIG_AREA_ENTERED and COMSIG_ENTER_AREA (to the atom)
*
* If the area has ambience, then it plays some ambience music to the ambience channel
*/
/area/Entered(atom/movable/M, atom/OldLoc)
set waitfor = FALSE
SEND_SIGNAL(src, COMSIG_AREA_ENTERED, M)
@@ -563,6 +652,12 @@ GLOBAL_LIST_EMPTY(teleportlocs)
return FALSE //Too big
beauty = totalbeauty / areasize
/**
* Called when an atom exits an area
*
* Sends signals COMSIG_AREA_EXITED and COMSIG_EXIT_AREA (to the atom)
*/
/area/Exited(atom/movable/M)
SEND_SIGNAL(src, COMSIG_AREA_EXITED, M)
SEND_SIGNAL(M, COMSIG_EXIT_AREA, src) //The atom that exits the area
+1
View File
@@ -9,6 +9,7 @@ Unused icons for new areas are "awaycontent1" ~ "awaycontent30"
icon_state = "away"
has_gravity = STANDARD_GRAVITY
ambientsounds = AWAY_MISSION
sound_environment = SOUND_ENVIRONMENT_ROOM
/area/awaymission/beach
name = "Beach"
+1
View File
@@ -4,6 +4,7 @@
dynamic_lighting = DYNAMIC_LIGHTING_DISABLED
flags_1 = 0
hidden = TRUE
sound_environment = SOUND_ENVIRONMENT_PADDED_CELL
var/obj/machinery/computer/holodeck/linked
var/restricted = 0 // if true, program goes on emag list
+3
View File
@@ -19,6 +19,7 @@
flags_1 = NONE
ambientsounds = MINING
flora_allowed = FALSE
sound_environment = SOUND_AREA_STANDARD_STATION
/area/mine/unexplored
name = "Mine"
@@ -86,6 +87,7 @@
has_gravity = STANDARD_GRAVITY
flags_1 = NONE
flora_allowed = TRUE
sound_environment = SOUND_AREA_LAVALAND
/area/lavaland/surface
name = "Lavaland"
@@ -139,6 +141,7 @@
flags_1 = NONE
flora_allowed = TRUE
blob_allowed = FALSE
sound_environment = SOUND_AREA_ICEMOON
/area/icemoon/surface
name = "Icemoon"
+1
View File
@@ -7,6 +7,7 @@
hidden = TRUE
dynamic_lighting = DYNAMIC_LIGHTING_FORCED
ambientsounds = RUINS
sound_environment = SOUND_ENVIRONMENT_STONEROOM
/area/ruin/unpowered
+1
View File
@@ -12,6 +12,7 @@
icon_state = "shuttle"
// Loading the same shuttle map at a different time will produce distinct area instances.
unique = FALSE
sound_environment = SOUND_ENVIRONMENT_ROOM
/area/shuttle/Initialize()
if(!canSmoothWithAreas)
+10 -10
View File
@@ -60,7 +60,7 @@
blocked = TRUE
var/attackamt = rand(2,6)
temp = "You attack for [attackamt] damage!"
playsound(loc, 'sound/arcade/hit.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3)
updateUsrDialog()
if(turtle > 0)
turtle--
@@ -74,7 +74,7 @@
var/pointamt = rand(1,3)
var/healamt = rand(6,8)
temp = "You use [pointamt] magic to heal for [healamt] damage!"
playsound(loc, 'sound/arcade/heal.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/heal.ogg', 50, TRUE, extrarange = -3)
updateUsrDialog()
turtle++
@@ -89,7 +89,7 @@
blocked = TRUE
var/chargeamt = rand(4,7)
temp = "You regain [chargeamt] points"
playsound(loc, 'sound/arcade/mana.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/mana.ogg', 50, TRUE, extrarange = -3)
player_mp += chargeamt
if(turtle > 0)
turtle--
@@ -124,7 +124,7 @@
if(!gameover)
gameover = TRUE
temp = "[enemy_name] has fallen! Rejoice!"
playsound(loc, 'sound/arcade/win.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3)
if(obj_flags & EMAGGED)
new /obj/effect/spawner/newbomb/timer/syndicate(loc)
@@ -141,13 +141,13 @@
else if ((obj_flags & EMAGGED) && (turtle >= 4))
var/boomamt = rand(5,10)
temp = "[enemy_name] throws a bomb, exploding you for [boomamt] damage!"
playsound(loc, 'sound/arcade/boom.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/boom.ogg', 50, TRUE, extrarange = -3)
player_hp -= boomamt
else if ((enemy_mp <= 5) && (prob(70)))
var/stealamt = rand(2,3)
temp = "[enemy_name] steals [stealamt] of your power!"
playsound(loc, 'sound/arcade/steal.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/steal.ogg', 50, TRUE, extrarange = -3)
player_mp -= stealamt
updateUsrDialog()
@@ -155,27 +155,27 @@
gameover = TRUE
sleep(turn_speed)
temp = "You have been drained! GAME OVER"
playsound(loc, 'sound/arcade/lose.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/lose.ogg', 50, TRUE, extrarange = -3)
if(obj_flags & EMAGGED)
usr.gib()
SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("loss", "mana", (obj_flags & EMAGGED ? "emagged":"normal")))
else if ((enemy_hp <= 10) && (enemy_mp > 4))
temp = "[enemy_name] heals for 4 health!"
playsound(loc, 'sound/arcade/heal.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/heal.ogg', 50, TRUE, extrarange = -3)
enemy_hp += 4
enemy_mp -= 4
else
var/attackamt = rand(3,6)
temp = "[enemy_name] attacks for [attackamt] damage!"
playsound(loc, 'sound/arcade/hit.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3)
player_hp -= attackamt
if ((player_mp <= 0) || (player_hp <= 0))
gameover = TRUE
temp = "You have been crushed! GAME OVER"
playsound(loc, 'sound/arcade/lose.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/lose.ogg', 50, TRUE, extrarange = -3)
if(obj_flags & EMAGGED)
usr.gib()
SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("loss", "hp", (obj_flags & EMAGGED ? "emagged":"normal")))
@@ -78,7 +78,7 @@
columns = 0
mine_placed = 0
if(href_list["Easy"])
playsound(loc, startup_sound, 50, 0, extrarange = -3, falloff = 10)
playsound(loc, startup_sound, 50, FALSE, extrarange = -3)
flag_text = "OFF"
game_status = MINESWEEPER_GAME_PLAYING
reset_board = TRUE
@@ -87,7 +87,7 @@
columns = 10
mine_limit = 10
if(href_list["Intermediate"])
playsound(loc, startup_sound, 50, 0, extrarange = -3, falloff = 10)
playsound(loc, startup_sound, 50, FALSE, extrarange = -3)
flag_text = "OFF"
game_status = MINESWEEPER_GAME_PLAYING
reset_board = TRUE
@@ -96,7 +96,7 @@
columns = 17
mine_limit = 40
if(href_list["Hard"])
playsound(loc, startup_sound, 50, 0, extrarange = -3, falloff = 10)
playsound(loc, startup_sound, 50, FALSE, extrarange = -3)
flag_text = "OFF"
game_status = MINESWEEPER_GAME_PLAYING
reset_board = TRUE
@@ -110,9 +110,9 @@
game_status = MINESWEEPER_GAME_PLAYING
reset_board = TRUE
difficulty = "Custom"
playsound(loc, startup_sound, 50, 0, extrarange = -3, falloff = 10)
playsound(loc, startup_sound, 50, FALSE, extrarange = -3)
if(href_list["Flag"])
playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, FALSE, extrarange = -3)
if(!flagging)
flagging = TRUE
flag_text = "ON"
@@ -122,10 +122,10 @@
if(game_status == MINESWEEPER_GAME_MAIN_MENU)
if(CHECK_BITFIELD(obj_flags, EMAGGED))
playsound(loc, 'sound/arcade/minesweeper_emag2.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_emag2.ogg', 50, FALSE, extrarange = -3)
web += "<font size='2'>Explode in the game, explode in real life!<br>What difficulty do you want to play?<br><br><br><br><b><a href='byond://?src=[REF(src)];Easy=1'><font color='#cc66ff'>Easy (9x9 board, 10 mines)</font></a><br><a href='byond://?src=[REF(src)];Intermediate=1'><font color='#cc66ff'>Intermediate (16x16 board, 40 mines)</font></a><br><a href='byond://?src=[REF(src)];Hard=1'><font color='#cc66ff'>Hard (16x30 board, 99 mines)</font></a><br><a href='byond://?src=[REF(src)];Custom=1'><font color='#cc66ff'>Custom</font>"
else
playsound(loc, 'sound/arcade/minesweeper_startup.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_startup.ogg', 50, FALSE, extrarange = -3)
web += web_difficulty_menu
if(game_status == MINESWEEPER_GAME_PLAYING)
@@ -152,7 +152,7 @@
if(table[y1][x1] < 10 && table[y1][x1] >= 0) //Check that it's not already revealed, and stop flag removal if we're out of flag mode
table[y1][x1] += 10
if(table[y1][x1] != 10)
playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, FALSE, extrarange = -3)
else
if(game_status != MINESWEEPER_GAME_LOST && game_status != MINESWEEPER_GAME_WON)
game_status = MINESWEEPER_GAME_LOST
@@ -164,14 +164,14 @@
if(mine_sound)
switch(rand(1,3)) //Play every time a mine is hit
if(1)
playsound(loc, 'sound/arcade/minesweeper_explosion1.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_explosion1.ogg', 50, FALSE, extrarange = -3)
if(2)
playsound(loc, 'sound/arcade/minesweeper_explosion2.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_explosion2.ogg', 50, FALSE, extrarange = -3)
if(3)
playsound(loc, 'sound/arcade/minesweeper_explosion3.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_explosion3.ogg', 50, FALSE, extrarange = -3)
mine_sound = FALSE
else
playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, FALSE, extrarange = -3)
if(table[y1][x1] >= 0) //Check that it's not already flagged
table[y1][x1] -= 10
else if(table[y1][x1] < 0) //If flagged, remove the flag
@@ -182,7 +182,7 @@
game_status = MINESWEEPER_GAME_PLAYING
if(table[y1][x1] >= 10) //If revealed, become unrevealed!
if(mine_sound)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3)
mine_sound = FALSE
table[y1][x1] -= 10
if(table[y1][x1] > 10 && !reset_board)
@@ -243,10 +243,10 @@
if(safe_squares_revealed >= win_condition && game_status == MINESWEEPER_GAME_PLAYING)
game_status = MINESWEEPER_GAME_WON
if(rows < 10 || columns < 10) //If less than easy difficulty
playsound(loc, 'sound/arcade/minesweeper_winfail.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_winfail.ogg', 50, FALSE, extrarange = -3)
say("You cleared the board of all mines, but you picked too small of a board! Try again with at least a 9x9 board!")
else
playsound(loc, 'sound/arcade/minesweeper_win.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_win.ogg', 50, FALSE, extrarange = -3)
say("You cleared the board of all mines! Congratulations!")
if(CHECK_BITFIELD(obj_flags, EMAGGED))
var/itemname
@@ -299,32 +299,32 @@
ENABLE_BITFIELD(obj_flags, EMAGGED)
if(game_status == MINESWEEPER_GAME_MAIN_MENU)
to_chat(user, "<span class='warning'>An ominous tune plays from the arcade's speakers!</span>")
playsound(user, 'sound/arcade/minesweeper_emag1.ogg', 100, 0, extrarange = 3, falloff = 10)
playsound(user, 'sound/arcade/minesweeper_emag1.ogg', 100, FALSE, extrarange = 3)
else //Can't let you do that, star fox!
to_chat(user, "<span class='warning'>The machine buzzes and sparks... the game has been reset!</span>")
playsound(user, 'sound/machines/buzz-sigh.ogg', 100, 0, extrarange = 3, falloff = 10) //Loud buzz
playsound(user, 'sound/machines/buzz-sigh.ogg', 100, FALSE, extrarange = 3) //Loud buzz
game_status = MINESWEEPER_GAME_MAIN_MENU
return TRUE
/obj/machinery/computer/arcade/minesweeper/proc/custom_generation(mob/user)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10) //Entered into the menu so ping sound
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) //Entered into the menu so ping sound
var/new_rows = input(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") as null|num
if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
new_rows = clamp(new_rows + 1, 4, 30)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3)
var/new_columns = input(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") as null|num
if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
new_columns = clamp(new_columns + 1, 4, 50)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3)
var/grid_area = (new_rows - 1) * (new_columns - 1)
var/lower_limit = round(grid_area*0.156)
var/upper_limit = round(grid_area*0.85)
var/new_mine_limit = input(user, "How many mines do you want? (Minimum: [lower_limit], Maximum: [upper_limit])", "Minesweeper Mines") as null|num
if(!new_mine_limit || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3)
rows = new_rows
columns = new_columns
mine_limit = clamp(new_mine_limit, lower_limit, upper_limit)
@@ -17,14 +17,14 @@
to_chat(c_user, "<span class='warning'>You move your hand towards the machine, and begin to hesitate as a bloodied guillotine emerges from inside of it...</span>")
if(do_after(c_user, 50, target = src))
to_chat(c_user, "<span class='userdanger'>The guillotine drops on your arm, and the machine sucks it in!</span>")
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
playsound(loc, 'sound/weapons/slice.ogg', 25, TRUE, -1)
var/which_hand = BODY_ZONE_L_ARM
if(!(c_user.active_hand_index % 2))
which_hand = BODY_ZONE_R_ARM
var/obj/item/bodypart/chopchop = c_user.get_bodypart(which_hand)
chopchop.dismember()
qdel(chopchop)
playsound(loc, 'sound/arcade/win.ogg', 50, 1, extrarange = -3, falloff = 10)
playsound(loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3)
for(var/i=1; i<=rand(3,5); i++)
prizevend(user)
else
+3 -3
View File
@@ -130,7 +130,7 @@
/obj/machinery/quantumpad/proc/doteleport(mob/user, obj/machinery/quantumpad/target_pad = linked_pad)
if(target_pad)
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, 1)
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, TRUE)
teleporting = TRUE
spawn(teleport_speed)
@@ -155,9 +155,9 @@
target_pad.sparks()
flick("qpad-beam", src)
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, TRUE)
flick("qpad-beam", target_pad)
playsound(get_turf(target_pad), 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
playsound(get_turf(target_pad), 'sound/weapons/emitter2.ogg', 25, TRUE)
for(var/atom/movable/ROI in get_turf(src))
if(QDELETED(ROI))
continue //sleeps in CHECK_TICK
@@ -347,9 +347,9 @@
last_hearcheck = world.time
for(var/mob/H in hearing_mobs)
if(!istype(H.loc, /obj/item/dogborg/sleeper))
H.playsound_local(source, null, 45, falloff = 0, S = pred_death)
H.playsound_local(source, null, 45, S = pred_death)
else if(H in contents)
H.playsound_local(source, null, 65, falloff = 0, S = prey_death)
H.playsound_local(source, null, 65, S = prey_death)
for(var/belly in T.vore_organs)
var/obj/belly/B = belly
for(var/atom/movable/thing in B)
@@ -391,9 +391,9 @@
last_hearcheck = world.time
for(var/mob/H in hearing_mobs)
if(!istype(H.loc, /obj/item/dogborg/sleeper))
H.playsound_local(source, null, 45, falloff = 0, S = pred_digest)
H.playsound_local(source, null, 45, S = pred_digest)
else if(H in contents)
H.playsound_local(source, null, 65, falloff = 0, S = prey_digest)
H.playsound_local(source, null, 65, S = prey_digest)
update_gut(hound)
+117 -38
View File
@@ -1,4 +1,47 @@
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, soundenvwet = -10000, soundenvdry = 0)
///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
/*! playsound
playsound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that.
source - Origin of sound
soundin - Either a file, or a string that can be used to get an SFX
vol - The volume of the sound, excluding falloff and pressure affection.
vary - bool that determines if the sound changes pitch every time it plays
extrarange - modifier for sound range. This gets added on top of SOUND_RANGE
falloff_exponent - Rate of falloff for the audio. Higher means quicker drop to low volume. Should generally be over 1 to indicate a quick dive to 0 rather than a slow dive.
frequency - playback speed of audio
channel - The channel the sound is played at
pressure_affected - Whether or not difference in pressure affects the sound (E.g. if you can hear in space)
ignore_walls - Whether or not the sound can pass through walls.
falloff_distance - Distance at which falloff begins. Sound is at peak volume (in regards to falloff) aslong as it is in this range.
*/
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff_exponent = SOUND_FALLOFF_EXPONENT, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, use_reverb = TRUE)
if(isarea(source))
CRASH("playsound(): source is an area")
@@ -10,26 +53,60 @@
//allocate a channel if necessary now so its the same for everyone
channel = channel || SSsounds.random_available_channel()
// Looping through the player list has the added bonus of working for mobs inside containers
// Looping through the player list has the added bonus of working for mobs inside containers
var/sound/S = sound(get_sfx(soundin))
var/maxdistance = (world.view + extrarange)
var/z = turf_source.z
var/list/listeners = SSmobs.clients_by_zlevel[z]
var/maxdistance = SOUND_RANGE + extrarange
var/source_z = turf_source.z
var/list/listeners = SSmobs.clients_by_zlevel[source_z].Copy()
var/turf/above_turf = SSmapping.get_turf_above(turf_source)
var/turf/below_turf = SSmapping.get_turf_below(turf_source)
if(!ignore_walls) //these sounds don't carry through walls
listeners = listeners & hearers(maxdistance,turf_source)
if(above_turf && istransparentturf(above_turf))
listeners += hearers(maxdistance,above_turf)
if(below_turf && istransparentturf(turf_source))
listeners += hearers(maxdistance,below_turf)
else
if(above_turf && istransparentturf(above_turf))
listeners += SSmobs.clients_by_zlevel[above_turf.z]
if(below_turf && istransparentturf(turf_source))
listeners += SSmobs.clients_by_zlevel[below_turf.z]
for(var/P in listeners)
var/mob/M = P
if(get_dist(M, turf_source) <= maxdistance)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, soundenvwet, soundenvdry)
for(var/P in SSmobs.dead_players_by_zlevel[z])
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance)
for(var/P in SSmobs.dead_players_by_zlevel[source_z])
var/mob/M = P
if(get_dist(M, turf_source) <= maxdistance)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, soundenvwet, soundenvdry)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance)
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, channel = 0, pressure_affected = TRUE, sound/S, envwet = -10000, envdry = 0, manual_x, manual_y, distance_multiplier = 1)
if(audiovisual_redirect)
var/turf/T = get_turf(src)
audiovisual_redirect.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S, 0, -1000, turf_source.x - T.x, turf_source.y - T.y, distance_multiplier)
/*! playsound
playsound_local is a proc used to play a sound directly on a mob from a specific turf.
This is called by playsound to send sounds to players, in which case it also gets the max_distance of that sound.
turf_source - Origin of sound
soundin - Either a file, or a string that can be used to get an SFX
vol - The volume of the sound, excluding falloff
vary - bool that determines if the sound changes pitch every time it plays
frequency - playback speed of audio
falloff_exponent - Rate of falloff for the audio. Higher means quicker drop to low volume. Should generally be over 1 to indicate a quick dive to 0 rather than a slow dive.
channel - The channel the sound is played at
pressure_affected - Whether or not difference in pressure affects the sound (E.g. if you can hear in space)
max_distance - The peak distance of the sound, if this is a 3D sound
falloff_distance - Distance at which falloff begins, if this is a 3D sound
distance_multiplier - Can be used to multiply the distance at which the sound is heard
*/
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/S, max_distance, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = 1, use_reverb = TRUE)
if(!client || !can_hear())
return
@@ -39,7 +116,6 @@
S.wait = 0 //No queue
S.channel = channel || SSsounds.random_available_channel()
S.volume = vol
S.environment = 7
if(vary)
if(frequency)
@@ -51,13 +127,13 @@
var/turf/T = get_turf(src)
//sound volume falloff with distance
var/distance = 0
if(!manual_x && !manual_y)
distance = get_dist(T, turf_source)
var/distance = get_dist(T, turf_source)
distance *= distance_multiplier
S.volume -= max(distance - world.view, 0) * 2 //multiplicative falloff to add on top of natural audio falloff.
if(max_distance) //If theres no max_distance we're not a 3D sound, so no falloff.
S.volume -= (max(distance - falloff_distance, 0) ** (1 / falloff_exponent)) / ((max(max_distance, distance) - falloff_distance) ** (1 / falloff_exponent)) * S.volume
//https://www.desmos.com/calculator/sqdfl8ipgf
if(pressure_affected)
//Atmosphere affects sound
@@ -72,8 +148,6 @@
else //space
pressure_factor = 0
S.echo = list(envdry, null, envwet, null, null, null, null, null, null, null, null, null, null, 1, 1, 1, null, null)
if(distance <= 1)
pressure_factor = max(pressure_factor, 0.15) //touching the source of the sound
@@ -83,31 +157,36 @@
if(S.volume <= 0)
return //No sound
var/dx = 0 // Hearing from the right/left
if(!manual_x)
dx = turf_source.x - T.x
else
dx = manual_x
var/dx = turf_source.x - T.x // Hearing from the right/left
S.x = dx * distance_multiplier
var/dz = 0 // Hearing from infront/behind
if(!manual_x)
dz = turf_source.y - T.y
else
dz = manual_y
var/dz = turf_source.y - T.y // Hearing from infront/behind
S.z = dz * distance_multiplier
// The y value is for above your head, but there is no ceiling in 2d spessmens.
S.y = 1
S.falloff = (falloff ? falloff : FALLOFF_SOUNDS)
var/dy = (turf_source.z - T.z) * 5 * distance_multiplier // Hearing from above / below, multiplied by 5 because we assume height is further along coords.
S.y = dy
S.falloff = max_distance || 1 //use max_distance, else just use 1 as we are a direct sound so falloff isnt relevant.
if(S.environment == SOUND_ENVIRONMENT_NONE)
if(sound_environment_override != SOUND_ENVIRONMENT_NONE)
S.environment = sound_environment_override
else
var/area/A = get_area(src)
if(A.sound_environment != SOUND_ENVIRONMENT_NONE)
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)
/proc/sound_to_playing_players(soundin, volume = 100, vary = FALSE, frequency = 0, channel = 0, pressure_affected = FALSE, sound/S)
if(!S)
S = sound(get_sfx(soundin))
for(var/m in GLOB.player_list)
if(ismob(m) && !isnewplayer(m))
var/mob/M = m
M.playsound_local(M, null, volume, vary, frequency, falloff, channel, pressure_affected, S)
M.playsound_local(M, null, volume, vary, frequency, null, channel, pressure_affected, S)
/mob/proc/stop_sound_channel(chan)
SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = chan))
@@ -130,14 +209,14 @@
/proc/get_sfx(soundin)
if(istext(soundin))
switch(soundin)
if ("explosion_creaking") // from skyrat-ss13/skyrat13/pull/3295
soundin = pick('sound/effects/explosioncreak1.ogg', 'sound/effects/explosioncreak2.ogg')
if ("hull_creaking") // from skyrat-ss13/skyrat13/pull/3295
soundin = pick('sound/effects/creak1.ogg', 'sound/effects/creak2.ogg', 'sound/effects/creak3.ogg')
if ("shatter")
soundin = pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg')
if ("explosion")
soundin = pick('sound/effects/explosion1.ogg','sound/effects/explosion2.ogg')
if ("explosion_creaking")
soundin = pick('sound/effects/explosioncreak1.ogg', 'sound/effects/explosioncreak2.ogg')
if ("hull_creaking")
soundin = pick('sound/effects/creak1.ogg', 'sound/effects/creak2.ogg', 'sound/effects/creak3.ogg')
if ("sparks")
soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
if ("rustle")