[READY] Helps data disks stop being unemployed (#38319)

* data cards actually have a function now

* Adds data cards to the IC printer for real rea

* more cards, less shitty code

* how the fuck did I miss that

adds a missing ..()

* wait wrong use of ..() fuck
This commit is contained in:
JStheguy
2018-06-19 09:22:59 -05:00
committed by letterjay
parent 1438afa013
commit 02744c59a5
5 changed files with 83 additions and 17 deletions
@@ -1,5 +1,5 @@
/obj/item/integrated_circuit/input/card_reader
name = "card reader"
name = "ID card reader" //To differentiate it from the data card reader
desc = "A circuit that can read the registred name, assignment, and PassKey string from an ID card."
icon_state = "card_reader"
@@ -14,6 +14,10 @@
"on read" = IC_PINTYPE_PULSE_OUT
)
/obj/item/integrated_circuit/input/card_reader/old
name = "card reader"
spawn_flags = 0
/obj/item/integrated_circuit/input/card_reader/attackby_react(obj/item/I, mob/living/user, intent)
var/obj/item/card/id/card = I.GetID()
var/list/access = I.GetAccess()
@@ -1104,3 +1104,43 @@
else
activate_pin(3)
/obj/item/integrated_circuit/input/data_card_reader
name = "data card reader"
desc = "A circuit that can read from and write to data cards."
extended_desc = "Setting the \"write mode\" boolean to true will cause any data cards that are used on the assembly to replace\
their existing function and data strings with the given strings, if it is set to false then using a data card on the assembly will cause\
the function and data strings stored on the card to be written to the output pins."
icon_state = "card_reader"
complexity = 4
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
inputs = list(
"function" = IC_PINTYPE_STRING,
"data to store" = IC_PINTYPE_STRING,
"write mode" = IC_PINTYPE_BOOLEAN
)
outputs = list(
"function" = IC_PINTYPE_STRING,
"stored data" = IC_PINTYPE_STRING
)
activators = list(
"on write" = IC_PINTYPE_PULSE_OUT,
"on read" = IC_PINTYPE_PULSE_OUT
)
/obj/item/integrated_circuit/input/data_card_reader/attackby_react(obj/item/I, mob/living/user, intent)
var/obj/item/card/data/card = I.GetCard()
var/write_mode = get_pin_data(IC_INPUT, 3)
if(card)
if(write_mode == TRUE)
card.function = get_pin_data(IC_INPUT, 1)
card.data = get_pin_data(IC_INPUT, 2)
push_data()
activate_pin(1)
else
set_pin_data(IC_OUTPUT, 1, card.function)
set_pin_data(IC_OUTPUT, 2, card.data)
push_data()
activate_pin(2)
else
return FALSE
return TRUE