Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions code/game/machinery/computer/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
return TRUE
return ACCESS_CAPTAIN in authorize_access

/// Are we NOT a silicon, AND we're logged in as a head
/obj/machinery/computer/communications/proc/authenticated_as_non_silicon_head(mob/user)
if(issilicon(user))
return FALSE
return ACCESS_HEADS in authorize_access

/// Are we a silicon, OR logged in?
/obj/machinery/computer/communications/proc/authenticated(mob/user)
if (issilicon(user))
Expand Down Expand Up @@ -330,6 +336,11 @@
log_game("[key_name(usr)] enabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.")
deadchat_broadcast(" enabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
if ("printSpare")
if (authenticated_as_non_silicon_head(usr))
playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1)
new /obj/item/card/id/captains_spare/temporary(loc)
priority_announce("The emergency spare ID has been printed by [authorize_name].", "Emergency Spare ID Warning System", SSstation.announcer.get_rand_report_sound())

/obj/machinery/computer/communications/ui_data(mob/user)
var/list/data = list(
Expand Down Expand Up @@ -361,6 +372,7 @@
data["importantActionReady"] = COOLDOWN_FINISHED(src, important_action_cooldown)
data["shuttleCalled"] = FALSE
data["shuttleLastCalled"] = FALSE
data["canPrintId"] = FALSE

data["alertLevel"] = get_security_level()
data["authorizeName"] = authorize_name
Expand All @@ -371,6 +383,9 @@
data["canMessageAssociates"] = TRUE
data["canRequestNuke"] = TRUE

if (!issilicon(user))
data["canPrintId"] = TRUE

if (can_send_messages_to_other_sectors(user))
data["canSendToSectors"] = TRUE

Expand Down
22 changes: 22 additions & 0 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,28 @@ update_label("John Doe", "Clowny")
access = J.get_access()
. = ..()

/obj/item/card/id/captains_spare/temporary
name = "emergency id card"
desc = "A temporary ID for access to secure areas in the event of an emergency"
resistance_flags = FLAMMABLE

/obj/item/card/id/captains_spare/temporary/Initialize()
. = ..()
access -= ACCESS_CHANGE_IDS
access -= ACCESS_HEADS
addtimer(CALLBACK(src, .proc/wipe_id), 50 SECONDS)

/obj/item/card/id/captains_spare/temporary/proc/wipe_id()
visible_message("<span class='danger'>The temporary spare begins to smolder</span>", "<span class='userdanger'>The temporary spare begins to smolder</span>", "<span class='userdanger'>The temporary spare begins to smolder</span>")
sleep(10 SECONDS)
if(isliving(loc))
var/mob/living/M = loc
M.adjust_fire_stacks(1)
M.IgniteMob()
fire_act()
sleep(2 SECONDS)
burn()

/obj/item/card/id/centcom
name = "\improper CentCom ID"
desc = "An ID straight from Central Command."
Expand Down
9 changes: 8 additions & 1 deletion tgui/packages/tgui/interfaces/CommunicationsConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ const PageMain = (props, context) => {
shuttleCalledPreviously,
shuttleCanEvacOrFailReason,
shuttleLastCalled,
canPrintId,
shuttleRecallable,
} = data;

Expand Down Expand Up @@ -387,6 +388,12 @@ const PageMain = (props, context) => {
onClick={() => act("makeVoiceAnnouncement")}
/>}

{!!canPrintId && <Button
icon="id-card"
content="Print Emergency ID"
onClick={() => act("printSpare")}
/>}

{!!canToggleEmergencyAccess && <Button.Confirm
icon="id-card-o"
content={`${emergencyAccess ? "Disable" : "Enable"} Emergency Maintenance Access`}
Expand Down Expand Up @@ -688,4 +695,4 @@ export const CommunicationsConsole = (props, context) => {
</Window.Content>
</Window>
);
};
};