[MIRROR] Medical Adjustments (#10604)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-04-08 01:51:17 +02:00
committed by GitHub
co-authored by Cameron Lennox Kashargul
parent 4faf6a1599
commit 8f6c3fee0e
15 changed files with 191 additions and 42 deletions
+17
View File
@@ -0,0 +1,17 @@
/*!
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
/**
* tgui state: living_state
*
* Checks that the user is a mob/living.
**/
GLOBAL_DATUM_INIT(tgui_living_state, /datum/tgui_state/living_state, new)
/datum/tgui_state/living_state/can_use_topic(src_object, mob/user)
if(isliving(user))
return STATUS_INTERACTIVE
return STATUS_CLOSE
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
/**
* tgui state: living_adjacent_state
*
* In addition to default checks, only allows interaction for a
* living adjacent user.
**/
GLOBAL_DATUM_INIT(tgui_living_adjacent_state, /datum/tgui_state/living_adjacent_state, new)
/datum/tgui_state/living_adjacent_state/can_use_topic(src_object, mob/user)
. = user.default_can_use_tgui_topic(src_object)
var/dist = get_dist(src_object, user)
if((dist > 1) || (!isliving(user)))
// Can't be used unless adjacent and human, even with TK
. = min(., STATUS_UPDATE)