mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
NanoUI portable scrubber/pump
This commit is contained in:
@@ -21,10 +21,10 @@
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/default_can_use_topic(var/src_object)
|
||||
if(stat || !client)
|
||||
return STATUS_CLOSE
|
||||
if(lockcharge || stunned || weakened)
|
||||
return STATUS_DISABLED
|
||||
. = shared_nano_interaction()
|
||||
if(. <= STATUS_DISABLED)
|
||||
return
|
||||
|
||||
// robots can interact with things they can see within their view range
|
||||
if((src_object in view(src)) && get_dist(src_object, src) <= src.client.view)
|
||||
return STATUS_INTERACTIVE // interactive (green visibility)
|
||||
@@ -46,8 +46,10 @@
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/silicon/ai/default_can_use_topic(var/src_object)
|
||||
if(!client || check_unable(1))
|
||||
return STATUS_CLOSE
|
||||
. = shared_nano_interaction()
|
||||
if(. != STATUS_INTERACTIVE)
|
||||
return
|
||||
|
||||
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
|
||||
// unless it's on the same level as the object it's interacting with.
|
||||
var/turf/T = get_turf(src_object)
|
||||
@@ -61,9 +63,10 @@
|
||||
// If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view
|
||||
if(is_in_chassis())
|
||||
//stop AIs from leaving windows open and using then after they lose vision
|
||||
//apc_override is needed here because AIs use their own APC when powerless
|
||||
if(cameranet && !cameranet.checkTurfVis(get_turf(src_object)))
|
||||
return apc_override ? STATUS_INTERACTIVE : STATUS_CLOSE
|
||||
return STATUS_CLOSE
|
||||
return STATUS_INTERACTIVE
|
||||
else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
return STATUS_CLOSE
|
||||
@@ -87,15 +90,15 @@
|
||||
|
||||
/mob/living/default_can_use_topic(var/src_object)
|
||||
. = shared_nano_interaction(src_object)
|
||||
if(. == STATUS_INTERACTIVE)
|
||||
if(. != STATUS_CLOSE)
|
||||
if(loc)
|
||||
. = loc.contents_nano_distance(src_object, src)
|
||||
. = min(., loc.contents_nano_distance(src_object, src))
|
||||
if(STATUS_INTERACTIVE)
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/carbon/human/default_can_use_topic(var/src_object)
|
||||
. = shared_nano_interaction(src_object)
|
||||
if(. == STATUS_INTERACTIVE)
|
||||
. = shared_living_nano_distance(src_object)
|
||||
if(. != STATUS_CLOSE)
|
||||
. = min(., shared_living_nano_distance(src_object))
|
||||
if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction.
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/var/global/datum/topic_state/physical/physical_state = new()
|
||||
|
||||
/datum/topic_state/physical/can_use_topic(var/src_object, var/mob/user)
|
||||
. = user.shared_nano_interaction(src_object)
|
||||
if(. > STATUS_CLOSE)
|
||||
return min(., user.check_physical_distance(src_object))
|
||||
|
||||
/mob/proc/check_physical_distance(var/src_object)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/dead/observer/check_physical_distance(var/src_object)
|
||||
return default_can_use_topic(src_object)
|
||||
|
||||
/mob/living/check_physical_distance(var/src_object)
|
||||
return shared_living_nano_distance(src_object)
|
||||
|
||||
/mob/living/silicon/check_physical_distance(var/src_object)
|
||||
return max(STATUS_UPDATE, shared_living_nano_distance(src_object))
|
||||
@@ -7,7 +7,7 @@
|
||||
// Toilets are a type of disposal bin for small objects only and work on magic. By magic, I mean torque rotation
|
||||
#define SEND_PRESSURE 0.05*ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/disposal/
|
||||
/obj/machinery/disposal
|
||||
name = "disposal unit"
|
||||
desc = "A pneumatic waste disposal unit."
|
||||
icon = 'icons/obj/pipes/disposal.dmi'
|
||||
@@ -208,6 +208,10 @@
|
||||
|
||||
// ai as human but can't flush
|
||||
/obj/machinery/disposal/attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/disposal/attack_ghost(mob/user as mob)
|
||||
ui_interact(user)
|
||||
|
||||
// human interact with machine
|
||||
@@ -241,10 +245,10 @@
|
||||
data["mode"] = mode
|
||||
if(mode <= 0)
|
||||
data["pumpstatus"] = ""
|
||||
else if(mode == 1 && pressure_round != "100")
|
||||
else if(mode == 1)
|
||||
data["pumpstatus"] = "(pressurizing)"
|
||||
else if(mode == 2)
|
||||
data["pumpstatus"] = "(flushing)"
|
||||
data["pumpstatus"] = "(ready)"
|
||||
else
|
||||
data["pumpstatus"] = "(idle)"
|
||||
data["pressure"] = pressure_round
|
||||
|
||||
Reference in New Issue
Block a user