mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 03:59:59 +01:00
Adds the multiplexer circuit component - en.wikipedia.org/wiki/Multiplexer Circuit components can now be directly inserted into shells rather than having to take the integrated circuit out. Special information can be accessed from components now through the "Info" button besides the eject button on a component.
41 lines
941 B
Plaintext
41 lines
941 B
Plaintext
/**
|
|
* # Get Species Component
|
|
*
|
|
* Return the species of a mob
|
|
*/
|
|
/obj/item/circuit_component/species
|
|
display_name = "Get Species"
|
|
display_desc = "A component that returns the species of its input."
|
|
|
|
/// The input port
|
|
var/datum/port/input/input_port
|
|
|
|
/// The result from the output
|
|
var/datum/port/output/output
|
|
|
|
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL
|
|
|
|
/obj/item/circuit_component/species/Initialize()
|
|
. = ..()
|
|
input_port = add_input_port("Organism", PORT_TYPE_ATOM)
|
|
|
|
output = add_output_port("Species", PORT_TYPE_STRING)
|
|
|
|
/obj/item/circuit_component/species/Destroy()
|
|
input_port = null
|
|
output = null
|
|
return ..()
|
|
|
|
/obj/item/circuit_component/species/input_received(datum/port/input/port)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
var/mob/living/carbon/human/human = input_port.input_value
|
|
if(!istype(human) || !human.has_dna())
|
|
output.set_output(null)
|
|
return
|
|
|
|
output.set_output(human.dna.species.name)
|
|
|