mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 04:48:18 +01:00
e063223199
* autolathe1 * cl * Oops * pay the price --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
25 lines
672 B
Plaintext
25 lines
672 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: heavy_vehicle
|
|
*
|
|
* Checks that the user is inside a mech, that the mech is powered and is the right one.
|
|
*
|
|
*/
|
|
|
|
GLOBAL_DATUM_INIT(heavy_vehicle_state, /datum/ui_state/heavy_vehicle, new)
|
|
|
|
/datum/ui_state/heavy_vehicle/can_use_topic(src_object, mob/user)
|
|
. = user.shared_ui_interaction(src_object)
|
|
|
|
if(!istype(src_object, /obj/item/mecha_equipment))
|
|
return
|
|
var/obj/item/mecha_equipment/mecha_equip = src_object
|
|
if(ismech(user.loc))
|
|
var/mob/living/heavy_vehicle/mech = user.loc
|
|
if(mecha_equip.owner == mech && mech.power == MECH_POWER_ON)
|
|
return UI_INTERACTIVE
|