[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 yogstation13-bot
parent 36624b04d6
commit 495c0524bf
5 changed files with 83 additions and 17 deletions

View File

@@ -78,5 +78,8 @@ PROCESSING_SUBSYSTEM_DEF(circuit)
/obj/item/integrated_electronics/wirer,
/obj/item/integrated_electronics/debugger,
/obj/item/integrated_electronics/analyzer,
/obj/item/integrated_electronics/detailer
/obj/item/integrated_electronics/detailer,
/obj/item/card/data,
/obj/item/card/data/full_color,
/obj/item/card/data/disk
)

View File

@@ -9,7 +9,7 @@
/*
* DATA CARDS - Used for the teleporter
* DATA CARDS - Used for the IC data card reader
*/
/obj/item/card
name = "card"
@@ -24,30 +24,49 @@
return BRUTELOSS
/obj/item/card/data
name = "data disk"
desc = "A disk of data."
icon_state = "data"
name = "data card"
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has a stripe running down the middle."
icon_state = "data_1"
obj_flags = UNIQUE_RENAME
var/function = "storage"
var/data = "null"
var/special = null
item_state = "card-id"
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
var/detail_color = COLOR_ASSEMBLY_ORANGE
/obj/item/card/data/verb/label(t as text)
set name = "Label Disk"
set category = "Object"
set src in usr
/obj/item/card/data/Initialize()
.=..()
update_icon()
if(usr.stat || !usr.canmove || usr.restrained())
/obj/item/card/data/update_icon()
cut_overlays()
if(detail_color == COLOR_FLOORTILE_GRAY)
return
var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/card.dmi', "[icon_state]-color")
detail_overlay.color = detail_color
add_overlay(detail_overlay)
if (t)
src.name = "data disk- '[t]'"
else
src.name = "data disk"
src.add_fingerprint(usr)
return
/obj/item/card/data/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/integrated_electronics/detailer))
var/obj/item/integrated_electronics/detailer/D = I
detail_color = D.detail_color
update_icon()
return ..()
/obj/item/proc/GetCard()
/obj/item/card/data/GetCard()
return src
/obj/item/card/data/full_color
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has the entire card colored."
icon_state = "data_2"
/obj/item/card/data/disk
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one inexplicibly looks like a floppy disk."
icon_state = "data_3"
/*
* ID CARDS

View File

@@ -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()

View File

@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB