mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-28 07:39:13 +01:00
[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:
co-authored by
Cameron Lennox
Kashargul
parent
4faf6a1599
commit
8f6c3fee0e
@@ -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)
|
||||
Reference in New Issue
Block a user