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

Research Biohazard Lockdown #4067

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5741197
USCM & WY (start)
realforest2001 Jul 25, 2023
d94b293
Almayer Lower Deck
realforest2001 Jul 25, 2023
9f14195
Top deck and pipes
realforest2001 Jul 25, 2023
a5c2588
More lists and Ultrazine
realforest2001 Jul 25, 2023
0842c20
More WY and Corpses
realforest2001 Jul 25, 2023
fb954f4
UPP and Yautja defines
realforest2001 Jul 25, 2023
3bf80e9
CLF and TWE defines
realforest2001 Jul 25, 2023
e91c641
Merge remote-tracking branch 'cmss13-devs/master' into project/factio…
realforest2001 Jul 28, 2023
8491e21
research pipes and walls
realforest2001 Jul 28, 2023
eb665f1
Generic UPP/CLF & WY Goons specific
realforest2001 Jul 28, 2023
d122a6b
Goodbye get_all_main_access
realforest2001 Jul 28, 2023
992edc9
alignment fix
realforest2001 Jul 28, 2023
d38f142
fixes press door
realforest2001 Jul 30, 2023
3c9be16
Merge branch 'forest/pressfix' into project/factionaccess
realforest2001 Jul 30, 2023
6e263a8
woop woop biohazard
realforest2001 Jul 31, 2023
9020224
no breaking
realforest2001 Aug 2, 2023
593a384
Merge remote-tracking branch 'cmss13-devs/master' into project/factio…
realforest2001 Aug 4, 2023
e8235fc
conflict resolution
realforest2001 Aug 4, 2023
f92fcfc
aso prep
realforest2001 Aug 4, 2023
b39487c
Apply suggestions from code review
realforest2001 Aug 5, 2023
a3c9ada
less spammable & sound change
realforest2001 Aug 6, 2023
86cc623
Merge remote-tracking branch 'cmss13-devs/master' into project/factio…
realforest2001 Aug 8, 2023
81de223
aux
realforest2001 Aug 8, 2023
f3001d5
Merge remote-tracking branch 'cmss13-devs/master' into project/factio…
realforest2001 Aug 8, 2023
b6d13d7
mapfix
realforest2001 Aug 8, 2023
e77998b
chaplain prep
realforest2001 Aug 8, 2023
29896c3
PMC/Goon/CLF access sets.
realforest2001 Aug 11, 2023
134ded0
indentation
realforest2001 Aug 17, 2023
5965980
Merge remote-tracking branch 'cmss13-devs/master' into project/factio…
realforest2001 Aug 17, 2023
59b8745
Merge remote-tracking branch 'cmss13-devs/master' into project/factio…
realforest2001 Aug 18, 2023
8e9f1b6
Merge remote-tracking branch 'cmss13-devs/master' into project/ares/b…
realforest2001 Aug 18, 2023
5d3d06e
merge conflicts
realforest2001 Aug 18, 2023
dc0dcef
global fix
realforest2001 Aug 20, 2023
0ad4e7e
Merge remote-tracking branch 'cmss13-devs/master' into project/ares/b…
realforest2001 Aug 21, 2023
a410884
Merge branch 'project/factionaccess' into project/ares/biohazard
realforest2001 Aug 21, 2023
3f3ab30
merge conflict
realforest2001 Aug 21, 2023
a84ded3
ARES log
realforest2001 Aug 22, 2023
bf0aaa8
ares log message
realforest2001 Aug 22, 2023
3197ff3
Merge remote-tracking branch 'cmss13-devs/master' into project/ares/b…
realforest2001 Aug 22, 2023
44d5839
white directionals
realforest2001 Aug 22, 2023
a71df91
implementation
realforest2001 Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@

/// From
#define COMSIG_GLOB_YAUTJA_ARMORY_OPENED "yautja_armory_opened"

/// From /proc/biohazard_lockdown()
#define COMSIG_GLOB_RESEARCH_LOCKDOWN "research_lockdown_closed"
#define COMSIG_GLOB_RESEARCH_LIFT "research_lockdown_opened"
109 changes: 109 additions & 0 deletions code/game/machinery/biohazard_lockdown.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#define LOCKDOWN_READY 0
#define LOCKDOWN_ACTIVE 1
GLOBAL_VAR_INIT(lockdown_state, LOCKDOWN_READY)

/obj/structure/machinery/biohazard_lockdown
name = "Emergency Containment Breach"
icon_state = "big_red_button_tablev"
unslashable = TRUE
unacidable = TRUE
COOLDOWN_DECLARE(containment_lockdown)

/obj/structure/machinery/biohazard_lockdown/ex_act(severity)
return FALSE

/obj/structure/machinery/biohazard_lockdown/attack_remote(mob/user as mob)
return FALSE

/obj/structure/machinery/biohazard_lockdown/attack_alien(mob/user as mob)
return FALSE

/obj/structure/machinery/biohazard_lockdown/attackby(obj/item/attacking_item, mob/user)
return attack_hand(user)

/obj/structure/machinery/biohazard_lockdown/attack_hand(mob/living/user)
if(isxeno(user))
return FALSE
if(!allowed(user))
to_chat(user, SPAN_DANGER("Access Denied"))
flick(initial(icon_state) + "-denied", src)
return FALSE

if(!COOLDOWN_FINISHED(src, containment_lockdown))
to_chat(user, SPAN_BOLDWARNING("Biohazard Lockdown procedures are on cooldown! They will be ready in [COOLDOWN_SECONDSLEFT(src, containment_lockdown)] seconds!"))
return FALSE

add_fingerprint(user)
biohazard_lockdown(user)
COOLDOWN_START(src, containment_lockdown, 5 MINUTES)

/obj/structure/machinery/door/poddoor/almayer/biohazard
name = "Biohazard Containment Airlock"
density = FALSE

/obj/structure/machinery/door/poddoor/almayer/biohazard/Initialize()
. = ..()
RegisterSignal(SSdcs, COMSIG_GLOB_RESEARCH_LOCKDOWN, PROC_REF(close))
RegisterSignal(SSdcs, COMSIG_GLOB_RESEARCH_LIFT, PROC_REF(open))

/obj/structure/machinery/door/poddoor/almayer/biohazard/white
icon_state = "w_almayer_pdoor1"
base_icon_state = "w_almayer_pdoor"

/client/proc/admin_biohazard_alert()
set name = "Containment Breach Alert"
set category = "Admin.Ship"

if(!admin_holder ||!check_rights(R_EVENT))
return FALSE

var/prompt = tgui_alert(src, "Are you sure you want to trigger a containment breach alert? This will force red alert, and lockdown research.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt != "Yes")
return FALSE

prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
var/whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?")
biohazard_lockdown(usr, whattoannounce, TRUE)
else
biohazard_lockdown(usr, admin = TRUE)
return TRUE

/proc/biohazard_lockdown(mob/user, message, admin = FALSE)
if(IsAdminAdvancedProcCall())
return PROC_BLOCKED

var/log = "[key_name(user)] triggered research bio lockdown!"
var/ares_log = "[user.name] triggered Medical Research Biohazard Containment Lockdown."
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."

switch(GLOB.lockdown_state)
if(LOCKDOWN_READY)
GLOB.lockdown_state = LOCKDOWN_ACTIVE
set_security_level(SEC_LEVEL_RED, TRUE, FALSE)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_RESEARCH_LOCKDOWN)
if(LOCKDOWN_ACTIVE)
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."
if(admin)
log += " (Admin Triggered)."
ares_log = "[MAIN_AI_SYSTEM] lifted Medical Research Biohazard Containment Lockdown."

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)
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_security("Containment Lockdown", ares_log)

#undef LOCKDOWN_READY
#undef LOCKDOWN_ACTIVE
3 changes: 2 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ var/list/admin_verbs_minor_event = list(
/client/proc/toggle_shipside_sd,
/client/proc/shakeshipverb,
/client/proc/adminpanelweapons,
/client/proc/adminpanelgq,
/client/proc/admin_general_quarters,
/client/proc/admin_biohazard_alert,
/client/proc/toggle_hardcore_perma
)

Expand Down
36 changes: 19 additions & 17 deletions code/modules/admin/verbs/adminpanelgq.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/client/proc/adminpanelgq()
/client/proc/admin_general_quarters()
set name = "Call General Quarters"
set category = "Admin.Ship"

if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA)
tgui_alert(src, "Security is already red or above, General Quarters cannot be called.", "Acknowledge!", list("ok."), 10 SECONDS)
else
var/whattoannounce = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS."
var/prompt = tgui_alert(src, "Do you want to leave the announcement as the default one?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "No")
whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?")
prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
set_security_level(2, no_sound=1, announce=0)
shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
message_admins("[key_name_admin(src)] Sent General Quarters with a custom announcement!")
else
prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
set_security_level(2, no_sound=1, announce=0)
shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
message_admins("[key_name_admin(src)] Sent General Quarters!")
return FALSE

var/prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt != "Yes")
return FALSE

var/whattoannounce = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS."
var/log = "[key_name_admin(src)] Sent General Quarters!"

prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?")
log = "[key_name_admin(src)] Sent General Quarters! (Using a custom announcement)"

set_security_level(SEC_LEVEL_RED, TRUE, FALSE)
shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
message_admins(log)
return TRUE
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@
#include "code\game\machinery\autolathe_datums.dm"
#include "code\game\machinery\Beacon.dm"
#include "code\game\machinery\bio-dome_floodlights.dm"
#include "code\game\machinery\biohazard_lockdown.dm"
#include "code\game\machinery\bioprinter.dm"
#include "code\game\machinery\buttons.dm"
#include "code\game\machinery\cell_charger.dm"
Expand Down
Binary file modified icons/obj/structures/doors/blastdoors_shutters.dmi
Binary file not shown.
Loading