[MODULAR] Ghostrole Cryo Announcements! (#14901)

* Exit cryo comms QoL!

* Ooooh, shiny!

* Oops, channels!

* Oops, prisoners!

* Announce ghost job on awake! Also fix common radio-

* Qdel radio on destroy!

* Commit suggestions!

* Oop!

* Commit suggestions!

Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
This commit is contained in:
RimiNosha
2022-07-29 10:16:17 -07:00
committed by GitHub
co-authored by Zonespace
parent a9a3d18dcc
commit 82fd1fa909
7 changed files with 86 additions and 42 deletions
@@ -2208,12 +2208,11 @@
/turf/open/floor/plating,
/area/ruin/syndicate_lava_base/main)
"tx" = (
/obj/machinery/computer/cryopod{
/obj/machinery/computer/cryopod/interdyne{
dir = 4;
pixel_x = -32;
req_one_access = list(150)
pixel_x = -24
},
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 4
},
/turf/open/floor/iron,
@@ -4133,14 +4133,13 @@
/turf/open/floor/wood/large,
/area/ruin/syndicate_lava_base/dormitories)
"Qa" = (
/obj/machinery/computer/cryopod{
dir = 4;
pixel_x = -32;
req_one_access = list(150)
},
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 4
},
/obj/machinery/computer/cryopod/interdyne{
dir = 4;
pixel_x = -24
},
/turf/open/floor/iron,
/area/ruin/syndicate_lava_base/dormitories)
"Qk" = (
@@ -3161,7 +3161,7 @@
/turf/open/floor/iron/textured_large,
/area/ruin/space/has_grav/skyrat/interdynefob/research)
"kZ" = (
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 4
},
/turf/open/floor/iron/dark,
@@ -5188,16 +5188,15 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/skyrat/interdynefob/halls)
"sg" = (
/obj/machinery/computer/cryopod{
dir = 4;
pixel_x = -24;
req_one_access = list(150)
},
/obj/effect/turf_decal/delivery/white{
color = "#00ff00";
name = "green"
},
/obj/machinery/cryopod/quiet{
/obj/machinery/computer/cryopod/interdyne{
dir = 4;
pixel_x = -24
},
/obj/machinery/cryopod{
dir = 4
},
/turf/open/floor/iron/dark,
@@ -6435,7 +6434,7 @@
/area/ruin/space/has_grav/skyrat/interdynefob/security/prison)
"wo" = (
/obj/machinery/light/directional/north,
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 4
},
/turf/open/floor/iron/dark,
@@ -7640,7 +7639,7 @@
color = "#00ff00";
name = "green"
},
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 4
},
/turf/open/floor/iron/dark,
@@ -9210,7 +9209,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/skyrat/interdynefob/cargo/hangar)
"FQ" = (
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 8
},
/turf/open/floor/iron/dark,
@@ -12172,10 +12171,9 @@
/turf/open/floor/iron/dark/textured_large,
/area/ruin/space/has_grav/skyrat/interdynefob/service/chapel)
"PE" = (
/obj/machinery/computer/cryopod{
/obj/machinery/computer/cryopod/interdyne{
dir = 8;
pixel_x = 32;
req_one_access = list(150)
pixel_x = 24
},
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/skyrat/interdynefob/service/dorms)
@@ -22,7 +22,7 @@
/area/ruin/space/has_grav/port_tarkon/trauma)
"ai" = (
/obj/effect/decal/cleanable/dirt,
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 4
},
/turf/open/floor/iron,
@@ -5216,7 +5216,7 @@
/area/ruin/space/has_grav/port_tarkon/developement)
"Ef" = (
/obj/effect/decal/cleanable/dirt,
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 1
},
/turf/open/floor/iron,
@@ -6153,7 +6153,7 @@
/turf/open/floor/iron,
/area/ruin/space/has_grav/port_tarkon)
"Jq" = (
/obj/machinery/cryopod/quiet{
/obj/machinery/cryopod{
dir = 1
},
/turf/open/floor/iron,
@@ -8341,13 +8341,12 @@
"Wn" = (
/obj/effect/decal/cleanable/dirt,
/obj/effect/decal/cleanable/dirt,
/obj/machinery/computer/cryopod{
dir = 4;
pixel_x = -24;
req_one_access = list("tarkon")
},
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/machinery/computer/cryopod/tarkon{
dir = 4;
pixel_x = -24
},
/turf/open/floor/iron,
/area/ruin/space/has_grav/port_tarkon/centerhall)
"Wp" = (
@@ -87,10 +87,6 @@ GLOBAL_LIST_EMPTY(announcement_systems)
message = CompileText(newhead, user, rank)
else if(message_type == "ARRIVALS_BROKEN")
message = "The arrivals shuttle has been damaged. Docking for repairs..."
//SKYRAT EDIT ADDITION
else if(message_type == "CRYOSTORAGE")
message = "[user][rank ? ", [rank]" : ""] has been moved to cryo storage."
//SKYRAT EDIT END
broadcast(message, channels)
@@ -17,27 +17,32 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
icon = 'modular_skyrat/modules/cryosleep/icons/cryogenics.dmi'
icon_state = "cellconsole_1"
icon_keyboard = null
// circuit = /obj/item/circuitboard/cryopodcontrol
density = FALSE
interaction_flags_machine = INTERACT_MACHINE_OFFLINE
req_one_access = list(ACCESS_COMMAND, ACCESS_ARMORY) // Heads of staff or the warden can go here to claim recover items from their department that people went were cryodormed with.
var/mode = null
verb_say = "coldly states"
verb_ask = "queries"
verb_exclaim = "alarms"
/// Used for logging people entering cryosleep and important items they are carrying.
var/list/frozen_crew = list()
/// The items currently stored in the cryopod control panel.
var/list/frozen_item = list()
var/storage_type = "crewmembers"
var/storage_name = "Cryogenic Oversight Control"
/// This is what the announcement system uses to make announcements. Make sure to set a radio that has the channel you want to broadcast on.
var/obj/item/radio/headset/radio = /obj/item/radio/headset/silicon/pai
/// The channel to be broadcast on, valid values are any of the "RADIO_CHANNEL_" defines.
var/announcement_channel = null // RADIO_CHANNEL_COMMON doesn't work here.
/obj/machinery/computer/cryopod/Initialize(mapload)
. = ..()
GLOB.cryopod_computers += src
radio = new radio(src)
/obj/machinery/computer/cryopod/Destroy()
GLOB.cryopod_computers -= src
QDEL_NULL(radio)
return ..()
/obj/machinery/computer/cryopod/update_icon_state()
@@ -110,6 +115,13 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
else
CRASH("Illegal action for ui_act: '[action]'")
/obj/machinery/computer/cryopod/proc/announce(message_type, user, rank)
switch(message_type)
if("CRYO_JOIN")
radio.talk_into(src, "[user][rank ? ", [rank]" : ""] has woken up from cryo storage.", announcement_channel)
if("CRYO_LEAVE")
radio.talk_into(src, "[user][rank ? ", [rank]" : ""] has been moved to cryo storage.", announcement_channel)
// Cryopods themselves.
/obj/machinery/cryopod
name = "cryogenic freezer"
@@ -312,9 +324,8 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
control_computer.frozen_crew += list(crew_member)
// Make an announcement and log the person entering storage. If set to quiet, does not make an announcement.
if(GLOB.announcement_systems.len && !quiet)
var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems)
announcer.announce("CRYOSTORAGE", mob_occupant.real_name, announce_rank, list())
if(!quiet)
control_computer.announce("CRYO_LEAVE", mob_occupant.real_name, announce_rank)
visible_message(span_notice("[src] hums and hisses as it moves [mob_occupant.real_name] into storage."))
@@ -431,4 +442,34 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
/obj/machinery/cryopod/blob_act()
return // Sorta gamey, but we don't really want these to be destroyed.
// Wake-up notifications
/obj/effect/mob_spawn/ghost_role
/// For figuring out where the local cryopod computer is. Must be set for cryo computer announcements.
var/area/computer_area
/obj/effect/mob_spawn/ghost_role/special(mob/living/spawned_mob, mob/mob_possessor)
. = ..()
var/obj/machinery/computer/cryopod/control_computer = find_control_computer()
var/datum/data/record/record = new
record.fields["name"] = spawned_mob.real_name
record.fields["rank"] = name
GLOB.data_core.general.Add(record)
if(control_computer)
control_computer.announce("CRYO_JOIN", spawned_mob.real_name, name)
/obj/effect/mob_spawn/ghost_role/proc/find_control_computer()
if(!computer_area)
return
for(var/cryo_console as anything in GLOB.cryopod_computers)
var/obj/machinery/computer/cryopod/console = cryo_console
var/area/area = get_area(cryo_console) // Define moment
if(area.type == computer_area)
return console
return null
/obj/effect/mob_spawn/ghost_role/human/lavaland_syndicate
computer_area = /area/ruin/syndicate_lava_base/dormitories
#undef AHELP_FIRST_MESSAGE
@@ -35,6 +35,7 @@
flavour_text = "Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. Continue operating as best you can, and try to keep a low profile."
quirks_enabled = TRUE
random_appearance = FALSE
computer_area = /area/ruin/space/has_grav/skyrat/interdynefob/service/dorms
/obj/effect/mob_spawn/ghost_role/human/ds2/prisoner
name = "Syndicate Prisoner"
@@ -282,6 +283,7 @@
loadout_enabled = TRUE
quirks_enabled = TRUE
random_appearance = FALSE
computer_area = /area/ruin/space/has_grav/port_tarkon/centerhall
/datum/outfit/tarkon
name = "default port tarkon outfit"
@@ -496,3 +498,13 @@
name = "Freighter Ship"
icon_state = "yellow"
//CRYO CONSOLES
/obj/machinery/computer/cryopod/interdyne
radio = /obj/item/radio/headset/interdyne
announcement_channel = RADIO_CHANNEL_INTERDYNE
req_one_access = list("syndicate_leader")
/obj/machinery/computer/cryopod/tarkon
radio = /obj/item/radio/headset/tarkon
announcement_channel = RADIO_CHANNEL_TARKON
req_one_access = list("tarkon")