Files
f881d54dbf Panel port test [IDB IGNORE] (#17350)
* no more self callbacks on update fullness

* fix missing code

* Belly test

* import type

* full partiy

* .

* fix preview

* in belly to late join

* robot nutri

* .

* .

* update export

* finish open todos

* code cleanup

* fix some old slacking

* move this to a define

* fixing

* ,

* .

* Creates a Consume Belly Reagents pref (#10)

* Creates a Consume Belly Reagents pref

Added a Consume Belly Reagents pref that blocks the consumption of all reagents produced by a belly via reagent containers such as food, drink, beakers, pills, syringes and hyposprays. Seems to work well as intended.

* These changes at least do not cause any problems

* Missed this one

* Reverts reagent_names

* _BELLY versions

* Fixed typo

* .

* fix admin spawn mobs bellies

* also fix that bug

* hints

* fix that

* .

* initial

* should be all

* that is no longer needed

* fluids into hand items

I was convinced this was broken until it was pointed out that the item has to be ON THE GROUND to fill it...Instead of in your hand. That seems so convoluted.

ARC = active-hand reagent container. IRC = inactive-hand reagent container.

* some stuff

---------

Co-authored-by: SatinIsle <98125273+SatinIsle@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
2025-03-16 17:08:47 -04:00

115 lines
3.1 KiB
Plaintext

/*
This file contains:
Manual Injector:
Manually injects chemicals into a xenobiological creature from a linked machine.
*/
/obj/machinery/computer/xenobio2
name = "injector control console"
desc = "Used to control mechanized biological injectors."
icon_keyboard = "med_key"
icon_screen = "dna"
light_color = "#315ab4"
use_power = USE_POWER_IDLE
idle_power_usage = 250
active_power_usage = 500
circuit = /obj/item/circuitboard/xenobio2computer
var/obj/machinery/xenobio2/manualinjector/injector
var/transfer_amount = 5 //VOREStation Edit - This is never set anywhere, and 1 is too slow (1 is the default in the transfer proc).
var/active
/obj/machinery/computer/xenobio2/Destroy()
injector.computer = null
. = ..()
/obj/machinery/computer/xenobio2/attack_hand(mob/user)
if(..())
return 1
ui_interact(user)
/obj/machinery/computer/xenobio2/attackby(var/obj/item/W, var/mob/user)
//Did you want to link it?
if(istype(W, /obj/item/multitool))
var/obj/item/multitool/P = W
if(P.connectable)
if(istype(P.connectable, /obj/machinery/xenobio2/manualinjector))
var/obj/machinery/xenobio2/manualinjector/I = P.connectable
injector = I
I.computer = src
to_chat(user, span_warning(" You link the [src] to the [P.connectable]!"))
else
to_chat(user, span_warning(" You store the [src] in the [P]'s buffer!"))
P.connectable = src
return
..()
//Is missing a tgui interface?
/obj/machinery/computer/xenobio2/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(!user)
return
if(!injector)
return
var/list/data = list()
data["activity"] = active
data["beaker"] = injector.beaker
if(injector.occupant)
data["occupied"] = 1
if(isxeno(injector.occupant))
var/mob/living/simple_mob/xeno/X = injector.occupant
data["compatible"] = 1
data["instability"] = 100 * (X.mut_level / X.mut_max)
else
data["compatible"] = null
if(injector.beaker)
data["reagentAmount"] = injector.beaker.reagents.total_volume
data["reagentMax"] = injector.beaker.reagents.maximum_volume
data["reagentMin"] = 0
else
data["reagentAmount"] = null
data["reagentMax"] = 1
data["reagentMin"] = 0
if(injector.occupant)
data["occupantHealth"] = injector.occupant.health
data["occupantHealthMax"] = injector.occupant.getMaxHealth()
else
data["occupantHealth"] = null
data["occupantHealthMax"] = null
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "xenobio_computer.tmpl", "Injector Control Console UI", 470, 450)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/computer/xenobio2/Topic(href, href_list)
if(..())
return 1
if(href_list["inject_target"])
active = 1
spawn(5)
injector.inject_reagents()
active = 0
if(href_list["eject_occupant"])
injector.eject_xeno()
if(href_list["eject_beaker"])
injector.eject_beaker()
usr.set_machine(src)
src.add_fingerprint(usr)
/obj/item/circuitboard/xenobio2computer
name = T_BOARD("injector control console")
build_path = /obj/machinery/computer/xenobio2
origin_tech = list() //To be filled