Merge pull request #15853 from shellspeed1/posialert-console

Port of the Posialert console from hyper. Credit to jjpark-kb for initial work.
This commit is contained in:
silicons
2022-09-23 16:21:19 -07:00
committed by GitHub
13 changed files with 117 additions and 29 deletions
+55
View File
@@ -0,0 +1,55 @@
/obj/machinery/posialert
name = "automated positronic alert console"
desc = "A console that will ping when a positronic personality is available for download."
icon = 'icons/obj/machines/terminals.dmi'
icon_state = "posialert"
var/inuse = FALSE
var/online = TRUE
var/obj/item/radio/radio
var/radio_key = /obj/item/encryptionkey/headset_sci
var/science_channel = "Science"
/obj/machinery/posialert/Initialize(mapload, ndir, building)
. = ..()
radio = new(src)
radio.keyslot = new radio_key
radio.listening = 0
radio.recalculateChannels()
if(building)
setDir(ndir)
pixel_x = (dir & 3)? 0 : (dir == 4 ? -32 : 32)
pixel_y = (dir & 3)? (dir ==1 ? -32 : 32) : 0
/obj/machinery/posialert/Destroy()
QDEL_NULL(radio)
return ..()
/obj/item/wallframe/posialert
name = "automated positronic alert console frame"
desc = "Used to build positronic alert consoles, just secure to the wall."
icon_state = "newscaster"
custom_materials = list(/datum/material/iron=14000, /datum/material/glass=8000)
result_path = /obj/machinery/posialert
/obj/machinery/posialert/attack_hand(mob/living/user)
online = !online
to_chat(user, "<span class='warning'>You turn the posi-alert system [online ? "on" : "off"]!</span>")
return
/obj/machinery/posialert/attack_ghost(mob/user)
. = ..()
if(!online)
return
if(inuse)
return
inuse = TRUE
flick("posialertflash",src)
visible_message("There are positronic personalities available!")
radio.talk_into(src, "There are positronic personalities available!", science_channel)
playsound(loc, 'sound/machines/ping.ogg', 50)
addtimer(CALLBACK(src, .proc/liftcooldown), 300)
/obj/machinery/posialert/proc/liftcooldown()
inuse = FALSE
@@ -75,6 +75,14 @@
build_path = /obj/item/wallframe/newscaster
category = list("initial", "Construction")
/datum/design/posialert
name = "Posialert Frame"
id = "posialert_frame"
build_type = AUTOLATHE
materials = list(/datum/material/iron = 14000, /datum/material/glass = 8000)
build_path = /obj/item/wallframe/posialert
category = list("initial", "Construction")
/datum/design/status_display_frame
name = "Status Display Frame"
id = "status_display_frame"