mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Adds medical kiosk to code/buildable
This commit is contained in:
187
code/game/machinery/medical_kiosk.dm
Normal file
187
code/game/machinery/medical_kiosk.dm
Normal file
@@ -0,0 +1,187 @@
|
||||
#define BROKEN_BONES 0x1
|
||||
#define INTERNAL_BLEEDING 0x2
|
||||
#define EXTERNAL_BLEEDING 0x4
|
||||
#define SERIOUS_EXTERNAL_DAMAGE 0x8
|
||||
#define SERIOUS_INTERNAL_DAMAGE 0x10
|
||||
#define RADIATION_DAMAGE 0x20
|
||||
#define TOXIN_DAMAGE 0x40
|
||||
#define OXY_DAMAGE 0x80
|
||||
|
||||
/obj/machinery/medical_kiosk
|
||||
name = "medical kiosk"
|
||||
desc = "A helpful kiosk for finding out whatever is wrong with you."
|
||||
icon = 'icons/obj/machines/medical_kiosk.dmi'
|
||||
icon_state = "kiosk_off"
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 200
|
||||
circuit = /obj/item/weapon/circuitboard/medical_kiosk
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
|
||||
var/mob/living/active_user
|
||||
var/db_key
|
||||
var/datum/transcore_db/our_db
|
||||
|
||||
/obj/machinery/medical_kiosk/Initialize()
|
||||
. = ..()
|
||||
our_db = SStranscore.db_by_key(db_key)
|
||||
|
||||
/obj/machinery/medical_kiosk/update_icon()
|
||||
. = ..()
|
||||
if(panel_open)
|
||||
icon_state = "kiosk_open" // panel
|
||||
else if((stat & (NOPOWER|BROKEN)) || !active_user)
|
||||
icon_state = "kiosk_off" // asleep or no power
|
||||
else
|
||||
icon_state = "kiosk" // waiting for user or to finish processing
|
||||
|
||||
/obj/machinery/medical_kiosk/attack_hand(mob/living/user)
|
||||
. = ..()
|
||||
if(istype(user) && Adjacent(user))
|
||||
if(inoperable() || panel_open)
|
||||
to_chat(user, "<span class='warning'>\The [src] seems to be nonfunctional...</span>")
|
||||
else if(active_user && active_user != user)
|
||||
to_chat(user, "<span class='warning'>Another patient has begin using this machine. Please wait for them to finish, or their session to time out.</span>")
|
||||
else
|
||||
start_using(user)
|
||||
|
||||
/obj/machinery/medical_kiosk/attackby(obj/item/O, mob/user)
|
||||
. = ..()
|
||||
if(default_unfasten_wrench(user, O, 40))
|
||||
return
|
||||
if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
if(default_part_replacement(user, O))
|
||||
return
|
||||
|
||||
/obj/machinery/medical_kiosk/proc/wake_lock(mob/living/user)
|
||||
active_user = user
|
||||
update_icon()
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
|
||||
/obj/machinery/medical_kiosk/proc/suspend()
|
||||
active_user = null
|
||||
update_icon()
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
|
||||
/obj/machinery/medical_kiosk/proc/start_using(mob/living/user)
|
||||
// Out of standby
|
||||
wake_lock(user)
|
||||
|
||||
// User requests service
|
||||
user.visible_message("<b>[user]</b> wakes [src].", "You wake [src].")
|
||||
var/choice = tgui_alert(user, "What service would you like?", "[src]", list("Health Scan", "Backup Scan", "Cancel"), timeout = 10 SECONDS)
|
||||
if(!choice || choice == "Cancel" || !Adjacent(user) || inoperable() || panel_open)
|
||||
suspend()
|
||||
return
|
||||
|
||||
// Service begins, delay
|
||||
visible_message("<b>\The [src]</b> scans [user] thoroughly!")
|
||||
flick("kiosk_active", src)
|
||||
if(!do_after(user, 10 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) || inoperable())
|
||||
suspend()
|
||||
return
|
||||
|
||||
// Service completes
|
||||
switch(choice)
|
||||
if("Health Scan")
|
||||
var/health_report = tell_health_info(user)
|
||||
to_chat(user, "<span class='notice'><b>Health report results:</b></span>"+health_report)
|
||||
if("Backup Scan")
|
||||
if(!our_db)
|
||||
to_chat(user, "<span class='notice'><b>Backup scan results:</b></span><br>DATABASE ERROR!")
|
||||
else
|
||||
var/scan_report = do_backup_scan(user)
|
||||
to_chat(user, "<span class='notice'><b>Backup scan results:</b></span>"+scan_report)
|
||||
|
||||
// Standby
|
||||
suspend()
|
||||
|
||||
/obj/machinery/medical_kiosk/proc/tell_health_info(mob/living/user)
|
||||
if(!istype(user))
|
||||
return "<br><span class='warning'>Unable to perform diagnosis on this type of life form.</span>"
|
||||
if(user.isSynthetic())
|
||||
return "<br><span class='warning'>Unable to perform diagnosis on synthetic life forms.</span>"
|
||||
|
||||
var/problems = 0
|
||||
for(var/obj/item/organ/external/E in user)
|
||||
if(E.status & ORGAN_BROKEN)
|
||||
problems |= BROKEN_BONES
|
||||
if(E.status & (ORGAN_DEAD|ORGAN_DESTROYED))
|
||||
problems |= SERIOUS_EXTERNAL_DAMAGE
|
||||
if(E.status & ORGAN_BLEEDING)
|
||||
problems |= EXTERNAL_BLEEDING
|
||||
for(var/datum/wound/W in E.wounds)
|
||||
if(W.bleeding())
|
||||
if(W.internal)
|
||||
problems |= INTERNAL_BLEEDING
|
||||
else
|
||||
problems |= EXTERNAL_BLEEDING
|
||||
|
||||
for(var/obj/item/organ/internal/I in user)
|
||||
if(I.status & (ORGAN_BROKEN|ORGAN_DEAD|ORGAN_DESTROYED))
|
||||
problems |= SERIOUS_INTERNAL_DAMAGE
|
||||
if(I.status & ORGAN_BLEEDING)
|
||||
problems |= INTERNAL_BLEEDING
|
||||
|
||||
if(user.getToxLoss() > 0)
|
||||
problems |= TOXIN_DAMAGE
|
||||
if(user.getOxyLoss() > 0)
|
||||
problems |= OXY_DAMAGE
|
||||
if(user.radiation > 0)
|
||||
problems |= RADIATION_DAMAGE
|
||||
if(user.getFireLoss() > 40 || user.getBruteLoss() > 40)
|
||||
problems |= SERIOUS_EXTERNAL_DAMAGE
|
||||
|
||||
if(!problems)
|
||||
if(user.getHalLoss() > 0)
|
||||
return "<br><span class='warning'>Mild concussion detected - advising bed rest until patient feels well. No other anatomical issues detected.</span>"
|
||||
else
|
||||
return "<br><span class='notice'>No anatomical issues detected.</span>"
|
||||
|
||||
var/problem_text = ""
|
||||
if(problems & BROKEN_BONES)
|
||||
problem_text += "<br><span class='warning'>Broken bones detected - see a medical professional and move as little as possible.</span>"
|
||||
if(problems & INTERNAL_BLEEDING)
|
||||
problem_text += "<br><span class='danger'>Internal bleeding detected - seek medical attention, ASAP!</span>"
|
||||
if(problems & EXTERNAL_BLEEDING)
|
||||
problem_text += "<br><span class='warning'>External bleeding detected - advising pressure with cloth and bandaging.</span>"
|
||||
if(problems & SERIOUS_EXTERNAL_DAMAGE)
|
||||
problem_text += "<br><span class='danger'>Severe anatomical damage detected - seek medical attention.</span>"
|
||||
if(problems & SERIOUS_INTERNAL_DAMAGE)
|
||||
problem_text += "<br><span class='danger'>Severe internal damage detected - seek medical attention.</span>"
|
||||
if(problems & RADIATION_DAMAGE)
|
||||
problem_text += "<br><span class='danger'>Exposure to ionizing radiation detected - seek medical attention.</span>"
|
||||
if(problems & TOXIN_DAMAGE)
|
||||
problem_text += "<br><span class='warning'>Exposure to toxic materials detected - induce vomiting if you have consumed anything recently.</span>"
|
||||
if(problems & OXY_DAMAGE)
|
||||
problem_text += "<br><span class='warning'>Blood/air perfusion level is below acceptable norms - use concentrated oxygen if necessary.</span>"
|
||||
|
||||
return problem_text
|
||||
|
||||
/obj/machinery/medical_kiosk/proc/do_backup_scan(mob/living/carbon/human/user)
|
||||
if(!istype(user))
|
||||
return "<br><span class='warning'>Unable to perform full scan. Please see a medical professional.</span>"
|
||||
if(!user.mind)
|
||||
return "<br><span class='warning'>Unable to perform full scan. Please see a medical professional.</span>"
|
||||
|
||||
var/nif = user.nif
|
||||
if(nif)
|
||||
persist_nif_data(user)
|
||||
|
||||
our_db.m_backup(user.mind,nif,one_time = TRUE)
|
||||
var/datum/transhuman/body_record/BR = new()
|
||||
BR.init_from_mob(user, TRUE, TRUE, database_key = db_key)
|
||||
|
||||
return "<br><span class='notice'>Backup scan completed!</span><br><b>Note:</b> A backup implant is required for automated notifications to the appropriate department in case of incident."
|
||||
|
||||
#undef BROKEN_BONES
|
||||
#undef INTERNAL_BLEEDING
|
||||
#undef EXTERNAL_BLEEDING
|
||||
#undef SERIOUS_EXTERNAL_DAMAGE
|
||||
#undef SERIOUS_INTERNAL_DAMAGE
|
||||
#undef RADIATION_DAMAGE
|
||||
#undef TOXIN_DAMAGE
|
||||
#undef OXY_DAMAGE
|
||||
@@ -210,6 +210,15 @@
|
||||
/obj/item/weapon/stock_parts/scanning_module = 3,
|
||||
/obj/item/stack/material/glass/reinforced = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/medical_kiosk
|
||||
name = T_BOARD("medical kiosk")
|
||||
build_path = /obj/machinery/medical_kiosk
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2)
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/scanning_module = 3,
|
||||
/obj/item/stack/material/glass/reinforced = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/sleeper
|
||||
name = T_BOARD("sleeper")
|
||||
build_path = /obj/machinery/sleeper
|
||||
|
||||
@@ -650,6 +650,7 @@
|
||||
/obj/item/weapon/circuitboard/scanner_console,
|
||||
/obj/item/weapon/circuitboard/sleeper_console,
|
||||
/obj/item/weapon/circuitboard/body_scanner,
|
||||
/obj/item/weapon/circuitboard/medical_kiosk,
|
||||
/obj/item/weapon/circuitboard/sleeper,
|
||||
/obj/item/weapon/circuitboard/dna_analyzer)
|
||||
contraband = list(/obj/item/weapon/cell/potato = 3)
|
||||
|
||||
BIN
icons/obj/machines/medical_kiosk.dmi
Normal file
BIN
icons/obj/machines/medical_kiosk.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -130942,31 +130942,21 @@ aaa
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/admin)
|
||||
"aeN" = (
|
||||
/obj/effect/floor_decal/borderfloorwhite{
|
||||
dir = 5
|
||||
},
|
||||
/obj/effect/floor_decal/corner/paleblue/border{
|
||||
dir = 5
|
||||
},
|
||||
/obj/effect/floor_decal/borderfloorwhite/corner2{
|
||||
dir = 4
|
||||
},
|
||||
/obj/effect/floor_decal/corner/paleblue/bordercorner2{
|
||||
dir = 4
|
||||
},
|
||||
/obj/structure/extinguisher_cabinet{
|
||||
pixel_y = 30
|
||||
},
|
||||
/obj/structure/disposalpipe/trunk,
|
||||
/obj/machinery/disposal,
|
||||
/obj/machinery/camera/network/medbay{
|
||||
dir = 8
|
||||
},
|
||||
/obj/item/device/radio/intercom{
|
||||
dir = 4;
|
||||
name = "Station Intercom (General)";
|
||||
pixel_x = 24
|
||||
},
|
||||
/obj/machinery/medical_kiosk,
|
||||
/obj/effect/floor_decal/corner/paleblue{
|
||||
dir = 6
|
||||
},
|
||||
/obj/effect/floor_decal/corner/paleblue{
|
||||
dir = 9
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aeO" = (
|
||||
@@ -131488,14 +131478,9 @@ aaa
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"afC" = (
|
||||
/obj/structure/cable/green{
|
||||
d1 = 1;
|
||||
d2 = 2;
|
||||
icon_state = "1-2"
|
||||
},
|
||||
/obj/structure/disposalpipe/junction{
|
||||
dir = 2;
|
||||
icon_state = "pipe-j2"
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 4;
|
||||
icon_state = "pipe-c"
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
@@ -132969,6 +132954,9 @@ aaa
|
||||
/obj/effect/floor_decal/corner/paleblue/bordercorner2{
|
||||
dir = 9
|
||||
},
|
||||
/obj/machinery/camera/network/medbay{
|
||||
dir = 1
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"ahM" = (
|
||||
@@ -155259,16 +155247,21 @@ aaa
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aUW" = (
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 4
|
||||
},
|
||||
/obj/effect/floor_decal/borderfloorwhite{
|
||||
dir = 4
|
||||
},
|
||||
/obj/effect/floor_decal/corner/paleblue/border{
|
||||
dir = 4
|
||||
},
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 4
|
||||
/obj/effect/floor_decal/borderfloorwhite/corner2{
|
||||
dir = 6
|
||||
},
|
||||
/obj/effect/floor_decal/corner/paleblue/bordercorner2{
|
||||
dir = 6
|
||||
},
|
||||
/obj/structure/disposalpipe/segment,
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aUX" = (
|
||||
@@ -155363,10 +155356,6 @@ aaa
|
||||
/obj/effect/floor_decal/corner/paleblue/border{
|
||||
dir = 4
|
||||
},
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 8;
|
||||
icon_state = "pipe-c"
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aVf" = (
|
||||
@@ -155454,6 +155443,9 @@ aaa
|
||||
/obj/structure/disposalpipe/segment,
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply,
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 4
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aVl" = (
|
||||
@@ -155472,15 +155464,16 @@ aaa
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aVn" = (
|
||||
/obj/structure/bed/chair{
|
||||
dir = 1
|
||||
},
|
||||
/obj/effect/floor_decal/borderfloorwhite,
|
||||
/obj/effect/floor_decal/corner/paleblue/border,
|
||||
/obj/machinery/alarm{
|
||||
dir = 1;
|
||||
pixel_y = -25
|
||||
},
|
||||
/obj/machinery/disposal,
|
||||
/obj/structure/disposalpipe/trunk{
|
||||
dir = 1
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"aVo" = (
|
||||
@@ -166500,6 +166493,9 @@ aaa
|
||||
/area/tether/surfacebase/public_garden_three)
|
||||
"exM" = (
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 4
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"eCG" = (
|
||||
@@ -171091,6 +171087,15 @@ aaa
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/crew_quarters/kitchen)
|
||||
"wle" = (
|
||||
/obj/structure/cable/green{
|
||||
d1 = 1;
|
||||
d2 = 2;
|
||||
icon_state = "1-2"
|
||||
},
|
||||
/obj/structure/disposalpipe/junction,
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"wlf" = (
|
||||
/obj/structure/table/glass,
|
||||
/obj/machinery/atmospherics/unary/vent_pump/on,
|
||||
@@ -171525,6 +171530,52 @@ aaa
|
||||
/obj/machinery/camera/network/tether,
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/tether/surfacebase/surface_three_hall)
|
||||
<<<<<<< HEAD
|
||||
||||||| parent of 3f87fb4853... Merge pull request #11234 from VOREStation/Arokha/scanmachine
|
||||
"xEb" = (
|
||||
/obj/effect/floor_decal/borderfloor{
|
||||
dir = 8
|
||||
},
|
||||
/obj/effect/floor_decal/corner/lightgrey/border{
|
||||
dir = 8
|
||||
},
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals7{
|
||||
dir = 5
|
||||
},
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals7{
|
||||
dir = 6
|
||||
},
|
||||
/obj/structure/sign/painting/public{
|
||||
pixel_x = -30
|
||||
},
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/tether/surfacebase/surface_three_hall)
|
||||
=======
|
||||
"xDo" = (
|
||||
/obj/structure/disposalpipe/segment{
|
||||
dir = 4
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/lobby)
|
||||
"xEb" = (
|
||||
/obj/effect/floor_decal/borderfloor{
|
||||
dir = 8
|
||||
},
|
||||
/obj/effect/floor_decal/corner/lightgrey/border{
|
||||
dir = 8
|
||||
},
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals7{
|
||||
dir = 5
|
||||
},
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals7{
|
||||
dir = 6
|
||||
},
|
||||
/obj/structure/sign/painting/public{
|
||||
pixel_x = -30
|
||||
},
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/tether/surfacebase/surface_three_hall)
|
||||
>>>>>>> 3f87fb4853... Merge pull request #11234 from VOREStation/Arokha/scanmachine
|
||||
"xEB" = (
|
||||
/obj/structure/disposalpipe/segment,
|
||||
/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers{
|
||||
@@ -247829,7 +247880,7 @@ abw
|
||||
ahW
|
||||
lqJ
|
||||
bno
|
||||
agX
|
||||
afC
|
||||
aVn
|
||||
aeG
|
||||
qIb
|
||||
@@ -248113,7 +248164,7 @@ aah
|
||||
adE
|
||||
aUV
|
||||
bnY
|
||||
agX
|
||||
xDo
|
||||
ahL
|
||||
aUU
|
||||
xIO
|
||||
@@ -248396,8 +248447,8 @@ bnG
|
||||
uAI
|
||||
aOX
|
||||
gtn
|
||||
afC
|
||||
uAI
|
||||
wle
|
||||
ahN
|
||||
aii
|
||||
aRW
|
||||
|
||||
8135
vorestation.dme
8135
vorestation.dme
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user