Even More Circuit Changes

See PR for changes.
This commit is contained in:
Neerti
2017-07-31 10:58:03 -04:00
parent 91b06c20d1
commit 36b0f5fa99
38 changed files with 1210 additions and 774 deletions

View File

@@ -80,7 +80,9 @@
if (NORTHEAST) return "northeast" if (NORTHEAST) return "northeast"
if (SOUTHEAST) return "southeast" if (SOUTHEAST) return "southeast"
if (NORTHWEST) return "northwest" if (NORTHWEST) return "northwest"
if (SOUTHWEST) return "southwest" if (SOUTHWEST) return "southwest"
if (UP) return "up"
if (DOWN) return "down"
// Turns text into proper directions // Turns text into proper directions
/proc/text2dir(direction) /proc/text2dir(direction)

View File

@@ -42,3 +42,17 @@
containertype = /obj/structure/closet/crate/hydroponics containertype = /obj/structure/closet/crate/hydroponics
containername = "Exotic Seeds crate" containername = "Exotic Seeds crate"
access = access_hydroponics access = access_hydroponics
/datum/supply_packs/sci/integrated_circuit_printer
name = "Integrated circuit printer"
contains = list(/obj/item/device/integrated_circuit_printer = 2)
cost = 15
containertype = /obj/structure/closet/crate
containername = "Integrated circuit crate"
/datum/supply_packs/sci/integrated_circuit_printer_upgrade
name = "Integrated circuit printer upgrade - advanced designs"
contains = list(/obj/item/weapon/disk/integrated_circuit/upgrade/advanced)
cost = 30
containertype = /obj/structure/closet/crate
containername = "Integrated circuit crate"

View File

@@ -1,5 +1,6 @@
/obj/item/weapon/implant/integrated_circuit /obj/item/weapon/implant/integrated_circuit
name = "electronic implant" name = "electronic implant"
desc = "It's a case, for building very tiny electronics with."
icon = 'icons/obj/electronic_assemblies.dmi' icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "setup_implant" icon_state = "setup_implant"
var/obj/item/device/electronic_assembly/implant/IC = null var/obj/item/device/electronic_assembly/implant/IC = null

View File

@@ -2,19 +2,44 @@
#define IC_OUTPUT "output" #define IC_OUTPUT "output"
#define IC_ACTIVATOR "activator" #define IC_ACTIVATOR "activator"
// Pin functionality.
#define DATA_CHANNEL "data channel" #define DATA_CHANNEL "data channel"
#define PULSE_CHANNEL "pulse channel" #define PULSE_CHANNEL "pulse channel"
#define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box. // Methods of obtaining a circuit.
#define IC_SPAWN_RESEARCH 2 // If the circuit design will be autogenerated for RnD. #define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box and able to be printed in the IC printer.
#define IC_SPAWN_RESEARCH 2 // If the circuit design will be available in the IC printer after upgrading it.
// Displayed along with the pin name to show what type of pin it is.
#define IC_FORMAT_ANY "\<ANY\>"
#define IC_FORMAT_STRING "\<TEXT\>" #define IC_FORMAT_STRING "\<TEXT\>"
#define IC_FORMAT_CHAR "\<CHAR\>"
#define IC_FORMAT_COLOR "\<COLOR\>"
#define IC_FORMAT_NUMBER "\<NUM\>" #define IC_FORMAT_NUMBER "\<NUM\>"
#define IC_FORMAT_DIR "\<DIR\>"
#define IC_FORMAT_BOOLEAN "\<BOOL\>"
#define IC_FORMAT_REF "\<REF\>" #define IC_FORMAT_REF "\<REF\>"
#define IC_FORMAT_LIST "\<LIST\>" #define IC_FORMAT_LIST "\<LIST\>"
#define IC_FORMAT_ANY "\<ANY\>"
#define IC_FORMAT_PULSE "\<PULSE\>" #define IC_FORMAT_PULSE "\<PULSE\>"
// Used inside input/output list to tell the constructor what pin to make.
#define IC_PINTYPE_ANY /datum/integrated_io
#define IC_PINTYPE_STRING /datum/integrated_io/string
#define IC_PINTYPE_CHAR /datum/integrated_io/char
#define IC_PINTYPE_COLOR /datum/integrated_io/color
#define IC_PINTYPE_NUMBER /datum/integrated_io/number
#define IC_PINTYPE_DIR /datum/integrated_io/dir
#define IC_PINTYPE_BOOLEAN /datum/integrated_io/boolean
#define IC_PINTYPE_REF /datum/integrated_io/ref
#define IC_PINTYPE_LIST /datum/integrated_io/list
#define IC_PINTYPE_PULSE_IN /datum/integrated_io/activate
#define IC_PINTYPE_PULSE_OUT /datum/integrated_io/activate/out
// Data limits.
#define IC_MAX_LIST_LENGTH 200
var/list/all_integrated_circuits = list() var/list/all_integrated_circuits = list()
/proc/initialize_integrated_circuits_list() /proc/initialize_integrated_circuits_list()
@@ -30,8 +55,10 @@ var/list/all_integrated_circuits = list()
var/obj/item/device/electronic_assembly/assembly = null // Reference to the assembly holding this circuit, if any. var/obj/item/device/electronic_assembly/assembly = null // Reference to the assembly holding this circuit, if any.
var/extended_desc = null var/extended_desc = null
var/list/inputs = list() var/list/inputs = list()
var/list/inputs_default = list() // Assoc list which will fill a pin with data upon creation. e.g. "2" = 0 will set input pin 2 to equal 0 instead of null.
var/list/outputs = list() var/list/outputs = list()
var/list/activators = list() //associated_list, = 1 for inbound, = 0 for outbound var/list/outputs_default = list() // Ditto, for output.
var/list/activators = list()
var/next_use = 0 //Uses world.time var/next_use = 0 //Uses world.time
var/complexity = 1 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'. var/complexity = 1 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'.
var/size = null //This acts as a limitation on building machines, bigger components cost more 'space'. -1 for size 0 var/size = null //This acts as a limitation on building machines, bigger components cost more 'space'. -1 for size 0
@@ -40,7 +67,6 @@ var/list/all_integrated_circuits = list()
var/power_draw_idle = 0 // How much power is drawn when doing nothing. var/power_draw_idle = 0 // How much power is drawn when doing nothing.
var/spawn_flags = null // Used for world initializing, see the #defines above. var/spawn_flags = null // Used for world initializing, see the #defines above.
var/category_text = "NO CATEGORY THIS IS A BUG" // To show up on circuit printer, and perhaps other places. var/category_text = "NO CATEGORY THIS IS A BUG" // To show up on circuit printer, and perhaps other places.
var/autopulse = -1 // When input is received, the circuit will pulse itself if set to 1. 0 means it won't. -1 means it is permanently off.
var/removable = TRUE // Determines if a circuit is removable from the assembly. var/removable = TRUE // Determines if a circuit is removable from the assembly.
var/displayed_name = "" var/displayed_name = ""
var/allow_multitool = 1 // Allows additional multitool functionality var/allow_multitool = 1 // Allows additional multitool functionality

View File

@@ -3,7 +3,7 @@
/obj/item/device/electronic_assembly /obj/item/device/electronic_assembly
name = "electronic assembly" name = "electronic assembly"
desc = "It's a case, for building electronics with." desc = "It's a case, for building small electronics with."
w_class = ITEMSIZE_SMALL w_class = ITEMSIZE_SMALL
icon = 'icons/obj/electronic_assemblies.dmi' icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "setup_small" icon_state = "setup_small"
@@ -17,6 +17,7 @@
/obj/item/device/electronic_assembly/medium /obj/item/device/electronic_assembly/medium
name = "electronic mechanism" name = "electronic mechanism"
icon_state = "setup_medium" icon_state = "setup_medium"
desc = "It's a case, for building medium-sized electronics with."
w_class = ITEMSIZE_NORMAL w_class = ITEMSIZE_NORMAL
max_components = IC_COMPONENTS_BASE * 2 max_components = IC_COMPONENTS_BASE * 2
max_complexity = IC_COMPLEXITY_BASE * 2 max_complexity = IC_COMPLEXITY_BASE * 2
@@ -24,6 +25,7 @@
/obj/item/device/electronic_assembly/large /obj/item/device/electronic_assembly/large
name = "electronic machine" name = "electronic machine"
icon_state = "setup_large" icon_state = "setup_large"
desc = "It's a case, for building large electronics with."
w_class = ITEMSIZE_LARGE w_class = ITEMSIZE_LARGE
max_components = IC_COMPONENTS_BASE * 4 max_components = IC_COMPONENTS_BASE * 4
max_complexity = IC_COMPLEXITY_BASE * 4 max_complexity = IC_COMPLEXITY_BASE * 4
@@ -31,6 +33,7 @@
/obj/item/device/electronic_assembly/drone /obj/item/device/electronic_assembly/drone
name = "electronic drone" name = "electronic drone"
icon_state = "setup_drone" icon_state = "setup_drone"
desc = "It's a case, for building mobile electronics with."
w_class = ITEMSIZE_NORMAL w_class = ITEMSIZE_NORMAL
max_components = IC_COMPONENTS_BASE * 1.5 max_components = IC_COMPONENTS_BASE * 1.5
max_complexity = IC_COMPLEXITY_BASE * 1.5 max_complexity = IC_COMPLEXITY_BASE * 1.5
@@ -38,9 +41,10 @@
/obj/item/device/electronic_assembly/implant /obj/item/device/electronic_assembly/implant
name = "electronic implant" name = "electronic implant"
icon_state = "setup_implant" icon_state = "setup_implant"
desc = "It's a case, for building very tiny electronics with."
w_class = ITEMSIZE_TINY w_class = ITEMSIZE_TINY
max_components = IC_COMPONENTS_BASE / 4 max_components = IC_COMPONENTS_BASE / 2
max_complexity = IC_COMPLEXITY_BASE / 4 max_complexity = IC_COMPLEXITY_BASE / 2
var/obj/item/weapon/implant/integrated_circuit/implant = null var/obj/item/weapon/implant/integrated_circuit/implant = null
/obj/item/device/electronic_assembly/New() /obj/item/device/electronic_assembly/New()

View File

@@ -1,8 +1,22 @@
/obj/item/integrated_circuit/proc/setup_io(var/list/io_list, var/io_type) /obj/item/integrated_circuit/proc/setup_io(var/list/io_list, var/io_type, var/list/io_default_list)
var/list/io_list_copy = io_list.Copy() var/list/io_list_copy = io_list.Copy()
io_list.Cut() io_list.Cut()
var/i = 0
for(var/io_entry in io_list_copy) for(var/io_entry in io_list_copy)
io_list.Add(new io_type(src, io_entry, io_list_copy[io_entry])) var/default_data = null
var/io_type_override = null
// Override the default data.
if(io_default_list && io_default_list.len) // List containing special pin types that need to be added.
default_data = io_default_list["[i]"] // This is deliberately text because the index is a number in text form.
// Override the pin type.
if(io_list_copy[io_entry])
io_type_override = io_list_copy[io_entry]
if(io_type_override)
// world << "io_type_override is now [io_type_override] on [src]."
io_list.Add(new io_type_override(src, io_entry, default_data))
else
io_list.Add(new io_type(src, io_entry, default_data))
/obj/item/integrated_circuit/proc/set_pin_data(var/pin_type, var/pin_number, var/new_data) /obj/item/integrated_circuit/proc/set_pin_data(var/pin_type, var/pin_number, var/new_data)
var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number) var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number)

View File

@@ -11,10 +11,10 @@ a creative player the means to solve many problems. Circuits are held inside an
// This should be used when someone is examining while the case is opened. // This should be used when someone is examining while the case is opened.
/obj/item/integrated_circuit/proc/internal_examine(mob/user) /obj/item/integrated_circuit/proc/internal_examine(mob/user)
to_chat(user, "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s.") to_chat(user, "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s.")
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
if(I.linked.len) if(I.linked.len)
to_chat(user, "The '[I]' is connected to [I.get_linked_to_desc()].") to_chat(user, "The '[I]' is connected to [I.get_linked_to_desc()].")
for(var/datum/integrated_io/output/O in outputs) for(var/datum/integrated_io/O in outputs)
if(O.linked.len) if(O.linked.len)
to_chat(user, "The '[O]' is connected to [O.get_linked_to_desc()].") to_chat(user, "The '[O]' is connected to [O.get_linked_to_desc()].")
for(var/datum/integrated_io/activate/A in activators) for(var/datum/integrated_io/activate/A in activators)
@@ -34,8 +34,8 @@ a creative player the means to solve many problems. Circuits are held inside an
displayed_name = name displayed_name = name
if(!size) size = w_class if(!size) size = w_class
if(size == -1) size = 0 if(size == -1) size = 0
setup_io(inputs, /datum/integrated_io/input) setup_io(inputs, /datum/integrated_io, inputs_default)
setup_io(outputs, /datum/integrated_io/output) setup_io(outputs, /datum/integrated_io, outputs_default)
setup_io(activators, /datum/integrated_io/activate) setup_io(activators, /datum/integrated_io/activate)
..() ..()
@@ -85,8 +85,8 @@ a creative player the means to solve many problems. Circuits are held inside an
/obj/item/integrated_circuit/interact(mob/user) /obj/item/integrated_circuit/interact(mob/user)
if(!check_interactivity(user)) if(!check_interactivity(user))
return return
if(!assembly) // if(!assembly)
return // return
var/window_height = 350 var/window_height = 350
var/window_width = 600 var/window_width = 600
@@ -128,7 +128,7 @@ a creative player the means to solve many problems. Circuits are held inside an
if(1) if(1)
io = get_pin_ref(IC_INPUT, i) io = get_pin_ref(IC_INPUT, i)
if(io) if(io)
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data()]</a></b><br>" words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.display_pin_type()] [io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data(io.data)]</a></b><br>"
if(io.linked.len) if(io.linked.len)
for(var/datum/integrated_io/linked in io.linked) for(var/datum/integrated_io/linked in io.linked)
// words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a> // words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a>
@@ -139,14 +139,14 @@ a creative player the means to solve many problems. Circuits are held inside an
height = 1 height = 1
if(2) if(2)
if(i == 1) if(i == 1)
words += "[src.displayed_name]<br>([src.name])<hr>[src.desc]" words += "[src.displayed_name]<br>[src.name != src.displayed_name ? "([src.name])":""]<hr>[src.desc]"
height = row_height height = row_height
else else
continue continue
if(3) if(3)
io = get_pin_ref(IC_OUTPUT, i) io = get_pin_ref(IC_OUTPUT, i)
if(io) if(io)
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data()]</a></b><br>" words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.display_pin_type()] [io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data(io.data)]</a></b><br>"
if(io.linked.len) if(io.linked.len)
for(var/datum/integrated_io/linked in io.linked) for(var/datum/integrated_io/linked in io.linked)
// words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a> // words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a>
@@ -162,7 +162,7 @@ a creative player the means to solve many problems. Circuits are held inside an
var/datum/integrated_io/io = activator var/datum/integrated_io/io = activator
var/words = list() var/words = list()
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]><font color='FF0000'>[io.name]</font></a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]><font color='FF0000'>[io.data?"\<PULSE IN\>":"\<PULSE OUT\>"]</font></a></b><br>" words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]><font color='FF0000'>[io.name]</font></a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]><font color='FF0000'>[io.data?"\<PULSE OUT\>":"\<PULSE IN\>"]</font></a></b><br>"
if(io.linked.len) if(io.linked.len)
for(var/datum/integrated_io/linked in io.linked) for(var/datum/integrated_io/linked in io.linked)
// words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a> // words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a>
@@ -176,10 +176,8 @@ a creative player the means to solve many problems. Circuits are held inside an
HTML += "</table>" HTML += "</table>"
HTML += "</div>" HTML += "</div>"
if(autopulse != -1) // HTML += "<br><font color='33CC33'>Meta Variables;</font>" // If more meta vars get introduced, uncomment this.
HTML += "<br><font color='33CC33'>Meta Variables;</font>" // HTML += "<br>"
HTML += "<br><font color='33CC33'><a href='?src=\ref[src];autopulse=1'>\[Autopulse\]</a> = <b>[autopulse ? "ON" : "OFF"]</b></font>"
HTML += "<br>"
HTML += "<br><font color='0000AA'>Complexity: [complexity]</font>" HTML += "<br><font color='0000AA'>Complexity: [complexity]</font>"
if(power_draw_idle) if(power_draw_idle)
@@ -235,6 +233,8 @@ a creative player the means to solve many problems. Circuits are held inside an
else else
var/datum/integrated_io/io = pin var/datum/integrated_io/io = pin
io.ask_for_pin_data(usr) // The pins themselves will determine how to ask for data, and will validate the data.
/*
if(io.io_type == DATA_CHANNEL) if(io.io_type == DATA_CHANNEL)
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number", "null") var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number", "null")
@@ -260,6 +260,7 @@ a creative player the means to solve many problems. Circuits are held inside an
else if(io.io_type == PULSE_CHANNEL) else if(io.io_type == PULSE_CHANNEL)
io.holder.check_then_do_work(ignore_power = TRUE) io.holder.check_then_do_work(ignore_power = TRUE)
to_chat(usr, "<span class='notice'>You pulse \the [io.holder]'s [io] pin.</span>") to_chat(usr, "<span class='notice'>You pulse \the [io.holder]'s [io] pin.</span>")
*/
if(href_list["pin_unwire"]) if(href_list["pin_unwire"])
@@ -313,10 +314,6 @@ a creative player the means to solve many problems. Circuits are held inside an
else else
to_chat(usr, "<span class='warning'>You need a multitool/debugger set to 'ref' mode to do that.</span>") to_chat(usr, "<span class='warning'>You need a multitool/debugger set to 'ref' mode to do that.</span>")
if(href_list["autopulse"])
if(autopulse != -1)
autopulse = !autopulse
if(href_list["return"]) if(href_list["return"])
if(A) if(A)
update_to_assembly = 1 update_to_assembly = 1
@@ -354,11 +351,11 @@ a creative player the means to solve many problems. Circuits are held inside an
/obj/item/integrated_circuit/proc/push_data() /obj/item/integrated_circuit/proc/push_data()
for(var/datum/integrated_io/output/O in outputs) for(var/datum/integrated_io/O in outputs)
O.push_data() O.push_data()
/obj/item/integrated_circuit/proc/pull_data() /obj/item/integrated_circuit/proc/pull_data()
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.push_data() I.push_data()
/obj/item/integrated_circuit/proc/draw_idle_power() /obj/item/integrated_circuit/proc/draw_idle_power()
@@ -391,9 +388,9 @@ a creative player the means to solve many problems. Circuits are held inside an
return return
/obj/item/integrated_circuit/proc/disconnect_all() /obj/item/integrated_circuit/proc/disconnect_all()
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.disconnect() I.disconnect()
for(var/datum/integrated_io/output/O in outputs) for(var/datum/integrated_io/O in outputs)
O.disconnect() O.disconnect()
for(var/datum/integrated_io/activate/A in activators) for(var/datum/integrated_io/activate/A in activators)
A.disconnect() A.disconnect()

View File

@@ -25,10 +25,11 @@ D [1]/ ||
var/list/linked = list() var/list/linked = list()
var/io_type = DATA_CHANNEL var/io_type = DATA_CHANNEL
/datum/integrated_io/New(var/newloc, var/name, var/data) /datum/integrated_io/New(var/newloc, var/name, var/new_data)
..() ..()
src.name = name src.name = name
src.data = data if(new_data)
src.data = new_data
holder = newloc holder = newloc
if(!istype(holder)) if(!istype(holder))
message_admins("ERROR: An integrated_io ([src.name]) spawned without a valid holder! This is a bug.") message_admins("ERROR: An integrated_io ([src.name]) spawned without a valid holder! This is a bug.")
@@ -50,17 +51,43 @@ D [1]/ ||
var/output = w.resolve() var/output = w.resolve()
return istype(output, as_type) ? output : null return istype(output, as_type) ? output : null
/datum/integrated_io/proc/display_data() /datum/integrated_io/proc/display_data(var/input)
if(isnull(data)) if(isnull(input))
return "(null)" // Empty data means nothing to show. return "(null)" // Empty data means nothing to show.
if(istext(data))
return "(\"[data]\")" // Wraps the 'string' in escaped quotes, so that people know it's a 'string'. if(istext(input))
if(isweakref(data)) return "(\"[input]\")" // Wraps the 'string' in escaped quotes, so that people know it's a 'string'.
var/weakref/w = data
/*
list[](
"A",
"B",
"C"
)
*/
if(islist(input))
var/list/my_list = input
var/result = "list\[[my_list.len]\]("
if(my_list.len)
result += "<br>"
var/pos = 0
for(var/line in my_list)
result += "[display_data(line)]"
pos++
if(pos != my_list.len)
result += ",<br>"
result += "<br>"
result += ")"
return result
if(isweakref(input))
var/weakref/w = input
var/atom/A = w.resolve() var/atom/A = w.resolve()
//return A ? "([A.name] \[Ref\])" : "(null)" // For refs, we want just the name displayed. //return A ? "([A.name] \[Ref\])" : "(null)" // For refs, we want just the name displayed.
return A ? "(\ref[A] \[Ref\])" : "(null)" return A ? "(\ref[A] \[Ref\])" : "(null)"
return "([data])" // Nothing special needed for numbers or other stuff.
return "([input])" // Nothing special needed for numbers or other stuff.
/datum/integrated_io/activate/display_data() /datum/integrated_io/activate/display_data()
return "(\[pulse\])" return "(\[pulse\])"
@@ -117,23 +144,44 @@ D [1]/ ||
//Now that we're removed from them, we gotta remove them from us. //Now that we're removed from them, we gotta remove them from us.
src.linked.Remove(their_io) src.linked.Remove(their_io)
/datum/integrated_io/input /datum/integrated_io/proc/ask_for_data_type(mob/user, var/default, var/list/allowed_data_types = list("string","number","null"))
name = "input pin" var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in allowed_data_types
if(!holder.check_interactivity(user))
return
/datum/integrated_io/output var/new_data = null
name = "output pin" switch(type_to_use)
if("string")
new_data = input("Now type in a string.","[src] string writing", istext(default) ? default : null) as null|text
if(istext(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data
if("number")
new_data = input("Now type in a number.","[src] number writing", isnum(default) ? default : null) as null|num
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data
if("null")
if(holder.check_interactivity(user))
to_chat(user, "<span class='notice'>You clear the pin's memory.</span>")
return new_data
// Basically a null check
/datum/integrated_io/proc/is_valid()
return !isnull(data)
// This proc asks for the data to write, then writes it.
/datum/integrated_io/proc/ask_for_pin_data(mob/user)
var/new_data = ask_for_data_type(user)
write_data_to_pin(new_data)
/datum/integrated_io/activate/ask_for_pin_data(mob/user) // This just pulses the pin.
holder.check_then_do_work(ignore_power = TRUE)
to_chat(user, "<span class='notice'>You pulse \the [holder]'s [src] pin.</span>")
/datum/integrated_io/activate /datum/integrated_io/activate
name = "activation pin" name = "activation pin"
io_type = PULSE_CHANNEL io_type = PULSE_CHANNEL
/datum/integrated_io/list /datum/integrated_io/activate/out // All this does is just make the UI say 'out' instead of 'in'
name = "list pin" data = 1
/datum/integrated_io/list/write_data_to_pin(var/new_data)
if(islist(new_data))
data = new_data
holder.on_data_written()
/datum/integrated_io/list/display_pin_type()
return IC_FORMAT_LIST

View File

@@ -0,0 +1,25 @@
// These pins only contain 0 or 1. Null is not allowed.
/datum/integrated_io/boolean
name = "boolean pin"
data = FALSE
/datum/integrated_io/boolean/ask_for_pin_data(mob/user) // 'Ask' is a bit misleading, acts more like a toggle.
var/new_data = !data
write_data_to_pin(new_data)
/datum/integrated_io/boolean/write_data_to_pin(var/new_data)
if(new_data == FALSE || new_data == TRUE)
data = new_data
holder.on_data_written()
/datum/integrated_io/boolean/scramble()
write_data_to_pin(rand(FALSE,TRUE))
push_data()
/datum/integrated_io/boolean/display_pin_type()
return IC_FORMAT_BOOLEAN
/datum/integrated_io/boolean/display_data(var/input)
if(data == TRUE)
return "(True)"
return "(False)"

View File

@@ -0,0 +1,27 @@
// These pins can only contain a 1 character string or null.
/datum/integrated_io/char
name = "char pin"
/datum/integrated_io/char/ask_for_pin_data(mob/user)
var/new_data = input("Please type in one character.","[src] char writing") as null|text
if(holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
write_data_to_pin(new_data)
/datum/integrated_io/char/write_data_to_pin(var/new_data)
if(isnull(new_data) || istext(new_data))
if(length(new_data) > 1)
return
data = new_data
holder.on_data_written()
// This makes the text go from "A" to "%".
/datum/integrated_io/char/scramble()
if(!is_valid())
return
var/list/options = list("!","@","#","$","%","^","&","*") + alphabet_uppercase
data = pick(options)
push_data()
/datum/integrated_io/char/display_pin_type()
return IC_FORMAT_CHAR

View File

@@ -0,0 +1,51 @@
// These pins can only contain a color (in the form of #FFFFFF) or null.
/datum/integrated_io/color
name = "color pin"
/datum/integrated_io/color/ask_for_pin_data(mob/user)
var/new_data = input("Please select a color.","[src] color writing") as null|color
if(holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input a <font color='[new_data]'>new color</font> into the pin.</span>")
world << "new_data equals [new_data]."
write_data_to_pin(new_data)
/datum/integrated_io/color/write_data_to_pin(var/new_data)
// Since this is storing the color as a string hex color code, we need to make sure it's actually one.
if(isnull(new_data) || istext(new_data))
if(istext(new_data))
new_data = uppertext(new_data)
if(length(new_data) != 7) // We can hex if we want to, we can leave your strings behind
world << "Wrong length."
return // Cause your strings don't hex and if they don't hex
var/friends = copytext(new_data, 2, 8) // Well they're are no strings of mine
world << "friends equal [friends]."
// I say, we can go where we want to, a place where they will never find
var/safety_dance = 1
while(safety_dance >= 7) // And we can act like we come from out of this world.log
var/hex = copytext(friends, safety_dance, safety_dance+1)
world << "Checking [hex]."
if(!(hex in list("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")))
world << "Hex [hex] failed"
return // Leave the fake one far behind,
safety_dance++
data = new_data // And we can hex
holder.on_data_written()
world << "Done."
world << "Rip."
// This randomizes the color.
/datum/integrated_io/color/scramble()
if(!is_valid())
return
var/new_data = get_random_colour(simple = FALSE, lower = 0, upper = 255)
data = new_data
push_data()
/datum/integrated_io/color/display_pin_type()
return IC_FORMAT_COLOR
/datum/integrated_io/color/display_data(var/input)
if(!isnull(data))
return "(<font color='[data]'>[data]</font>)"
return ..()

View File

@@ -0,0 +1,33 @@
// These pins can only contain directions (1,2,4,8...) or null.
/datum/integrated_io/dir
name = "dir pin"
/datum/integrated_io/dir/ask_for_pin_data(mob/user)
var/new_data = input("Please type in a valid dir number. \
Valid dirs are;\n\
North/Fore = [NORTH],\n\
South/Aft = [SOUTH],\n\
East/Starboard = [EAST],\n\
West/Port = [WEST],\n\
Northeast = [NORTHEAST],\n\
Northwest = [NORTHWEST],\n\
Southeast = [SOUTHEAST],\n\
Southwest = [SOUTHWEST],\n\
Up = [UP],\n\
Down = [DOWN]","[src] dir writing") as null|num
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
write_data_to_pin(new_data)
/datum/integrated_io/dir/write_data_to_pin(var/new_data)
if(isnull(new_data) || new_data in alldirs + list(UP, DOWN))
data = new_data
holder.on_data_written()
/datum/integrated_io/dir/display_pin_type()
return IC_FORMAT_DIR
/datum/integrated_io/dir/display_data(var/input)
if(!isnull(data))
return "([dir2text(data)])"
return ..()

View File

@@ -0,0 +1,150 @@
// These pins contain a list. Null is not allowed.
/datum/integrated_io/list
name = "list pin"
data = list()
/datum/integrated_io/list/ask_for_pin_data(mob/user)
interact(user)
/datum/integrated_io/list/proc/interact(mob/user)
var/list/my_list = data
var/t = "<h2>[src]</h2><br>"
t += "List length: [my_list.len]<br>"
t += "<a href='?src=\ref[src]'>\[Refresh\]</a> | "
t += "<a href='?src=\ref[src];add=1'>\[Add\]</a> | "
t += "<a href='?src=\ref[src];swap=1'>\[Swap\]</a> | "
t += "<a href='?src=\ref[src];clear=1'>\[Clear\]</a><br>"
t += "<hr>"
var/i = 0
for(var/line in my_list)
i++
t += "#[i] | [display_data(line)] | "
t += "<a href='?src=\ref[src];edit=1;pos=[i]'>\[Edit\]</a> | "
t += "<a href='?src=\ref[src];remove=1;pos=[i]'>\[Remove\]</a><br>"
user << browse(t, "window=list_pin_\ref[src];size=500x400")
/datum/integrated_io/list/proc/add_to_list(mob/user, var/new_entry)
if(!new_entry && user)
new_entry = ask_for_data_type(user)
if(is_valid(new_entry))
Add(new_entry)
/datum/integrated_io/list/proc/Add(var/new_entry)
var/list/my_list = data
if(my_list.len > IC_MAX_LIST_LENGTH)
my_list.Cut(Start=1,End=2)
my_list.Add(new_entry)
/datum/integrated_io/list/proc/remove_from_list_by_position(mob/user, var/position)
var/list/my_list = data
if(!my_list.len)
to_chat(user, "<span class='warning'>The list is empty, there's nothing to remove.</span>")
return
if(!position)
return
var/target_entry = my_list.Find(position)
if(target_entry)
my_list.Remove(target_entry)
/datum/integrated_io/list/proc/remove_from_list(mob/user, var/target_entry)
var/list/my_list = data
if(!my_list.len)
to_chat(user, "<span class='warning'>The list is empty, there's nothing to remove.</span>")
return
if(!target_entry)
target_entry = input("Which piece of data do you want to remove?", "Remove") as null|anything in my_list
if(target_entry)
my_list.Remove(target_entry)
/datum/integrated_io/list/proc/edit_in_list(mob/user, var/target_entry)
var/list/my_list = data
if(!my_list.len)
to_chat(user, "<span class='warning'>The list is empty, there's nothing to modify.</span>")
return
if(!target_entry)
target_entry = input("Which piece of data do you want to edit?", "Edit") as null|anything in my_list
if(target_entry)
var/edited_entry = ask_for_data_type(user, target_entry)
if(edited_entry)
target_entry = edited_entry
/datum/integrated_io/list/proc/edit_in_list_by_position(mob/user, var/position)
var/list/my_list = data
if(!my_list.len)
to_chat(user, "<span class='warning'>The list is empty, there's nothing to modify.</span>")
return
if(!position)
return
var/target_entry = my_list.Find(position)
if(target_entry)
var/edited_entry = ask_for_data_type(user, target_entry)
if(edited_entry)
target_entry = edited_entry
/datum/integrated_io/list/proc/swap_inside_list(mob/user, var/first_target, var/second_target)
var/list/my_list = data
if(my_list.len <= 1)
to_chat(user, "<span class='warning'>The list is empty, or too small to do any meaningful swapping.</span>")
return
if(!first_target)
first_target = input("Which piece of data do you want to swap? (1)", "Swap") as null|anything in my_list
if(first_target)
if(!second_target)
second_target = input("Which piece of data do you want to swap? (2)", "Swap") as null|anything in my_list - first_target
if(second_target)
var/first_pos = my_list.Find(first_target)
var/second_pos = my_list.Find(second_target)
my_list.Swap(first_pos, second_pos)
/datum/integrated_io/list/proc/clear_list(mob/user)
var/list/my_list = data
my_list.Cut()
/datum/integrated_io/list/scramble()
var/list/my_list = data
my_list = shuffle(my_list)
push_data()
/datum/integrated_io/list/write_data_to_pin(var/new_data)
if(islist(new_data))
var/list/new_list = new_data
data = new_list.Copy()
holder.on_data_written()
/datum/integrated_io/list/display_pin_type()
return IC_FORMAT_LIST
/datum/integrated_io/list/Topic(href, href_list, state = interactive_state)
if(!holder.check_interactivity(usr))
return
if(..())
return 1
if(href_list["add"])
add_to_list(usr)
if(href_list["swap"])
swap_inside_list(usr)
if(href_list["clear"])
clear_list(usr)
if(href_list["remove"])
world << "Removing [href_list["pos"]]"
if(href_list["pos"])
remove_from_list_by_position(usr, text2num(href_list["pos"]))
else
remove_from_list(usr)
if(href_list["edit"])
if(href_list["pos"])
edit_in_list_by_position(usr, text2num(href_list["pos"]))
else
edit_in_list(usr)
holder.interact(usr) // Refresh the main UI,
interact(usr) // and the list UI.

View File

@@ -0,0 +1,18 @@
// These pins can only contain numbers (int and floating point) or null.
/datum/integrated_io/number
name = "number pin"
// data = 0
/datum/integrated_io/number/ask_for_pin_data(mob/user)
var/new_data = input("Please type in a number.","[src] number writing") as null|num
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
write_data_to_pin(new_data)
/datum/integrated_io/number/write_data_to_pin(var/new_data)
if(isnull(new_data) || isnum(new_data))
data = new_data
holder.on_data_written()
/datum/integrated_io/number/display_pin_type()
return IC_FORMAT_NUMBER

View File

@@ -0,0 +1,14 @@
// These pins only contain weakrefs or null.
/datum/integrated_io/ref
name = "ref pin"
/datum/integrated_io/ref/ask_for_pin_data(mob/user) // This clears the pin.
write_data_to_pin(null)
/datum/integrated_io/ref/write_data_to_pin(var/new_data)
if(isnull(new_data) || isweakref(new_data))
data = new_data
holder.on_data_written()
/datum/integrated_io/ref/display_pin_type()
return IC_FORMAT_REF

View File

@@ -0,0 +1,29 @@
// These pins can only contain text and null.
/datum/integrated_io/string
name = "string pin"
/datum/integrated_io/string/ask_for_pin_data(mob/user)
var/new_data = input("Please type in a string.","[src] string writing") as null|text
if(holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
write_data_to_pin(new_data)
/datum/integrated_io/string/write_data_to_pin(var/new_data)
if(isnull(new_data) || istext(new_data))
data = new_data
holder.on_data_written()
// This makes the text go "from this" to "#G&*!HD$%L"
/datum/integrated_io/string/scramble()
if(!is_valid())
return
var/string_length = length(data)
var/list/options = list("!","@","#","$","%","^","&","*") + alphabet_uppercase
var/new_data = ""
while(string_length)
new_data += pick(options)
string_length--
push_data()
/datum/integrated_io/string/display_pin_type()
return IC_FORMAT_STRING

View File

@@ -2,25 +2,20 @@
/obj/item/integrated_circuit/arithmetic /obj/item/integrated_circuit/arithmetic
complexity = 1 complexity = 1
inputs = list( inputs = list(
"\<NUM\> A", "A" = IC_PINTYPE_NUMBER,
"\<NUM\> B", "B" = IC_PINTYPE_NUMBER,
"\<NUM\> C", "C" = IC_PINTYPE_NUMBER,
"\<NUM\> D", "D" = IC_PINTYPE_NUMBER,
"\<NUM\> E", "E" = IC_PINTYPE_NUMBER,
"\<NUM\> F", "F" = IC_PINTYPE_NUMBER,
"\<NUM\> G", "G" = IC_PINTYPE_NUMBER,
"\<NUM\> H" "H" = IC_PINTYPE_NUMBER
) )
outputs = list("\<NUM\> result") outputs = list("result" = IC_PINTYPE_NUMBER)
activators = list("compute" = 1, "on computed" = 0) activators = list("compute" = IC_PINTYPE_PULSE_IN, "on computed" = IC_PINTYPE_PULSE_OUT)
category_text = "Arithmetic" category_text = "Arithmetic"
autopulse = 1
power_draw_per_use = 5 // Math is pretty cheap. power_draw_per_use = 5 // Math is pretty cheap.
/obj/item/integrated_circuit/arithmetic/on_data_written()
if(autopulse == 1)
check_then_do_work()
// +Adding+ // // +Adding+ //
/obj/item/integrated_circuit/arithmetic/addition /obj/item/integrated_circuit/arithmetic/addition
@@ -34,7 +29,7 @@
/obj/item/integrated_circuit/arithmetic/addition/do_work() /obj/item/integrated_circuit/arithmetic/addition/do_work()
var/result = 0 var/result = 0
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.pull_data() I.pull_data()
if(isnum(I.data)) if(isnum(I.data))
result = result + I.data result = result + I.data
@@ -60,7 +55,7 @@
return return
var/result = A.data var/result = A.data
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
if(I == A) if(I == A)
continue continue
I.pull_data() I.pull_data()
@@ -88,7 +83,7 @@
if(!isnum(A.data)) if(!isnum(A.data))
return return
var/result = A.data var/result = A.data
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
if(I == A) if(I == A)
continue continue
I.pull_data() I.pull_data()
@@ -116,7 +111,7 @@
return return
var/result = A.data var/result = A.data
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
if(I == A) if(I == A)
continue continue
I.pull_data() I.pull_data()
@@ -133,7 +128,7 @@
name = "exponent circuit" name = "exponent circuit"
desc = "Outputs A to the power of B." desc = "Outputs A to the power of B."
icon_state = "exponent" icon_state = "exponent"
inputs = list("A", "B") inputs = list("A" = IC_PINTYPE_NUMBER, "B" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/exponent/do_work() /obj/item/integrated_circuit/arithmetic/exponent/do_work()
@@ -154,7 +149,7 @@
desc = "This will say if a number is positive, negative, or zero." desc = "This will say if a number is positive, negative, or zero."
extended_desc = "Will output 1, -1, or 0, depending on if A is a postive number, a negative number, or zero, respectively." extended_desc = "Will output 1, -1, or 0, depending on if A is a postive number, a negative number, or zero, respectively."
icon_state = "sign" icon_state = "sign"
inputs = list("A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/sign/do_work() /obj/item/integrated_circuit/arithmetic/sign/do_work()
@@ -179,7 +174,7 @@
desc = "Rounds A to the nearest B multiple of A." desc = "Rounds A to the nearest B multiple of A."
extended_desc = "If B is not given a number, it will output the floor of A instead." extended_desc = "If B is not given a number, it will output the floor of A instead."
icon_state = "round" icon_state = "round"
inputs = list("A", "B") inputs = list("A" = IC_PINTYPE_NUMBER, "B" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/round/do_work() /obj/item/integrated_circuit/arithmetic/round/do_work()
@@ -203,12 +198,12 @@
name = "absolute circuit" name = "absolute circuit"
desc = "This outputs a non-negative version of the number you put in. This may also be thought of as its distance from zero." desc = "This outputs a non-negative version of the number you put in. This may also be thought of as its distance from zero."
icon_state = "absolute" icon_state = "absolute"
inputs = list("A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/absolute/do_work() /obj/item/integrated_circuit/arithmetic/absolute/do_work()
var/result = 0 var/result = 0
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.pull_data() I.pull_data()
if(isnum(I.data)) if(isnum(I.data))
result = abs(I.data) result = abs(I.data)
@@ -229,7 +224,7 @@
/obj/item/integrated_circuit/arithmetic/average/do_work() /obj/item/integrated_circuit/arithmetic/average/do_work()
var/result = 0 var/result = 0
var/inputs_used = 0 var/inputs_used = 0
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.pull_data() I.pull_data()
if(isnum(I.data)) if(isnum(I.data))
inputs_used++ inputs_used++
@@ -262,7 +257,7 @@
extended_desc = "'Inclusive' means that the upper bound is included in the range of numbers, e.g. L = 1 and H = 3 will allow \ extended_desc = "'Inclusive' means that the upper bound is included in the range of numbers, e.g. L = 1 and H = 3 will allow \
for outputs of 1, 2, or 3. H being the higher number is not <i>strictly</i> required." for outputs of 1, 2, or 3. H being the higher number is not <i>strictly</i> required."
icon_state = "random" icon_state = "random"
inputs = list("\<NUM\> L","\<NUM\> H") inputs = list("L" = IC_PINTYPE_NUMBER,"H" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/random/do_work() /obj/item/integrated_circuit/arithmetic/random/do_work()
@@ -283,12 +278,12 @@
name = "square root circuit" name = "square root circuit"
desc = "This outputs the square root of a number you put in." desc = "This outputs the square root of a number you put in."
icon_state = "square_root" icon_state = "square_root"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/square_root/do_work() /obj/item/integrated_circuit/arithmetic/square_root/do_work()
var/result = 0 var/result = 0
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.pull_data() I.pull_data()
if(isnum(I.data)) if(isnum(I.data))
result = sqrt(I.data) result = sqrt(I.data)
@@ -303,7 +298,7 @@
name = "modulo circuit" name = "modulo circuit"
desc = "Gets the remainder of A / B." desc = "Gets the remainder of A / B."
icon_state = "modulo" icon_state = "modulo"
inputs = list("\<NUM\> A", "\<NUM\> B") inputs = list("A" = IC_PINTYPE_NUMBER, "B" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/arithmetic/modulo/do_work() /obj/item/integrated_circuit/arithmetic/modulo/do_work()

View File

@@ -11,7 +11,7 @@
name = "assembly input" name = "assembly input"
desc = "A built in chip for handling pulses from attached assembly items." desc = "A built in chip for handling pulses from attached assembly items."
complexity = 0 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'. complexity = 0 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'.
activators = list("on pulsed" = 0) activators = list("on pulsed" = IC_PINTYPE_PULSE_OUT)
/obj/item/integrated_circuit/built_in/device_input/do_work() /obj/item/integrated_circuit/built_in/device_input/do_work()
activate_pin(1) activate_pin(1)
@@ -20,7 +20,7 @@
name = "assembly out" name = "assembly out"
desc = "A built in chip for pulsing attached assembly items." desc = "A built in chip for pulsing attached assembly items."
complexity = 0 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'. complexity = 0 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'.
activators = list("pulse attached" = 1) activators = list("pulse attached" = IC_PINTYPE_PULSE_IN)
/obj/item/integrated_circuit/built_in/device_output/do_work() /obj/item/integrated_circuit/built_in/device_output/do_work()
if(istype(assembly, /obj/item/device/electronic_assembly/device)) if(istype(assembly, /obj/item/device/electronic_assembly/device))

View File

@@ -3,29 +3,24 @@
complexity = 2 complexity = 2
inputs = list("input") inputs = list("input")
outputs = list("output") outputs = list("output")
activators = list("convert" = 1, "on convert" = 0) activators = list("convert" = IC_PINTYPE_PULSE_IN, "on convert" = IC_PINTYPE_PULSE_OUT)
category_text = "Converter" category_text = "Converter"
autopulse = 1
power_draw_per_use = 10 power_draw_per_use = 10
/obj/item/integrated_circuit/converter/on_data_written()
if(autopulse == 1)
check_then_do_work()
/obj/item/integrated_circuit/converter/num2text /obj/item/integrated_circuit/converter/num2text
name = "number to string" name = "number to string"
desc = "This circuit can convert a number variable into a string." desc = "This circuit can convert a number variable into a string."
extended_desc = "Because of game limitations null/false variables will output a '0' string." extended_desc = "Because of game limitations null/false variables will output a '0' string."
icon_state = "num-string" icon_state = "num-string"
inputs = list("\<NUM\> input") inputs = list("input" = IC_PINTYPE_NUMBER)
outputs = list("\<TEXT\> output") outputs = list("output" = IC_PINTYPE_STRING)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/num2text/do_work() /obj/item/integrated_circuit/converter/num2text/do_work()
var/result = null var/result = null
pull_data() pull_data()
var/incoming = get_pin_data(IC_INPUT, 1) var/incoming = get_pin_data(IC_INPUT, 1)
if(incoming && isnum(incoming)) if(!isnull(incoming))
result = num2text(incoming) result = num2text(incoming)
else if(!incoming) else if(!incoming)
result = "0" result = "0"
@@ -38,15 +33,15 @@
name = "string to number" name = "string to number"
desc = "This circuit can convert a string variable into a number." desc = "This circuit can convert a string variable into a number."
icon_state = "string-num" icon_state = "string-num"
inputs = list("\<TEXT\> input") inputs = list("input" = IC_PINTYPE_STRING)
outputs = list("\<NUM\> output") outputs = list("output" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/text2num/do_work() /obj/item/integrated_circuit/converter/text2num/do_work()
var/result = null var/result = null
pull_data() pull_data()
var/incoming = get_pin_data(IC_INPUT, 1) var/incoming = get_pin_data(IC_INPUT, 1)
if(incoming && istext(incoming)) if(!isnull(incoming))
result = text2num(incoming) result = text2num(incoming)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -57,8 +52,8 @@
name = "reference to string" name = "reference to string"
desc = "This circuit can convert a reference to something else to a string, specifically the name of that reference." desc = "This circuit can convert a reference to something else to a string, specifically the name of that reference."
icon_state = "ref-string" icon_state = "ref-string"
inputs = list("\<REF\> input") inputs = list("input" = IC_PINTYPE_REF)
outputs = list("\<TEXT\> output") outputs = list("output" = IC_PINTYPE_STRING)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/ref2text/do_work() /obj/item/integrated_circuit/converter/ref2text/do_work()
@@ -76,15 +71,15 @@
name = "lowercase string converter" name = "lowercase string converter"
desc = "this will cause a string to come out in all lowercase." desc = "this will cause a string to come out in all lowercase."
icon_state = "lowercase" icon_state = "lowercase"
inputs = list("\<TEXT\> input") inputs = list("input" = IC_PINTYPE_STRING)
outputs = list("\<TEXT\> output") outputs = list("output" = IC_PINTYPE_STRING)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/lowercase/do_work() /obj/item/integrated_circuit/converter/lowercase/do_work()
var/result = null var/result = null
pull_data() pull_data()
var/incoming = get_pin_data(IC_INPUT, 1) var/incoming = get_pin_data(IC_INPUT, 1)
if(incoming && istext(incoming)) if(!isnull(incoming))
result = lowertext(incoming) result = lowertext(incoming)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -95,15 +90,15 @@
name = "uppercase string converter" name = "uppercase string converter"
desc = "THIS WILL CAUSE A STRING TO COME OUT IN ALL UPPERCASE." desc = "THIS WILL CAUSE A STRING TO COME OUT IN ALL UPPERCASE."
icon_state = "uppercase" icon_state = "uppercase"
inputs = list("\<TEXT\> input") inputs = list("input" = IC_PINTYPE_STRING)
outputs = list("\<TEXT\> output") outputs = list("output" = IC_PINTYPE_STRING)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/uppercase/do_work() /obj/item/integrated_circuit/converter/uppercase/do_work()
var/result = null var/result = null
pull_data() pull_data()
var/incoming = get_pin_data(IC_INPUT, 1) var/incoming = get_pin_data(IC_INPUT, 1)
if(incoming && istext(incoming)) if(!isnull(incoming))
result = uppertext(incoming) result = uppertext(incoming)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -112,34 +107,31 @@
/obj/item/integrated_circuit/converter/concatenator /obj/item/integrated_circuit/converter/concatenator
name = "concatenator" name = "concatenator"
desc = "This joins many strings or numbers together to get one big string." desc = "This joins many strings together to get one big string."
complexity = 4 complexity = 4
inputs = list( inputs = list(
"\<TEXT/NUM\> A", "A" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> B", "B" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> C", "C" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> D", "D" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> E", "E" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> F", "F" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> G", "G" = IC_PINTYPE_STRING,
"\<TEXT/NUM\> H" "H" = IC_PINTYPE_STRING
) )
outputs = list("\<TEXT\> result") outputs = list("result" = IC_PINTYPE_STRING)
activators = list("concatenate" = 1, "on concatenated" = 0) activators = list("concatenate" = IC_PINTYPE_PULSE_IN, "on concatenated" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/concatenator/do_work() /obj/item/integrated_circuit/converter/concatenator/do_work()
var/result = null var/result = null
for(var/datum/integrated_io/input/I in inputs) for(var/datum/integrated_io/I in inputs)
I.pull_data() I.pull_data()
if(istext(I.data)) if(!isnull(I.data))
result = result + I.data result = result + I.data
else if(!isnull(I.data) && num2text(I.data))
result = result + num2text(I.data)
var/datum/integrated_io/outgoing = outputs[1] set_pin_data(IC_OUTPUT, 1, result)
outgoing.data = result push_data()
outgoing.push_data()
activate_pin(2) activate_pin(2)
/obj/item/integrated_circuit/converter/separator /obj/item/integrated_circuit/converter/separator
@@ -150,14 +142,14 @@
will split into 'a p' and 'erson'." will split into 'a p' and 'erson'."
complexity = 4 complexity = 4
inputs = list( inputs = list(
"\<TEXT\> string", "string to split" = IC_PINTYPE_STRING,
"\<NUM\> index", "index" = IC_PINTYPE_NUMBER,
) )
outputs = list( outputs = list(
"\<TEXT\> before split", "before split" = IC_PINTYPE_STRING,
"\<TEXT\> after split" "after split" = IC_PINTYPE_STRING
) )
activators = list("separate" = 1, "on separated" = 0) activators = list("separate" = IC_PINTYPE_PULSE_IN, "on separated" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
@@ -170,12 +162,9 @@
var/before_text = copytext(text, 1, split) var/before_text = copytext(text, 1, split)
var/after_text = copytext(text, split, 0) var/after_text = copytext(text, split, 0)
var/datum/integrated_io/outgoing1 = outputs[1] set_pin_data(IC_OUTPUT, 1, before_text)
var/datum/integrated_io/outgoing2 = outputs[2] set_pin_data(IC_OUTPUT, 2, after_text)
outgoing1.data = before_text push_data()
outgoing2.data = after_text
outgoing1.push_data()
outgoing2.push_data()
activate_pin(2) activate_pin(2)
@@ -183,15 +172,15 @@
/obj/item/integrated_circuit/converter/radians2degrees /obj/item/integrated_circuit/converter/radians2degrees
name = "radians to degrees converter" name = "radians to degrees converter"
desc = "Converts radians to degrees." desc = "Converts radians to degrees."
inputs = list("\<NUM\> radian") inputs = list("radian" = IC_PINTYPE_NUMBER)
outputs = list("\<NUM\> degrees") outputs = list("degrees" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/radians2degrees/do_work() /obj/item/integrated_circuit/converter/radians2degrees/do_work()
var/result = null var/result = null
pull_data() pull_data()
var/incoming = get_pin_data(IC_INPUT, 1) var/incoming = get_pin_data(IC_INPUT, 1)
if(incoming && isnum(incoming)) if(!isnull(incoming))
result = ToDegrees(incoming) result = ToDegrees(incoming)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -201,15 +190,15 @@
/obj/item/integrated_circuit/converter/degrees2radians /obj/item/integrated_circuit/converter/degrees2radians
name = "degrees to radians converter" name = "degrees to radians converter"
desc = "Converts degrees to radians." desc = "Converts degrees to radians."
inputs = list("\<NUM\> degrees") inputs = list("degrees" = IC_PINTYPE_NUMBER)
outputs = list("\<NUM\> radians") outputs = list("radians" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/degrees2radians/do_work() /obj/item/integrated_circuit/converter/degrees2radians/do_work()
var/result = null var/result = null
pull_data() pull_data()
var/incoming = get_pin_data(IC_INPUT, 1) var/incoming = get_pin_data(IC_INPUT, 1)
if(incoming && isnum(incoming)) if(!isnull(incoming))
result = ToRadians(incoming) result = ToRadians(incoming)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -221,9 +210,17 @@
name = "abs to rel coordinate converter" name = "abs to rel coordinate converter"
desc = "Easily convert absolute coordinates to relative coordinates with this." desc = "Easily convert absolute coordinates to relative coordinates with this."
complexity = 4 complexity = 4
inputs = list("\<NUM\> X1", "\<NUM\> Y1", "\<NUM\> X2", "\<NUM\> Y2") inputs = list(
outputs = list("\<NUM\> X", "\<NUM\> Y") "X1" = IC_PINTYPE_NUMBER,
activators = list("compute rel coordinates" = 1, "on convert" = 0) "Y1" = IC_PINTYPE_NUMBER,
"X2" = IC_PINTYPE_NUMBER,
"Y2" = IC_PINTYPE_NUMBER
)
outputs = list(
"X" = IC_PINTYPE_NUMBER,
"Y" = IC_PINTYPE_NUMBER
)
activators = list("compute rel coordinates" = IC_PINTYPE_PULSE_IN, "on convert" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/converter/abs_to_rel_coords/do_work() /obj/item/integrated_circuit/converter/abs_to_rel_coords/do_work()
@@ -233,7 +230,7 @@
var/x2 = get_pin_data(IC_INPUT, 3) var/x2 = get_pin_data(IC_INPUT, 3)
var/y2 = get_pin_data(IC_INPUT, 4) var/y2 = get_pin_data(IC_INPUT, 4)
if(x1 && y1 && x2 && y2) if(!isnull(x1) && !isnull(y1) && !isnull(x2) && !isnull(y2))
set_pin_data(IC_OUTPUT, 1, x1 - x2) set_pin_data(IC_OUTPUT, 1, x1 - x2)
set_pin_data(IC_OUTPUT, 2, y1 - y2) set_pin_data(IC_OUTPUT, 2, y1 - y2)

View File

@@ -1,114 +1,25 @@
/obj/item/integrated_circuit/transfer /obj/item/integrated_circuit/transfer
category_text = "Data Transfer" category_text = "Data Transfer"
autopulse = 1
power_draw_per_use = 2 power_draw_per_use = 2
/obj/item/integrated_circuit/transfer/on_data_written()
if(autopulse == 1)
check_then_do_work()
/obj/item/integrated_circuit/transfer/splitter
name = "splitter"
desc = "Splits incoming data into all of the output pins."
icon_state = "splitter"
complexity = 3
inputs = list("data to split")
outputs = list("A","B")
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/transfer/splitter/medium
name = "four splitter"
icon_state = "splitter4"
complexity = 5
outputs = list("A","B","C","D")
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4
/obj/item/integrated_circuit/transfer/splitter/large
name = "eight splitter"
icon_state = "splitter8"
w_class = ITEMSIZE_SMALL
complexity = 9
outputs = list("A","B","C","D","E","F","G","H")
spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 8
/obj/item/integrated_circuit/transfer/splitter/do_work()
var/datum/integrated_io/I = inputs[1]
for(var/datum/integrated_io/output/O in outputs)
O.data = I.data
/obj/item/integrated_circuit/transfer/activator_splitter
name = "activator splitter"
desc = "Splits incoming activation pulses into all of the output pins."
icon_state = "splitter"
complexity = 3
activators = list(
"pulse" = 1,
"pulse A" = 0,
"pulse B" = 0
)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 2
/obj/item/integrated_circuit/transfer/activator_splitter/do_work()
for(var/datum/integrated_io/activate/A in outputs)
if(A == activators[1])
continue
if(A.linked.len)
for(var/datum/integrated_io/activate/target in A.linked)
target.holder.check_then_do_work()
/obj/item/integrated_circuit/transfer/activator_splitter/medium
name = "four activator splitter"
icon_state = "splitter4"
complexity = 5
activators = list(
"pulse" = 1,
"pulse A" = 0,
"pulse B" = 0,
"pulse C" = 0,
"pulse D" = 0
)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4
/obj/item/integrated_circuit/transfer/activator_splitter/large
name = "eight activator splitter"
icon_state = "splitter4"
w_class = ITEMSIZE_SMALL
complexity = 9
activators = list(
"incoming pulse" = 1,
"outgoing pulse A" = 0,
"outgoing pulse B" = 0,
"outgoing pulse C" = 0,
"outgoing pulse D" = 0,
"outgoing pulse E" = 0,
"outgoing pulse F" = 0,
"outgoing pulse G" = 0,
"outgoing pulse H" = 0
)
spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 8
/obj/item/integrated_circuit/transfer/multiplexer /obj/item/integrated_circuit/transfer/multiplexer
name = "two multiplexer" name = "two multiplexer"
desc = "This is what those in the business tend to refer to as a 'mux' or data selector. It moves data from one of the selected inputs to the output." desc = "This is what those in the business tend to refer to as a 'mux' or data selector. It moves data from one of the selected inputs to the output."
extended_desc = "The first input pin is used to select which of the other input pins which has its data moved to the output. If the input selection is outside the valid range then no output is given." extended_desc = "The first input pin is used to select which of the other input pins which has its data moved to the output. \
If the input selection is outside the valid range then no output is given."
complexity = 2 complexity = 2
icon_state = "mux2" icon_state = "mux2"
inputs = list("input selection") inputs = list("input selection" = IC_PINTYPE_NUMBER)
outputs = list("output") outputs = list("output" = IC_PINTYPE_ANY)
activators = list("select" = 1, "on select" = 0) activators = list("select" = IC_PINTYPE_PULSE_IN, "on select" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4 power_draw_per_use = 4
var/number_of_inputs = 2 var/number_of_inputs = 2
/obj/item/integrated_circuit/transfer/multiplexer/New() /obj/item/integrated_circuit/transfer/multiplexer/New()
for(var/i = 1 to number_of_inputs) for(var/i = 1 to number_of_inputs)
inputs += "input [i]" inputs["input [i]"] = IC_PINTYPE_ANY // This is just a string since pins don't get built until ..() is called.
// inputs += "input [i]"
complexity = number_of_inputs complexity = number_of_inputs
..() ..()
desc += " It has [number_of_inputs] input pins." desc += " It has [number_of_inputs] input pins."
@@ -118,7 +29,7 @@
var/input_index = get_pin_data(IC_INPUT, 1) var/input_index = get_pin_data(IC_INPUT, 1)
var/output = null var/output = null
if(isnum(input_index) && (input_index >= 1 && input_index < inputs.len)) if(!isnull(input_index) && (input_index >= 1 && input_index < inputs.len))
output = get_pin_data(IC_INPUT, input_index + 1) output = get_pin_data(IC_INPUT, input_index + 1)
set_pin_data(IC_OUTPUT, 1, output) set_pin_data(IC_OUTPUT, 1, output)
@@ -145,19 +56,21 @@
/obj/item/integrated_circuit/transfer/demultiplexer /obj/item/integrated_circuit/transfer/demultiplexer
name = "two demultiplexer" name = "two demultiplexer"
desc = "This is what those in the business tend to refer to as a 'demux'. It moves data from the input to one of the selected outputs." desc = "This is what those in the business tend to refer to as a 'demux'. It moves data from the input to one of the selected outputs."
extended_desc = "The first input pin is used to select which of the output pins is given the data from the second input pin. If the output selection is outside the valid range then no output is given." extended_desc = "The first input pin is used to select which of the output pins is given the data from the second input pin. \
If the output selection is outside the valid range then no output is given."
complexity = 2 complexity = 2
icon_state = "dmux2" icon_state = "dmux2"
inputs = list("output selection","input") inputs = list("output selection" = IC_PINTYPE_NUMBER, "input" = IC_PINTYPE_ANY)
outputs = list() outputs = list()
activators = list("select" = 1) activators = list("select" = IC_PINTYPE_PULSE_IN, "on select" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4 power_draw_per_use = 4
var/number_of_outputs = 2 var/number_of_outputs = 2
/obj/item/integrated_circuit/transfer/demultiplexer/New() /obj/item/integrated_circuit/transfer/demultiplexer/New()
for(var/i = 1 to number_of_outputs) for(var/i = 1 to number_of_outputs)
outputs += "output [i]" // outputs += "output [i]"
outputs["output [i]"] = IC_PINTYPE_ANY
complexity = number_of_outputs complexity = number_of_outputs
..() ..()
@@ -171,6 +84,8 @@
for(var/i = 1 to outputs.len) for(var/i = 1 to outputs.len)
set_pin_data(IC_OUTPUT, i, i == output_index ? output : null) set_pin_data(IC_OUTPUT, i, i == output_index ? output : null)
activate_pin(2)
/obj/item/integrated_circuit/transfer/demultiplexer/medium /obj/item/integrated_circuit/transfer/demultiplexer/medium
name = "four demultiplexer" name = "four demultiplexer"
icon_state = "dmux4" icon_state = "dmux4"

View File

@@ -14,7 +14,7 @@
can_be_asked_input = 1 can_be_asked_input = 1
inputs = list() inputs = list()
outputs = list() outputs = list()
activators = list("on pressed" = 0) activators = list("on pressed" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/input/button/ask_for_input(mob/user) //Bit misleading name for this specific use. /obj/item/integrated_circuit/input/button/ask_for_input(mob/user) //Bit misleading name for this specific use.
@@ -28,8 +28,8 @@
complexity = 1 complexity = 1
can_be_asked_input = 1 can_be_asked_input = 1
inputs = list() inputs = list()
outputs = list("\<NUM\> on" = 0) outputs = list("on" = IC_PINTYPE_BOOLEAN)
activators = list("on toggle" = 0) activators = list("on toggle" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/input/toggle_button/ask_for_input(mob/user) // Ditto. /obj/item/integrated_circuit/input/toggle_button/ask_for_input(mob/user) // Ditto.
@@ -45,8 +45,8 @@
complexity = 2 complexity = 2
can_be_asked_input = 1 can_be_asked_input = 1
inputs = list() inputs = list()
outputs = list("\<NUM\> number entered") outputs = list("number entered" = IC_PINTYPE_NUMBER)
activators = list("on entered" = 0) activators = list("on entered" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4 power_draw_per_use = 4
@@ -64,8 +64,8 @@
complexity = 2 complexity = 2
can_be_asked_input = 1 can_be_asked_input = 1
inputs = list() inputs = list()
outputs = list("\<TEXT\> string entered") outputs = list("string entered" = IC_PINTYPE_STRING)
activators = list("on entered" = 0) activators = list("on entered" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4 power_draw_per_use = 4
@@ -82,8 +82,11 @@
icon_state = "medscan" icon_state = "medscan"
complexity = 4 complexity = 4
inputs = list("\<REF\> target") inputs = list("\<REF\> target")
outputs = list("\<NUM\> total health %", "\<NUM\> total missing health") outputs = list(
activators = list("scan" = 1, "on scanned" = 0) "total health %" = IC_PINTYPE_NUMBER,
"total missing health" = IC_PINTYPE_NUMBER
)
activators = list("scan" = IC_PINTYPE_PULSE_IN, "on scanned" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2) origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
power_draw_per_use = 40 power_draw_per_use = 40
@@ -93,7 +96,7 @@
if(!istype(H)) //Invalid input if(!istype(H)) //Invalid input
return return
if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range. if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
var/total_health = round(H.health/H.getMaxHealth(), 0.1)*100 var/total_health = round(H.health/H.getMaxHealth(), 0.01)*100
var/missing_health = H.getMaxHealth() - H.health var/missing_health = H.getMaxHealth() - H.health
set_pin_data(IC_OUTPUT, 1, total_health) set_pin_data(IC_OUTPUT, 1, total_health)
@@ -110,15 +113,15 @@
complexity = 12 complexity = 12
inputs = list("\<REF\> target") inputs = list("\<REF\> target")
outputs = list( outputs = list(
"\<NUM\> total health %", "total health %" = IC_PINTYPE_NUMBER,
"\<NUM\> total missing health", "total missing health" = IC_PINTYPE_NUMBER,
"\<NUM\> brute damage", "brute damage" = IC_PINTYPE_NUMBER,
"\<NUM\> burn damage", "burn damage" = IC_PINTYPE_NUMBER,
"\<NUM\> tox damage", "tox damage" = IC_PINTYPE_NUMBER,
"\<NUM\> oxy damage", "oxy damage" = IC_PINTYPE_NUMBER,
"\<NUM\> clone damage" "clone damage" = IC_PINTYPE_NUMBER
) )
activators = list("scan" = 1, "on scanned" = 0) activators = list("scan" = IC_PINTYPE_PULSE_IN, "on scanned" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 4) origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 4)
power_draw_per_use = 80 power_draw_per_use = 80
@@ -128,7 +131,7 @@
if(!istype(H)) //Invalid input if(!istype(H)) //Invalid input
return return
if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range. if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
var/total_health = round(H.health/H.getMaxHealth(), 0.1)*100 var/total_health = round(H.health/H.getMaxHealth(), 0.01)*100
var/missing_health = H.getMaxHealth() - H.health var/missing_health = H.getMaxHealth() - H.health
set_pin_data(IC_OUTPUT, 1, total_health) set_pin_data(IC_OUTPUT, 1, total_health)
@@ -148,7 +151,7 @@
that is holding the machine containing it." that is holding the machine containing it."
inputs = list() inputs = list()
outputs = list("located ref") outputs = list("located ref")
activators = list("locate" = 1) activators = list("locate" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 20 power_draw_per_use = 20
@@ -170,7 +173,7 @@
random." random."
inputs = list("desired type ref") inputs = list("desired type ref")
outputs = list("located ref") outputs = list("located ref")
activators = list("locate" = 1) activators = list("locate" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 30 power_draw_per_use = 30
@@ -204,9 +207,12 @@
Meaning the default frequency is expressed as 1457, not 145.7. To send a signal, pulse the 'send signal' activator pin." Meaning the default frequency is expressed as 1457, not 145.7. To send a signal, pulse the 'send signal' activator pin."
icon_state = "signal" icon_state = "signal"
complexity = 4 complexity = 4
inputs = list("\<NUM\> frequency","\<NUM\> code") inputs = list("frequency" = IC_PINTYPE_NUMBER,"code" = IC_PINTYPE_NUMBER)
outputs = list() outputs = list()
activators = list("send signal" = 1,"on signal sent" = 0, "on signal received" = 0) activators = list(
"send signal" = IC_PINTYPE_PULSE_IN,
"on signal sent" = IC_PINTYPE_PULSE_OUT,
"on signal received" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2) origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2)
power_draw_idle = 5 power_draw_idle = 5
@@ -286,9 +292,17 @@
will pulse whatever's connected to it. Pulsing the first activation pin will send a message." will pulse whatever's connected to it. Pulsing the first activation pin will send a message."
icon_state = "signal" icon_state = "signal"
complexity = 4 complexity = 4
inputs = list("\<TEXT\> target EPv2 address", "\<TEXT\> data to send", "\<TEXT\> secondary text") inputs = list(
outputs = list("\<TEXT\> address received", "\<TEXT\> data received", "\<TEXT\> secondary text received") "target EPv2 address" = IC_PINTYPE_STRING,
activators = list("send data" = 1, "on data received" = 0) "data to send" = IC_PINTYPE_STRING,
"secondary text" = IC_PINTYPE_STRING
)
outputs = list(
"address received" = IC_PINTYPE_STRING,
"data received" = IC_PINTYPE_STRING,
"secondary text received" = IC_PINTYPE_STRING
)
activators = list("send data" = IC_PINTYPE_PULSE_IN, "on data received" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2, TECH_BLUESPACE = 2) origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2, TECH_BLUESPACE = 2)
power_draw_per_use = 50 power_draw_per_use = 50
@@ -331,8 +345,8 @@
icon_state = "gps" icon_state = "gps"
complexity = 4 complexity = 4
inputs = list() inputs = list()
outputs = list("\<NUM\> X", "\<NUM\> Y") outputs = list("X"= IC_PINTYPE_NUMBER, "Y" = IC_PINTYPE_NUMBER)
activators = list("get coordinates" = 1, "on get coordinates" = 0) activators = list("get coordinates" = IC_PINTYPE_PULSE_IN, "on get coordinates" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 30 power_draw_per_use = 30
@@ -360,8 +374,11 @@
icon_state = "recorder" icon_state = "recorder"
complexity = 8 complexity = 8
inputs = list() inputs = list()
outputs = list("\<TEXT\> speaker", "\<TEXT\> message") outputs = list(
activators = list("on message received" = 1, "on translation" = 0) "speaker" = IC_PINTYPE_STRING,
"message" = IC_PINTYPE_STRING
)
activators = list("on message received" = IC_PINTYPE_PULSE_IN, "on translation" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 15 power_draw_per_use = 15
@@ -394,12 +411,12 @@
/obj/item/integrated_circuit/input/sensor /obj/item/integrated_circuit/input/sensor
name = "sensor" name = "sensor"
desc = "Scans and obtains a reference for any objects or persons near you. All you need to do is shove the machine in their face." desc = "Scans and obtains a reference for any objects or persons near you. All you need to do is shove the machine in their face."
extended_desc = "If 'ignore storage' pin is set to 1, the sensor will disregard scanning various storage containers such as backpacks." extended_desc = "If 'ignore storage' pin is set to true, the sensor will disregard scanning various storage containers such as backpacks."
icon_state = "recorder" icon_state = "recorder"
complexity = 12 complexity = 12
inputs = list("\<NUM\> ignore storage" = 1) inputs = list("ignore storage" = IC_PINTYPE_BOOLEAN)
outputs = list("\<REF\> scanned") outputs = list("scanned" = IC_PINTYPE_REF)
activators = list("on scanned" = 0) activators = list("on scanned" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 120 power_draw_per_use = 120
@@ -414,324 +431,3 @@
activate_pin(1) activate_pin(1)
return TRUE return TRUE
/obj/item/integrated_circuit/output
category_text = "Output"
/obj/item/integrated_circuit/output/screen
name = "small screen"
desc = "This small screen can display a single piece of data, when the machine is examined closely."
icon_state = "screen"
inputs = list("\<TEXT/NUM\> displayed data")
outputs = list()
activators = list("load data" = 1)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 10
autopulse = 1
var/stuff_to_display = null
/obj/item/integrated_circuit/output/screen/disconnect_all()
..()
stuff_to_display = null
/obj/item/integrated_circuit/output/screen/any_examine(mob/user)
to_chat(user, "There is a little screen labeled '[name]', which displays [stuff_to_display ? "'[stuff_to_display]'" : "nothing"].")
/obj/item/integrated_circuit/output/screen/do_work()
var/datum/integrated_io/I = inputs[1]
if(isweakref(I.data))
var/datum/d = I.data_as_type(/datum)
if(d)
stuff_to_display = "[d]"
else
stuff_to_display = I.data
/obj/item/integrated_circuit/output/screen/medium
name = "screen"
desc = "This screen allows for people holding the device to see a piece of data."
icon_state = "screen_medium"
power_draw_per_use = 20
/obj/item/integrated_circuit/output/screen/medium/do_work()
..()
var/list/nearby_things = range(0, get_turf(src))
for(var/mob/M in nearby_things)
var/obj/O = assembly ? assembly : src
to_chat(M, "<span class='notice'>\icon[O] [stuff_to_display]</span>")
/obj/item/integrated_circuit/output/screen/large
name = "large screen"
desc = "This screen allows for people able to see the device to see a piece of data."
icon_state = "screen_large"
power_draw_per_use = 40
/obj/item/integrated_circuit/output/screen/large/do_work()
..()
var/obj/O = assembly ? loc : assembly
O.visible_message("<span class='notice'>\icon[O] [stuff_to_display]</span>")
/obj/item/integrated_circuit/output/light
name = "light"
desc = "This light can turn on and off on command."
icon_state = "light"
complexity = 4
inputs = list()
outputs = list()
activators = list("toggle light" = 1)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
var/light_toggled = 0
var/light_brightness = 3
var/light_rgb = "#FFFFFF"
power_draw_idle = 0 // Adjusted based on brightness.
/obj/item/integrated_circuit/output/light/do_work()
light_toggled = !light_toggled
update_lighting()
/obj/item/integrated_circuit/output/light/proc/update_lighting()
if(light_toggled)
set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb)
else
set_light(0)
power_draw_idle = light_toggled ? light_brightness * 2 : 0
/obj/item/integrated_circuit/output/light/advanced/update_lighting()
var/R = get_pin_data(IC_INPUT, 1)
var/G = get_pin_data(IC_INPUT, 2)
var/B = get_pin_data(IC_INPUT, 3)
var/brightness = get_pin_data(IC_INPUT, 4)
if(isnum(R) && isnum(G) && isnum(B) && isnum(brightness))
R = Clamp(R, 0, 255)
G = Clamp(G, 0, 255)
B = Clamp(B, 0, 255)
brightness = Clamp(brightness, 0, 6)
light_rgb = rgb(R, G, B)
light_brightness = brightness
..()
/obj/item/integrated_circuit/output/light/power_fail() // Turns off the flashlight if there's no power left.
light_toggled = FALSE
update_lighting()
/obj/item/integrated_circuit/output/light/advanced
name = "advanced light"
desc = "This light can turn on and off on command, in any color, and in various brightness levels."
icon_state = "light_adv"
complexity = 8
inputs = list(
"\<NUM\> R",
"\<NUM\> G",
"\<NUM\> B",
"\<NUM\> Brightness"
)
outputs = list()
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3)
/obj/item/integrated_circuit/output/light/advanced/on_data_written()
update_lighting()
/obj/item/integrated_circuit/output/sound
name = "speaker circuit"
desc = "A miniature speaker is attached to this component."
icon_state = "speaker"
complexity = 8
cooldown_per_use = 4 SECONDS
inputs = list(
"\<TEXT\> sound ID",
"\<NUM\> volume",
"\<NUM\> frequency"
)
outputs = list()
activators = list("play sound" = 1)
power_draw_per_use = 20
var/list/sounds = list()
/obj/item/integrated_circuit/output/text_to_speech
name = "text-to-speech circuit"
desc = "A miniature speaker is attached to this component."
extended_desc = "This unit is more advanced than the plain speaker circuit, able to transpose any valid text to speech."
icon_state = "speaker"
complexity = 12
cooldown_per_use = 4 SECONDS
inputs = list("text")
outputs = list()
activators = list("to speech" = 1)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 60
/obj/item/integrated_circuit/output/text_to_speech/do_work()
var/datum/integrated_io/text = inputs[1]
if(istext(text.data))
var/obj/O = assembly ? loc : assembly
audible_message("\icon[O] \The [O.name] states, \"[text.data]\"")
/obj/item/integrated_circuit/output/sound/New()
..()
extended_desc = list()
extended_desc += "The first input pin determines which sound is used. The choices are; "
extended_desc += jointext(sounds, ", ")
extended_desc += ". The second pin determines the volume of sound that is played"
extended_desc += ", and the third determines if the frequency of the sound will vary with each activation."
extended_desc = jointext(extended_desc, null)
/obj/item/integrated_circuit/output/sound/do_work()
var/datum/integrated_io/ID = inputs[1]
var/datum/integrated_io/vol = inputs[2]
var/datum/integrated_io/frequency = inputs[3]
if(istext(ID.data) && isnum(vol.data) && isnum(frequency.data))
var/selected_sound = sounds[ID.data]
if(!selected_sound)
return
vol.data = Clamp(vol.data, 0, 100)
frequency.data = round(Clamp(frequency.data, 0, 1))
playsound(get_turf(src), selected_sound, vol.data, frequency.data, -1)
/obj/item/integrated_circuit/output/sound/beeper
name = "beeper circuit"
desc = "A miniature speaker is attached to this component. This is often used in the construction of motherboards, which use \
the speaker to tell the user if something goes very wrong when booting up. It can also do other similar synthetic sounds such \
as buzzing, pinging, chiming, and more."
sounds = list(
"beep" = 'sound/machines/twobeep.ogg',
"chime" = 'sound/machines/chime.ogg',
"buzz sigh" = 'sound/machines/buzz-sigh.ogg',
"buzz twice" = 'sound/machines/buzz-two.ogg',
"ping" = 'sound/machines/ping.ogg',
"synth yes" = 'sound/machines/synth_yes.ogg',
"synth no" = 'sound/machines/synth_no.ogg',
"warning buzz" = 'sound/machines/warning-buzzer.ogg'
)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/output/sound/beepsky
name = "securitron sound circuit"
desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron."
sounds = list(
"creep" = 'sound/voice/bcreep.ogg',
"criminal" = 'sound/voice/bcriminal.ogg',
"freeze" = 'sound/voice/bfreeze.ogg',
"god" = 'sound/voice/bgod.ogg',
"i am the law" = 'sound/voice/biamthelaw.ogg',
"insult" = 'sound/voice/binsult.ogg',
"radio" = 'sound/voice/bradio.ogg',
"secure day" = 'sound/voice/bsecureday.ogg',
)
spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_ILLEGAL = 1)
/obj/item/integrated_circuit/output/video_camera
name = "video camera circuit"
desc = "This small camera allows a remote viewer to see what it sees."
extended_desc = "The camera is linked to the Research camera network."
icon_state = "video_camera"
w_class = ITEMSIZE_SMALL
complexity = 10
inputs = list("camera name" = "video camera circuit", "camera active" = 0)
outputs = list()
activators = list()
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_idle = 5 // Raises to 80 when on.
var/obj/machinery/camera/network/research/camera
/obj/item/integrated_circuit/output/video_camera/New()
..()
camera = new(src)
on_data_written()
/obj/item/integrated_circuit/output/video_camera/Destroy()
qdel_null(camera)
return ..()
/obj/item/integrated_circuit/output/video_camera/proc/set_camera_status(var/status)
if(camera)
camera.set_status(status)
power_draw_idle = camera.status ? 80 : 5
if(camera.status) // Ensure that there's actually power.
if(!draw_idle_power())
power_fail()
/obj/item/integrated_circuit/output/video_camera/on_data_written()
if(camera)
var/datum/integrated_io/cam_name = inputs[1]
var/datum/integrated_io/cam_active = inputs[2]
if(istext(cam_name.data))
camera.c_tag = cam_name.data
if(isnum(cam_active.data))
set_camera_status(cam_active.data)
/obj/item/integrated_circuit/output/video_camera/power_fail()
if(camera)
set_camera_status(0)
var/datum/integrated_io/cam_active = inputs[2]
cam_active.data = FALSE
/obj/item/integrated_circuit/output/led
name = "light-emitting diode"
desc = "This a LED that is lit whenever there is TRUE-equivalent data on its input."
extended_desc = "TRUE-equivalent values are: Non-empty strings, non-zero numbers, and valid refs."
complexity = 0.1
icon_state = "led"
inputs = list("lit")
outputs = list()
activators = list()
power_draw_idle = 0 // Raises to 1 when lit.
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
var/led_color
/obj/item/integrated_circuit/output/led/on_data_written()
power_draw_idle = get_pin_data(IC_INPUT, 1) ? 1 : 0
/obj/item/integrated_circuit/output/led/power_fail()
set_pin_data(IC_INPUT, 1, FALSE)
/obj/item/integrated_circuit/output/led/any_examine(mob/user)
var/text_output = list()
var/initial_name = initial(name)
// Doing all this work just to have a color-blind friendly output.
text_output += "There is "
if(name == initial_name)
text_output += "\an [name]"
else
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
to_chat(user,jointext(text_output,null))
/obj/item/integrated_circuit/output/led/red
name = "red LED"
led_color = COLOR_RED
/obj/item/integrated_circuit/output/led/orange
name = "orange LED"
led_color = COLOR_ORANGE
/obj/item/integrated_circuit/output/led/yellow
name = "yellow LED"
led_color = COLOR_YELLOW
/obj/item/integrated_circuit/output/led/green
name = "green LED"
led_color = COLOR_GREEN
/obj/item/integrated_circuit/output/led/blue
name = "blue LED"
led_color = COLOR_BLUE
/obj/item/integrated_circuit/output/led/purple
name = "purple LED"
led_color = COLOR_PURPLE
/obj/item/integrated_circuit/output/led/cyan
name = "cyan LED"
led_color = COLOR_CYAN
/obj/item/integrated_circuit/output/led/white
name = "white LED"
led_color = COLOR_WHITE
/obj/item/integrated_circuit/output/led/pink
name = "pink LED"
led_color = COLOR_PINK

View File

@@ -0,0 +1,89 @@
//These circuits do things with lists, and use special list pins for stability.
/obj/item/integrated_circuit/list
complexity = 1
inputs = list(
"input" = IC_PINTYPE_LIST
)
outputs = list("result" = IC_PINTYPE_STRING)
activators = list("compute" = IC_PINTYPE_PULSE_IN, "on computed" = IC_PINTYPE_PULSE_OUT)
category_text = "Lists"
power_draw_per_use = 20
/obj/item/integrated_circuit/list/pick
name = "pick circuit"
desc = "This circuit will randomly 'pick' an element from a list that is inputted."
extended_desc = "Will output null if the list is empty. Input list is unmodified."
icon_state = "addition"
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/list/pick/do_work()
var/result = null
var/list/input_list = get_pin_data(IC_INPUT, 1) // List pins guarantee that there is a list inside, even if just an empty one.
if(input_list.len)
result = pick(input_list)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
activate_pin(2)
/obj/item/integrated_circuit/list/append
name = "append circuit"
desc = "This circuit will add an element to a list."
extended_desc = "The new element will always be at the bottom of the list."
inputs = list(
"list to append" = IC_PINTYPE_LIST,
"input" = IC_PINTYPE_ANY
)
outputs = list(
"appended list" = IC_PINTYPE_LIST
)
icon_state = "addition"
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/list/append/do_work()
var/list/input_list = get_pin_data(IC_INPUT, 1)
var/list/output_list = list()
var/new_entry = get_pin_data(IC_INPUT, 2)
output_list = input_list.Copy()
output_list.Add(new_entry)
set_pin_data(IC_OUTPUT, 1, output_list)
push_data()
activate_pin(2)
/obj/item/integrated_circuit/list/jointext
name = "join text circuit"
desc = "This circuit will add all elements of a list into one string, seperated by a character."
extended_desc = "Default settings will encode the entire list into a string."
inputs = list(
"list to join" = IC_PINTYPE_LIST,
"delimiter" = IC_PINTYPE_CHAR,
"start" = IC_PINTYPE_NUMBER,
"end" = IC_PINTYPE_NUMBER
)
inputs_default = list(
"2" = ",",
"3" = 1,
"4" = 0
)
outputs = list(
"joined text" = IC_PINTYPE_STRING
)
icon_state = "addition"
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/list/jointext/do_work()
var/list/input_list = get_pin_data(IC_INPUT, 1)
var/delimiter = get_pin_data(IC_INPUT, 2)
var/start = get_pin_data(IC_INPUT, 3)
var/end = get_pin_data(IC_INPUT, 4)
var/result = null
if(input_list.len && delimiter && !isnull(start) && !isnull(end))
result = jointext(input_list, delimiter, start, end)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
activate_pin(2)

View File

@@ -4,21 +4,16 @@
extended_desc = "Logic circuits will treat a null, 0, and a \"\" string value as FALSE and anything else as TRUE." extended_desc = "Logic circuits will treat a null, 0, and a \"\" string value as FALSE and anything else as TRUE."
complexity = 3 complexity = 3
outputs = list("result") outputs = list("result")
activators = list("compare" = 1) activators = list("compare" = IC_PINTYPE_PULSE_IN)
category_text = "Logic" category_text = "Logic"
autopulse = 1
power_draw_per_use = 1 power_draw_per_use = 1
/obj/item/integrated_circuit/logic/on_data_written()
if(autopulse == 1)
check_then_do_work()
/obj/item/integrated_circuit/logic/do_work() /obj/item/integrated_circuit/logic/do_work()
push_data() push_data()
/obj/item/integrated_circuit/logic/binary /obj/item/integrated_circuit/logic/binary
inputs = list("\<ANY\> A","\<ANY\> B") inputs = list("A","B")
activators = list("compare" = 1, "on true result" = 0, "on false result" = 0) activators = list("compare" = IC_PINTYPE_PULSE_IN, "on true result" = IC_PINTYPE_PULSE_OUT, "on false result" = IC_PINTYPE_PULSE_OUT)
/obj/item/integrated_circuit/logic/binary/do_work() /obj/item/integrated_circuit/logic/binary/do_work()
pull_data() pull_data()
@@ -37,8 +32,8 @@
return FALSE return FALSE
/obj/item/integrated_circuit/logic/unary /obj/item/integrated_circuit/logic/unary
inputs = list("\<ANY\> A") inputs = list("A")
activators = list("compare" = 1, "on compare" = 0) activators = list("compare" = IC_PINTYPE_PULSE_IN, "on compare" = IC_PINTYPE_PULSE_OUT)
/obj/item/integrated_circuit/logic/unary/do_work() /obj/item/integrated_circuit/logic/unary/do_work()
pull_data() pull_data()
@@ -128,7 +123,7 @@
desc = "This gate inverts what's fed into it." desc = "This gate inverts what's fed into it."
icon_state = "not" icon_state = "not"
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
activators = list("invert" = 1, "on inverted" = 0) activators = list("invert" = IC_PINTYPE_PULSE_IN, "on inverted" = IC_PINTYPE_PULSE_OUT)
/obj/item/integrated_circuit/logic/unary/not/do_check(var/datum/integrated_io/A) /obj/item/integrated_circuit/logic/unary/not/do_check(var/datum/integrated_io/A)
return !A.data return !A.data

View File

@@ -12,12 +12,12 @@
w_class = ITEMSIZE_NORMAL w_class = ITEMSIZE_NORMAL
size = 3 size = 3
inputs = list( inputs = list(
"\<NUM\> target X rel", "target X rel" = IC_PINTYPE_NUMBER,
"\<NUM\> target Y rel" "target Y rel" = IC_PINTYPE_NUMBER
) )
outputs = list() outputs = list()
activators = list( activators = list(
"fire" = 1 "fire" = IC_PINTYPE_PULSE_IN
) )
var/obj/item/weapon/gun/installed_gun = null var/obj/item/weapon/gun/installed_gun = null
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
@@ -104,24 +104,15 @@
name = "locomotion circuit" name = "locomotion circuit"
desc = "This allows a machine to move in a given direction." desc = "This allows a machine to move in a given direction."
icon_state = "locomotion" icon_state = "locomotion"
extended_desc = "The circuit accepts a number as a direction to move towards.<br> \ extended_desc = "The circuit accepts a 'dir' number as a direction to move towards.<br>\
North/Fore = 1,<br>\
South/Aft = 2,<br>\
East/Starboard = 4,<br>\
West/Port = 8,<br>\
Northeast = 5,<br>\
Northwest = 9,<br>\
Southeast = 6,<br>\
Southwest = 10<br>\
<br>\
Pulsing the 'step towards dir' activator pin will cause the machine to move a meter in that direction, assuming it is not \ Pulsing the 'step towards dir' activator pin will cause the machine to move a meter in that direction, assuming it is not \
being held, or anchored in some way. It should be noted that the ability to move is dependant on the type of assembly that this circuit inhabits." being held, or anchored in some way. It should be noted that the ability to move is dependant on the type of assembly that this circuit inhabits."
w_class = ITEMSIZE_NORMAL w_class = ITEMSIZE_NORMAL
complexity = 20 complexity = 20
// size = 5 // size = 5
inputs = list("dir num") inputs = list("direction" = IC_PINTYPE_DIR)
outputs = list() outputs = list()
activators = list("step towards dir" = 1) activators = list("step towards dir" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 100 power_draw_per_use = 100
@@ -146,9 +137,9 @@
icon_state = "grenade" icon_state = "grenade"
complexity = 30 complexity = 30
size = 2 size = 2
inputs = list("\<NUM\> detonation time") inputs = list("detonation time" = IC_PINTYPE_NUMBER)
outputs = list() outputs = list()
activators = list("prime grenade" = 1) activators = list("prime grenade" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_COMBAT = 4) origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_COMBAT = 4)
var/obj/item/weapon/grenade/attached_grenade var/obj/item/weapon/grenade/attached_grenade

View File

@@ -3,12 +3,20 @@
desc = "This tiny chip can store one piece of data." desc = "This tiny chip can store one piece of data."
icon_state = "memory" icon_state = "memory"
complexity = 1 complexity = 1
inputs = list("input pin 1") inputs = list()
outputs = list("output pin 1") outputs = list()
activators = list("set" = 1, "on set") activators = list("set" = IC_PINTYPE_PULSE_IN, "on set" = IC_PINTYPE_PULSE_OUT)
category_text = "Memory" category_text = "Memory"
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 1 power_draw_per_use = 1
var/number_of_pins = 1
/obj/item/integrated_circuit/memory/New()
for(var/i = 1 to number_of_pins)
inputs["input [i]"] = IC_PINTYPE_ANY // This is just a string since pins don't get built until ..() is called.
outputs["output [i]"] = IC_PINTYPE_ANY
complexity = number_of_pins
..()
/obj/item/integrated_circuit/memory/examine(mob/user) /obj/item/integrated_circuit/memory/examine(mob/user)
..() ..()
@@ -36,83 +44,26 @@
name = "memory circuit" name = "memory circuit"
desc = "This circuit can store four pieces of data." desc = "This circuit can store four pieces of data."
icon_state = "memory4" icon_state = "memory4"
complexity = 4
inputs = list("input pin 1","input pin 2","input pin 3","input pin 4")
outputs = list("output pin 1","output pin 2","output pin 3","output pin 4")
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 2 power_draw_per_use = 2
number_of_pins = 4
/obj/item/integrated_circuit/memory/large /obj/item/integrated_circuit/memory/large
name = "large memory circuit" name = "large memory circuit"
desc = "This big circuit can hold eight pieces of data." desc = "This big circuit can hold eight pieces of data."
icon_state = "memory8" icon_state = "memory8"
complexity = 8
inputs = list(
"input pin 1",
"input pin 2",
"input pin 3",
"input pin 4",
"input pin 5",
"input pin 6",
"input pin 7",
"input pin 8")
outputs = list(
"output pin 1",
"output pin 2",
"output pin 3",
"output pin 4",
"output pin 5",
"output pin 6",
"output pin 7",
"output pin 8")
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3) origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3)
power_draw_per_use = 4 power_draw_per_use = 4
number_of_pins = 8
/obj/item/integrated_circuit/memory/huge /obj/item/integrated_circuit/memory/huge
name = "large memory stick" name = "large memory stick"
desc = "This stick of memory can hold up up to sixteen pieces of data." desc = "This stick of memory can hold up up to sixteen pieces of data."
icon_state = "memory16" icon_state = "memory16"
w_class = ITEMSIZE_NORMAL w_class = ITEMSIZE_NORMAL
complexity = 16
inputs = list(
"input pin 1",
"input pin 2",
"input pin 3",
"input pin 4",
"input pin 5",
"input pin 6",
"input pin 7",
"input pin 8",
"input pin 9",
"input pin 10",
"input pin 11",
"input pin 12",
"input pin 13",
"input pin 14",
"input pin 15",
"input pin 16"
)
outputs = list(
"output pin 1",
"output pin 2",
"output pin 3",
"output pin 4",
"output pin 5",
"output pin 6",
"output pin 7",
"output pin 8",
"output pin 9",
"output pin 10",
"output pin 11",
"output pin 12",
"output pin 13",
"output pin 14",
"output pin 15",
"output pin 16")
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4) origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4)
power_draw_per_use = 8 power_draw_per_use = 8
number_of_pins = 16
/obj/item/integrated_circuit/memory/constant /obj/item/integrated_circuit/memory/constant
name = "constant chip" name = "constant chip"
@@ -120,8 +71,8 @@
icon_state = "memory" icon_state = "memory"
complexity = 1 complexity = 1
inputs = list() inputs = list()
outputs = list("output pin") outputs = list("output pin" = IC_PINTYPE_ANY)
activators = list("push data" = 0) activators = list("push data" = IC_PINTYPE_PULSE_IN)
var/accepting_refs = 0 var/accepting_refs = 0
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
@@ -142,13 +93,13 @@
new_data = input("Now type in a string.","[src] string writing") as null|text new_data = input("Now type in a string.","[src] string writing") as null|text
if(istext(new_data) && CanInteract(user, physical_state)) if(istext(new_data) && CanInteract(user, physical_state))
O.data = new_data O.data = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data()].</span>") to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
if("number") if("number")
accepting_refs = 0 accepting_refs = 0
new_data = input("Now type in a number.","[src] number writing") as null|num new_data = input("Now type in a number.","[src] number writing") as null|num
if(isnum(new_data) && CanInteract(user, physical_state)) if(isnum(new_data) && CanInteract(user, physical_state))
O.data = new_data O.data = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data()].</span>") to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
if("ref") if("ref")
accepting_refs = 1 accepting_refs = 1
to_chat(user, "<span class='notice'>You turn \the [src]'s ref scanner on. Slide it across \ to_chat(user, "<span class='notice'>You turn \the [src]'s ref scanner on. Slide it across \
@@ -162,6 +113,6 @@
var/datum/integrated_io/O = outputs[1] var/datum/integrated_io/O = outputs[1]
O.data = weakref(target) O.data = weakref(target)
visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>") visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>")
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [O.display_data()]. The ref scanner is \ to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [O.display_data(O.data)]. The ref scanner is \
now off.</span>") now off.</span>")
accepting_refs = 0 accepting_refs = 0

View File

@@ -0,0 +1,316 @@
/obj/item/integrated_circuit/output
category_text = "Output"
/obj/item/integrated_circuit/output/screen
name = "small screen"
desc = "This small screen can display a single piece of data, when the machine is examined closely."
icon_state = "screen"
inputs = list("displayed data" = IC_PINTYPE_ANY)
outputs = list()
activators = list("load data" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 10
var/stuff_to_display = null
/obj/item/integrated_circuit/output/screen/disconnect_all()
..()
stuff_to_display = null
/obj/item/integrated_circuit/output/screen/any_examine(mob/user)
to_chat(user, "There is a little screen labeled '[name]', which displays [!isnull(stuff_to_display) ? "'[stuff_to_display]'" : "nothing"].")
/obj/item/integrated_circuit/output/screen/do_work()
var/datum/integrated_io/I = inputs[1]
if(isweakref(I.data))
var/datum/d = I.data_as_type(/datum)
if(d)
stuff_to_display = "[d]"
else
stuff_to_display = I.data
/obj/item/integrated_circuit/output/screen/medium
name = "screen"
desc = "This screen allows for people holding the device to see a piece of data."
icon_state = "screen_medium"
power_draw_per_use = 20
/obj/item/integrated_circuit/output/screen/medium/do_work()
..()
var/list/nearby_things = range(0, get_turf(src))
for(var/mob/M in nearby_things)
var/obj/O = assembly ? assembly : src
to_chat(M, "<span class='notice'>\icon[O] [stuff_to_display]</span>")
/obj/item/integrated_circuit/output/screen/large
name = "large screen"
desc = "This screen allows for people able to see the device to see a piece of data."
icon_state = "screen_large"
power_draw_per_use = 40
/obj/item/integrated_circuit/output/screen/large/do_work()
..()
var/obj/O = assembly ? loc : assembly
O.visible_message("<span class='notice'>\icon[O] [stuff_to_display]</span>")
/obj/item/integrated_circuit/output/light
name = "light"
desc = "This light can turn on and off on command."
icon_state = "light"
complexity = 4
inputs = list()
outputs = list()
activators = list("toggle light" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
var/light_toggled = 0
var/light_brightness = 3
var/light_rgb = "#FFFFFF"
power_draw_idle = 0 // Adjusted based on brightness.
/obj/item/integrated_circuit/output/light/do_work()
light_toggled = !light_toggled
update_lighting()
/obj/item/integrated_circuit/output/light/proc/update_lighting()
if(light_toggled)
if(assembly)
assembly.set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb)
else
if(assembly)
assembly.set_light(0)
power_draw_idle = light_toggled ? light_brightness * 2 : 0
/obj/item/integrated_circuit/output/light/advanced/update_lighting()
var/new_color = get_pin_data(IC_INPUT, 1)
var/brightness = get_pin_data(IC_INPUT, 2)
if(new_color && isnum(brightness))
brightness = Clamp(brightness, 0, 6)
light_rgb = new_color
light_brightness = brightness
..()
/obj/item/integrated_circuit/output/light/power_fail() // Turns off the flashlight if there's no power left.
light_toggled = FALSE
update_lighting()
/obj/item/integrated_circuit/output/light/advanced
name = "advanced light"
desc = "This light can turn on and off on command, in any color, and in various brightness levels."
icon_state = "light_adv"
complexity = 8
inputs = list(
"color" = IC_PINTYPE_COLOR,
"brightness" = IC_PINTYPE_NUMBER
)
outputs = list()
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3)
/obj/item/integrated_circuit/output/light/advanced/on_data_written()
update_lighting()
/obj/item/integrated_circuit/output/sound
name = "speaker circuit"
desc = "A miniature speaker is attached to this component."
icon_state = "speaker"
complexity = 8
cooldown_per_use = 4 SECONDS
inputs = list(
"sound ID" = IC_PINTYPE_STRING,
"volume" = IC_PINTYPE_NUMBER,
"frequency" = IC_PINTYPE_BOOLEAN
)
outputs = list()
activators = list("play sound" = IC_PINTYPE_PULSE_IN)
power_draw_per_use = 20
var/list/sounds = list()
/obj/item/integrated_circuit/output/text_to_speech
name = "text-to-speech circuit"
desc = "A miniature speaker is attached to this component."
extended_desc = "This unit is more advanced than the plain speaker circuit, able to transpose any valid text to speech."
icon_state = "speaker"
complexity = 12
cooldown_per_use = 4 SECONDS
inputs = list("text" = IC_PINTYPE_STRING)
outputs = list()
activators = list("to speech" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 60
/obj/item/integrated_circuit/output/text_to_speech/do_work()
text = get_pin_data(IC_INPUT, 1)
if(!isnull(text))
var/obj/O = assembly ? loc : assembly
audible_message("\icon[O] \The [O.name] states, \"[text]\"")
/obj/item/integrated_circuit/output/sound/New()
..()
extended_desc = list()
extended_desc += "The first input pin determines which sound is used. The choices are; "
extended_desc += jointext(sounds, ", ")
extended_desc += ". The second pin determines the volume of sound that is played"
extended_desc += ", and the third determines if the frequency of the sound will vary with each activation."
extended_desc = jointext(extended_desc, null)
/obj/item/integrated_circuit/output/sound/do_work()
var/ID = get_pin_data(IC_INPUT, 1)
var/vol = get_pin_data(IC_INPUT, 2)
var/freq = get_pin_data(IC_INPUT, 3)
if(!isnull(ID) && !isnull(vol))
var/selected_sound = sounds[ID]
if(!selected_sound)
return
vol = between(0, vol, 100)
playsound(get_turf(src), selected_sound, vol, freq, -1)
/obj/item/integrated_circuit/output/sound/beeper
name = "beeper circuit"
desc = "A miniature speaker is attached to this component. This is often used in the construction of motherboards, which use \
the speaker to tell the user if something goes very wrong when booting up. It can also do other similar synthetic sounds such \
as buzzing, pinging, chiming, and more."
sounds = list(
"beep" = 'sound/machines/twobeep.ogg',
"chime" = 'sound/machines/chime.ogg',
"buzz sigh" = 'sound/machines/buzz-sigh.ogg',
"buzz twice" = 'sound/machines/buzz-two.ogg',
"ping" = 'sound/machines/ping.ogg',
"synth yes" = 'sound/machines/synth_yes.ogg',
"synth no" = 'sound/machines/synth_no.ogg',
"warning buzz" = 'sound/machines/warning-buzzer.ogg'
)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/output/sound/beepsky
name = "securitron sound circuit"
desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron."
sounds = list(
"creep" = 'sound/voice/bcreep.ogg',
"criminal" = 'sound/voice/bcriminal.ogg',
"freeze" = 'sound/voice/bfreeze.ogg',
"god" = 'sound/voice/bgod.ogg',
"i am the law" = 'sound/voice/biamthelaw.ogg',
"insult" = 'sound/voice/binsult.ogg',
"radio" = 'sound/voice/bradio.ogg',
"secure day" = 'sound/voice/bsecureday.ogg',
)
spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_ILLEGAL = 1)
/obj/item/integrated_circuit/output/video_camera
name = "video camera circuit"
desc = "This small camera allows a remote viewer to see what it sees."
extended_desc = "The camera is linked to the Research camera network."
icon_state = "video_camera"
w_class = ITEMSIZE_SMALL
complexity = 10
inputs = list(
"camera name" = IC_PINTYPE_STRING,
"camera active" = IC_PINTYPE_BOOLEAN
)
inputs_default = list("1" = "video camera circuit")
outputs = list()
activators = list()
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_idle = 5 // Raises to 80 when on.
var/obj/machinery/camera/network/research/camera
/obj/item/integrated_circuit/output/video_camera/New()
..()
camera = new(src)
on_data_written()
/obj/item/integrated_circuit/output/video_camera/Destroy()
qdel_null(camera)
return ..()
/obj/item/integrated_circuit/output/video_camera/proc/set_camera_status(var/status)
if(camera)
camera.set_status(status)
power_draw_idle = camera.status ? 80 : 5
if(camera.status) // Ensure that there's actually power.
if(!draw_idle_power())
power_fail()
/obj/item/integrated_circuit/output/video_camera/on_data_written()
if(camera)
var/cam_name = get_pin_data(IC_INPUT, 1)
var/cam_active = get_pin_data(IC_INPUT, 2)
if(!isnull(cam_name))
camera.c_tag = cam_name
set_camera_status(cam_active)
/obj/item/integrated_circuit/output/video_camera/power_fail()
if(camera)
set_camera_status(0)
set_pin_data(IC_INPUT, 2, FALSE)
/obj/item/integrated_circuit/output/led
name = "light-emitting diode"
desc = "This a LED that is lit whenever there is TRUE-equivalent data on its input."
extended_desc = "TRUE-equivalent values are: Non-empty strings, non-zero numbers, and valid refs."
complexity = 0.1
icon_state = "led"
inputs = list("lit" = IC_PINTYPE_BOOLEAN)
outputs = list()
activators = list()
power_draw_idle = 0 // Raises to 1 when lit.
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
var/led_color
/obj/item/integrated_circuit/output/led/on_data_written()
power_draw_idle = get_pin_data(IC_INPUT, 1) ? 1 : 0
/obj/item/integrated_circuit/output/led/power_fail()
set_pin_data(IC_INPUT, 1, FALSE)
/obj/item/integrated_circuit/output/led/any_examine(mob/user)
var/text_output = list()
var/initial_name = initial(name)
// Doing all this work just to have a color-blind friendly output.
text_output += "There is "
if(name == initial_name)
text_output += "\an [name]"
else
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]><3E></font>" : "unlit."]"
to_chat(user,jointext(text_output,null))
/obj/item/integrated_circuit/output/led/red
name = "red LED"
led_color = COLOR_RED
/obj/item/integrated_circuit/output/led/orange
name = "orange LED"
led_color = COLOR_ORANGE
/obj/item/integrated_circuit/output/led/yellow
name = "yellow LED"
led_color = COLOR_YELLOW
/obj/item/integrated_circuit/output/led/green
name = "green LED"
led_color = COLOR_GREEN
/obj/item/integrated_circuit/output/led/blue
name = "blue LED"
led_color = COLOR_BLUE
/obj/item/integrated_circuit/output/led/purple
name = "purple LED"
led_color = COLOR_PURPLE
/obj/item/integrated_circuit/output/led/cyan
name = "cyan LED"
led_color = COLOR_CYAN
/obj/item/integrated_circuit/output/led/white
name = "white LED"
led_color = COLOR_WHITE
/obj/item/integrated_circuit/output/led/pink
name = "pink LED"
led_color = COLOR_PINK

View File

@@ -11,9 +11,13 @@
some power is lost due to ineffiency." some power is lost due to ineffiency."
w_class = ITEMSIZE_SMALL w_class = ITEMSIZE_SMALL
complexity = 16 complexity = 16
inputs = list("\<REF\> target") inputs = list("target" = IC_PINTYPE_REF)
outputs = list("\<NUM\> target cell charge", "\<NUM\> target cell max charge", "\<NUM\> target cell percentage") outputs = list(
activators = list("transmit" = 1) "target cell charge" = IC_PINTYPE_NUMBER,
"target cell max charge" = IC_PINTYPE_NUMBER,
"target cell percentage" = IC_PINTYPE_NUMBER
)
activators = list("transmit" = IC_PINTYPE_PULSE_IN, "on transmit" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4, TECH_POWER = 4, TECH_MAGNET = 3) origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4, TECH_POWER = 4, TECH_MAGNET = 3)
power_draw_per_use = 500 // Inefficency has to come from somewhere. power_draw_per_use = 500 // Inefficency has to come from somewhere.
@@ -67,6 +71,7 @@
set_pin_data(IC_OUTPUT, 1, cell.charge) set_pin_data(IC_OUTPUT, 1, cell.charge)
set_pin_data(IC_OUTPUT, 2, cell.maxcharge) set_pin_data(IC_OUTPUT, 2, cell.maxcharge)
set_pin_data(IC_OUTPUT, 3, cell.percent()) set_pin_data(IC_OUTPUT, 3, cell.percent())
activate_pin(2)
return TRUE return TRUE
return FALSE return FALSE

View File

@@ -13,13 +13,13 @@
desc = "Unlike most electronics, creating smoke is completely intentional." desc = "Unlike most electronics, creating smoke is completely intentional."
icon_state = "smoke" icon_state = "smoke"
extended_desc = "This smoke generator creates clouds of smoke on command. It can also hold liquids inside, which will go \ extended_desc = "This smoke generator creates clouds of smoke on command. It can also hold liquids inside, which will go \
into the smoke clouds when activated." into the smoke clouds when activated. The reagents are consumed when smoke is made."
flags = OPENCONTAINER flags = OPENCONTAINER
complexity = 20 complexity = 20
cooldown_per_use = 30 SECONDS cooldown_per_use = 30 SECONDS
inputs = list() inputs = list()
outputs = list() outputs = list()
activators = list("create smoke" = 1) activators = list("create smoke" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 3) origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 3)
volume = 100 volume = 100
@@ -43,9 +43,10 @@
flags = OPENCONTAINER flags = OPENCONTAINER
complexity = 20 complexity = 20
cooldown_per_use = 6 SECONDS cooldown_per_use = 6 SECONDS
inputs = list("\<REF\> target", "\<NUM\> injection amount" = 5) inputs = list("target" = IC_PINTYPE_REF, "injection amount" = IC_PINTYPE_NUMBER)
inputs_default = list("2" = 5)
outputs = list() outputs = list()
activators = list("inject" = 1) activators = list("inject" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
volume = 30 volume = 30
power_draw_per_use = 15 power_draw_per_use = 15
@@ -88,19 +89,20 @@
outside the machine if it is next to the machine. Note that this cannot be used on entities." outside the machine if it is next to the machine. Note that this cannot be used on entities."
flags = OPENCONTAINER flags = OPENCONTAINER
complexity = 8 complexity = 8
inputs = list("\<REF\> source", "\<REF\> target", "\<NUM\> injection amount" = 10) inputs = list("source" = IC_PINTYPE_REF, "target" = IC_PINTYPE_REF, "injection amount" = IC_PINTYPE_NUMBER)
inputs_default = list("3" = 5)
outputs = list() outputs = list()
activators = list("transfer reagents" = 1, "on transfer" = 0) activators = list("transfer reagents" = IC_PINTYPE_PULSE_IN, "on transfer" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2) origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
var/transfer_amount = 10 var/transfer_amount = 10
power_draw_per_use = 10 power_draw_per_use = 10
/obj/item/integrated_circuit/reagent/pump/on_data_written() /obj/item/integrated_circuit/reagent/pump/on_data_written()
var/datum/integrated_io/amount = inputs[3] var/new_amount = get_pin_data(IC_INPUT, 3)
if(isnum(amount.data)) if(!isnull(new_amount))
amount.data = Clamp(amount.data, 0, 50) new_amount = Clamp(new_amount, 0, 50)
transfer_amount = amount.data transfer_amount = new_amount
/obj/item/integrated_circuit/reagent/pump/do_work() /obj/item/integrated_circuit/reagent/pump/do_work()
var/atom/movable/source = get_pin_data_as_type(IC_INPUT, 1, /atom/movable) var/atom/movable/source = get_pin_data_as_type(IC_INPUT, 1, /atom/movable)
@@ -130,16 +132,15 @@
flags = OPENCONTAINER flags = OPENCONTAINER
complexity = 4 complexity = 4
inputs = list() inputs = list()
outputs = list("volume used") outputs = list("volume used" = IC_PINTYPE_NUMBER)
activators = list() activators = list()
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2) origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
volume = 60 volume = 60
/obj/item/integrated_circuit/reagent/storage/on_reagent_change() /obj/item/integrated_circuit/reagent/storage/on_reagent_change()
var/datum/integrated_io/A = outputs[1] set_pin_data(IC_OUTPUT, 1, reagents.total_volume)
A.data = reagents.total_volume push_data()
A.push_data()
/obj/item/integrated_circuit/reagent/storage/cryo /obj/item/integrated_circuit/reagent/storage/cryo
name = "cryo reagent storage" name = "cryo reagent storage"

View File

@@ -8,9 +8,9 @@
cannot see the target, it will not be able to calculate the correct direction." cannot see the target, it will not be able to calculate the correct direction."
icon_state = "numberpad" icon_state = "numberpad"
complexity = 25 complexity = 25
inputs = list("\<REF\> target") inputs = list("target" = IC_PINTYPE_REF)
outputs = list("\<NUM\> dir") outputs = list("dir" = IC_PINTYPE_DIR)
activators = list("calculate dir" = 1, "on calculated" = 0) activators = list("calculate dir" = IC_PINTYPE_PULSE_IN, "on calculated" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 5) origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 5)
power_draw_per_use = 40 power_draw_per_use = 40

View File

@@ -12,7 +12,7 @@
This circuit is set to send a pulse after a delay of two seconds." This circuit is set to send a pulse after a delay of two seconds."
icon_state = "delay-20" icon_state = "delay-20"
var/delay = 2 SECONDS var/delay = 2 SECONDS
activators = list("incoming"= 1,"outgoing" = 0) activators = list("incoming"= IC_PINTYPE_PULSE_IN,"outgoing" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 2 power_draw_per_use = 2
@@ -59,7 +59,7 @@
desc = "This sends a pulse signal out after a delay, critical for ensuring proper control flow in a complex machine. \ desc = "This sends a pulse signal out after a delay, critical for ensuring proper control flow in a complex machine. \
This circuit's delay can be customized, between 1/10th of a second to one hour. The delay is updated upon receiving a pulse." This circuit's delay can be customized, between 1/10th of a second to one hour. The delay is updated upon receiving a pulse."
icon_state = "delay" icon_state = "delay"
inputs = list("\<NUM\> delay time") inputs = list("delay time" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/time/delay/custom/do_work() /obj/item/integrated_circuit/time/delay/custom/do_work()
@@ -78,8 +78,8 @@
var/ticks_to_pulse = 4 var/ticks_to_pulse = 4
var/ticks_completed = 0 var/ticks_completed = 0
var/is_running = FALSE var/is_running = FALSE
inputs = list("\<NUM\> enable ticking" = 0) inputs = list("enable ticking" = IC_PINTYPE_BOOLEAN)
activators = list("outgoing pulse" = 0) activators = list("outgoing pulse" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 4 power_draw_per_use = 4
@@ -131,8 +131,13 @@
desc = "Tells you what the local time is, specific to your station or planet." desc = "Tells you what the local time is, specific to your station or planet."
icon_state = "clock" icon_state = "clock"
inputs = list() inputs = list()
outputs = list("\<TEXT\> time", "\<NUM\> hours", "\<NUM\> minutes", "\<NUM\> seconds") outputs = list(
activators = list("get time" = 1,"on time got" = 0) "time" = IC_PINTYPE_STRING,
"hours" = IC_PINTYPE_NUMBER,
"minutes" = IC_PINTYPE_NUMBER,
"seconds" = IC_PINTYPE_NUMBER
)
activators = list("get time" = IC_PINTYPE_PULSE_IN, "on time got" = IC_PINTYPE_PULSE_OUT)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 4 power_draw_per_use = 4

View File

@@ -2,40 +2,35 @@
/obj/item/integrated_circuit/trig /obj/item/integrated_circuit/trig
complexity = 1 complexity = 1
inputs = list( inputs = list(
"\<NUM\> A", "A" = IC_PINTYPE_NUMBER,
"\<NUM\> B", "B" = IC_PINTYPE_NUMBER,
"\<NUM\> C", "C" = IC_PINTYPE_NUMBER,
"\<NUM\> D", "D" = IC_PINTYPE_NUMBER,
"\<NUM\> E", "E" = IC_PINTYPE_NUMBER,
"\<NUM\> F", "F" = IC_PINTYPE_NUMBER,
"\<NUM\> G", "G" = IC_PINTYPE_NUMBER,
"\<NUM\> H" "H" = IC_PINTYPE_NUMBER
) )
outputs = list("\<NUM\> result") outputs = list("result" = IC_PINTYPE_NUMBER)
activators = list("compute" = 1, "on computed" = 0) activators = list("compute" = IC_PINTYPE_PULSE_IN, "on computed" = IC_PINTYPE_PULSE_OUT)
category_text = "Trig" category_text = "Trig"
extended_desc = "Input and output are in degrees." extended_desc = "Input and output are in degrees."
autopulse = 1
power_draw_per_use = 1 // Still cheap math. power_draw_per_use = 1 // Still cheap math.
/obj/item/integrated_circuit/trig/on_data_written()
if(autopulse == 1)
check_then_do_work()
// Sine // // Sine //
/obj/item/integrated_circuit/trig/sine /obj/item/integrated_circuit/trig/sine
name = "sin circuit" name = "sin circuit"
desc = "Has nothing to do with evil, unless you consider trigonometry to be evil. Outputs the sine of A." desc = "Has nothing to do with evil, unless you consider trigonometry to be evil. Outputs the sine of A."
icon_state = "sine" icon_state = "sine"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/trig/sine/do_work() /obj/item/integrated_circuit/trig/sine/do_work()
pull_data() pull_data()
var/result = null var/result = null
var/A = get_pin_data(IC_INPUT, 1) var/A = get_pin_data(IC_INPUT, 1)
if(isnum(A)) if(!isnull(A))
result = sin(A) result = sin(A)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -48,14 +43,14 @@
name = "cos circuit" name = "cos circuit"
desc = "Outputs the cosine of A." desc = "Outputs the cosine of A."
icon_state = "cosine" icon_state = "cosine"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/trig/cosine/do_work() /obj/item/integrated_circuit/trig/cosine/do_work()
pull_data() pull_data()
var/result = null var/result = null
var/A = get_pin_data(IC_INPUT, 1) var/A = get_pin_data(IC_INPUT, 1)
if(isnum(A)) if(!isnull(A))
result = cos(A) result = cos(A)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -68,14 +63,14 @@
name = "tan circuit" name = "tan circuit"
desc = "Outputs the tangent of A. Guaranteed to not go on a tangent about its existance." desc = "Outputs the tangent of A. Guaranteed to not go on a tangent about its existance."
icon_state = "tangent" icon_state = "tangent"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/trig/tangent/do_work() /obj/item/integrated_circuit/trig/tangent/do_work()
pull_data() pull_data()
var/result = null var/result = null
var/A = get_pin_data(IC_INPUT, 1) var/A = get_pin_data(IC_INPUT, 1)
if(isnum(A)) if(!isnull(A))
result = Tan(A) result = Tan(A)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -88,14 +83,14 @@
name = "csc circuit" name = "csc circuit"
desc = "Outputs the cosecant of A." desc = "Outputs the cosecant of A."
icon_state = "cosecant" icon_state = "cosecant"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/trig/cosecant/do_work() /obj/item/integrated_circuit/trig/cosecant/do_work()
pull_data() pull_data()
var/result = null var/result = null
var/A = get_pin_data(IC_INPUT, 1) var/A = get_pin_data(IC_INPUT, 1)
if(isnum(A)) if(!isnull(A))
result = Csc(A) result = Csc(A)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -109,14 +104,14 @@
name = "sec circuit" name = "sec circuit"
desc = "Outputs the secant of A. Has nothing to do with the security department." desc = "Outputs the secant of A. Has nothing to do with the security department."
icon_state = "secant" icon_state = "secant"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/trig/secant/do_work() /obj/item/integrated_circuit/trig/secant/do_work()
pull_data() pull_data()
var/result = null var/result = null
var/A = get_pin_data(IC_INPUT, 1) var/A = get_pin_data(IC_INPUT, 1)
if(isnum(A)) if(!isnull(A))
result = Sec(A) result = Sec(A)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)
@@ -130,14 +125,14 @@
name = "cot circuit" name = "cot circuit"
desc = "Outputs the cotangent of A." desc = "Outputs the cotangent of A."
icon_state = "cotangent" icon_state = "cotangent"
inputs = list("\<NUM\> A") inputs = list("A" = IC_PINTYPE_NUMBER)
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
/obj/item/integrated_circuit/trig/cotangent/do_work() /obj/item/integrated_circuit/trig/cotangent/do_work()
pull_data() pull_data()
var/result = null var/result = null
var/A = get_pin_data(IC_INPUT, 1) var/A = get_pin_data(IC_INPUT, 1)
if(isnum(A)) if(!isnull(A))
result = Cot(A) result = Cot(A)
set_pin_data(IC_OUTPUT, 1, result) set_pin_data(IC_OUTPUT, 1, result)

View File

@@ -8,9 +8,29 @@
#undef IC_SPAWN_DEFAULT #undef IC_SPAWN_DEFAULT
//#undef IC_SPAWN_RESEARCH // Research designs depend on this unfortunately. //#undef IC_SPAWN_RESEARCH // Research designs depend on this unfortunately.
#undef IC_FORMAT_ANY
#undef IC_FORMAT_STRING #undef IC_FORMAT_STRING
#undef IC_FORMAT_CHAR
#undef IC_FORMAT_COLOR
#undef IC_FORMAT_NUMBER #undef IC_FORMAT_NUMBER
#undef IC_FORMAT_DIR
#undef IC_FORMAT_BOOLEAN
#undef IC_FORMAT_REF #undef IC_FORMAT_REF
#undef IC_FORMAT_LIST #undef IC_FORMAT_LIST
#undef IC_FORMAT_ANY
#undef IC_FORMAT_PULSE #undef IC_FORMAT_PULSE
#undef IC_PINTYPE_ANY
#undef IC_PINTYPE_STRING
#undef IC_PINTYPE_CHAR
#undef IC_PINTYPE_COLOR
#undef IC_PINTYPE_NUMBER
#undef IC_PINTYPE_DIR
#undef IC_PINTYPE_BOOLEAN
#undef IC_PINTYPE_REF
#undef IC_PINTYPE_LIST
#undef IC_PINTYPE_PULSE_IN
#undef IC_PINTYPE_PULSE_OUT
#undef IC_MAX_LIST_LENGTH

View File

@@ -1595,6 +1595,24 @@ CIRCUITS BELOW
build_path = /obj/item/device/assembly/electronic_assembly build_path = /obj/item/device/assembly/electronic_assembly
sort_string = "VCAAF" sort_string = "VCAAF"
/datum/design/item/custom_circuit_printer
name = "Portable integrated circuit printer"
desc = "A portable(ish) printer for modular machines."
id = "ic_printer"
req_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 4, TECH_DATA = 5)
materials = list(DEFAULT_WALL_MATERIAL = 10000)
build_path = /obj/item/device/integrated_circuit_printer
sort_string = "VCAAG"
/datum/design/item/custom_circuit_printer
name = "Integrated circuit printer upgrade - advanced designs"
desc = "Allows the integrated circuit printer to create advanced circuits"
id = "ic_printer_upgrade_adv"
req_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 4)
materials = list(DEFAULT_WALL_MATERIAL = 2000)
build_path = /obj/item/weapon/disk/integrated_circuit/upgrade/advanced
sort_string = "VCAAH"
/datum/design/item/translator /datum/design/item/translator
name = "handheld translator" name = "handheld translator"
id = "translator" id = "translator"

View File

@@ -54,7 +54,7 @@ research holder datum.
known_tech += new T(src) known_tech += new T(src)
for(var/D in typesof(/datum/design) - /datum/design) for(var/D in typesof(/datum/design) - /datum/design)
possible_designs += new D(src) possible_designs += new D(src)
generate_integrated_circuit_designs() // generate_integrated_circuit_designs()
RefreshResearch() RefreshResearch()
/datum/research/techonly /datum/research/techonly
@@ -129,7 +129,7 @@ research holder datum.
var/datum/tech/check_tech = T var/datum/tech/check_tech = T
if(initial(check_tech.id) == ID) if(initial(check_tech.id) == ID)
return initial(check_tech.name) return initial(check_tech.name)
/*
/datum/research/proc/generate_integrated_circuit_designs() /datum/research/proc/generate_integrated_circuit_designs()
spawn(2 SECONDS) // So the list has time to initialize. spawn(2 SECONDS) // So the list has time to initialize.
for(var/obj/item/integrated_circuit/IC in all_integrated_circuits) for(var/obj/item/integrated_circuit/IC in all_integrated_circuits)
@@ -143,6 +143,7 @@ research holder datum.
D.req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) D.req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2)
D.build_path = IC.type D.build_path = IC.type
possible_designs += D possible_designs += D
*/
/*************************************************************** /***************************************************************
** Technology Datums ** ** Technology Datums **

View File

@@ -1,17 +0,0 @@
/datum/unit_test/integrated_circuits/splitter
name = "Data Transfer Circuits: Splitter"
circuit_type = /obj/item/integrated_circuit/transfer/splitter
inputs_to_give = list("Test")
expected_outputs = list("Test", "Test")
/datum/unit_test/integrated_circuits/splitter4
name = "Data Transfer Circuits: Splitter 4"
circuit_type = /obj/item/integrated_circuit/transfer/splitter/medium
inputs_to_give = list("Test")
expected_outputs = list("Test", "Test", "Test", "Test")
/datum/unit_test/integrated_circuits/splitter8
name = "Data Transfer Circuits: Splitter 8"
circuit_type = /obj/item/integrated_circuit/transfer/splitter/large
inputs_to_give = list("Test")
expected_outputs = list("Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1451,17 +1451,28 @@
#include "code\modules\integrated_electronics\core\helpers.dm" #include "code\modules\integrated_electronics\core\helpers.dm"
#include "code\modules\integrated_electronics\core\integrated_circuit.dm" #include "code\modules\integrated_electronics\core\integrated_circuit.dm"
#include "code\modules\integrated_electronics\core\pins.dm" #include "code\modules\integrated_electronics\core\pins.dm"
#include "code\modules\integrated_electronics\core\printer.dm"
#include "code\modules\integrated_electronics\core\tools.dm" #include "code\modules\integrated_electronics\core\tools.dm"
#include "code\modules\integrated_electronics\core\special_pins\boolean_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\char_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\color_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\dir_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\list_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\number_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\ref_pin.dm"
#include "code\modules\integrated_electronics\core\special_pins\string_pin.dm"
#include "code\modules\integrated_electronics\passive\passive.dm" #include "code\modules\integrated_electronics\passive\passive.dm"
#include "code\modules\integrated_electronics\passive\power.dm" #include "code\modules\integrated_electronics\passive\power.dm"
#include "code\modules\integrated_electronics\subtypes\arithmetic.dm" #include "code\modules\integrated_electronics\subtypes\arithmetic.dm"
#include "code\modules\integrated_electronics\subtypes\built_in.dm" #include "code\modules\integrated_electronics\subtypes\built_in.dm"
#include "code\modules\integrated_electronics\subtypes\converters.dm" #include "code\modules\integrated_electronics\subtypes\converters.dm"
#include "code\modules\integrated_electronics\subtypes\data_transfer.dm" #include "code\modules\integrated_electronics\subtypes\data_transfer.dm"
#include "code\modules\integrated_electronics\subtypes\input_output.dm" #include "code\modules\integrated_electronics\subtypes\input.dm"
#include "code\modules\integrated_electronics\subtypes\lists.dm"
#include "code\modules\integrated_electronics\subtypes\logic.dm" #include "code\modules\integrated_electronics\subtypes\logic.dm"
#include "code\modules\integrated_electronics\subtypes\manipulation.dm" #include "code\modules\integrated_electronics\subtypes\manipulation.dm"
#include "code\modules\integrated_electronics\subtypes\memory.dm" #include "code\modules\integrated_electronics\subtypes\memory.dm"
#include "code\modules\integrated_electronics\subtypes\output.dm"
#include "code\modules\integrated_electronics\subtypes\power.dm" #include "code\modules\integrated_electronics\subtypes\power.dm"
#include "code\modules\integrated_electronics\subtypes\reagents.dm" #include "code\modules\integrated_electronics\subtypes\reagents.dm"
#include "code\modules\integrated_electronics\subtypes\smart.dm" #include "code\modules\integrated_electronics\subtypes\smart.dm"
@@ -2217,7 +2228,6 @@
#include "code\unit_tests\integrated_circuits\arithmetic.dm" #include "code\unit_tests\integrated_circuits\arithmetic.dm"
#include "code\unit_tests\integrated_circuits\circuits.dm" #include "code\unit_tests\integrated_circuits\circuits.dm"
#include "code\unit_tests\integrated_circuits\converter.dm" #include "code\unit_tests\integrated_circuits\converter.dm"
#include "code\unit_tests\integrated_circuits\data_transfer.dm"
#include "code\unit_tests\integrated_circuits\logic.dm" #include "code\unit_tests\integrated_circuits\logic.dm"
#include "code\unit_tests\integrated_circuits\trig.dm" #include "code\unit_tests\integrated_circuits\trig.dm"
#include "code\ZAS\_docs.dm" #include "code\ZAS\_docs.dm"