Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project ARES: Announcement Signatures #6030

Merged
merged 11 commits into from
May 2, 2024
14 changes: 7 additions & 7 deletions code/defines/procs/announcement.dm
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@

switch(logging)
if(ARES_LOG_MAIN)
log_ares_announcement(title, message)
log_ares_announcement(title, message, signature)
if(ARES_LOG_SECURITY)
log_ares_security(title, message)
log_ares_security(title, message, signature)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved

else if(faction_to_display == "Everyone (-Yautja)")
for(var/mob/M in targets)
Expand Down Expand Up @@ -98,9 +98,9 @@

switch(logging)
if(ARES_LOG_MAIN)
log_ares_announcement("[MAIN_AI_SYSTEM] Comms Update", message)
log_ares_announcement("Comms Update", message, MAIN_AI_SYSTEM)
if(ARES_LOG_SECURITY)
log_ares_security("[MAIN_AI_SYSTEM] Security Update", message)
log_ares_security("Security Update", message, MAIN_AI_SYSTEM)

/proc/ai_silent_announcement(message, channel_prefix, bypass_cooldown = FALSE)
if(!message)
Expand Down Expand Up @@ -133,9 +133,9 @@
message += "<br><br><i> Signed by, <br> [signature]</i>"
switch(ares_logging)
if(ARES_LOG_MAIN)
log_ares_announcement(title, message)
log_ares_announcement(title, message, signature)
if(ARES_LOG_SECURITY)
log_ares_security(title, message)
log_ares_security(title, message, signature)

announcement_helper(message, title, targets, sound_to_play)

Expand All @@ -148,7 +148,7 @@
if(!ishuman(T) || isyautja(T) || !is_mainship_level((get_turf(T))?.z))
targets.Remove(T)

log_ares_announcement("[title] Shipwide Update", message)
log_ares_announcement("Shipwide Update", message, title)

announcement_helper(message, title, targets, sound_to_play)

Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/ARES/ARES_interface.dm
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
shipwide_ai_announcement("ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS.", MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
log_game("[key_name(user)] has called for general quarters via ARES.")
message_admins("[key_name_admin(user)] has called for general quarters via ARES.")
log_ares_security("General Quarters", "[last_login] has called for general quarters via ARES.")
log_ares_security("General Quarters", "Called for general quarters via ARES.", last_login)
COOLDOWN_START(datacore, ares_quarters_cooldown, 10 MINUTES)
. = TRUE

Expand All @@ -442,7 +442,7 @@

log_game("[key_name(user)] has called for an emergency evacuation via ARES.")
message_admins("[key_name_admin(user)] has called for an emergency evacuation via ARES.")
log_ares_security("Initiate Evacuation", "[last_login] has called for an emergency evacuation via ARES.")
log_ares_security("Initiate Evacuation", "Called for an emergency evacuation via ARES.", last_login)
. = TRUE

if("distress")
Expand Down Expand Up @@ -496,7 +496,7 @@
playsound_client(admin,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(user)] has requested use of Nuclear Ordnance (via ARES)! Reason: <b>[reason]</b> [CC_MARK(user)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukeapprove=\ref[user]'>APPROVE</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukedeny=\ref[user]'>DENY</A>) [ADMIN_JMP_USER(user)] [CC_REPLY(user)]")
to_chat(user, SPAN_NOTICE("A nuclear ordnance request has been sent to USCM High Command for the following reason: [reason]"))
log_ares_security("Nuclear Ordnance Request", "[last_login] has sent a request for nuclear ordnance for the following reason: [reason]")
log_ares_security("Nuclear Ordnance Request", "Sent a request for nuclear ordnance for the following reason: [reason]", last_login)
if(ares_can_interface())
ai_silent_announcement("[last_login] has sent a request for nuclear ordnance to USCM High Command.", ".V")
ai_silent_announcement("Reason given: [reason].", ".V")
Expand All @@ -518,7 +518,7 @@
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
log_ares_security("Nerve Gas Release", "Released Nerve Gas from Vent '[sec_vent.vent_tag]'.", last_login)
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,6 @@
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[MAIN_AI_SYSTEM] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
log_ares_security("Nerve Gas Release", "Released Nerve Gas from Vent '[sec_vent.vent_tag]'.", MAIN_AI_SYSTEM)
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")
2 changes: 1 addition & 1 deletion code/game/machinery/ARES/ARES_interface_apollo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
log_ares_security("Nerve Gas Release", "Released Nerve Gas from Vent '[sec_vent.vent_tag]'.", last_login)
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(operator)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

Expand Down
14 changes: 10 additions & 4 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,29 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_bombardment.Add(new /datum/ares_record/bombardment(ob_name, message, user_name))

/proc/log_ares_announcement(title, message)
/proc/log_ares_announcement(title, message, signature)
if(!ares_can_log())
return FALSE
var/final_msg = message
if(signature)
final_msg = "[signature]: - [final_msg]"
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_announcement.Add(new /datum/ares_record/announcement(title, message))
datacore.records_announcement.Add(new /datum/ares_record/announcement(title, final_msg))

/proc/log_ares_requisition(source, details, user_name)
if(!ares_can_log())
return FALSE
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_asrs.Add(new /datum/ares_record/requisition_log(source, details, user_name))

/proc/log_ares_security(title, details)
/proc/log_ares_security(title, details, signature)
if(!ares_can_log())
return FALSE
var/final_msg = details
if(signature)
final_msg = "[signature]: - [final_msg]"
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_security.Add(new /datum/ares_record/security(title, details))
datacore.records_security.Add(new /datum/ares_record/security(title, final_msg))

/proc/log_ares_antiair(details)
if(!ares_can_log())
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/ARES/apollo_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
log_ares_security("Nerve Gas Release", "Released Nerve Gas from Vent '[sec_vent.vent_tag]'.", last_login)
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(operator)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

Expand Down
11 changes: 6 additions & 5 deletions code/game/machinery/biohazard_lockdown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ GLOBAL_VAR_INIT(lockdown_state, LOCKDOWN_READY)
return PROC_BLOCKED

var/log = "[key_name(user)] triggered research bio lockdown!"
var/ares_log = "[user.name] triggered Medical Research Biohazard Containment Lockdown."
var/ares_log = "Triggered Medical Research Biohazard Containment Lockdown."
var/person = user.name
if(!message)
message = "ATTENTION! \n\nBIOHAZARD CONTAINMENT BREACH. \n\nRESEARCH DEPARTMENT UNDER LOCKDOWN."
else
log = "[key_name(user)] triggered research bio lockdown! (Using a custom announcement)."
if(admin)
log += " (Admin Triggered)."
ares_log = "[MAIN_AI_SYSTEM] triggered Medical Research Biohazard Containment Lockdown."
person = MAIN_AI_SYSTEM

switch(GLOB.lockdown_state)
if(LOCKDOWN_READY)
Expand All @@ -92,17 +93,17 @@ GLOBAL_VAR_INIT(lockdown_state, LOCKDOWN_READY)
GLOB.lockdown_state = LOCKDOWN_READY
message = "ATTENTION! \n\nBIOHAZARD CONTAINMENT LOCKDOWN LIFTED."
log = "[key_name(user)] lifted research bio lockdown!"
ares_log = "[user.name] lifted Medical Research Biohazard Containment Lockdown."
ares_log = "Lifted Medical Research Biohazard Containment Lockdown."
if(admin)
log += " (Admin Triggered)."
ares_log = "[MAIN_AI_SYSTEM] lifted Medical Research Biohazard Containment Lockdown."
person = MAIN_AI_SYSTEM

set_security_level(SEC_LEVEL_BLUE, TRUE, FALSE)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_RESEARCH_LIFT)

shipwide_ai_announcement(message, MAIN_AI_SYSTEM, 'sound/effects/biohazard.ogg')
message_admins(log)
log_ares_security("Containment Lockdown", ares_log)
log_ares_security("Containment Lockdown", ares_log, person)

#undef LOCKDOWN_READY
#undef LOCKDOWN_ACTIVE
81 changes: 41 additions & 40 deletions code/game/machinery/computer/almayer_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,33 +108,34 @@
. = ..()
if(.)
return
var/mob/user = ui.user
switch(action)
if("award")
open_medal_panel(usr, src)
open_medal_panel(user, src)
. = TRUE

// evac stuff start \\

if("evacuation_start")
if(GLOB.security_level < SEC_LEVEL_RED)
to_chat(usr, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
to_chat(user, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
return FALSE

if(SShijack.evac_admin_denied)
to_chat(usr, SPAN_WARNING("The USCM has placed a lock on deploying the evacuation pods."))
to_chat(user, SPAN_WARNING("The USCM has placed a lock on deploying the evacuation pods."))
return FALSE

if(!SShijack.initiate_evacuation())
to_chat(usr, SPAN_WARNING("You are unable to initiate an evacuation procedure right now!"))
to_chat(user, SPAN_WARNING("You are unable to initiate an evacuation procedure right now!"))
return FALSE

log_game("[key_name(usr)] has called for an emergency evacuation.")
message_admins("[key_name_admin(usr)] has called for an emergency evacuation.")
log_ares_security("Initiate Evacuation", "[usr] has called for an emergency evacuation.")
log_game("[key_name(user)] has called for an emergency evacuation.")
message_admins("[key_name_admin(user)] has called for an emergency evacuation.")
log_ares_security("Initiate Evacuation", "Called for an emergency evacuation.", user)
. = TRUE

if("evacuation_cancel")
var/mob/living/carbon/human/human_user = usr
var/mob/living/carbon/human/human_user = user
var/obj/item/card/id/idcard = human_user.get_active_hand()
var/bio_fail = FALSE
if(!istype(idcard))
Expand All @@ -148,12 +149,12 @@
return FALSE

if(!SShijack.cancel_evacuation())
to_chat(usr, SPAN_WARNING("You are unable to cancel the evacuation right now!"))
to_chat(user, SPAN_WARNING("You are unable to cancel the evacuation right now!"))
return FALSE

log_game("[key_name(usr)] has canceled the emergency evacuation.")
message_admins("[key_name_admin(usr)] has canceled the emergency evacuation.")
log_ares_security("Cancel Evacuation", "[usr] has cancelled the emergency evacuation.")
log_game("[key_name(user)] has canceled the emergency evacuation.")
message_admins("[key_name_admin(user)] has canceled the emergency evacuation.")
log_ares_security("Cancel Evacuation", "Cancelled the emergency evacuation.", user)
. = TRUE

// evac stuff end \\
Expand All @@ -168,32 +169,32 @@
if(SEC_LEVEL_DELTA)
return

var/level_selected = tgui_input_list(usr, "What alert would you like to set it as?", "Alert Level", alert_list)
var/level_selected = tgui_input_list(user, "What alert would you like to set it as?", "Alert Level", alert_list)
if(!level_selected)
return

set_security_level(seclevel2num(level_selected), log = ARES_LOG_NONE)
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
log_ares_security("Manual Security Update", "[usr] has changed the security level to [get_security_level()].")
log_game("[key_name(user)] has changed the security level to [get_security_level()].")
message_admins("[key_name_admin(user)] has changed the security level to [get_security_level()].")
log_ares_security("Manual Security Update", "Changed the security level to [get_security_level()].", user)
. = TRUE

if("messageUSCM")
if(!COOLDOWN_FINISHED(src, cooldown_central))
to_chat(usr, SPAN_WARNING("Arrays are re-cycling. Please stand by."))
to_chat(user, SPAN_WARNING("Arrays are re-cycling. Please stand by."))
return FALSE
var/input = stripped_input(usr, "Please choose a message to transmit to USCM. Please be aware that this process is very expensive, and abuse will lead to termination. Transmission does not guarantee a response. There is a small delay before you may send another message. Be clear and concise.", "To abort, send an empty message.", "")
if(!input || !(usr in view(1,src)) || !COOLDOWN_FINISHED(src, cooldown_central))
var/input = stripped_input(user, "Please choose a message to transmit to USCM. Please be aware that this process is very expensive, and abuse will lead to termination. Transmission does not guarantee a response. There is a small delay before you may send another message. Be clear and concise.", "To abort, send an empty message.", "")
if(!input || !(user in view(1,src)) || !COOLDOWN_FINISHED(src, cooldown_central))
return FALSE

high_command_announce(input, usr)
to_chat(usr, SPAN_NOTICE("Message transmitted."))
log_announcement("[key_name(usr)] has made an USCM announcement: [input]")
high_command_announce(input, user)
to_chat(user, SPAN_NOTICE("Message transmitted."))
log_announcement("[key_name(user)] has made an USCM announcement: [input]")
COOLDOWN_START(src, cooldown_central, COOLDOWN_COMM_CENTRAL)
. = TRUE

if("ship_announce")
var/mob/living/carbon/human/human_user = usr
var/mob/living/carbon/human/human_user = user
var/obj/item/card/id/idcard = human_user.get_active_hand()
var/bio_fail = FALSE
if(!istype(idcard))
Expand All @@ -207,10 +208,10 @@
return FALSE

if(!COOLDOWN_FINISHED(src, cooldown_message))
to_chat(usr, SPAN_WARNING("Please allow at least [COOLDOWN_TIMELEFT(src, cooldown_message)/10] second\s to pass between announcements."))
to_chat(user, SPAN_WARNING("Please allow at least [COOLDOWN_TIMELEFT(src, cooldown_message)/10] second\s to pass between announcements."))
return FALSE
var/input = stripped_multiline_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement", "")
if(!input || !COOLDOWN_FINISHED(src, cooldown_message) || !(usr in view(1,src)))
var/input = stripped_multiline_input(user, "Please write a message to announce to the station crew.", "Priority Announcement", "")
if(!input || !COOLDOWN_FINISHED(src, cooldown_message) || !(user in view(1,src)))
return FALSE

var/signed = null
Expand All @@ -219,35 +220,35 @@

COOLDOWN_START(src, cooldown_message, COOLDOWN_COMM_MESSAGE)
shipwide_ai_announcement(input, COMMAND_SHIP_ANNOUNCE, signature = signed)
message_admins("[key_name(usr)] has made a shipwide annoucement.")
log_announcement("[key_name(usr)] has announced the following to the ship: [input]")
message_admins("[key_name(user)] has made a shipwide annoucement.")
log_announcement("[key_name(user)] has announced the following to the ship: [input]")
. = TRUE

if("distress")
if(world.time < DISTRESS_TIME_LOCK)
to_chat(usr, SPAN_WARNING("The distress beacon cannot be launched this early in the operation. Please wait another [time_left_until(DISTRESS_TIME_LOCK, world.time, 1 MINUTES)] minutes before trying again."))
to_chat(user, SPAN_WARNING("The distress beacon cannot be launched this early in the operation. Please wait another [time_left_until(DISTRESS_TIME_LOCK, world.time, 1 MINUTES)] minutes before trying again."))
return FALSE

if(!SSticker.mode)
return FALSE //Not a game mode?

if(SSticker.mode.force_end_at == 0)
to_chat(usr, SPAN_WARNING("ARES has denied your request for operational security reasons."))
to_chat(user, SPAN_WARNING("ARES has denied your request for operational security reasons."))
return FALSE

if(!COOLDOWN_FINISHED(src, cooldown_request))
to_chat(usr, SPAN_WARNING("The distress beacon has recently broadcast a message. Please wait."))
to_chat(user, SPAN_WARNING("The distress beacon has recently broadcast a message. Please wait."))
return FALSE

if(GLOB.security_level == SEC_LEVEL_DELTA)
to_chat(usr, SPAN_WARNING("The ship is already undergoing self-destruct procedures!"))
to_chat(user, SPAN_WARNING("The ship is already undergoing self-destruct procedures!"))
return FALSE

for(var/client/admin_client as anything in GLOB.admins)
if((R_ADMIN|R_MOD) & admin_client.admin_holder.rights)
admin_client << 'sound/effects/sos-morse-code.ogg'
SSticker.mode.request_ert(usr)
to_chat(usr, SPAN_NOTICE("A distress beacon request has been sent to USCM Central Command."))
SSticker.mode.request_ert(user)
to_chat(user, SPAN_NOTICE("A distress beacon request has been sent to USCM Central Command."))

COOLDOWN_START(src, cooldown_request, COOLDOWN_COMM_REQUEST)
. = TRUE
Expand All @@ -256,29 +257,29 @@

if("destroy")
if(world.time < DISTRESS_TIME_LOCK)
to_chat(usr, SPAN_WARNING("The self-destruct cannot be activated this early in the operation. Please wait another [time_left_until(DISTRESS_TIME_LOCK, world.time, 1 MINUTES)] minutes before trying again."))
to_chat(user, SPAN_WARNING("The self-destruct cannot be activated this early in the operation. Please wait another [time_left_until(DISTRESS_TIME_LOCK, world.time, 1 MINUTES)] minutes before trying again."))
return FALSE

if(!SSticker.mode)
return FALSE //Not a game mode?

if(SSticker.mode.force_end_at == 0)
to_chat(usr, SPAN_WARNING("ARES has denied your request for operational security reasons."))
to_chat(user, SPAN_WARNING("ARES has denied your request for operational security reasons."))
return FALSE

if(!COOLDOWN_FINISHED(src, cooldown_destruct))
to_chat(usr, SPAN_WARNING("A self-destruct request has already been sent to high command. Please wait."))
to_chat(user, SPAN_WARNING("A self-destruct request has already been sent to high command. Please wait."))
return FALSE

if(get_security_level() == "delta")
to_chat(usr, SPAN_WARNING("The [MAIN_SHIP_NAME]'s self-destruct is already activated."))
to_chat(user, SPAN_WARNING("The [MAIN_SHIP_NAME]'s self-destruct is already activated."))
return FALSE

for(var/client/admin_client as anything in GLOB.admins)
if((R_ADMIN|R_MOD) & admin_client.admin_holder.rights)
admin_client << 'sound/effects/sos-morse-code.ogg'
message_admins("[key_name(usr)] has requested Self-Destruct! [CC_MARK(usr)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];destroyship=\ref[usr]'>GRANT</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];sddeny=\ref[usr]'>DENY</A>) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]")
to_chat(usr, SPAN_NOTICE("A self-destruct request has been sent to USCM Central Command."))
message_admins("[key_name(user)] has requested Self-Destruct! [CC_MARK(user)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];destroyship=\ref[user]'>GRANT</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];sddeny=\ref[user]'>DENY</A>) [ADMIN_JMP_USER(user)] [CC_REPLY(user)]")
to_chat(user, SPAN_NOTICE("A self-destruct request has been sent to USCM Central Command."))
COOLDOWN_START(src, cooldown_destruct, COOLDOWN_COMM_DESTRUCT)
. = TRUE

Expand Down
Loading
Loading