mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #8768 from Yoshax/emergencymessage
Emergency message changes
This commit is contained in:
34
code/game/machinery/bluespacerelay.dm
Normal file
34
code/game/machinery/bluespacerelay.dm
Normal file
@@ -0,0 +1,34 @@
|
||||
/obj/machinery/bluespacerelay
|
||||
name = "Emergency Bluespace Relay"
|
||||
desc = "This sends messages through bluespace! Wow!"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "bspacerelay"
|
||||
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 1
|
||||
var/on = 1
|
||||
|
||||
idle_power_usage = 15000
|
||||
active_power_usage = 15000
|
||||
|
||||
/obj/machinery/bluespacerelay/process()
|
||||
|
||||
update_power()
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/bluespacerelay/update_icon()
|
||||
if(on)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
icon_state = "[initial(icon_state)]_off"
|
||||
|
||||
/obj/machinery/bluespacerelay/proc/update_power()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER|EMPED))
|
||||
on = 0
|
||||
else
|
||||
on = 1
|
||||
|
||||
34
code/game/machinery/commsbantenna.dm
Normal file
34
code/game/machinery/commsbantenna.dm
Normal file
@@ -0,0 +1,34 @@
|
||||
/obj/machinery/bluespacerelay
|
||||
name = "Emergency Bluespace Relay"
|
||||
desc = "This sends messages through bluespace! Wow!"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "bspacerelay"
|
||||
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 1
|
||||
var/on = 1
|
||||
|
||||
idle_power_usage = 15000
|
||||
active_power_usage = 15000
|
||||
|
||||
/obj/machinery/bluespacerelay/process()
|
||||
|
||||
update_power()
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/bluespacerelay/update_icon()
|
||||
if(on)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
icon_state = "[initial(icon_state)]_off"
|
||||
|
||||
/obj/machinery/bluespacerelay/proc/update_power()
|
||||
|
||||
if(stat & (BROKEN|NOPOWER|EMPED))
|
||||
on = 0
|
||||
else
|
||||
on = 1
|
||||
|
||||
@@ -48,9 +48,7 @@
|
||||
/obj/machinery/computer/communications/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
if (src.z > 1)
|
||||
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
if(!href_list["operation"])
|
||||
@@ -68,8 +66,8 @@
|
||||
if (I && istype(I))
|
||||
if(src.check_access(I))
|
||||
authenticated = 1
|
||||
if(access_captain in I.access)
|
||||
authenticated = 2
|
||||
//if(access_captain in I.access)
|
||||
//authenticated = 2
|
||||
crew_announcement.announcer = GetNameAndAssignmentFromId(I)
|
||||
if("logout")
|
||||
authenticated = 0
|
||||
@@ -82,7 +80,7 @@
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
if (I && istype(I))
|
||||
if(access_captain in I.access || access_heads in I.access) //Let heads change the alert level.
|
||||
if(access_heads in I.access) //Let heads change the alert level.
|
||||
var/old_level = security_level
|
||||
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
@@ -106,7 +104,7 @@
|
||||
usr << "You need to swipe your ID."
|
||||
|
||||
if("announce")
|
||||
if(src.authenticated==2)
|
||||
if(src.authenticated==1)
|
||||
if(message_cooldown)
|
||||
usr << "Please allow at least one minute to pass between announcements"
|
||||
return
|
||||
@@ -183,32 +181,35 @@
|
||||
|
||||
// OMG CENTCOMM LETTERHEAD
|
||||
if("MessageCentcomm")
|
||||
if(src.authenticated==2)
|
||||
if(src.authenticated==1)
|
||||
if(centcomm_message_cooldown)
|
||||
usr << "\red Arrays recycling. Please stand by."
|
||||
usr << "<span class='warning'>Arrays recycling. Please stand by.</span>"
|
||||
return
|
||||
if(!is_relay_online())//Contact Centcom has a check, Syndie doesn't to allow for Traitor funs.
|
||||
usr <<"<span class='warning'>No Emergency Bluespace Relay detected. Unable to transmit message.</span>"
|
||||
return
|
||||
var/input = sanitize(input("Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", ""))
|
||||
if(!input || !(usr in view(1,src)))
|
||||
return
|
||||
Centcomm_announce(input, usr)
|
||||
usr << "\blue Message transmitted."
|
||||
usr << "<span class='notice'>Message transmitted.</span>"
|
||||
log_say("[key_name(usr)] has made an IA Centcomm announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(300)//10 minute cooldown
|
||||
spawn(300)//30 second cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
|
||||
|
||||
// OMG SYNDICATE ...LETTERHEAD
|
||||
if("MessageSyndicate")
|
||||
if((src.authenticated==2) && (src.emagged))
|
||||
if((src.authenticated==1) && (src.emagged))
|
||||
if(centcomm_message_cooldown)
|
||||
usr << "\red Arrays recycling. Please stand by."
|
||||
usr << "<span class='warning'>Arrays recycling. Please stand by.</span>"
|
||||
return
|
||||
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", ""))
|
||||
if(!input || !(usr in view(1,src)))
|
||||
return
|
||||
Syndicate_announce(input, usr)
|
||||
usr << "\blue Message transmitted."
|
||||
usr << "<span class='notice'>Message transmitted.</span>"
|
||||
log_say("[key_name(usr)] has made an illegal announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(300)//10 minute cooldown
|
||||
@@ -279,9 +280,6 @@
|
||||
/obj/machinery/computer/communications/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if (src.z > 6)
|
||||
user << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat = "<head><title>Communications Console</title></head><body>"
|
||||
@@ -301,7 +299,7 @@
|
||||
if(STATE_DEFAULT)
|
||||
if (src.authenticated)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=logout'>Log Out</A> \]"
|
||||
if (src.authenticated==2)
|
||||
if (src.authenticated==1)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=announce'>Make An Announcement</A> \]"
|
||||
if(src.emagged == 0)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=MessageCentcomm'>Send an emergency message to Centcomm</A> \]"
|
||||
@@ -519,6 +517,13 @@
|
||||
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
|
||||
return
|
||||
|
||||
|
||||
/proc/is_relay_online()
|
||||
for(var/obj/machinery/bluespacerelay/M in world)
|
||||
if(M.stat == 0)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/communications/proc/post_status(var/command, var/data1, var/data2)
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef T_BOARD
|
||||
#error T_BOARD macro is not defined but we need it!
|
||||
#endif
|
||||
|
||||
/obj/item/weapon/circuitboard/bluespacerelay
|
||||
name = T_BOARD("bluespacerelay")
|
||||
build_path = "/obj/machinery/bluespacerelay"
|
||||
board_type = "machine"
|
||||
origin_tech = "bluespace=4,programming=4"
|
||||
frame_desc = "Requires 30 Cable Coil, 1 Hyperwave Filter and 1 Ansible Crystal, and 2 Micro-Manipulators"
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 30,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
)
|
||||
Reference in New Issue
Block a user