Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit f7d3ac6

Browse files
committed
emerald tablet apartment toxic
1 parent 2485a94 commit f7d3ac6

File tree

5 files changed

+86
-1
lines changed

5 files changed

+86
-1
lines changed

code/game/machinery/medical_kiosk.dm

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
var/mob/living/carbon/human/altPatient //If scanning someone else, this will be the target.
2828
var/obj/item/card/id/C //the account of the person using the console.
2929

30+
COOLDOWN_DECLARE(bracelet_print)
31+
var/bracelet_print_cd = 5 SECONDS
32+
3033
/obj/machinery/medical_kiosk/Initialize(mapload) //loaded subtype for mapping use
3134
. = ..()
3235
scanner_wand = new/obj/item/scanner_wand(src)
@@ -328,7 +331,7 @@
328331
data["active_status_4"] = scan_active_4 // Radio-Neuro Scan Check
329332
return data
330333

331-
/obj/machinery/medical_kiosk/ui_act(action,active)
334+
/obj/machinery/medical_kiosk/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
332335
if(..())
333336
return
334337
switch(action)
@@ -356,3 +359,46 @@
356359
altPatient = null
357360
clearScans()
358361
. = TRUE
362+
if("printBracelet")
363+
if(!isliving(usr))
364+
return
365+
var/mob/living/living_user = usr
366+
var/issue = trim(sanitize(living_user.treat_message(tgui_input_text(living_user, "Enter your medical issue.", "Medical Wristband", "I have a boo-boo.", 60))), 60)
367+
if(!istext(issue) || !issue || issue == "")
368+
to_chat(living_user, span_warning("Error, no issue written."))
369+
return
370+
if(!Adjacent(living_user))
371+
to_chat(living_user, span_warning("Error, you are too far away from the kiosk."))
372+
return
373+
if(!COOLDOWN_FINISHED(src, bracelet_print))
374+
to_chat(living_user, span_warning("Error, bracelet printed too recently. Please wait [(COOLDOWN_TIMELEFT(src, bracelet_print) / 10)] seconds."))
375+
return
376+
if(!(altPatient?.name))
377+
to_chat(living_user, span_warning("Error, no patient detected."))
378+
return
379+
if(isnotpretty(issue))
380+
to_chat(living_user, "<span class='notice'>Your fingers slip. <a href='https://forums.yogstation.net/help/rules/#rule-0_1'>See rule 0.1</a>.</span>")
381+
var/log_message = "[key_name(living_user)] just tripped a pretty filter: '[issue]'."
382+
message_admins(log_message)
383+
log_say(log_message)
384+
return
385+
COOLDOWN_START(src, bracelet_print, bracelet_print_cd)
386+
var/obj/item/clothing/gloves/patient_bracelet/new_bracelet = new
387+
new_bracelet.patient_name = altPatient.name
388+
new_bracelet.patient_issue = issue
389+
living_user.put_in_hands(new_bracelet)
390+
playsound(src, 'sound/machines/machine_vend.ogg', 50, TRUE, extrarange = -3)
391+
392+
/// Mob examine code in code/modules/mob/living/carbon/human/examine.dm
393+
/obj/item/clothing/gloves/patient_bracelet
394+
name = "patient wristbands"
395+
desc = "A pair of advanced patient wristbands used to identify patients and assist in triage. To be worn on the wrist."
396+
icon_state = "gloves_cell"
397+
worn_icon = 'icons/mob/clothing/hands/hands.dmi'
398+
worn_icon_state = "latex"
399+
var/patient_name = "Unknown"
400+
var/patient_issue = "Not listed."
401+
402+
/obj/item/clothing/gloves/patient_bracelet/examine(mob/user)
403+
. = ..()
404+
. += "Patient: <b>[bracelet.patient_name]</b>\n\"[bracelet.patient_issue]\""

code/game/machinery/scan_gate.dm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define SCANGATE_WANTED "Wanted"
77
#define SCANGATE_SPECIES "Species"
88
#define SCANGATE_NUTRITION "Nutrition"
9+
#define SCANGATE_BRACELET "Wristband"
910

1011
#define SCANGATE_HUMAN "human"
1112
#define SCANGATE_LIZARD "lizard"
@@ -161,6 +162,11 @@
161162
beep = TRUE
162163
if(H.nutrition >= detect_nutrition && detect_nutrition == NUTRITION_LEVEL_FAT)
163164
beep = TRUE
165+
if(SCANGATE_BRACELET)
166+
if(ishuman(M))
167+
var/mob/living/carbon/human/human_target = M
168+
if(istype(human_target.gloves, /obj/item/clothing/gloves/patient_bracelet))
169+
beep = TRUE
164170

165171
if(reverse)
166172
beep = !beep
@@ -249,6 +255,7 @@
249255
#undef SCANGATE_WANTED
250256
#undef SCANGATE_SPECIES
251257
#undef SCANGATE_NUTRITION
258+
#undef SCANGATE_BRACELET
252259

253260
#undef SCANGATE_HUMAN
254261
#undef SCANGATE_LIZARD

code/modules/mob/living/carbon/human/examine.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@
128128
badwings = "Weaponized "
129129
. += "[t_He] [t_has] a pair of [span_warning(badwings)][(dna.features["wings"])] wings on [t_his] back"
130130

131+
//Patient bracelet
132+
if(gloves && !(ITEM_SLOT_GLOVES in obscured) && istype(gloves, /obj/item/clothing/gloves/patient_bracelet))
133+
var/obj/item/clothing/gloves/patient_bracelet/bracelet = gloves
134+
. += span_notice("[icon2html(gloves, user)] - Patient: <b>[bracelet.patient_name]</b>\n\"[bracelet.patient_issue]\"")
135+
131136
if(user?.mind && HAS_TRAIT(user.mind, TRAIT_PSYCH) && LAZYLEN(get_traumas()))
132137
var/highest_trauma = 0
133138
for(var/datum/brain_trauma/B in get_traumas())

tgui/packages/tgui/interfaces/MedicalKiosk.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ const MedicalKioskInstructions = (props, context) => {
137137
color="average"
138138
onClick={() => act('clearTarget')}
139139
content="Reset Scanner" />
140+
<Button
141+
inline
142+
mt={1}
143+
tooltip={multiline`
144+
Prints out a medical wristband that helps with triage & speeds up treatment.
145+
`}
146+
icon="print"
147+
onClick={() => act('printBracelet')}
148+
content="Print Wristband" />
140149
</Section>
141150
);
142151
};

tgui/packages/tgui/interfaces/ScannerGate.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ const SCANNER_GATE_ROUTES = {
118118
title: 'Scanner Mode: Nanites',
119119
component: () => ScannerGateNanites,
120120
},
121+
Bracelet: {
122+
title: 'Scanner Mode: Wristband',
123+
component: () => ScannerGateBracelet,
124+
},
121125
};
122126

123127
const ScannerGateControl = (props, context) => {
@@ -329,6 +333,20 @@ const ScannerGateNanites = (props, context) => {
329333
);
330334
};
331335

336+
const ScannerGateBracelet = (props, context) => {
337+
const { data } = useBackend(context);
338+
const { reverse } = data;
339+
return (
340+
<>
341+
<Box mb={2}>
342+
Trigger if the person scanned {reverse ? 'does not have' : 'has'}
343+
{' '}a patient wristband.
344+
</Box>
345+
<ScannerGateMode />
346+
</>
347+
);
348+
};
349+
332350
const ScannerGateMode = (props, context) => {
333351
const { act, data } = useBackend(context);
334352
const { reverse } = data;

0 commit comments

Comments
 (0)