Files
Cameron LennoxandGitHub 2e38926234 Removes sleeping from the code in more places (#17418)
* Axes unused 'paused' variable from projectile code

* Remove TGUI in scrubber init

Moves it to only happen when a user interacts with it.

* Ghostpod tgui input from init -> LateInit

Ghost query REQUIRES a tgui input. It can't be fixed on that level.
Ghost pods however created a ghost query when spawned if they are NOT mapspawn. This means it can only be moved to lateinit, as far as I can see

* Moves borer ghost query from init to lateinit

* Better mob chasing. Gets rid of sleep in mob chasing

Moves Noodle's and Ian's snack tracking var to base /simple_mob
Moves Noodle's and Ian's tracking process from a individual proc of each to /simple_mob
Moves the sleeps out from the tracking proc and makes it a repeating timer.
Noodle now gets nutrition when you feed him.

* Moves blob query to lateinit

Once again, blob HAS to do a ghost query when it's created.
Ghost query will ALWAYS make a tgui window.

* No sleep in cyborg code

Moves pick_module() from /init on robot_module to /LateInit on /robot
photo showing it popped up the module select when I spawned in as a borg: https://i.imgur.com/5rGbqIR.png

* Moves AI controlled human's 'death' proc to LateInitialize

* Moves Corpse's processing from Init to LateInit

death() has a LOT that happens inside of it.

* Let's actually make it lateload on the human itself

* In case we don't want to auto kill ai controlled mobs

* Fixes death() some more

- Protean blobs will ALWAYS have a humanform, so that segment of code was unused.
- Makes the bulk of the exit VR section in a new perform_exit() proc
- Gets rid of the WIP proof of concept hack in there.

* whoops duplicate

* We will ALWAYS have a humanform. ALWAYS.

The server will CRASH if we do not.

* get rid of this...

* Makes corpsespawn work better

* more VR stuff

* No suspending the whole machines subsystem

* avatar

* as anything

* u2

* nolist

* forgot this one

* fix

* VR fix

Fixes an oversight with VR sleepers

* player initiated

* OVERSIGHT

* Update borer.dm

OF course WE DON'T have a mind, we're a GHOST.
Fixes borer spawning

* this was unused

no
2025-04-07 17:16:07 -04:00

138 lines
4.1 KiB
Plaintext

/obj/machinery/computer/area_atmos
name = "Area Air Control"
desc = "A computer used to control the stationary scrubbers and pumps in the area."
icon_keyboard = "atmos_key"
icon_screen = "area_atmos"
light_color = "#e6ffff"
circuit = /obj/item/circuitboard/area_atmos
var/list/connectedscrubbers = list()
var/status = ""
var/range = 25
//Simple variable to prevent me from doing attack_hand in both this and the child computer
var/zone = "This computer is working on a wireless range, the range is currently limited to "
/obj/machinery/computer/area_atmos/Initialize(mapload)
. = ..()
scanscrubbers()
/obj/machinery/computer/area_atmos/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/area_atmos/attack_hand(var/mob/user as mob)
if(..(user))
return
tgui_interact(user)
/obj/machinery/computer/area_atmos/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "AreaScrubberControl", name)
ui.open()
/obj/machinery/computer/area_atmos/tgui_data(mob/user)
var/list/working = list()
for(var/id in connectedscrubbers)
var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber = connectedscrubbers[id]
if(!validscrubber(scrubber))
connectedscrubbers -= scrubber
continue
working.Add(list(list(
"id" = id,
"name" = scrubber.name,
"on" = scrubber.on,
"pressure" = scrubber.air_contents.return_pressure(),
"flow_rate" = scrubber.last_flow_rate,
"load" = scrubber.last_power_draw,
"area" = get_area(scrubber),
)))
return list("scrubbers" = working)
/obj/machinery/computer/area_atmos/tgui_act(action, params, datum/tgui/ui)
if(..())
return TRUE
switch(action)
if("toggle")
var/scrub_id = params["id"]
var/obj/machinery/portable_atmospherics/powered/scrubber/huge/S = connectedscrubbers["[scrub_id]"]
if(!validscrubber(S))
connectedscrubbers -= S
return TRUE
S.on = !S.on
S.update_icon()
. = TRUE
if("allon")
INVOKE_ASYNC(src, PROC_REF(toggle_all), TRUE)
. = TRUE
if("alloff")
INVOKE_ASYNC(src, PROC_REF(toggle_all), FALSE)
. = TRUE
if("scan")
scanscrubbers_user(ui.user)
. = TRUE
add_fingerprint(ui.user)
/obj/machinery/computer/area_atmos/proc/toggle_all(on)
for(var/id in connectedscrubbers)
var/obj/machinery/portable_atmospherics/powered/scrubber/huge/S = connectedscrubbers["[id]"]
if(!validscrubber(S))
connectedscrubbers -= S
continue
S.on = on
S.update_icon()
CHECK_TICK
/obj/machinery/computer/area_atmos/proc/validscrubber(obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber as obj)
if(!isobj(scrubber) || get_dist(scrubber.loc, src.loc) > src.range || scrubber.loc.z != src.loc.z)
return FALSE
return TRUE
/obj/machinery/computer/area_atmos/proc/scanscrubbers()
connectedscrubbers = list()
var/found = 0
for(var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber in range(range, src.loc))
found = 1
connectedscrubbers["[scrubber.id]"] = scrubber
if(!found)
status = "ERROR: No scrubber found!"
/obj/machinery/computer/area_atmos/proc/scanscrubbers_user(mob/user) //Used when the user is in the UI and scans for scrubbers.
scanscrubbers()
updateUsrDialog(user)
// The one that only works in the same map area
/obj/machinery/computer/area_atmos/area
zone = "This computer is working in a wired network limited to this area."
/obj/machinery/computer/area_atmos/area/scanscrubbers(mob/user)
connectedscrubbers.Cut()
var/found = 0
var/area/A = get_area(src)
for(var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber in A)
connectedscrubbers["[scrubber.id]"] = scrubber
found = 1
if(!found)
status = "ERROR: No scrubber found!"
/obj/machinery/computer/area_atmos/area/scanscrubbers_user(mob/user) //Used when the user is in the UI and scans for scrubbers.
scanscrubbers()
updateUsrDialog(user)
/obj/machinery/computer/area_atmos/area/validscrubber(var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber)
if(!istype(scrubber))
return FALSE
if(get_area(scrubber) == get_area(src))
return TRUE
return FALSE