mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Converts airlocks to have departmental based wires. (#30196)
* the majority * Update code/game/area/ss13_areas/science_areas.dm Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> --------- Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
This commit is contained in:
co-authored by
PollardTheDragon
warriorstar-orion
parent
e1d8325fbb
commit
211ccbe233
@@ -83,3 +83,4 @@
|
||||
#define WIRE_DISABLE "Disable"
|
||||
#define WIRE_INTERFACE "Interface"
|
||||
|
||||
#define ZLVL_BASED_WIRES "Zlvl_based_wires"
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// Wires for airlocks
|
||||
|
||||
/datum/wires/airlock/secure
|
||||
randomize = TRUE
|
||||
|
||||
/datum/wires/airlock
|
||||
holder_type = /obj/machinery/door/airlock
|
||||
wire_count = 12 // 10 actual, 2 duds.
|
||||
@@ -15,6 +12,50 @@
|
||||
)
|
||||
return ..()
|
||||
|
||||
/datum/wires/airlock/maint
|
||||
dictionary_key = /datum/wires/airlock/maint
|
||||
proper_name = "Maintenance Airlock"
|
||||
|
||||
/datum/wires/airlock/command
|
||||
dictionary_key = /datum/wires/airlock/command
|
||||
proper_name = "Command Airlock"
|
||||
|
||||
/datum/wires/airlock/service
|
||||
dictionary_key = /datum/wires/airlock/service
|
||||
proper_name = "Service Airlock"
|
||||
|
||||
/datum/wires/airlock/security
|
||||
dictionary_key = /datum/wires/airlock/security
|
||||
proper_name = "Security Airlock"
|
||||
|
||||
/datum/wires/airlock/engineering
|
||||
dictionary_key = /datum/wires/airlock/engineering
|
||||
proper_name = "Engineering Airlock"
|
||||
|
||||
/datum/wires/airlock/medbay
|
||||
dictionary_key = /datum/wires/airlock/medbay
|
||||
proper_name = "Medbay Airlock"
|
||||
|
||||
/datum/wires/airlock/science
|
||||
dictionary_key = /datum/wires/airlock/science
|
||||
proper_name = "Science Airlock"
|
||||
|
||||
/datum/wires/airlock/ai
|
||||
dictionary_key = /datum/wires/airlock/ai
|
||||
proper_name = "AI Airlock"
|
||||
|
||||
/datum/wires/airlock/cargo
|
||||
dictionary_key = /datum/wires/airlock/cargo
|
||||
proper_name = "Cargo Airlock"
|
||||
|
||||
// We want ruin airlocks to be configured by zlvl.
|
||||
// I don't have a good way to do this. Please send me ideas.
|
||||
/datum/wires/airlock/ruin
|
||||
dictionary_key = /datum/wires/airlock/ruin
|
||||
|
||||
/datum/wires/airlock/secure
|
||||
randomize = TRUE
|
||||
|
||||
/datum/wires/airlock/interactable(mob/user)
|
||||
var/obj/machinery/door/airlock/A = holder
|
||||
if(iscarbon(user) && A.Adjacent(user) && A.isElectrified() && A.shock(user, 100))
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
var/atom/holder
|
||||
/// The holder type; used to make sure that the holder is the correct type.
|
||||
var/holder_type
|
||||
/// Key that enables wire assignments to be common across different holders. If null, will use the holder_type as a key.
|
||||
var/dictionary_key = null
|
||||
/// The display name for the TGUI window. For example, given the var is "APC"...
|
||||
/// When the TGUI window is opened, "wires" will be appended to it's title, and it would become "APC wires".
|
||||
var/proper_name = "Unknown"
|
||||
@@ -41,12 +43,13 @@
|
||||
if(randomize)
|
||||
randomize()
|
||||
return
|
||||
|
||||
if(!GLOB.wire_color_directory[holder_type])
|
||||
// If there is a dictionary key set, we'll want to use that. Otherwise, use the holder type.
|
||||
var/key = dictionary_key ? dictionary_key : holder_type
|
||||
if(!GLOB.wire_color_directory[key])
|
||||
randomize()
|
||||
GLOB.wire_color_directory[holder_type] = colors
|
||||
GLOB.wire_color_directory[key] = colors
|
||||
else
|
||||
colors = GLOB.wire_color_directory[holder_type]
|
||||
colors = GLOB.wire_color_directory[key]
|
||||
|
||||
/datum/wires/Destroy()
|
||||
for(var/color in colors)
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
/// Turrets use this list to see if individual power/lethal settings are allowed. Contains the /obj/machinery/turretid for this area
|
||||
var/list/turret_controls = list()
|
||||
|
||||
/// Wire assignment for airlocks in this area
|
||||
var/airlock_wires = /datum/wires/airlock
|
||||
|
||||
/// The flags applied to request consoles spawned in this area.
|
||||
/// See [RC_ASSIST], [RC_SUPPLY], [RC_INFO].
|
||||
var/request_console_flags = 0
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
/area/mine
|
||||
icon_state = "mining"
|
||||
airlock_wires = ZLVL_BASED_WIRES
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
@@ -46,6 +47,7 @@
|
||||
sound_environment = SOUND_AREA_STANDARD_STATION
|
||||
request_console_name = "Mining Outpost"
|
||||
request_console_flags = RC_SUPPLY
|
||||
airlock_wires = /datum/wires/airlock/cargo
|
||||
|
||||
/area/mine/outpost/airlock
|
||||
name = "Mining Station Airlock"
|
||||
@@ -104,6 +106,7 @@
|
||||
/area/mine/outpost/maintenance
|
||||
name = "Mining Station Maintenance"
|
||||
icon_state = "maintcentral"
|
||||
airlock_wires = /datum/wires/airlock/maint
|
||||
|
||||
/area/mine/outpost/maintenance/south
|
||||
name = "Mining Station South Maintenance"
|
||||
@@ -135,6 +138,7 @@
|
||||
/area/mine/laborcamp
|
||||
name = "Labor Camp"
|
||||
icon_state = "brig"
|
||||
airlock_wires = /datum/wires/airlock/security
|
||||
|
||||
/area/mine/laborcamp/security
|
||||
name = "Labor Camp Security"
|
||||
@@ -147,6 +151,7 @@
|
||||
/area/lavaland
|
||||
icon_state = "mining"
|
||||
sound_environment = SOUND_AREA_LAVALAND
|
||||
airlock_wires = ZLVL_BASED_WIRES
|
||||
|
||||
/area/lavaland/surface
|
||||
name = "Lavaland"
|
||||
|
||||
@@ -249,6 +249,7 @@
|
||||
ambientsounds = list('sound/ambience/dvorak_ambience_final.ogg')
|
||||
min_ambience_cooldown = 110 SECONDS // 3 seconds longer than the length of the song
|
||||
max_ambience_cooldown = 170 SECONDS // A minute break at most
|
||||
airlock_wires = /datum/wires/airlock/secure // D.V.O.R.A.K says fuck you and has randomized all their wires. Have fun!
|
||||
|
||||
/area/ruin/space/telecomms/powercontrol
|
||||
name = "\improper Telecommunications Power Control"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
/area/station/turret_protected
|
||||
ambientsounds = list('sound/ambience/ambimalf.ogg', 'sound/ambience/ambitech.ogg', 'sound/ambience/ambitech2.ogg', 'sound/ambience/ambiatmos.ogg', 'sound/ambience/ambiatmos2.ogg')
|
||||
airlock_wires = /datum/wires/airlock/ai
|
||||
|
||||
/area/station/turret_protected/ai_upload
|
||||
name = "\improper AI Upload Chamber"
|
||||
@@ -47,6 +48,7 @@
|
||||
/area/station/telecomms
|
||||
ambientsounds = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg', 'sound/ambience/ambitech.ogg',\
|
||||
'sound/ambience/ambitech2.ogg', 'sound/ambience/ambitech3.ogg', 'sound/ambience/ambimystery.ogg')
|
||||
airlock_wires = /datum/wires/airlock/ai
|
||||
|
||||
/area/station/telecomms/chamber
|
||||
name = "\improper Telecoms Central Compartment"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
|
||||
//Command
|
||||
|
||||
/area/station/command
|
||||
airlock_wires = /datum/wires/airlock/command
|
||||
|
||||
/area/station/command/bridge
|
||||
name = "\improper Bridge"
|
||||
icon_state = "bridge"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
/area/station/engineering
|
||||
ambientsounds = ENGINEERING_SOUNDS
|
||||
sound_environment = SOUND_AREA_LARGE_ENCLOSED
|
||||
airlock_wires = /datum/wires/airlock/engineering
|
||||
|
||||
/area/station/engineering/smes
|
||||
name = "\improper Engineering SMES"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/area/station/legal
|
||||
airlock_wires = /datum/wires/airlock/security
|
||||
|
||||
/area/station/legal/courtroom
|
||||
name = "\improper Courtroom"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
ambientsounds = MAINTENANCE_SOUNDS
|
||||
valid_territory = FALSE
|
||||
sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
|
||||
airlock_wires = /datum/wires/airlock/maint
|
||||
|
||||
/area/station/maintenance/engimaint
|
||||
name = "Engineering Maintenance"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
sound_environment = SOUND_AREA_STANDARD_STATION
|
||||
min_ambience_cooldown = 90 SECONDS
|
||||
max_ambience_cooldown = 180 SECONDS
|
||||
airlock_wires = /datum/wires/airlock/medbay
|
||||
|
||||
/area/station/medical/medbay
|
||||
name = "\improper Medbay"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
/area/station/procedure/trainer_office
|
||||
name = "\improper Trainer's Office"
|
||||
icon_state = "procedure_nct"
|
||||
airlock_wires = /datum/wires/airlock/command // This or security
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
/area/station/science
|
||||
sound_environment = SOUND_AREA_STANDARD_STATION
|
||||
airlock_wires = /datum/wires/airlock/science
|
||||
|
||||
/area/station/science/rnd
|
||||
name = "Research and Development"
|
||||
@@ -90,6 +91,7 @@
|
||||
/area/station/science/server
|
||||
name = "\improper Server Room"
|
||||
icon_state = "server"
|
||||
airlock_wires = /datum/wires/airlock/command // Like every one has command doors.
|
||||
|
||||
/area/station/science/server/coldroom
|
||||
name = "\improper Server Coldroom"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/area/station/security
|
||||
ambientsounds = HIGHSEC_SOUNDS
|
||||
sound_environment = SOUND_AREA_STANDARD_STATION
|
||||
airlock_wires = /datum/wires/airlock/security
|
||||
|
||||
/area/station/security/main
|
||||
name = "\improper Security Office"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/area/station/service
|
||||
airlock_wires = /datum/wires/airlock/service
|
||||
|
||||
/area/station/service/cafeteria
|
||||
name = "\improper Cafe"
|
||||
icon_state = "cafeteria"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
name = "\improper Quartermasters"
|
||||
icon_state = "quart"
|
||||
sound_environment = SOUND_AREA_STANDARD_STATION
|
||||
airlock_wires = /datum/wires/airlock/cargo
|
||||
|
||||
/area/station/supply/lobby
|
||||
name = "\improper Cargo Lobby"
|
||||
@@ -38,12 +39,14 @@
|
||||
name = "Smith's Office"
|
||||
icon_state = "smith"
|
||||
|
||||
// this should really be command/office/cmo
|
||||
/area/station/supply/qm
|
||||
name = "\improper Quartermaster's Office"
|
||||
icon_state = "qm"
|
||||
request_console_flags = RC_ASSIST | RC_INFO
|
||||
request_console_name = "Quartermaster's Desk"
|
||||
request_console_announces = TRUE
|
||||
airlock_wires = /datum/wires/airlock/command
|
||||
|
||||
/area/station/supply/miningdock
|
||||
name = "\improper Mining Dock"
|
||||
|
||||
@@ -146,7 +146,7 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
* one wire for controlling door speed. When active, dor closes at normal rate. When cut, door does not close manually. When pulsed, door attempts to close every tick.
|
||||
*/
|
||||
// You can find code for the airlock wires in the wire datum folder.
|
||||
wires = new(src)
|
||||
wires = get_wires()
|
||||
|
||||
if(closeOtherId != null)
|
||||
addtimer(CALLBACK(src, PROC_REF(update_other_id)), 5)
|
||||
@@ -166,6 +166,21 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
diag_hud.add_to_hud(src)
|
||||
diag_hud_set_electrified()
|
||||
|
||||
/**
|
||||
* Generates the airlock's wire layout based on the current area the airlock resides in.
|
||||
*
|
||||
* Returns a new /datum/wires/ with the appropriate wire layout based on the airlock_wires
|
||||
* of the area the airlock is in.
|
||||
*/
|
||||
/obj/machinery/door/airlock/proc/get_wires()
|
||||
var/area/source_area = get_area(src)
|
||||
if(!source_area || !z)
|
||||
return new /datum/wires/airlock(src)
|
||||
if(source_area.airlock_wires == ZLVL_BASED_WIRES)
|
||||
var/snowflake_path = /datum/wires/airlock/ruin
|
||||
return new snowflake_path(src)
|
||||
return source_area?.airlock_wires ? new source_area.airlock_wires(src) : new /datum/wires/airlock(src)
|
||||
|
||||
/obj/machinery/door/airlock/proc/update_other_id()
|
||||
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
|
||||
if(A.closeOtherId == closeOtherId && A != src)
|
||||
|
||||
@@ -15,6 +15,7 @@ GLOBAL_LIST_INIT(ruin_prototypes, list(/area/ruin,
|
||||
dynamic_lighting = DYNAMIC_LIGHTING_FORCED
|
||||
ambientsounds = RUINS_SOUNDS
|
||||
sound_environment = SOUND_ENVIRONMENT_STONEROOM
|
||||
airlock_wires = ZLVL_BASED_WIRES
|
||||
|
||||
/area/ruin/unpowered
|
||||
|
||||
|
||||
Reference in New Issue
Block a user