mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Ports the Port of Circuits
Ports PsiOmegaDelta's port of integrated circuits, which has several improvements in code quality. Ports a few small things like the weakref datum and some macros.
This commit is contained in:
@@ -42,6 +42,10 @@
|
|||||||
|
|
||||||
#define isxeno(A) istype(A, /mob/living/simple_animal/xeno)
|
#define isxeno(A) istype(A, /mob/living/simple_animal/xeno)
|
||||||
|
|
||||||
|
#define isweakref(A) istype(A, /weakref)
|
||||||
|
|
||||||
#define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
|
#define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
|
||||||
|
|
||||||
#define to_chat(target, message) target << message
|
#define to_chat(target, message) target << message
|
||||||
|
|
||||||
|
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE)
|
||||||
|
|||||||
31
code/datums/weakref.dm
Normal file
31
code/datums/weakref.dm
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/datum
|
||||||
|
var/weakref/weakref
|
||||||
|
|
||||||
|
/datum/Destroy()
|
||||||
|
weakref = null // Clear this reference to ensure it's kept for as brief duration as possible.
|
||||||
|
. = ..()
|
||||||
|
|
||||||
|
//obtain a weak reference to a datum
|
||||||
|
/proc/weakref(datum/D)
|
||||||
|
if(D.gcDestroyed)
|
||||||
|
return
|
||||||
|
if(!D.weakref)
|
||||||
|
D.weakref = new/weakref(D)
|
||||||
|
return D.weakref
|
||||||
|
|
||||||
|
/weakref
|
||||||
|
var/ref
|
||||||
|
|
||||||
|
/weakref/New(datum/D)
|
||||||
|
ref = "\ref[D]"
|
||||||
|
|
||||||
|
/weakref/Destroy()
|
||||||
|
// A weakref datum should not be manually destroyed as it is a shared resource,
|
||||||
|
// rather it should be automatically collected by the BYOND GC when all references are gone.
|
||||||
|
return 0
|
||||||
|
|
||||||
|
/weakref/proc/resolve()
|
||||||
|
var/datum/D = locate(ref)
|
||||||
|
if(D && D.weakref == src)
|
||||||
|
return D
|
||||||
|
return null
|
||||||
@@ -630,3 +630,14 @@
|
|||||||
return ITEMSIZE_COST_HUGE
|
return ITEMSIZE_COST_HUGE
|
||||||
else
|
else
|
||||||
return ITEMSIZE_COST_NO_CONTAINER
|
return ITEMSIZE_COST_NO_CONTAINER
|
||||||
|
|
||||||
|
/obj/item/weapon/storage/proc/make_exact_fit()
|
||||||
|
storage_slots = contents.len
|
||||||
|
|
||||||
|
can_hold.Cut()
|
||||||
|
max_w_class = 0
|
||||||
|
max_storage_space = 0
|
||||||
|
for(var/obj/item/I in src)
|
||||||
|
can_hold[I.type]++
|
||||||
|
max_w_class = max(I.w_class, max_w_class)
|
||||||
|
max_storage_space += I.get_storage_cost()
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var/list/hiss_sound = list('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','soun
|
|||||||
var/list/page_sound = list('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg')
|
var/list/page_sound = list('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg')
|
||||||
//var/list/gun_sound = list('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
|
//var/list/gun_sound = list('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
|
||||||
|
|
||||||
/proc/playsound(var/atom/source, soundin, vol as num, vary, extrarange as num, falloff, var/is_global)
|
/proc/playsound(var/atom/source, soundin, vol as num, vary, extrarange as num, falloff, var/is_global, var/frequency)
|
||||||
|
|
||||||
soundin = get_sfx(soundin) // same sound for everyone
|
soundin = get_sfx(soundin) // same sound for everyone
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ var/list/page_sound = list('sound/effects/pageturn1.ogg', 'sound/effects/pagetur
|
|||||||
error("[source] is an area and is trying to make the sound: [soundin]")
|
error("[source] is an area and is trying to make the sound: [soundin]")
|
||||||
return
|
return
|
||||||
|
|
||||||
var/frequency = get_rand_frequency() // Same frequency for everybody
|
frequency = isnull(frequency) ? get_rand_frequency() : frequency // Same frequency for everybody
|
||||||
var/turf/turf_source = get_turf(source)
|
var/turf/turf_source = get_turf(source)
|
||||||
|
|
||||||
// Looping through the player list has the added bonus of working for mobs inside containers
|
// Looping through the player list has the added bonus of working for mobs inside containers
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
#define IC_INPUT "input"
|
||||||
|
#define IC_OUTPUT "output"
|
||||||
|
#define IC_ACTIVATOR "activator"
|
||||||
|
|
||||||
#define DATA_CHANNEL "data channel"
|
#define DATA_CHANNEL "data channel"
|
||||||
#define PULSE_CHANNEL "pulse channel"
|
#define PULSE_CHANNEL "pulse channel"
|
||||||
|
|
||||||
@@ -11,66 +15,37 @@
|
|||||||
var/list/inputs = list()
|
var/list/inputs = list()
|
||||||
var/list/outputs = list()
|
var/list/outputs = list()
|
||||||
var/list/activators = list()
|
var/list/activators = list()
|
||||||
var/number_of_inputs = 0 //This is how many input pins are created
|
var/next_use = 0 //Uses world.time
|
||||||
var/number_of_outputs = 0 //Likewise for output
|
|
||||||
var/number_of_activators = 0 //Guess
|
|
||||||
var/list/input_names = list()
|
|
||||||
var/list/output_names = list()
|
|
||||||
var/list/activator_names = list()
|
|
||||||
var/last_used = 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/cooldown_per_use = 2 SECONDS
|
var/cooldown_per_use = 1 SECOND
|
||||||
|
var/category = /obj/item/integrated_circuit // Used by the toolsets to filter out category types
|
||||||
|
|
||||||
/obj/item/integrated_circuit/examine(mob/user)
|
/obj/item/integrated_circuit/examine(mob/user)
|
||||||
..()
|
..()
|
||||||
user << "This board has [inputs.len] input [inputs.len != 1 ? "pins" : "pin"] and \
|
to_chat(user, "This board has [inputs.len] input pin\s and [outputs.len] output pin\s.")
|
||||||
[outputs.len] output [outputs.len != 1 ? "pins" : "pin"]."
|
|
||||||
for(var/datum/integrated_io/input/I in inputs)
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
if(I.linked.len)
|
if(I.linked.len)
|
||||||
user << "\The [I.name] 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/output/O in outputs)
|
||||||
if(O.linked.len)
|
if(O.linked.len)
|
||||||
user << "\The [O.name] 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)
|
||||||
if(A.linked.len)
|
if(A.linked.len)
|
||||||
user << "\The [A.name] is connected to [A.get_linked_to_desc()]."
|
to_chat(user, "The [A] is connected to [A.get_linked_to_desc()].")
|
||||||
|
|
||||||
interact(user)
|
interact(user)
|
||||||
|
|
||||||
/obj/item/integrated_circuit/New()
|
/obj/item/integrated_circuit/New()
|
||||||
|
setup_io(inputs, /datum/integrated_io/input)
|
||||||
|
setup_io(outputs, /datum/integrated_io/output)
|
||||||
|
setup_io(activators, /datum/integrated_io/activate)
|
||||||
..()
|
..()
|
||||||
var/i = 0
|
|
||||||
if(number_of_inputs)
|
|
||||||
for(i = number_of_inputs, i > 0, i--)
|
|
||||||
inputs.Add(new /datum/integrated_io/input(src))
|
|
||||||
|
|
||||||
if(number_of_outputs)
|
/obj/item/integrated_circuit/proc/setup_io(var/list/io_list, var/io_type)
|
||||||
for(i = number_of_outputs, i > 0, i--)
|
var/list/names = io_list.Copy()
|
||||||
outputs.Add(new /datum/integrated_io/output(src))
|
io_list.Cut()
|
||||||
|
for(var/name in names)
|
||||||
if(number_of_activators)
|
io_list.Add(new io_type(src, name))
|
||||||
for(i = number_of_activators, i > 0, i--)
|
|
||||||
activators.Add(new /datum/integrated_io/activate(src))
|
|
||||||
|
|
||||||
apply_names_to_io()
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/proc/apply_names_to_io()
|
|
||||||
var/i = 1
|
|
||||||
if(input_names.len)
|
|
||||||
for(var/datum/integrated_io/input/I in inputs)
|
|
||||||
I.name = "[input_names[i]]"
|
|
||||||
i++
|
|
||||||
i = 1
|
|
||||||
if(output_names.len)
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
|
||||||
O.name = "[output_names[i]]"
|
|
||||||
i++
|
|
||||||
|
|
||||||
i = 1
|
|
||||||
if(activator_names.len)
|
|
||||||
for(var/datum/integrated_io/activate/A in activators)
|
|
||||||
A.name = "[activator_names[i]]"
|
|
||||||
i++
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/proc/on_data_written() //Override this for special behaviour when new data gets pushed to the circuit.
|
/obj/item/integrated_circuit/proc/on_data_written() //Override this for special behaviour when new data gets pushed to the circuit.
|
||||||
return
|
return
|
||||||
@@ -82,7 +57,12 @@
|
|||||||
qdel(O)
|
qdel(O)
|
||||||
for(var/datum/integrated_io/A in activators)
|
for(var/datum/integrated_io/A in activators)
|
||||||
qdel(A)
|
qdel(A)
|
||||||
..()
|
. = ..()
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/nano_host()
|
||||||
|
if(istype(src.loc, /obj/item/device/electronic_assembly))
|
||||||
|
return loc
|
||||||
|
return ..()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/emp_act(severity)
|
/obj/item/integrated_circuit/emp_act(severity)
|
||||||
for(var/datum/integrated_io/io in inputs + outputs + activators)
|
for(var/datum/integrated_io/io in inputs + outputs + activators)
|
||||||
@@ -94,42 +74,42 @@
|
|||||||
set desc = "Rename your circuit, useful to stay organized."
|
set desc = "Rename your circuit, useful to stay organized."
|
||||||
|
|
||||||
var/mob/M = usr
|
var/mob/M = usr
|
||||||
|
if(!CanInteract(M, physical_state))
|
||||||
if(!M.canmove || M.stat || M.restrained())
|
|
||||||
return
|
return
|
||||||
|
|
||||||
var/input = sanitizeSafe(input("What do you want to name the circuit?", "Rename", src.name), MAX_NAME_LEN)
|
var/input = sanitizeSafe(input("What do you want to name the circuit?", "Rename", src.name) as null|text, MAX_NAME_LEN)
|
||||||
|
if(src && input && CanInteract(M, physical_state))
|
||||||
if(src && input)
|
to_chat(M, "<span class='notice'>The circuit '[src.name]' is now labeled '[input]'.</span>")
|
||||||
M << "<span class='notice'>The circuit '[src.name]' is now labeled '[input]'.</span>"
|
|
||||||
name = input
|
name = input
|
||||||
|
|
||||||
/obj/item/integrated_circuit/proc/get_pin_ref(var/pin_type, var/pin_number)
|
/obj/item/integrated_circuit/proc/get_pin_ref(var/pin_type, var/pin_number)
|
||||||
switch(pin_type)
|
switch(pin_type)
|
||||||
if("input")
|
if(IC_INPUT)
|
||||||
if(pin_number > inputs.len)
|
if(pin_number > inputs.len)
|
||||||
return null
|
return null
|
||||||
return inputs[pin_number]
|
return inputs[pin_number]
|
||||||
if("output")
|
if(IC_OUTPUT)
|
||||||
if(pin_number > outputs.len)
|
if(pin_number > outputs.len)
|
||||||
return null
|
return null
|
||||||
return outputs[pin_number]
|
return outputs[pin_number]
|
||||||
if("activator")
|
if(IC_ACTIVATOR)
|
||||||
if(pin_number > activators.len)
|
if(pin_number > activators.len)
|
||||||
return null
|
return null
|
||||||
return activators[pin_number]
|
return activators[pin_number]
|
||||||
return null
|
return null
|
||||||
|
|
||||||
/obj/item/integrated_circuit/interact(mob/user)
|
/obj/item/integrated_circuit/interact(mob/user)
|
||||||
if(get_dist(get_turf(src), user) > 1)
|
if(!CanInteract(user, physical_state))
|
||||||
user.unset_machine(src)
|
|
||||||
return
|
return
|
||||||
var/HTML = "<html><head><title>[src.name]</title></head><body>"
|
|
||||||
|
var/HTML = list()
|
||||||
|
HTML += "<html><head><title>[src.name]</title></head><body>"
|
||||||
HTML += "<div align='center'>"
|
HTML += "<div align='center'>"
|
||||||
HTML += "<table border='1' style='undefined;table-layout: fixed; width: 424px'>"
|
HTML += "<table border='1' style='undefined;table-layout: fixed; width: 424px'>"
|
||||||
|
|
||||||
HTML += "<br><a href='?src=\ref[src];user=\ref[user]'>\[Refresh\]</a> | "
|
HTML += "<br><a href='?src=\ref[src];'>\[Refresh\]</a> | "
|
||||||
HTML += "<a href='?src=\ref[src];user=\ref[user];rename=1'>\[Rename\]</a><br>"
|
HTML += "<a href='?src=\ref[src];rename=1'>\[Rename\]</a> | "
|
||||||
|
HTML += "<a href='?src=\ref[src];remove=1'>\[Remove\]</a><br>"
|
||||||
|
|
||||||
HTML += "<colgroup>"
|
HTML += "<colgroup>"
|
||||||
HTML += "<col style='width: 121px'>"
|
HTML += "<col style='width: 121px'>"
|
||||||
@@ -139,80 +119,69 @@
|
|||||||
|
|
||||||
var/column_width = 3
|
var/column_width = 3
|
||||||
var/row_height = max(inputs.len, outputs.len, 1)
|
var/row_height = max(inputs.len, outputs.len, 1)
|
||||||
var/i
|
|
||||||
var/j
|
for(var/i = 1 to row_height)
|
||||||
for(i = 1, i < row_height+1, i++)
|
|
||||||
HTML += "<tr>"
|
HTML += "<tr>"
|
||||||
for(j = 1, j < column_width+1, j++)
|
for(var/j = 1 to column_width)
|
||||||
var/datum/integrated_io/io = null
|
var/datum/integrated_io/io = null
|
||||||
var/words = null
|
var/words = list()
|
||||||
var/height = 1
|
var/height = 1
|
||||||
switch(j)
|
switch(j)
|
||||||
if(1)
|
if(1)
|
||||||
io = get_pin_ref("input",i)
|
io = get_pin_ref(IC_INPUT, i)
|
||||||
if(io)
|
if(io)
|
||||||
if(io.linked.len)
|
if(io.linked.len)
|
||||||
words = "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]><b>[io.name] [io.display_data()]</b></a><br>"
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]><b>[io.name] [io.display_data()]</b></a><br>"
|
||||||
for(var/datum/integrated_io/linked in io.linked)
|
for(var/datum/integrated_io/linked in io.linked)
|
||||||
words += "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>\[[linked.name]\]</a> \
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>\[[linked.name]\]</a> \
|
||||||
@ <a href=?src=\ref[linked.holder];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
@ <a href=?src=\ref[linked.holder];examine=1;>[linked.holder]</a><br>"
|
||||||
else // "Click <a href=?src=\ref[src];action=start>here</a>!"
|
else
|
||||||
words = "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>[io.name] [io.display_data()]</a><br>"
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>[io.name] [io.display_data()]</a><br>"
|
||||||
for(var/datum/integrated_io/linked in io.linked)
|
for(var/datum/integrated_io/linked in io.linked)
|
||||||
words += "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>\[[linked.name]\]</a> \
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>\[[linked.name]\]</a> \
|
||||||
@ <a href=?src=\ref[linked.holder];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
@ <a href=?src=\ref[linked.holder];examine=1;>[linked.holder]</a><br>"
|
||||||
if(outputs.len > inputs.len)
|
if(outputs.len > inputs.len)
|
||||||
// height = Floor(outputs.len / inputs.len)
|
height = 1
|
||||||
height = 1 // Because of bugs, if there's more outputs than inputs, it causes the output side to be hidden.
|
|
||||||
//world << "I wrote [words] at ([i],[j]). Height = [height]."
|
|
||||||
if(2)
|
if(2)
|
||||||
if(i == 1)
|
if(i == 1)
|
||||||
words = "[src.name]<br><br>[src.desc]"
|
words += "[src.name]<br><br>[src.desc]"
|
||||||
height = row_height
|
height = row_height
|
||||||
//world << "I wrote the center piece because i was equal to 1, at ([i],[j]). Height = [height]."
|
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
if(3)
|
if(3)
|
||||||
io = get_pin_ref("output",i)
|
io = get_pin_ref(IC_OUTPUT, i)
|
||||||
if(io)
|
if(io)
|
||||||
if(io.linked.len)
|
if(io.linked.len)
|
||||||
words = "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]><b>[io.name] [io.display_data()]</b></a><br>"
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]><b>[io.name] [io.display_data()]</b></a><br>"
|
||||||
for(var/datum/integrated_io/linked in io.linked)
|
for(var/datum/integrated_io/linked in io.linked)
|
||||||
words += "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>\[[linked.name]\]</a> \
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>\[[linked.name]\]</a> \
|
||||||
@ <a href=?src=\ref[linked.holder];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
@ <a href=?src=\ref[linked.holder];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
||||||
else
|
else
|
||||||
words = "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>[io.name] [io.display_data()]</a><br>"
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>[io.name] [io.display_data()]</a><br>"
|
||||||
for(var/datum/integrated_io/linked in io.linked)
|
for(var/datum/integrated_io/linked in io.linked)
|
||||||
words += "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>\[[linked.name]\]</a> \
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>\[[linked.name]\]</a> \
|
||||||
@ <a href=?src=\ref[linked.holder];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
@ <a href=?src=\ref[linked.holder];examine=1;>[linked.holder]</a><br>"
|
||||||
if(inputs.len > outputs.len)
|
if(inputs.len > outputs.len)
|
||||||
// height = Floor(inputs.len / outputs.len)
|
height = 1
|
||||||
height = 1 // See above.
|
HTML += "<td align='center' rowspan='[height]'>[jointext(words, null)]</td>"
|
||||||
//world << "I wrote [words] at ([i],[j]). Height = [height]."
|
|
||||||
HTML += "<td align='center' rowspan='[height]'>[words]</td>"
|
|
||||||
//HTML += "<td align='center'>[words]</td>"
|
|
||||||
//world << "Writing to ([i],[j])."
|
|
||||||
HTML += "</tr>"
|
HTML += "</tr>"
|
||||||
|
|
||||||
if(activators.len)
|
for(var/activator in activators)
|
||||||
for(i = 1, i < activators.len+1, i++)
|
var/datum/integrated_io/io = activator
|
||||||
var/datum/integrated_io/io = null
|
var/words = list()
|
||||||
var/words = null
|
if(io.linked.len)
|
||||||
io = get_pin_ref("activator",i)
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]><font color='FF0000'><b>[io.name]</b></font></a><br>"
|
||||||
if(io)
|
for(var/datum/integrated_io/linked in io.linked)
|
||||||
if(io.linked.len)
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>\[[linked.name]\]</a> \
|
||||||
words = "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]><font color='FF0000'><b>[io.name]</b></font></a><br>"
|
@ <a href=?src[src];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
||||||
for(var/datum/integrated_io/linked in io.linked)
|
else
|
||||||
words += "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>\[[linked.name]\]</a> \
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]><font color='FF0000'>[io.name]</font></a><br>"
|
||||||
@ <a href=?src[src];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
for(var/datum/integrated_io/linked in io.linked)
|
||||||
else // "Click <a href=?src=\ref[src];action=start>here</a>!"
|
words += "<a href=?src=\ref[src];wire=1;pin=\ref[io]>\[[linked.name]\]</a> \
|
||||||
words = "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]><font color='FF0000'>[io.name]</font></a><br>"
|
@ <a href=?src=\ref[linked.holder];examine=1;>[linked.holder]</a><br>"
|
||||||
for(var/datum/integrated_io/linked in io.linked)
|
HTML += "<tr>"
|
||||||
words += "<a href=?src=\ref[src];wire=1;user=\ref[user];pin=\ref[io]>\[[linked.name]\]</a> \
|
HTML += "<td colspan='3' align='center'>[jointext(words, null)]</td>"
|
||||||
@ <a href=?src=\ref[linked.holder];examine=1;user=\ref[user]>[linked.holder]</a><br>"
|
HTML += "</tr>"
|
||||||
HTML += "<tr>"
|
|
||||||
HTML += "<td colspan='3' align='center'>[words]</td>"
|
|
||||||
HTML += "</tr>"
|
|
||||||
|
|
||||||
HTML += "</table>"
|
HTML += "</table>"
|
||||||
HTML += "</div>"
|
HTML += "</div>"
|
||||||
@@ -221,56 +190,50 @@
|
|||||||
HTML += "<br><font color='0000FF'>[extended_desc]</font>"
|
HTML += "<br><font color='0000FF'>[extended_desc]</font>"
|
||||||
|
|
||||||
HTML += "</body></html>"
|
HTML += "</body></html>"
|
||||||
user << browse(HTML, "window=circuit-\ref[src];size=600x350;border=1;can_resize=1;can_close=1;can_minimize=1")
|
user << browse(jointext(HTML, null), "window=circuit-\ref[src];size=600x350;border=1;can_resize=1;can_close=1;can_minimize=1")
|
||||||
|
|
||||||
//user << sanitize(HTML, "window=debug;size=400x400;border=1;can_resize=1;can_close=1;can_minimize=1")
|
|
||||||
//world << sanitize(HTML)
|
|
||||||
|
|
||||||
user.set_machine(src)
|
|
||||||
onclose(user, "circuit-\ref[src]")
|
onclose(user, "circuit-\ref[src]")
|
||||||
|
|
||||||
/obj/item/integrated_circuit/Topic(href, href_list[])
|
/obj/item/integrated_circuit/Topic(href, href_list, state = physical_state)
|
||||||
var/mob/living/user = locate(href_list["user"]) in mob_list
|
if(..())
|
||||||
|
return 1
|
||||||
var/pin = locate(href_list["pin"]) in inputs + outputs + activators
|
var/pin = locate(href_list["pin"]) in inputs + outputs + activators
|
||||||
|
|
||||||
if(!user || !user.Adjacent(get_turf(src)) )
|
var/obj/held_item = usr.get_active_hand()
|
||||||
return 1
|
|
||||||
|
|
||||||
if(!user.canmove || user.stat || user.restrained())
|
|
||||||
return
|
|
||||||
|
|
||||||
if(href_list["wire"])
|
if(href_list["wire"])
|
||||||
if(ishuman(user) && Adjacent(user))
|
if(istype(held_item, /obj/item/device/integrated_electronics/wirer))
|
||||||
var/mob/living/carbon/human/H = user
|
var/obj/item/device/integrated_electronics/wirer/wirer = held_item
|
||||||
var/obj/held_item = H.get_active_hand()
|
if(pin)
|
||||||
|
wirer.wire(pin, usr)
|
||||||
|
|
||||||
if(istype(held_item, /obj/item/device/integrated_electronics/wirer))
|
else if(istype(held_item, /obj/item/device/integrated_electronics/debugger))
|
||||||
var/obj/item/device/integrated_electronics/wirer/wirer = held_item
|
var/obj/item/device/integrated_electronics/debugger/debugger = held_item
|
||||||
if(pin)
|
if(pin)
|
||||||
wirer.wire(pin, user)
|
debugger.write_data(pin, usr)
|
||||||
|
else
|
||||||
else if(istype(held_item, /obj/item/device/integrated_electronics/debugger))
|
to_chat(usr, "<span class='warning'>You can't do a whole lot without the proper tools.</span>")
|
||||||
var/obj/item/device/integrated_electronics/debugger/debugger = held_item
|
|
||||||
if(pin)
|
|
||||||
debugger.write_data(pin, user)
|
|
||||||
|
|
||||||
// if(istype(H.r_hand, /obj/item/device/integrated_electronics/wirer))
|
|
||||||
// wirer = H.r_hand
|
|
||||||
// else if(istype(H.l_hand, /obj/item/device/integrated_electronics/wirer))
|
|
||||||
// wirer = H.l_hand
|
|
||||||
|
|
||||||
// if(wirer && pin)
|
|
||||||
// wirer.wire(pin, user)
|
|
||||||
else
|
|
||||||
user << "<span class='warning'>You can't do a whole lot without tools.</span>"
|
|
||||||
|
|
||||||
if(href_list["examine"])
|
if(href_list["examine"])
|
||||||
examine(user)
|
examine(usr)
|
||||||
|
|
||||||
if(href_list["rename"])
|
if(href_list["rename"])
|
||||||
rename_component(user)
|
rename_component(usr)
|
||||||
|
|
||||||
interact(user) // To refresh the UI.
|
if(href_list["remove"])
|
||||||
|
if(istype(held_item, /obj/item/weapon/screwdriver))
|
||||||
|
disconnect_all()
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
forceMove(T)
|
||||||
|
playsound(T, 'sound/items/Crowbar.ogg', 50, 1)
|
||||||
|
to_chat(usr, "<span class='notice'>You pop \the [src] out of the case, and slide it out.</span>")
|
||||||
|
else
|
||||||
|
to_chat(usr, "<span class='warning'>You need a screwdriver to remove components.</span>")
|
||||||
|
var/obj/item/device/electronic_assembly/ea = loc
|
||||||
|
if(istype(ea))
|
||||||
|
ea.interact(usr)
|
||||||
|
return
|
||||||
|
|
||||||
|
interact(usr) // To refresh the UI.
|
||||||
|
|
||||||
/datum/integrated_io
|
/datum/integrated_io
|
||||||
var/name = "input/output"
|
var/name = "input/output"
|
||||||
@@ -287,8 +250,20 @@
|
|||||||
|
|
||||||
/datum/integrated_io/Destroy()
|
/datum/integrated_io/Destroy()
|
||||||
disconnect()
|
disconnect()
|
||||||
|
data = null
|
||||||
holder = null
|
holder = null
|
||||||
..()
|
. = ..()
|
||||||
|
|
||||||
|
/datum/integrated_io/nano_host()
|
||||||
|
return holder
|
||||||
|
|
||||||
|
|
||||||
|
/datum/integrated_io/proc/data_as_type(var/as_type)
|
||||||
|
if(!isweakref(data))
|
||||||
|
return
|
||||||
|
var/weakref/w = data
|
||||||
|
var/output = w.resolve()
|
||||||
|
return istype(output, as_type) ? output : null
|
||||||
|
|
||||||
/datum/integrated_io/proc/display_data()
|
/datum/integrated_io/proc/display_data()
|
||||||
if(isnull(data))
|
if(isnull(data))
|
||||||
@@ -316,43 +291,38 @@
|
|||||||
push_data()
|
push_data()
|
||||||
|
|
||||||
/datum/integrated_io/proc/write_data_to_pin(var/new_data)
|
/datum/integrated_io/proc/write_data_to_pin(var/new_data)
|
||||||
if(isnull(new_data) || isnum(new_data) || istext(new_data) || istype(new_data, /atom/) ) // Anything else is a type we don't want.
|
if(isnull(new_data) || isnum(new_data) || istext(new_data) || isweakref(new_data)) // Anything else is a type we don't want.
|
||||||
data = new_data
|
data = new_data
|
||||||
holder.on_data_written()
|
holder.on_data_written()
|
||||||
|
|
||||||
/datum/integrated_io/proc/push_data()
|
/datum/integrated_io/proc/push_data()
|
||||||
if(linked.len)
|
for(var/datum/integrated_io/io in linked)
|
||||||
for(var/datum/integrated_io/io in linked)
|
io.write_data_to_pin(data)
|
||||||
io.write_data_to_pin(data)
|
|
||||||
|
|
||||||
/datum/integrated_io/activate/push_data()
|
/datum/integrated_io/activate/push_data()
|
||||||
if(linked.len)
|
for(var/datum/integrated_io/io in linked)
|
||||||
for(var/datum/integrated_io/io in linked)
|
io.holder.check_then_do_work()
|
||||||
io.holder.work()
|
|
||||||
|
|
||||||
/datum/integrated_io/proc/pull_data()
|
/datum/integrated_io/proc/pull_data()
|
||||||
if(linked.len)
|
for(var/datum/integrated_io/io in linked)
|
||||||
for(var/datum/integrated_io/io in linked)
|
write_data_to_pin(io.data)
|
||||||
write_data_to_pin(io.data)
|
|
||||||
|
|
||||||
/datum/integrated_io/proc/get_linked_to_desc()
|
/datum/integrated_io/proc/get_linked_to_desc()
|
||||||
if(linked.len)
|
if(linked.len)
|
||||||
var/result = english_list(linked)
|
return "the [english_list(linked)]"
|
||||||
return "the [result]"
|
|
||||||
return "nothing"
|
return "nothing"
|
||||||
|
|
||||||
/datum/integrated_io/proc/disconnect()
|
/datum/integrated_io/proc/disconnect()
|
||||||
if(linked.len)
|
//First we iterate over everything we are linked to.
|
||||||
//First we iterate over everything we are linked to.
|
for(var/datum/integrated_io/their_io in linked)
|
||||||
for(var/datum/integrated_io/their_io in linked)
|
//While doing that, we iterate them as well, and disconnect ourselves from them.
|
||||||
//While doing that, we iterate them as well, and disconnect ourselves from them.
|
for(var/datum/integrated_io/their_linked_io in their_io.linked)
|
||||||
for(var/datum/integrated_io/their_linked_io in their_io.linked)
|
if(their_linked_io == src)
|
||||||
if(their_linked_io == src)
|
their_io.linked.Remove(src)
|
||||||
their_io.linked.Remove(src)
|
else
|
||||||
else
|
continue
|
||||||
continue
|
//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/input
|
||||||
name = "input pin"
|
name = "input pin"
|
||||||
@@ -372,11 +342,14 @@
|
|||||||
for(var/datum/integrated_io/input/I in inputs)
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
I.push_data()
|
I.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/proc/work(var/datum/integrated_io/io)
|
/obj/item/integrated_circuit/proc/check_then_do_work()
|
||||||
if(last_used + cooldown_per_use > world.time) // All intergrated circuits have an internal cooldown, to protect from spam.
|
if(world.time < next_use) // All intergrated circuits have an internal cooldown, to protect from spam.
|
||||||
return 0
|
return
|
||||||
last_used = world.time
|
next_use = world.time + cooldown_per_use
|
||||||
return 1
|
do_work()
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/proc/do_work()
|
||||||
|
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/input/I in inputs)
|
||||||
|
|||||||
@@ -1,25 +1,10 @@
|
|||||||
//These circuits do simple math.
|
//These circuits do simple math.
|
||||||
/obj/item/integrated_circuit/arithmetic
|
/obj/item/integrated_circuit/arithmetic
|
||||||
complexity = 1
|
complexity = 1
|
||||||
number_of_inputs = 8
|
inputs = list("A","B","C","D","E","F","G","H")
|
||||||
number_of_outputs = 1
|
outputs = list("result")
|
||||||
number_of_activators = 1
|
activators = list("compute")
|
||||||
input_names = list(
|
category = /obj/item/integrated_circuit/arithmetic
|
||||||
"A",
|
|
||||||
"B",
|
|
||||||
"C",
|
|
||||||
"D",
|
|
||||||
"E",
|
|
||||||
"F",
|
|
||||||
"G",
|
|
||||||
"H"
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"result"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"compute"
|
|
||||||
)
|
|
||||||
|
|
||||||
// +Adding+ //
|
// +Adding+ //
|
||||||
|
|
||||||
@@ -28,17 +13,16 @@
|
|||||||
desc = "This circuit can add numbers together."
|
desc = "This circuit can add numbers together."
|
||||||
icon_state = "addition"
|
icon_state = "addition"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/addition/work()
|
/obj/item/integrated_circuit/arithmetic/addition/do_work()
|
||||||
if(..())
|
var/result = 0
|
||||||
var/result = 0
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
for(var/datum/integrated_io/input/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
|
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.data = result
|
O.data = result
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
// -Subtracting- //
|
// -Subtracting- //
|
||||||
|
|
||||||
@@ -47,7 +31,7 @@
|
|||||||
desc = "This circuit can subtract numbers."
|
desc = "This circuit can subtract numbers."
|
||||||
icon_state = "subtraction"
|
icon_state = "subtraction"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/subtraction/work()
|
/obj/item/integrated_circuit/arithmetic/subtraction/do_work()
|
||||||
if(..())
|
if(..())
|
||||||
var/result = 0
|
var/result = 0
|
||||||
for(var/datum/integrated_io/input/I in inputs)
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
@@ -66,17 +50,16 @@
|
|||||||
desc = "This circuit can multiply numbers."
|
desc = "This circuit can multiply numbers."
|
||||||
icon_state = "multiplication"
|
icon_state = "multiplication"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/subtraction/work()
|
/obj/item/integrated_circuit/arithmetic/subtraction/do_work()
|
||||||
if(..())
|
var/result = 0
|
||||||
var/result = 0
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
for(var/datum/integrated_io/input/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
|
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.data = result
|
O.data = result
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
// /Division/ //
|
// /Division/ //
|
||||||
|
|
||||||
@@ -85,17 +68,16 @@
|
|||||||
desc = "This circuit can divide numbers, just don't think about trying to divide by zero!"
|
desc = "This circuit can divide numbers, just don't think about trying to divide by zero!"
|
||||||
icon_state = "division"
|
icon_state = "division"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/division/work()
|
/obj/item/integrated_circuit/arithmetic/division/do_work()
|
||||||
if(..())
|
var/result = 0
|
||||||
var/result = 0
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
for(var/datum/integrated_io/input/I in inputs)
|
I.pull_data()
|
||||||
I.pull_data()
|
if(isnum(I.data) && I.data != 0) //No runtimes here.
|
||||||
if(isnum(I.data) && I.data != 0) //No runtimes here.
|
result = result / I.data
|
||||||
result = result / I.data
|
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.data = result
|
O.data = result
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
// Absolute //
|
// Absolute //
|
||||||
|
|
||||||
@@ -103,20 +85,18 @@
|
|||||||
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"
|
||||||
number_of_inputs = 1
|
inputs = list("A")
|
||||||
number_of_outputs = 1
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/absolute/work()
|
/obj/item/integrated_circuit/arithmetic/absolute/do_work()
|
||||||
if(..())
|
var/result = 0
|
||||||
var/result = 0
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
for(var/datum/integrated_io/input/I in inputs)
|
I.pull_data()
|
||||||
I.pull_data()
|
if(isnum(I.data) && I.data != 0)
|
||||||
if(isnum(I.data) && I.data != 0)
|
result = abs(result)
|
||||||
result = abs(result)
|
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.data = result
|
O.data = result
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
// Averaging //
|
// Averaging //
|
||||||
|
|
||||||
@@ -125,59 +105,49 @@
|
|||||||
desc = "This circuit is of average quality, however it will compute the average for numbers you give it."
|
desc = "This circuit is of average quality, however it will compute the average for numbers you give it."
|
||||||
icon_state = "average"
|
icon_state = "average"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/average/work()
|
/obj/item/integrated_circuit/arithmetic/average/do_work()
|
||||||
if(..())
|
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/input/I in inputs)
|
I.pull_data()
|
||||||
I.pull_data()
|
if(isnum(I.data))
|
||||||
if(isnum(I.data))
|
inputs_used++
|
||||||
inputs_used++
|
result = result + I.data
|
||||||
result = result + I.data
|
|
||||||
|
|
||||||
if(inputs_used)
|
if(inputs_used)
|
||||||
result = result / inputs_used
|
result = result / inputs_used
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.data = result
|
O.data = result
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
// Pi, because why the hell not? //
|
// Pi, because why the hell not? //
|
||||||
/obj/item/integrated_circuit/arithmetic/pi
|
/obj/item/integrated_circuit/arithmetic/pi
|
||||||
name = "pi constant circuit"
|
name = "pi constant circuit"
|
||||||
desc = "Not recommended for cooking. Outputs '3.14159' when it receives a pulse."
|
desc = "Not recommended for cooking. Outputs '3.14159' when it receives a pulse."
|
||||||
icon_state = "pi"
|
icon_state = "pi"
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 1
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/pi/work()
|
/obj/item/integrated_circuit/arithmetic/pi/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/output/O = outputs[1]
|
||||||
var/datum/integrated_io/output/O = outputs[1]
|
O.data = 3.14159
|
||||||
O.data = 3.14159
|
O.push_data()
|
||||||
O.push_data()
|
|
||||||
|
|
||||||
// Random //
|
// Random //
|
||||||
/obj/item/integrated_circuit/arithmetic/random
|
/obj/item/integrated_circuit/arithmetic/random
|
||||||
name = "random number generator circuit"
|
name = "random number generator circuit"
|
||||||
desc = "This gives a random (integer) number between values A and B inclusive."
|
desc = "This gives a random (integer) number between values A and B inclusive."
|
||||||
icon_state = "random"
|
icon_state = "random"
|
||||||
number_of_inputs = 2
|
inputs = list("L","H")
|
||||||
number_of_outputs = 1
|
|
||||||
number_of_activators = 1
|
|
||||||
input_names = list(
|
|
||||||
"L",
|
|
||||||
"H"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/arithmetic/random/work()
|
/obj/item/integrated_circuit/arithmetic/random/do_work()
|
||||||
if(..())
|
var/result = 0
|
||||||
var/result = 0
|
var/datum/integrated_io/L = inputs[1]
|
||||||
var/datum/integrated_io/L = inputs[1]
|
var/datum/integrated_io/H = inputs[2]
|
||||||
var/datum/integrated_io/H = inputs[2]
|
|
||||||
|
|
||||||
if(isnum(L.data) && isnum(H.data))
|
if(isnum(L.data) && isnum(H.data))
|
||||||
result = rand(L.data, H.data)
|
result = rand(L.data, H.data)
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.data = result
|
O.data = result
|
||||||
O.push_data()
|
O.push_data()
|
||||||
@@ -1,7 +1,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 electronics with."
|
||||||
w_class = ITEMSIZE_SMALL
|
w_class = 2
|
||||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||||
icon_state = "setup_small"
|
icon_state = "setup_small"
|
||||||
var/max_components = 10
|
var/max_components = 10
|
||||||
@@ -11,62 +11,59 @@
|
|||||||
/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"
|
||||||
w_class = ITEMSIZE_NORMAL
|
w_class = 3
|
||||||
max_components = 20
|
max_components = 20
|
||||||
max_complexity = 80
|
max_complexity = 80
|
||||||
|
|
||||||
/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"
|
||||||
w_class = ITEMSIZE_LARGE
|
w_class = 4
|
||||||
max_components = 30
|
max_components = 30
|
||||||
max_complexity = 120
|
max_complexity = 120
|
||||||
|
|
||||||
/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"
|
||||||
w_class = ITEMSIZE_NORMAL
|
w_class = 3
|
||||||
max_components = 25
|
max_components = 25
|
||||||
max_complexity = 100
|
max_complexity = 100
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/interact(mob/user)
|
/obj/item/device/electronic_assembly/interact(mob/user)
|
||||||
if(get_dist(get_turf(src), user) > 1)
|
if(!CanInteract(user, physical_state))
|
||||||
user.unset_machine(src)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
var/total_parts = 0
|
var/total_parts = 0
|
||||||
var/total_complexity = 0
|
var/total_complexity = 0
|
||||||
for(var/obj/item/integrated_circuit/part in contents)
|
for(var/obj/item/integrated_circuit/part in contents)
|
||||||
total_parts++
|
total_parts++
|
||||||
total_complexity = total_complexity + part.complexity
|
total_complexity = total_complexity + part.complexity
|
||||||
var/HTML = "<html><head><title>[src.name]</title></head><body>"
|
var/HTML = list()
|
||||||
|
|
||||||
HTML += "<br><a href='?src=\ref[src];user=\ref[user]'>\[Refresh\]</a> | "
|
HTML += "<html><head><title>[src.name]</title></head><body>"
|
||||||
HTML += "<a href='?src=\ref[src];user=\ref[user];rename=1'>\[Rename\]</a><br>"
|
HTML += "<br><a href='?src=\ref[src]'>\[Refresh\]</a> | "
|
||||||
|
HTML += "<a href='?src=\ref[src];rename=1'>\[Rename\]</a><br>"
|
||||||
HTML += "[total_parts]/[max_components] ([round((total_parts / max_components) * 100, 0.1)]%) space taken up in the assembly.<br>"
|
HTML += "[total_parts]/[max_components] ([round((total_parts / max_components) * 100, 0.1)]%) space taken up in the assembly.<br>"
|
||||||
HTML += "[total_complexity]/[max_complexity] ([round((total_complexity / max_complexity) * 100, 0.1)]%) maximum complexity."
|
HTML += "[total_complexity]/[max_complexity] ([round((total_complexity / max_complexity) * 100, 0.1)]%) maximum complexity."
|
||||||
HTML += "<br><br>"
|
HTML += "<br><br>"
|
||||||
HTML += "Components;<br>"
|
HTML += "Components;<br>"
|
||||||
for(var/obj/item/integrated_circuit/circuit in contents)
|
for(var/obj/item/integrated_circuit/circuit in contents)
|
||||||
HTML += "<a href=?src=\ref[circuit];examine=1;user=\ref[user]>[circuit.name]</a> | "
|
HTML += "<a href=?src=\ref[circuit];examine=1>[circuit.name]</a> | "
|
||||||
HTML += "<a href=?src=\ref[circuit];rename=1;user=\ref[user]>\[Rename\]</a>"
|
HTML += "<a href=?src=\ref[circuit];rename=1>\[Rename\]</a> | "
|
||||||
|
HTML += "<a href=?src=\ref[circuit];remove=1>\[Remove\]</a>"
|
||||||
HTML += "<br>"
|
HTML += "<br>"
|
||||||
|
|
||||||
HTML += "</body></html>"
|
HTML += "</body></html>"
|
||||||
user << browse(HTML, "window=assembly-\ref[src];size=600x350;border=1;can_resize=1;can_close=1;can_minimize=1")
|
user << browse(jointext(HTML,null), "window=assembly-\ref[src];size=600x350;border=1;can_resize=1;can_close=1;can_minimize=1")
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/Topic(href, href_list[])
|
/obj/item/device/electronic_assembly/Topic(href, href_list[])
|
||||||
var/mob/living/user = locate(href_list["user"]) in mob_list
|
|
||||||
|
|
||||||
if(..())
|
if(..())
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(!user.canmove || user.stat || user.restrained())
|
|
||||||
return
|
|
||||||
|
|
||||||
if(href_list["rename"])
|
if(href_list["rename"])
|
||||||
rename(user)
|
rename(usr)
|
||||||
|
|
||||||
interact(user) // To refresh the UI.
|
interact(usr) // To refresh the UI.
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/verb/rename()
|
/obj/item/device/electronic_assembly/verb/rename()
|
||||||
set name = "Rename Circuit"
|
set name = "Rename Circuit"
|
||||||
@@ -74,14 +71,12 @@
|
|||||||
set desc = "Rename your circuit, useful to stay organized."
|
set desc = "Rename your circuit, useful to stay organized."
|
||||||
|
|
||||||
var/mob/M = usr
|
var/mob/M = usr
|
||||||
|
if(!CanInteract(M, physical_state))
|
||||||
if(!M.canmove || M.stat || M.restrained())
|
|
||||||
return
|
return
|
||||||
|
|
||||||
var/input = sanitizeSafe(input("What do you want to name this?", "Rename", src.name), MAX_NAME_LEN)
|
var/input = sanitizeSafe(input("What do you want to name this?", "Rename", src.name) as null|text, MAX_NAME_LEN)
|
||||||
|
if(src && input && CanInteract(M, physical_state))
|
||||||
if(src && input)
|
to_chat(M, "<span class='notice'>The machine now has a label reading '[input]'.</span>")
|
||||||
M << "<span class='notice'>The machine now has a label reading '[input]'.</span>"
|
|
||||||
name = input
|
name = input
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/update_icon()
|
/obj/item/device/electronic_assembly/update_icon()
|
||||||
@@ -91,22 +86,18 @@
|
|||||||
icon_state = initial(icon_state)
|
icon_state = initial(icon_state)
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/examine(mob/user)
|
/obj/item/device/electronic_assembly/examine(mob/user)
|
||||||
..()
|
. = ..(user, 1)
|
||||||
if(user.Adjacent(src))
|
if(.)
|
||||||
if(!opened)
|
for(var/obj/item/integrated_circuit/output/screen/S in contents)
|
||||||
for(var/obj/item/integrated_circuit/output/screen/S in contents)
|
if(S.stuff_to_display)
|
||||||
if(S.stuff_to_display)
|
to_chat(user, "There's a little screen labeled '[S.name]', which displays '[S.stuff_to_display]'.")
|
||||||
user << "There's a little screen labeled '[S.name]', which displays '[S.stuff_to_display]'."
|
if(opened)
|
||||||
else
|
|
||||||
interact(user)
|
interact(user)
|
||||||
// var/obj/item/integrated_circuit/IC = input(user, "Which circuit do you want to examine?", "Examination") as null|anything in contents
|
|
||||||
// if(IC)
|
|
||||||
// IC.examine(user)
|
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user)
|
/obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user)
|
||||||
if(istype(I, /obj/item/integrated_circuit))
|
if(istype(I, /obj/item/integrated_circuit))
|
||||||
if(!opened)
|
if(!opened)
|
||||||
user << "<span class='warning'>\The [src] isn't opened, so you can't put anything inside. Try using a crowbar.</span>"
|
to_chat(user, "<span class='warning'>\The [src] isn't opened, so you can't put anything inside. Try using a crowbar.</span>")
|
||||||
return 0
|
return 0
|
||||||
var/obj/item/integrated_circuit/IC = I
|
var/obj/item/integrated_circuit/IC = I
|
||||||
var/total_parts = 0
|
var/total_parts = 0
|
||||||
@@ -115,54 +106,45 @@
|
|||||||
total_parts++
|
total_parts++
|
||||||
total_complexity = total_complexity + part.complexity
|
total_complexity = total_complexity + part.complexity
|
||||||
|
|
||||||
if( (total_parts + 1) >= max_components)
|
if( (total_parts + 1) > max_components)
|
||||||
user << "<span class='warning'>You can't seem to add this [IC.name], since there's no more room.</span>"
|
to_chat(user, "<span class='warning'>You can't seem to add this [IC.name], since there's no more room.</span>")
|
||||||
return 0
|
return 0
|
||||||
if( (total_complexity + IC.complexity) >= max_complexity)
|
if( (total_complexity + IC.complexity) > max_complexity)
|
||||||
user << "<span class='warning'>You can't seem to add this [IC.name], since this setup's too complicated for the case.</span>"
|
to_chat(user, "<span class='warning'>You can't seem to add this [IC.name], since this setup's too complicated for the case.</span>")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
user << "<span class='notice'>You slide \the [IC] inside \the [src].</span>"
|
to_chat(user, "<span class='notice'>You slide \the [IC] inside \the [src].</span>")
|
||||||
user.drop_item()
|
user.drop_item()
|
||||||
IC.forceMove(src)
|
IC.forceMove(src)
|
||||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||||
if(istype(I, /obj/item/weapon/screwdriver))
|
interact(user)
|
||||||
if(!opened)
|
else if(istype(I, /obj/item/weapon/crowbar))
|
||||||
user << "<span class='warning'>\The [src] isn't opened, so you can't remove anything inside. Try using a crowbar.</span>"
|
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||||
return 0
|
|
||||||
if(!contents.len)
|
|
||||||
user << "<span class='warning'>There's nothing inside this to remove!</span>"
|
|
||||||
return 0
|
|
||||||
var/obj/item/integrated_circuit/option = input("What do you want to remove?", "Component Removal") as null|anything in contents
|
|
||||||
if(option)
|
|
||||||
option.disconnect_all()
|
|
||||||
option.forceMove(get_turf(src))
|
|
||||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
|
||||||
user << "<span class='notice'>You pop \the [option] out of the case, and slide it out.</span>"
|
|
||||||
if(istype(I, /obj/item/weapon/crowbar))
|
|
||||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
|
||||||
opened = !opened
|
opened = !opened
|
||||||
user << "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>"
|
to_chat(user, "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>")
|
||||||
update_icon()
|
update_icon()
|
||||||
if(istype(I, /obj/item/device/integrated_electronics/wirer))
|
else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || istype(I, /obj/item/weapon/screwdriver))
|
||||||
if(opened)
|
if(opened)
|
||||||
var/obj/item/integrated_circuit/IC = input(user, "Which circuit do you want to examine?", "Examination") as null|anything in contents
|
interact(user)
|
||||||
if(IC)
|
|
||||||
IC.examine(user)
|
|
||||||
else
|
else
|
||||||
user << "<span class='warning'>\The [src] isn't opened, so you can't fiddle with the internal components. \
|
to_chat(user, "<span class='warning'>\The [src] isn't opened, so you can't fiddle with the internal components. \
|
||||||
Try using a crowbar.</span>"
|
Try using a crowbar.</span>")
|
||||||
|
else
|
||||||
|
return ..()
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/attack_self(mob/user)
|
/obj/item/device/electronic_assembly/attack_self(mob/user)
|
||||||
|
if(opened)
|
||||||
|
interact(user)
|
||||||
|
|
||||||
var/list/available_inputs = list()
|
var/list/available_inputs = list()
|
||||||
for(var/obj/item/integrated_circuit/input/input in contents)
|
for(var/obj/item/integrated_circuit/input/input in contents)
|
||||||
if(input.can_be_asked_input)
|
if(input.can_be_asked_input)
|
||||||
available_inputs.Add(input)
|
available_inputs.Add(input)
|
||||||
var/obj/item/integrated_circuit/input/choice = input(user, "What do you want to interact with?", "Interaction") as null|anything in available_inputs
|
var/obj/item/integrated_circuit/input/choice = input(user, "What do you want to interact with?", "Interaction") as null|anything in available_inputs
|
||||||
if(choice)
|
if(choice && CanInteract(user, physical_state))
|
||||||
choice.ask_for_input(user)
|
choice.ask_for_input(user)
|
||||||
|
|
||||||
/obj/item/device/electronic_assembly/emp_act(severity)
|
/obj/item/device/electronic_assembly/emp_act(severity)
|
||||||
..()
|
..()
|
||||||
for(var/atom/movable/AM in contents)
|
for(var/atom/movable/AM in contents)
|
||||||
AM.emp_act(severity)
|
AM.emp_act(severity)
|
||||||
@@ -1,133 +1,101 @@
|
|||||||
//These circuits convert one variable to another.
|
//These circuits convert one variable to another.
|
||||||
/obj/item/integrated_circuit/converter
|
/obj/item/integrated_circuit/converter
|
||||||
complexity = 2
|
complexity = 2
|
||||||
number_of_inputs = 1
|
inputs = list("input")
|
||||||
number_of_outputs = 1
|
outputs = list("output")
|
||||||
number_of_activators = 1
|
activators = list("convert")
|
||||||
input_names = list(
|
category = /obj/item/integrated_circuit/converter
|
||||||
"input",
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"result"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"convert"
|
|
||||||
)
|
|
||||||
|
|
||||||
/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."
|
||||||
icon_state = "num-string"
|
icon_state = "num-string"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/num2text/work()
|
/obj/item/integrated_circuit/converter/num2text/do_work()
|
||||||
if(..())
|
var/result = null
|
||||||
var/result = null
|
var/datum/integrated_io/incoming = inputs[1]
|
||||||
var/datum/integrated_io/incoming = inputs[1]
|
var/datum/integrated_io/outgoing = outputs[1]
|
||||||
var/datum/integrated_io/outgoing = outputs[1]
|
if(incoming.data && isnum(incoming.data))
|
||||||
if(incoming.data && isnum(incoming.data))
|
result = num2text(incoming.data)
|
||||||
result = num2text(incoming.data)
|
|
||||||
|
|
||||||
outgoing.data = result
|
outgoing.data = result
|
||||||
outgoing.push_data()
|
outgoing.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/text2num
|
/obj/item/integrated_circuit/converter/text2num
|
||||||
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"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/text2num/work()
|
/obj/item/integrated_circuit/converter/text2num/do_work()
|
||||||
if(..())
|
var/result = null
|
||||||
var/result = null
|
var/datum/integrated_io/incoming = inputs[1]
|
||||||
var/datum/integrated_io/incoming = inputs[1]
|
var/datum/integrated_io/outgoing = outputs[1]
|
||||||
var/datum/integrated_io/outgoing = outputs[1]
|
if(incoming.data && istext(incoming.data))
|
||||||
if(incoming.data && istext(incoming.data))
|
result = text2num(incoming.data)
|
||||||
result = text2num(incoming.data)
|
|
||||||
|
|
||||||
outgoing.data = result
|
outgoing.data = result
|
||||||
outgoing.push_data()
|
outgoing.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/ref2text
|
/obj/item/integrated_circuit/converter/ref2text
|
||||||
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"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/ref2text/work()
|
/obj/item/integrated_circuit/converter/ref2text/do_work()
|
||||||
if(..())
|
var/result = null
|
||||||
var/result = null
|
var/datum/integrated_io/incoming = inputs[1]
|
||||||
var/datum/integrated_io/incoming = inputs[1]
|
var/datum/integrated_io/outgoing = outputs[1]
|
||||||
var/datum/integrated_io/outgoing = outputs[1]
|
var/atom/A = incoming.data_as_type(/atom)
|
||||||
if(incoming.data && istype(incoming.data, /atom/))
|
result = A && A.name
|
||||||
var/atom/A = incoming.data
|
|
||||||
result = A.name
|
|
||||||
|
|
||||||
outgoing.data = result
|
outgoing.data = result
|
||||||
outgoing.push_data()
|
outgoing.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/lowercase
|
/obj/item/integrated_circuit/converter/lowercase
|
||||||
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"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/lowercase/work()
|
/obj/item/integrated_circuit/converter/lowercase/do_work()
|
||||||
if(..())
|
var/result = null
|
||||||
var/result = null
|
var/datum/integrated_io/incoming = inputs[1]
|
||||||
var/datum/integrated_io/incoming = inputs[1]
|
var/datum/integrated_io/outgoing = outputs[1]
|
||||||
var/datum/integrated_io/outgoing = outputs[1]
|
if(incoming.data && istext(incoming.data))
|
||||||
if(incoming.data && istext(incoming.data))
|
result = lowertext(incoming.data)
|
||||||
result = lowertext(incoming.data)
|
|
||||||
|
|
||||||
outgoing.data = result
|
outgoing.data = result
|
||||||
outgoing.push_data()
|
outgoing.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/uppercase
|
/obj/item/integrated_circuit/converter/uppercase
|
||||||
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"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/uppercase/work()
|
/obj/item/integrated_circuit/converter/uppercase/do_work()
|
||||||
if(..())
|
var/result = null
|
||||||
var/result = null
|
var/datum/integrated_io/incoming = inputs[1]
|
||||||
var/datum/integrated_io/incoming = inputs[1]
|
var/datum/integrated_io/outgoing = outputs[1]
|
||||||
var/datum/integrated_io/outgoing = outputs[1]
|
if(incoming.data && istext(incoming.data))
|
||||||
if(incoming.data && istext(incoming.data))
|
result = uppertext(incoming.data)
|
||||||
result = uppertext(incoming.data)
|
|
||||||
|
|
||||||
outgoing.data = result
|
outgoing.data = result
|
||||||
outgoing.push_data()
|
outgoing.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/concatenatior
|
/obj/item/integrated_circuit/converter/concatenatior
|
||||||
name = "concatenatior"
|
name = "concatenatior"
|
||||||
desc = "This joins many strings together to get one big string."
|
desc = "This joins many strings together to get one big string."
|
||||||
complexity = 4
|
complexity = 4
|
||||||
number_of_inputs = 8
|
inputs = list("A","B","C","D","E","F","G","H")
|
||||||
number_of_outputs = 1
|
outputs = list("result")
|
||||||
number_of_activators = 1
|
activators = list("concatenate")
|
||||||
input_names = list(
|
|
||||||
"A",
|
|
||||||
"B",
|
|
||||||
"C",
|
|
||||||
"D",
|
|
||||||
"E",
|
|
||||||
"F",
|
|
||||||
"G",
|
|
||||||
"H"
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"result"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"concatenate"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/converter/concatenatior/do_work()
|
||||||
|
var/result = null
|
||||||
|
for(var/datum/integrated_io/input/I in inputs)
|
||||||
|
I.pull_data()
|
||||||
|
if(istext(I.data))
|
||||||
|
result = result + I.data
|
||||||
|
|
||||||
/obj/item/integrated_circuit/converter/concatenatior/work()
|
var/datum/integrated_io/outgoing = outputs[1]
|
||||||
if(..())
|
outgoing.data = result
|
||||||
var/result = null
|
outgoing.push_data()
|
||||||
for(var/datum/integrated_io/input/I in inputs)
|
|
||||||
I.pull_data()
|
|
||||||
if(istext(I.data))
|
|
||||||
result = result + I.data
|
|
||||||
|
|
||||||
var/datum/integrated_io/outgoing = outputs[1]
|
|
||||||
outgoing.data = result
|
|
||||||
outgoing.push_data()
|
|
||||||
@@ -4,58 +4,35 @@
|
|||||||
desc = "This allows you to easily know the position of a machine containing this device."
|
desc = "This allows you to easily know the position of a machine containing this device."
|
||||||
icon_state = "gps"
|
icon_state = "gps"
|
||||||
complexity = 4
|
complexity = 4
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 2
|
outputs = list("X (abs)", "Y (abs)")
|
||||||
number_of_activators = 1
|
activators = list("get coordinates")
|
||||||
input_names = list(
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"X (abs)",
|
|
||||||
"Y (abs)"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"get coordinates"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/gps/work()
|
/obj/item/integrated_circuit/gps/do_work()
|
||||||
if(..())
|
var/turf/T = get_turf(src)
|
||||||
var/turf/T = get_turf(src)
|
var/datum/integrated_io/result_x = outputs[1]
|
||||||
var/datum/integrated_io/result_x = outputs[1]
|
var/datum/integrated_io/result_y = outputs[2]
|
||||||
var/datum/integrated_io/result_y = outputs[2]
|
|
||||||
|
|
||||||
result_x.data = null
|
result_x.data = null
|
||||||
result_y.data = null
|
result_y.data = null
|
||||||
if(!T)
|
if(!T)
|
||||||
return
|
return
|
||||||
|
|
||||||
result_x.data = T.x
|
result_x.data = T.x
|
||||||
result_y.data = T.y
|
result_y.data = T.y
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/abs_to_rel_coords
|
/obj/item/integrated_circuit/abs_to_rel_coords
|
||||||
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
|
||||||
number_of_inputs = 4
|
inputs = list("X1 (abs)", "Y1 (abs)", "X2 (abs)", "Y2 (abs)")
|
||||||
number_of_outputs = 2
|
outputs = list("X (rel)", "Y (rel)")
|
||||||
number_of_activators = 1
|
activators = list("compute rel coordinates")
|
||||||
input_names = list(
|
|
||||||
"X1 (abs)",
|
|
||||||
"Y1 (abs)",
|
|
||||||
"X2 (abs)",
|
|
||||||
"Y2 (abs)"
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"X (rel)",
|
|
||||||
"Y (rel)"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"compute rel coordinates"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/abs_to_rel_coords/work()
|
/obj/item/integrated_circuit/abs_to_rel_coords/do_work()
|
||||||
var/datum/integrated_io/x1 = inputs[1]
|
var/datum/integrated_io/x1 = inputs[1]
|
||||||
var/datum/integrated_io/y1 = inputs[2]
|
var/datum/integrated_io/y1 = inputs[2]
|
||||||
|
|
||||||
@@ -69,7 +46,5 @@
|
|||||||
result_x.data = x1.data - x2.data
|
result_x.data = x1.data - x2.data
|
||||||
result_y.data = y1.data - y2.data
|
result_y.data = y1.data - y2.data
|
||||||
|
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.push_data()
|
O.push_data()
|
||||||
..()
|
|
||||||
@@ -3,49 +3,62 @@
|
|||||||
desc = "Splits incoming data into all of the output pins."
|
desc = "Splits incoming data into all of the output pins."
|
||||||
icon_state = "splitter"
|
icon_state = "splitter"
|
||||||
complexity = 3
|
complexity = 3
|
||||||
number_of_inputs = 1
|
inputs = list("data to split")
|
||||||
number_of_outputs = 2
|
outputs = list("A","B")
|
||||||
input_names = list(
|
|
||||||
"data to split"
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"A",
|
|
||||||
"B",
|
|
||||||
"C",
|
|
||||||
"D",
|
|
||||||
"E",
|
|
||||||
"F",
|
|
||||||
"G",
|
|
||||||
"H"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/splitter/medium
|
/obj/item/integrated_circuit/transfer/splitter/medium
|
||||||
name = "four splitter"
|
name = "four splitter"
|
||||||
icon_state = "splitter4"
|
icon_state = "splitter4"
|
||||||
complexity = 5
|
complexity = 5
|
||||||
number_of_inputs = 1
|
outputs = list("A","B","C","D")
|
||||||
number_of_outputs = 4
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/splitter/large
|
/obj/item/integrated_circuit/transfer/splitter/large
|
||||||
name = "eight splitter"
|
name = "eight splitter"
|
||||||
icon_state = "splitter8"
|
icon_state = "splitter8"
|
||||||
complexity = 9
|
complexity = 9
|
||||||
number_of_inputs = 1
|
outputs = list("A","B","C","D","E","F","G","H")
|
||||||
number_of_outputs = 8
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/splitter/work()
|
/obj/item/integrated_circuit/transfer/splitter/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/I = inputs[1]
|
||||||
var/datum/integrated_io/I = inputs[1]
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
O.data = I.data
|
||||||
O.data = I.data
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/activator_splitter
|
/obj/item/integrated_circuit/transfer/activator_splitter
|
||||||
name = "activator splitter"
|
name = "activator splitter"
|
||||||
desc = "Splits incoming activation pulses into all of the output pins."
|
desc = "Splits incoming activation pulses into all of the output pins."
|
||||||
icon_state = "splitter"
|
icon_state = "splitter"
|
||||||
complexity = 3
|
complexity = 3
|
||||||
number_of_activators = 3
|
activators = list(
|
||||||
activator_names = list(
|
"incoming pulse",
|
||||||
|
"outgoing pulse A",
|
||||||
|
"outgoing pulse B"
|
||||||
|
)
|
||||||
|
|
||||||
|
/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(
|
||||||
|
"incoming pulse",
|
||||||
|
"outgoing pulse A",
|
||||||
|
"outgoing pulse B",
|
||||||
|
"outgoing pulse C",
|
||||||
|
"outgoing pulse D"
|
||||||
|
)
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/transfer/activator_splitter/large
|
||||||
|
name = "eight activator splitter"
|
||||||
|
icon_state = "splitter4"
|
||||||
|
complexity = 9
|
||||||
|
activators = list(
|
||||||
"incoming pulse",
|
"incoming pulse",
|
||||||
"outgoing pulse A",
|
"outgoing pulse A",
|
||||||
"outgoing pulse B",
|
"outgoing pulse B",
|
||||||
@@ -55,25 +68,4 @@
|
|||||||
"outgoing pulse F",
|
"outgoing pulse F",
|
||||||
"outgoing pulse G",
|
"outgoing pulse G",
|
||||||
"outgoing pulse H"
|
"outgoing pulse H"
|
||||||
)
|
)
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/activator_splitter/work()
|
|
||||||
if(..())
|
|
||||||
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.work()
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/activator_splitter/medium
|
|
||||||
name = "four activator splitter"
|
|
||||||
icon_state = "splitter4"
|
|
||||||
complexity = 5
|
|
||||||
number_of_activators = 5
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/transfer/activator_splitter/large
|
|
||||||
name = "eight activator splitter"
|
|
||||||
icon_state = "splitter4"
|
|
||||||
complexity = 9
|
|
||||||
number_of_activators = 9
|
|
||||||
@@ -8,41 +8,32 @@
|
|||||||
name = "button"
|
name = "button"
|
||||||
desc = "This tiny button must do something, right?"
|
desc = "This tiny button must do something, right?"
|
||||||
icon_state = "button"
|
icon_state = "button"
|
||||||
number_of_inputs = 0
|
|
||||||
number_of_outputs = 0
|
|
||||||
number_of_activators = 1
|
|
||||||
complexity = 1
|
complexity = 1
|
||||||
can_be_asked_input = 1
|
can_be_asked_input = 1
|
||||||
activator_names = list(
|
inputs = list()
|
||||||
"on pressed"
|
outputs = list()
|
||||||
)
|
activators = list("on pressed")
|
||||||
|
|
||||||
/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.
|
||||||
var/datum/integrated_io/A = activators[1]
|
var/datum/integrated_io/A = activators[1]
|
||||||
if(A.linked.len)
|
if(A.linked.len)
|
||||||
for(var/datum/integrated_io/activate/target in A.linked)
|
for(var/datum/integrated_io/activate/target in A.linked)
|
||||||
target.holder.work()
|
target.holder.check_then_do_work()
|
||||||
user << "<span class='notice'>You press the button labeled '[src.name]'.</span>"
|
to_chat(user, "<span class='notice'>You press the button labeled '[src.name]'.</span>")
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/numberpad
|
/obj/item/integrated_circuit/input/numberpad
|
||||||
name = "number pad"
|
name = "number pad"
|
||||||
desc = "This small number pad allows someone to input a number into the system."
|
desc = "This small number pad allows someone to input a number into the system."
|
||||||
icon_state = "numberpad"
|
icon_state = "numberpad"
|
||||||
number_of_inputs = 0
|
|
||||||
number_of_outputs = 1
|
|
||||||
number_of_activators = 1
|
|
||||||
complexity = 2
|
complexity = 2
|
||||||
can_be_asked_input = 1
|
can_be_asked_input = 1
|
||||||
output_names = list(
|
inputs = list()
|
||||||
"number entered"
|
outputs = list("number entered")
|
||||||
)
|
activators = list("on entered")
|
||||||
activator_names = list(
|
|
||||||
"on entered"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user)
|
/obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user)
|
||||||
var/new_input = input(user, "Enter a number, please.","Number pad") as null|num
|
var/new_input = input(user, "Enter a number, please.","Number pad") as null|num
|
||||||
if(isnum(new_input))
|
if(isnum(new_input) && CanInteract(user, physical_state))
|
||||||
var/datum/integrated_io/O = outputs[1]
|
var/datum/integrated_io/O = outputs[1]
|
||||||
O.data = new_input
|
O.data = new_input
|
||||||
O.push_data()
|
O.push_data()
|
||||||
@@ -53,21 +44,15 @@
|
|||||||
name = "text pad"
|
name = "text pad"
|
||||||
desc = "This small text pad allows someone to input a string into the system."
|
desc = "This small text pad allows someone to input a string into the system."
|
||||||
icon_state = "textpad"
|
icon_state = "textpad"
|
||||||
number_of_inputs = 0
|
|
||||||
number_of_outputs = 1
|
|
||||||
number_of_activators = 1
|
|
||||||
complexity = 2
|
complexity = 2
|
||||||
can_be_asked_input = 1
|
can_be_asked_input = 1
|
||||||
output_names = list(
|
inputs = list()
|
||||||
"string entered"
|
outputs = list("string entered")
|
||||||
)
|
activators = list("on entered")
|
||||||
activator_names = list(
|
|
||||||
"on entered"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
|
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
|
||||||
var/new_input = input(user, "Enter some words, please.","Number pad") as null|text
|
var/new_input = input(user, "Enter some words, please.","Number pad") as null|text
|
||||||
if(new_input && istext(new_input))
|
if(istext(new_input) && CanInteract(user, physical_state))
|
||||||
var/datum/integrated_io/O = outputs[1]
|
var/datum/integrated_io/O = outputs[1]
|
||||||
O.data = new_input
|
O.data = new_input
|
||||||
O.push_data()
|
O.push_data()
|
||||||
@@ -78,53 +63,37 @@
|
|||||||
name = "integrated medical analyser"
|
name = "integrated medical analyser"
|
||||||
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is."
|
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is."
|
||||||
icon_state = "medscan"
|
icon_state = "medscan"
|
||||||
number_of_inputs = 1
|
|
||||||
number_of_outputs = 2
|
|
||||||
number_of_activators = 1
|
|
||||||
complexity = 4
|
complexity = 4
|
||||||
input_names = list(
|
inputs = list("target ref")
|
||||||
"target ref"
|
outputs = list("total health %", "total missing health")
|
||||||
)
|
activators = list("scan")
|
||||||
output_names = list(
|
|
||||||
"total health %",
|
|
||||||
"total missing health"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"scan"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/med_scanner/work()
|
/obj/item/integrated_circuit/input/med_scanner/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/I = inputs[1]
|
||||||
var/datum/integrated_io/I = inputs[1]
|
var/mob/living/carbon/human/H = I.data_as_type(/mob/living/carbon/human)
|
||||||
if(!I.data || !ishuman(I.data)) //Invalid input
|
if(!istype(H)) //Invalid input
|
||||||
return
|
return
|
||||||
var/mob/living/carbon/human/H = I.data
|
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.maxHealth, 0.1)*100
|
||||||
var/total_health = round(H.health/H.maxHealth, 0.1)*100
|
var/missing_health = H.maxHealth - H.health
|
||||||
var/missing_health = H.maxHealth - H.health
|
|
||||||
|
|
||||||
var/datum/integrated_io/total = outputs[1]
|
var/datum/integrated_io/total = outputs[1]
|
||||||
var/datum/integrated_io/missing = outputs[2]
|
var/datum/integrated_io/missing = outputs[2]
|
||||||
|
|
||||||
total.data = total_health
|
total.data = total_health
|
||||||
missing.data = missing_health
|
missing.data = missing_health
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/adv_med_scanner
|
/obj/item/integrated_circuit/input/adv_med_scanner
|
||||||
name = "integrated advanced medical analyser"
|
name = "integrated advanced medical analyser"
|
||||||
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is. \
|
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is. \
|
||||||
This type is much more precise, allowing the machine to know much more about the target than a normal analyzer."
|
This type is much more precise, allowing the machine to know much more about the target than a normal analyzer."
|
||||||
icon_state = "medscan_adv"
|
icon_state = "medscan_adv"
|
||||||
number_of_inputs = 1
|
|
||||||
number_of_outputs = 7
|
|
||||||
number_of_activators = 1
|
|
||||||
complexity = 12
|
complexity = 12
|
||||||
input_names = list(
|
inputs = list("target ref")
|
||||||
"target ref"
|
outputs = list(
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"total health %",
|
"total health %",
|
||||||
"total missing health",
|
"total missing health",
|
||||||
"brute damage",
|
"brute damage",
|
||||||
@@ -133,68 +102,53 @@
|
|||||||
"oxy damage",
|
"oxy damage",
|
||||||
"clone damage"
|
"clone damage"
|
||||||
)
|
)
|
||||||
activator_names = list(
|
activators = list("scan")
|
||||||
"scan"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/adv_med_scanner/work()
|
/obj/item/integrated_circuit/input/adv_med_scanner/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/I = inputs[1]
|
||||||
var/datum/integrated_io/I = inputs[1]
|
var/mob/living/carbon/human/H = I.data_as_type(/mob/living/carbon/human)
|
||||||
if(!I.data || !ishuman(I.data)) //Invalid input
|
if(!istype(H)) //Invalid input
|
||||||
return
|
return
|
||||||
var/mob/living/carbon/human/H = I.data
|
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.maxHealth, 0.1)*100
|
||||||
var/total_health = round(H.health/H.maxHealth, 0.1)*100
|
var/missing_health = H.maxHealth - H.health
|
||||||
var/missing_health = H.maxHealth - H.health
|
|
||||||
|
|
||||||
var/datum/integrated_io/total = outputs[1]
|
var/datum/integrated_io/total = outputs[1]
|
||||||
var/datum/integrated_io/missing = outputs[2]
|
var/datum/integrated_io/missing = outputs[2]
|
||||||
var/datum/integrated_io/brute = outputs[3]
|
var/datum/integrated_io/brute = outputs[3]
|
||||||
var/datum/integrated_io/burn = outputs[4]
|
var/datum/integrated_io/burn = outputs[4]
|
||||||
var/datum/integrated_io/tox = outputs[5]
|
var/datum/integrated_io/tox = outputs[5]
|
||||||
var/datum/integrated_io/oxy = outputs[6]
|
var/datum/integrated_io/oxy = outputs[6]
|
||||||
var/datum/integrated_io/clone = outputs[7]
|
var/datum/integrated_io/clone = outputs[7]
|
||||||
|
|
||||||
total.data = total_health
|
total.data = total_health
|
||||||
missing.data = missing_health
|
missing.data = missing_health
|
||||||
brute.data = H.getBruteLoss()
|
brute.data = H.getBruteLoss()
|
||||||
burn.data = H.getFireLoss()
|
burn.data = H.getFireLoss()
|
||||||
tox.data = H.getToxLoss()
|
tox.data = H.getToxLoss()
|
||||||
oxy.data = H.getOxyLoss()
|
oxy.data = H.getOxyLoss()
|
||||||
clone.data = H.getCloneLoss()
|
clone.data = H.getCloneLoss()
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/local_locator
|
/obj/item/integrated_circuit/input/local_locator
|
||||||
name = "local locator"
|
name = "local locator"
|
||||||
desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \
|
desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \
|
||||||
that is holding the machine containing it."
|
that is holding the machine containing it."
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 1
|
outputs = list("located ref")
|
||||||
number_of_activators = 1
|
activators = list("locate")
|
||||||
complexity = 4
|
|
||||||
output_names = list(
|
|
||||||
"located ref"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"locate"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/local_locator/work()
|
/obj/item/integrated_circuit/input/local_locator/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/O = outputs[1]
|
||||||
var/mob/living/L = null
|
O.data = null
|
||||||
var/datum/integrated_io/O = outputs[1]
|
if(istype(src.loc, /obj/item/device/electronic_assembly)) // Check to make sure we're actually in a machine.
|
||||||
O.data = null
|
var/obj/item/device/electronic_assembly/assembly = src.loc
|
||||||
if(istype(src.loc, /obj/item/device/electronic_assembly)) // Check to make sure we're actually in a machine.
|
if(istype(assembly.loc, /mob/living)) // Now check if someone's holding us.
|
||||||
var/obj/item/device/electronic_assembly/assembly = src.loc
|
O.data = weakref(assembly.loc)
|
||||||
if(istype(assembly.loc, /mob/living)) // Now check if someone's holding us.
|
|
||||||
L = assembly.loc
|
|
||||||
|
|
||||||
if(L)
|
O.push_data()
|
||||||
O.data = L
|
|
||||||
|
|
||||||
O.push_data()
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/signaler
|
/obj/item/integrated_circuit/input/signaler
|
||||||
name = "integrated signaler"
|
name = "integrated signaler"
|
||||||
@@ -203,37 +157,29 @@
|
|||||||
The two input pins are to configure the integrated signaler's settings. Note that the frequency should not have a decimal in it. \
|
The two input pins are to configure the integrated signaler's settings. Note that the frequency should not have a decimal in it. \
|
||||||
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"
|
||||||
number_of_inputs = 2
|
|
||||||
number_of_outputs = 0
|
|
||||||
number_of_activators = 2
|
|
||||||
complexity = 4
|
complexity = 4
|
||||||
input_names = list(
|
inputs = list("frequency","code")
|
||||||
"frequency",
|
outputs = list()
|
||||||
"code"
|
activators = list("send signal","on signal received")
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"send signal",
|
|
||||||
"on signal received"
|
|
||||||
)
|
|
||||||
var/frequency = 1457
|
var/frequency = 1457
|
||||||
var/code = 30
|
var/code = 30
|
||||||
var/datum/radio_frequency/radio_connection
|
var/datum/radio_frequency/radio_connection
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/signaler/New()
|
/obj/item/integrated_circuit/input/signaler/initialize()
|
||||||
..()
|
..()
|
||||||
spawn(4 SECONDS)
|
set_frequency(frequency)
|
||||||
set_frequency(frequency)
|
var/datum/integrated_io/new_freq = inputs[1]
|
||||||
var/datum/integrated_io/new_freq = inputs[1]
|
var/datum/integrated_io/new_code = inputs[2]
|
||||||
var/datum/integrated_io/new_code = inputs[2]
|
// Set the pins so when someone sees them, they won't show as null
|
||||||
// Set the pins so when someone sees them, they won't show as null
|
new_freq.data = frequency
|
||||||
new_freq.data = frequency
|
new_code.data = code
|
||||||
new_code.data = code
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/signaler/Destroy()
|
/obj/item/integrated_circuit/input/signaler/Destroy()
|
||||||
if(radio_controller)
|
if(radio_controller)
|
||||||
radio_controller.remove_object(src,frequency)
|
radio_controller.remove_object(src,frequency)
|
||||||
frequency = 0
|
frequency = 0
|
||||||
..()
|
. = ..()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/signaler/on_data_written()
|
/obj/item/integrated_circuit/input/signaler/on_data_written()
|
||||||
var/datum/integrated_io/new_freq = inputs[1]
|
var/datum/integrated_io/new_freq = inputs[1]
|
||||||
@@ -244,16 +190,15 @@
|
|||||||
code = new_code.data
|
code = new_code.data
|
||||||
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/signaler/work() // Sends a signal.
|
/obj/item/integrated_circuit/input/signaler/do_work() // Sends a signal.
|
||||||
if(..())
|
if(!radio_connection)
|
||||||
if(!radio_connection)
|
return
|
||||||
return
|
|
||||||
|
|
||||||
var/datum/signal/signal = new()
|
var/datum/signal/signal = new()
|
||||||
signal.source = src
|
signal.source = src
|
||||||
signal.encryption = code
|
signal.encryption = code
|
||||||
signal.data["message"] = "ACTIVATE"
|
signal.data["message"] = "ACTIVATE"
|
||||||
radio_connection.post_signal(src, signal)
|
radio_connection.post_signal(src, signal)
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/signaler/proc/set_frequency(new_frequency)
|
/obj/item/integrated_circuit/input/signaler/proc/set_frequency(new_frequency)
|
||||||
if(!frequency)
|
if(!frequency)
|
||||||
@@ -282,10 +227,9 @@
|
|||||||
var/datum/integrated_io/A = activators[2]
|
var/datum/integrated_io/A = activators[2]
|
||||||
A.push_data()
|
A.push_data()
|
||||||
|
|
||||||
for(var/mob/O in hearers(1, src.loc))
|
for(var/mob/O in hearers(1, get_turf(src)))
|
||||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||||
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/EPv2
|
/obj/item/integrated_circuit/input/EPv2
|
||||||
name = "\improper EPv2 circuit"
|
name = "\improper EPv2 circuit"
|
||||||
desc = "Enables the sending and receiving of messages on the Exonet with the EPv2 protocol."
|
desc = "Enables the sending and receiving of messages on the Exonet with the EPv2 protocol."
|
||||||
@@ -293,31 +237,17 @@
|
|||||||
second pin on each side, with additonal data reserved for the third pin. When a message is received, the second activaiton pin \
|
second pin on each side, with additonal data reserved for the third pin. When a message is received, the second activaiton pin \
|
||||||
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"
|
||||||
number_of_inputs = 3
|
|
||||||
number_of_outputs = 3
|
|
||||||
number_of_activators = 2
|
|
||||||
complexity = 4
|
complexity = 4
|
||||||
input_names = list(
|
inputs = list("target EPv2 address", "data to send", "secondary text")
|
||||||
"target EPv2 address",
|
outputs = list("address received", "data received", "secondary text received")
|
||||||
"data to send",
|
activators = list("send data", "on data received")
|
||||||
"secondary text"
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"address received",
|
|
||||||
"data received",
|
|
||||||
"secondary text received"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"send data",
|
|
||||||
"on data received"
|
|
||||||
)
|
|
||||||
var/datum/exonet_protocol/exonet = null
|
var/datum/exonet_protocol/exonet = null
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/EPv2/New()
|
/obj/item/integrated_circuit/input/EPv2/New()
|
||||||
..()
|
..()
|
||||||
exonet = new(src)
|
exonet = new(src)
|
||||||
exonet.make_address("EPv2_circuit-\ref[src]")
|
exonet.make_address("EPv2_circuit-\ref[src]")
|
||||||
desc += "This circuit's EPv2 address is: [exonet.address]."
|
desc += "<br>This circuit's EPv2 address is: [exonet.address]."
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/EPv2/Destroy()
|
/obj/item/integrated_circuit/input/EPv2/Destroy()
|
||||||
if(exonet)
|
if(exonet)
|
||||||
@@ -325,13 +255,12 @@
|
|||||||
qdel(exonet)
|
qdel(exonet)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/EPv2/work()
|
/obj/item/integrated_circuit/input/EPv2/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/target_address = inputs[1]
|
||||||
var/datum/integrated_io/target_address = inputs[1]
|
var/datum/integrated_io/message = inputs[2]
|
||||||
var/datum/integrated_io/message = inputs[2]
|
var/datum/integrated_io/text = inputs[3]
|
||||||
var/datum/integrated_io/text = inputs[3]
|
if(istext(target_address.data))
|
||||||
if(istext(target_address.data))
|
exonet.send_message(target_address.data, message.data, text.data)
|
||||||
exonet.send_message(target_address.data, message.data, text.data)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/receive_exonet_message(var/atom/origin_atom, var/origin_address, var/message, var/text)
|
/obj/item/integrated_circuit/input/receive_exonet_message(var/atom/origin_atom, var/origin_address, var/message, var/text)
|
||||||
var/datum/integrated_io/message_received = outputs[1]
|
var/datum/integrated_io/message_received = outputs[1]
|
||||||
@@ -349,42 +278,35 @@
|
|||||||
name = "screen"
|
name = "screen"
|
||||||
desc = "This small screen can display a single piece of data, when the machine is examined closely."
|
desc = "This small screen can display a single piece of data, when the machine is examined closely."
|
||||||
icon_state = "screen"
|
icon_state = "screen"
|
||||||
complexity = 4
|
inputs = list("displayed data")
|
||||||
number_of_inputs = 1
|
outputs = list()
|
||||||
number_of_outputs = 0
|
activators = list("load data")
|
||||||
number_of_activators = 1
|
|
||||||
input_names = list(
|
|
||||||
"displayed data"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"load data"
|
|
||||||
)
|
|
||||||
var/stuff_to_display = null
|
var/stuff_to_display = null
|
||||||
|
|
||||||
/obj/item/integrated_circuit/output/screen/work()
|
/obj/item/integrated_circuit/output/screen/do_work()
|
||||||
var/datum/integrated_io/I = inputs[1]
|
var/datum/integrated_io/I = inputs[1]
|
||||||
stuff_to_display = I.data
|
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/light
|
/obj/item/integrated_circuit/output/light
|
||||||
name = "light"
|
name = "light"
|
||||||
desc = "This light can turn on and off on command."
|
desc = "This light can turn on and off on command."
|
||||||
icon_state = "light_adv"
|
icon_state = "light_adv"
|
||||||
// icon_state = "light"
|
|
||||||
complexity = 4
|
complexity = 4
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 0
|
outputs = list()
|
||||||
number_of_activators = 1
|
activators = list("toggle light")
|
||||||
activator_names = list(
|
|
||||||
"toggle light"
|
|
||||||
)
|
|
||||||
var/light_toggled = 0
|
var/light_toggled = 0
|
||||||
var/light_brightness = 3
|
var/light_brightness = 3
|
||||||
var/light_rgb = "#FFFFFF"
|
var/light_rgb = "#FFFFFF"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/output/light/work()
|
/obj/item/integrated_circuit/output/light/do_work()
|
||||||
if(..())
|
light_toggled = !light_toggled
|
||||||
light_toggled = !light_toggled
|
update_lighting()
|
||||||
update_lighting()
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/output/light/proc/update_lighting()
|
/obj/item/integrated_circuit/output/light/proc/update_lighting()
|
||||||
if(light_toggled)
|
if(light_toggled)
|
||||||
@@ -413,15 +335,13 @@
|
|||||||
desc = "This light can turn on and off on command, in any color, and in various brightness levels."
|
desc = "This light can turn on and off on command, in any color, and in various brightness levels."
|
||||||
icon_state = "light_adv"
|
icon_state = "light_adv"
|
||||||
complexity = 8
|
complexity = 8
|
||||||
number_of_inputs = 4
|
inputs = list(
|
||||||
number_of_outputs = 0
|
|
||||||
number_of_activators = 1
|
|
||||||
input_names = list(
|
|
||||||
"R",
|
"R",
|
||||||
"G",
|
"G",
|
||||||
"B",
|
"B",
|
||||||
"Brightness"
|
"Brightness"
|
||||||
)
|
)
|
||||||
|
outputs = list()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/output/light/advanced/on_data_written()
|
/obj/item/integrated_circuit/output/light/advanced/on_data_written()
|
||||||
update_lighting()
|
update_lighting()
|
||||||
@@ -432,38 +352,43 @@
|
|||||||
icon_state = "speaker"
|
icon_state = "speaker"
|
||||||
complexity = 8
|
complexity = 8
|
||||||
cooldown_per_use = 4 SECONDS
|
cooldown_per_use = 4 SECONDS
|
||||||
number_of_inputs = 3
|
inputs = list(
|
||||||
number_of_outputs = 0
|
|
||||||
number_of_activators = 1
|
|
||||||
input_names = list(
|
|
||||||
"sound ID",
|
"sound ID",
|
||||||
"volume",
|
"volume",
|
||||||
"frequency"
|
"frequency"
|
||||||
)
|
)
|
||||||
activator_names = list(
|
outputs = list()
|
||||||
"play sound"
|
activators = list("play sound")
|
||||||
)
|
|
||||||
var/list/sounds = list()
|
var/list/sounds = list()
|
||||||
|
category = /obj/item/integrated_circuit/output/sound
|
||||||
|
|
||||||
/obj/item/integrated_circuit/output/sound/work()
|
/obj/item/integrated_circuit/output/sound/New()
|
||||||
if(..())
|
..()
|
||||||
var/datum/integrated_io/ID = inputs[1]
|
extended_desc = list()
|
||||||
var/datum/integrated_io/vol = inputs[2]
|
extended_desc += "The first input pin determines which sound is used. The choices are; "
|
||||||
var/datum/integrated_io/frequency = inputs[3]
|
extended_desc += jointext(sounds, ", ")
|
||||||
if(istext(ID.data) && isnum(vol.data) && isnum(frequency.data))
|
extended_desc += ". The second pin determines the volume of sound that is played"
|
||||||
var/selected_sound = sounds[ID.data]
|
extended_desc += ", and the third determines if the frequency of the sound will vary with each activation."
|
||||||
vol.data = Clamp(vol.data, 0, 1)
|
extended_desc = jointext(extended_desc, null)
|
||||||
frequency.data = Clamp(frequency.data, 0, 100)
|
|
||||||
playsound(get_turf(src), selected_sound, vol.data, frequency.data, -1)
|
/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)
|
||||||
|
world << "No 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
|
/obj/item/integrated_circuit/output/sound/beeper
|
||||||
name = "beeper circuit"
|
name = "beeper circuit"
|
||||||
desc = "A miniature speaker is attached to this component. This is often used in the construction of motherboards, which use \
|
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 \
|
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."
|
as buzzing, pinging, chiming, and more."
|
||||||
extended_desc = "The first input pin determines what sound is used. The choices are; beep, chime, buzz sigh, buzz twice, ping, \
|
|
||||||
synth yes, synth no, warning buzz. The second pin determines the volume of sound that is played, and the third determines if \
|
|
||||||
the frequency of the sound will vary with each activation."
|
|
||||||
sounds = list(
|
sounds = list(
|
||||||
"beep" = 'sound/machines/twobeep.ogg',
|
"beep" = 'sound/machines/twobeep.ogg',
|
||||||
"chime" = 'sound/machines/chime.ogg',
|
"chime" = 'sound/machines/chime.ogg',
|
||||||
@@ -478,9 +403,6 @@
|
|||||||
/obj/item/integrated_circuit/output/sound/beepsky
|
/obj/item/integrated_circuit/output/sound/beepsky
|
||||||
name = "securitron sound circuit"
|
name = "securitron sound circuit"
|
||||||
desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron."
|
desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron."
|
||||||
extended_desc = "The first input pin determines what sound is used. The choices are; creep, criminal, freeze, god, \
|
|
||||||
i am the law, insult, radio, secure day. The second pin determines the volume of sound that is played, and the \
|
|
||||||
third determines if the frequency of the sound will vary with each activation."
|
|
||||||
sounds = list(
|
sounds = list(
|
||||||
"creep" = 'sound/voice/bcreep.ogg',
|
"creep" = 'sound/voice/bcreep.ogg',
|
||||||
"criminal" = 'sound/voice/bcriminal.ogg',
|
"criminal" = 'sound/voice/bcriminal.ogg',
|
||||||
@@ -490,5 +412,4 @@
|
|||||||
"insult" = 'sound/voice/binsult.ogg',
|
"insult" = 'sound/voice/binsult.ogg',
|
||||||
"radio" = 'sound/voice/bradio.ogg',
|
"radio" = 'sound/voice/bradio.ogg',
|
||||||
"secure day" = 'sound/voice/bsecureday.ogg',
|
"secure day" = 'sound/voice/bsecureday.ogg',
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1,172 +1,106 @@
|
|||||||
/obj/item/integrated_circuit/logic
|
/obj/item/integrated_circuit/logic
|
||||||
name = "logic gate"
|
name = "logic gate"
|
||||||
desc = "This tiny chip will decide for you!"
|
desc = "This tiny chip will decide for you!"
|
||||||
|
extended_desc = "Logic circuits will treat a null, 0, and a \"\" string value as FALSE and anything else as TRUE."
|
||||||
complexity = 3
|
complexity = 3
|
||||||
number_of_inputs = 2
|
outputs = list("result")
|
||||||
number_of_outputs = 1
|
activators = list("compare", "on true result")
|
||||||
number_of_activators = 2
|
category = /obj/item/integrated_circuit/logic
|
||||||
input_names = list(
|
|
||||||
"A",
|
|
||||||
"B"
|
|
||||||
)
|
|
||||||
output_names = list(
|
|
||||||
"result"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"compare",
|
|
||||||
"on true result"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/equals
|
/obj/item/integrated_circuit/logic/do_work()
|
||||||
|
var/datum/integrated_io/O = outputs[1]
|
||||||
|
var/datum/integrated_io/P = activators[2]
|
||||||
|
O.push_data()
|
||||||
|
if(O.data)
|
||||||
|
P.push_data()
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/binary
|
||||||
|
inputs = list("A","B")
|
||||||
|
category = /obj/item/integrated_circuit/logic/binary
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/binary/do_work()
|
||||||
|
var/datum/integrated_io/A = inputs[1]
|
||||||
|
var/datum/integrated_io/B = inputs[2]
|
||||||
|
var/datum/integrated_io/O = outputs[1]
|
||||||
|
O.data = do_compare(A, B) ? TRUE : FALSE
|
||||||
|
..()
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/binary/proc/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/unary
|
||||||
|
inputs = list("A")
|
||||||
|
category = /obj/item/integrated_circuit/logic/unary
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/unary/do_work()
|
||||||
|
var/datum/integrated_io/A = inputs[1]
|
||||||
|
var/datum/integrated_io/O = outputs[1]
|
||||||
|
O.data = do_check(A) ? TRUE : FALSE
|
||||||
|
..()
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/unary/proc/do_check(var/datum/integrated_io/A)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/logic/binary/equals
|
||||||
name = "equal gate"
|
name = "equal gate"
|
||||||
desc = "This gate compares two values, and outputs the number one if both are the same."
|
desc = "This gate compares two values, and outputs the number one if both are the same."
|
||||||
icon_state = "equal"
|
icon_state = "equal"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/equals/work()
|
/obj/item/integrated_circuit/logic/binary/equals/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data == B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
var/datum/integrated_io/P = activators[2]
|
|
||||||
if(A.data == B.data)
|
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/not
|
/obj/item/integrated_circuit/logic/binary/and
|
||||||
name = "not gate"
|
|
||||||
desc = "This gate inverts what's fed into it."
|
|
||||||
icon_state = "not"
|
|
||||||
number_of_inputs = 1
|
|
||||||
number_of_outputs = 1
|
|
||||||
number_of_activators = 1
|
|
||||||
output_names = list(
|
|
||||||
"invert"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/not/work()
|
|
||||||
if(..())
|
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
if(A.data)
|
|
||||||
O.data = !A.data
|
|
||||||
O.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/and
|
|
||||||
name = "and gate"
|
name = "and gate"
|
||||||
desc = "This gate will output 'one' if both inputs evaluate to true."
|
desc = "This gate will output 'one' if both inputs evaluate to true."
|
||||||
icon_state = "and"
|
icon_state = "and"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/and/work()
|
/obj/item/integrated_circuit/logic/binary/and/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data && B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
var/datum/integrated_io/P = activators[2]
|
|
||||||
if(A.data && B.data)
|
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
|
||||||
A.push_data()
|
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/or
|
/obj/item/integrated_circuit/logic/binary/or
|
||||||
name = "or gate"
|
name = "or gate"
|
||||||
desc = "This gate will output 'one' if one of the inputs evaluate to true."
|
desc = "This gate will output 'one' if one of the inputs evaluate to true."
|
||||||
icon_state = "or"
|
icon_state = "or"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/or/work()
|
/obj/item/integrated_circuit/logic/binary/or/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data || B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
var/datum/integrated_io/P = activators[2]
|
|
||||||
if(A.data || B.data)
|
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
|
||||||
A.push_data()
|
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/less_than
|
/obj/item/integrated_circuit/logic/binary/less_than
|
||||||
name = "less than gate"
|
name = "less than gate"
|
||||||
desc = "This will output 'one' if the first input is less than the second input."
|
desc = "This will output 'one' if the first input is less than the second input."
|
||||||
icon_state = "less_than"
|
icon_state = "less_than"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/less_than/work()
|
/obj/item/integrated_circuit/logic/binary/less_than/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data < B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
var/datum/integrated_io/P = activators[2]
|
|
||||||
if(A.data < B.data)
|
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
|
||||||
A.push_data()
|
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/less_than_or_equal
|
/obj/item/integrated_circuit/logic/binary/less_than_or_equal
|
||||||
name = "less than or equal gate"
|
name = "less than or equal gate"
|
||||||
desc = "This will output 'one' if the first input is less than, or equal to the second input."
|
desc = "This will output 'one' if the first input is less than, or equal to the second input."
|
||||||
icon_state = "less_than_or_equal"
|
icon_state = "less_than_or_equal"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/less_than_or_equal/work()
|
/obj/item/integrated_circuit/logic/binary/less_than_or_equal/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data <= B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
var/datum/integrated_io/P = activators[2]
|
|
||||||
if(A.data <= B.data)
|
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
|
||||||
A.push_data()
|
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/greater_than
|
/obj/item/integrated_circuit/logic/binary/greater_than
|
||||||
name = "greater than gate"
|
name = "greater than gate"
|
||||||
desc = "This will output 'one' if the first input is greater than the second input."
|
desc = "This will output 'one' if the first input is greater than the second input."
|
||||||
icon_state = "greater_than"
|
icon_state = "greater_than"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/greater_than/work()
|
/obj/item/integrated_circuit/logic/binary/greater_than/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data > B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
|
||||||
var/datum/integrated_io/O = outputs[1]
|
|
||||||
var/datum/integrated_io/P = activators[2]
|
|
||||||
if(A.data > B.data)
|
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
|
||||||
A.push_data()
|
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/greater_than_or_equal
|
/obj/item/integrated_circuit/logic/binary/greater_than_or_equal
|
||||||
name = "greater_than or equal gate"
|
name = "greater_than or equal gate"
|
||||||
desc = "This will output 'one' if the first input is greater than, or equal to the second input."
|
desc = "This will output 'one' if the first input is greater than, or equal to the second input."
|
||||||
icon_state = "greater_than_or_equal"
|
icon_state = "greater_than_or_equal"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/logic/greater_than_or_equal/work()
|
/obj/item/integrated_circuit/logic/binary/greater_than_or_equal/do_compare(var/datum/integrated_io/A, var/datum/integrated_io/B)
|
||||||
if(..())
|
return A.data >= B.data
|
||||||
var/datum/integrated_io/A = inputs[1]
|
|
||||||
var/datum/integrated_io/B = inputs[2]
|
/obj/item/integrated_circuit/logic/unary/not
|
||||||
var/datum/integrated_io/O = outputs[1]
|
name = "not gate"
|
||||||
var/datum/integrated_io/P = activators[2]
|
desc = "This gate inverts what's fed into it."
|
||||||
if(A.data >= B.data)
|
icon_state = "not"
|
||||||
O.data = 1
|
|
||||||
O.push_data()
|
/obj/item/integrated_circuit/logic/unary/not/do_check(var/datum/integrated_io/A)
|
||||||
A.push_data()
|
return !A.data
|
||||||
P.push_data()
|
|
||||||
else
|
|
||||||
O.data = 0
|
|
||||||
@@ -6,14 +6,12 @@
|
|||||||
The 'fire' activator will cause the mechanism to attempt to fire the weapon at the coordinates, if possible. Note that the \
|
The 'fire' activator will cause the mechanism to attempt to fire the weapon at the coordinates, if possible. Note that the \
|
||||||
normal limitations to firearms, such as ammunition requirements and firing delays, still hold true if fired by the mechanism."
|
normal limitations to firearms, such as ammunition requirements and firing delays, still hold true if fired by the mechanism."
|
||||||
complexity = 20
|
complexity = 20
|
||||||
number_of_inputs = 2
|
inputs = list(
|
||||||
number_of_outputs = 0
|
|
||||||
number_of_activators = 1
|
|
||||||
input_names = list(
|
|
||||||
"target X rel",
|
"target X rel",
|
||||||
"target Y rel"
|
"target Y rel"
|
||||||
)
|
)
|
||||||
activator_names = list(
|
outputs = list()
|
||||||
|
activators = list(
|
||||||
"fire"
|
"fire"
|
||||||
)
|
)
|
||||||
var/obj/item/weapon/gun/installed_gun = null
|
var/obj/item/weapon/gun/installed_gun = null
|
||||||
@@ -45,7 +43,7 @@
|
|||||||
else
|
else
|
||||||
user << "<span class='notice'>There's no weapon to remove from the mechanism.</span>"
|
user << "<span class='notice'>There's no weapon to remove from the mechanism.</span>"
|
||||||
|
|
||||||
/obj/item/integrated_circuit/manipulation/weapon_firing/work()
|
/obj/item/integrated_circuit/manipulation/weapon_firing/do_work()
|
||||||
if(..())
|
if(..())
|
||||||
if(!installed_gun)
|
if(!installed_gun)
|
||||||
return
|
return
|
||||||
@@ -95,28 +93,23 @@
|
|||||||
into the smoke clouds when activated."
|
into the smoke clouds when activated."
|
||||||
flags = OPENCONTAINER
|
flags = OPENCONTAINER
|
||||||
complexity = 20
|
complexity = 20
|
||||||
number_of_inputs = 0
|
|
||||||
number_of_outputs = 0
|
|
||||||
number_of_activators = 1
|
|
||||||
cooldown_per_use = 30 SECONDS
|
cooldown_per_use = 30 SECONDS
|
||||||
input_names = list()
|
inputs = list()
|
||||||
activator_names = list(
|
outputs = list()
|
||||||
"create smoke"
|
activators = list("create smoke")
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/manipulation/smoke/New()
|
/obj/item/integrated_circuit/manipulation/smoke/New()
|
||||||
..()
|
..()
|
||||||
create_reagents(100)
|
create_reagents(100)
|
||||||
|
|
||||||
/obj/item/integrated_circuit/manipulation/smoke/work()
|
/obj/item/integrated_circuit/manipulation/smoke/do_work()
|
||||||
if(..())
|
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||||
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
|
var/datum/effect/effect/system/smoke_spread/chem/smoke_system = new()
|
||||||
var/datum/effect/effect/system/smoke_spread/chem/smoke_system = new()
|
smoke_system.set_up(reagents, 10, 0, get_turf(src))
|
||||||
smoke_system.set_up(reagents, 10, 0, get_turf(src))
|
spawn(0)
|
||||||
spawn(0)
|
for(var/i = 1 to 8)
|
||||||
for(var/i = 1 to 8)
|
smoke_system.start()
|
||||||
smoke_system.start()
|
reagents.clear_reagents()
|
||||||
reagents.clear_reagents()
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/manipulation/locomotion
|
/obj/item/integrated_circuit/manipulation/locomotion
|
||||||
name = "locomotion circuit"
|
name = "locomotion circuit"
|
||||||
@@ -135,24 +128,18 @@
|
|||||||
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."
|
being held, or anchored in some way."
|
||||||
complexity = 20
|
complexity = 20
|
||||||
number_of_inputs = 1
|
inputs = list("dir num")
|
||||||
number_of_outputs = 0
|
outputs = list()
|
||||||
number_of_activators = 1
|
activators = list("step towards dir")
|
||||||
input_names = list(
|
|
||||||
"dir num"
|
|
||||||
)
|
|
||||||
activator_names = list(
|
|
||||||
"step towards dir"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/manipulation/locomotion/work()
|
/obj/item/integrated_circuit/manipulation/locomotion/do_work()
|
||||||
if(..())
|
..()
|
||||||
var/turf/T = get_turf(src)
|
var/turf/T = get_turf(src)
|
||||||
if(istype(loc, /obj/item/device/electronic_assembly))
|
if(istype(loc, /obj/item/device/electronic_assembly))
|
||||||
var/obj/item/device/electronic_assembly/machine = loc
|
var/obj/item/device/electronic_assembly/machine = loc
|
||||||
if(machine.anchored || machine.w_class >= 4)
|
if(machine.anchored || machine.w_class >= 4)
|
||||||
return
|
return
|
||||||
if(machine.loc && machine.loc == T) // Check if we're held by someone. If the loc is the floor, we're not held.
|
if(machine.loc && machine.loc == T) // Check if we're held by someone. If the loc is the floor, we're not held.
|
||||||
var/datum/integrated_io/wanted_dir = inputs[1]
|
var/datum/integrated_io/wanted_dir = inputs[1]
|
||||||
if(isnum(wanted_dir.data))
|
if(isnum(wanted_dir.data))
|
||||||
step(machine, wanted_dir.data)
|
step(machine, wanted_dir.data)
|
||||||
@@ -3,99 +3,151 @@
|
|||||||
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
|
||||||
number_of_inputs = 1
|
inputs = list("input pin 1")
|
||||||
number_of_outputs = 1
|
outputs = list("output pin 1")
|
||||||
number_of_activators = 1
|
activators = list("set")
|
||||||
activator_names = list(
|
category = /obj/item/integrated_circuit/memory
|
||||||
"set"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/examine(mob/user)
|
/obj/item/integrated_circuit/memory/examine(mob/user)
|
||||||
..()
|
..()
|
||||||
var/i
|
var/i
|
||||||
for(i = 1, i <= outputs.len, i++)
|
for(i = 1, i <= outputs.len, i++)
|
||||||
var/datum/integrated_io/O = outputs[i]
|
var/datum/integrated_io/O = outputs[i]
|
||||||
user << "\The [src] has [O.data ? "'O.data'" : "nothing"] saved to address [i]."
|
var/data = "nothing"
|
||||||
|
if(isweakref(O.data))
|
||||||
|
var/datum/d = O.data_as_type(/datum)
|
||||||
|
if(d)
|
||||||
|
data = "[d]"
|
||||||
|
else if(!isnull(O.data))
|
||||||
|
data = O.data
|
||||||
|
to_chat(user, "\The [src] has [data] saved to address [i].")
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/work()
|
/obj/item/integrated_circuit/memory/do_work()
|
||||||
if(..())
|
for(var/i = 1 to inputs.len)
|
||||||
var/i
|
var/datum/integrated_io/I = inputs[i]
|
||||||
for(i = 1, i <= inputs.len, i++)
|
var/datum/integrated_io/O = outputs[i]
|
||||||
var/datum/integrated_io/I = inputs[i]
|
O.data = I.data
|
||||||
var/datum/integrated_io/O = outputs[i]
|
|
||||||
O.data = I.data
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/medium
|
/obj/item/integrated_circuit/memory/medium
|
||||||
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
|
complexity = 4
|
||||||
number_of_inputs = 4
|
inputs = list("input pin 1","input pin 2","input pin 3","input pin 4")
|
||||||
number_of_outputs = 4
|
outputs = list("output pin 1","output pin 2","output pin 3","output pin 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
|
complexity = 8
|
||||||
number_of_inputs = 8
|
inputs = list(
|
||||||
number_of_outputs = 8
|
"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")
|
||||||
|
|
||||||
/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"
|
||||||
complexity = 16
|
complexity = 16
|
||||||
number_of_inputs = 16
|
inputs = list(
|
||||||
number_of_outputs = 16
|
"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")
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/constant
|
/obj/item/integrated_circuit/memory/constant
|
||||||
name = "constant chip"
|
name = "constant chip"
|
||||||
desc = "This tiny chip can store one piece of data, which cannot be overwritten without disassembly."
|
desc = "This tiny chip can store one piece of data, which cannot be overwritten without disassembly."
|
||||||
icon_state = "memory"
|
icon_state = "memory"
|
||||||
complexity = 1
|
complexity = 1
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 1
|
outputs = list("output pin")
|
||||||
number_of_activators = 1
|
activators = list("push data")
|
||||||
activator_names = list(
|
|
||||||
"push data"
|
|
||||||
)
|
|
||||||
var/accepting_refs = 0
|
var/accepting_refs = 0
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/constant/work()
|
/obj/item/integrated_circuit/memory/constant/do_work()
|
||||||
var/datum/integrated_io/O = outputs[1]
|
var/datum/integrated_io/O = outputs[1]
|
||||||
O.push_data()
|
O.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/constant/attack_self(mob/user)
|
/obj/item/integrated_circuit/memory/constant/attack_self(mob/user)
|
||||||
var/datum/integrated_io/O = outputs[1]
|
var/datum/integrated_io/O = outputs[1]
|
||||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
|
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
|
||||||
|
if(!CanInteract(user, physical_state))
|
||||||
|
return
|
||||||
|
|
||||||
var/new_data = null
|
var/new_data = null
|
||||||
switch(type_to_use)
|
switch(type_to_use)
|
||||||
if("string")
|
if("string")
|
||||||
accepting_refs = 0
|
accepting_refs = 0
|
||||||
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))
|
if(istext(new_data) && CanInteract(user, physical_state))
|
||||||
O.data = new_data
|
O.data = new_data
|
||||||
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()].</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))
|
if(isnum(new_data) && CanInteract(user, physical_state))
|
||||||
O.data = new_data
|
O.data = new_data
|
||||||
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()].</span>")
|
||||||
if("ref")
|
if("ref")
|
||||||
accepting_refs = 1
|
accepting_refs = 1
|
||||||
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 \
|
||||||
an object for a ref of that object to save it in memory.</span>"
|
an object for a ref of that object to save it in memory.</span>")
|
||||||
if("null")
|
if("null")
|
||||||
O.data = null
|
O.data = null
|
||||||
user << "<span class='notice'>You set \the [src]'s memory to absolutely nothing.</span>"
|
to_chat(user, "<span class='notice'>You set \the [src]'s memory to absolutely nothing.</span>")
|
||||||
|
|
||||||
/obj/item/integrated_circuit/memory/constant/afterattack(atom/target, mob/living/user, proximity)
|
/obj/item/integrated_circuit/memory/constant/afterattack(atom/target, mob/living/user, proximity)
|
||||||
if(accepting_refs && proximity)
|
if(accepting_refs && proximity)
|
||||||
var/datum/integrated_io/O = outputs[1]
|
var/datum/integrated_io/O = outputs[1]
|
||||||
O.data = 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>")
|
||||||
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()]. The ref scanner is \
|
||||||
now off.</span>"
|
now off.</span>")
|
||||||
accepting_refs = 0
|
accepting_refs = 0
|
||||||
@@ -2,40 +2,38 @@
|
|||||||
name = "time circuit"
|
name = "time circuit"
|
||||||
desc = "Now you can build your own clock!"
|
desc = "Now you can build your own clock!"
|
||||||
complexity = 2
|
complexity = 2
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 0
|
outputs = list()
|
||||||
|
category = /obj/item/integrated_circuit/time
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/delay
|
/obj/item/integrated_circuit/time/delay
|
||||||
name = "two-sec delay circuit"
|
name = "two-sec delay circuit"
|
||||||
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 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"
|
||||||
number_of_activators = 2
|
var/delay = 2 SECONDS
|
||||||
var/delay = 20
|
activators = list("incoming pulse","outgoing pulse")
|
||||||
activator_names = list(
|
|
||||||
"incoming pulse",
|
|
||||||
"outgoing pulse"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/delay/work()
|
/obj/item/integrated_circuit/time/delay/do_work()
|
||||||
if(..())
|
set waitfor = 0 // Don't sleep in a proc that is called by a processor. It'll delay the entire thing
|
||||||
var/datum/integrated_io/out_pulse = activators[2]
|
|
||||||
sleep(delay)
|
var/datum/integrated_io/out_pulse = activators[2]
|
||||||
out_pulse.push_data()
|
sleep(delay)
|
||||||
|
out_pulse.push_data()
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/delay/five_sec
|
/obj/item/integrated_circuit/time/delay/five_sec
|
||||||
name = "five-sec delay circuit"
|
name = "five-sec delay circuit"
|
||||||
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 is set to send a pulse after a delay of five seconds."
|
This circuit is set to send a pulse after a delay of five seconds."
|
||||||
icon_state = "delay-50"
|
icon_state = "delay-50"
|
||||||
delay = 50
|
delay = 5 SECONDS
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/delay/one_sec
|
/obj/item/integrated_circuit/time/delay/one_sec
|
||||||
name = "one-sec delay circuit"
|
name = "one-sec delay circuit"
|
||||||
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 is set to send a pulse after a delay of one second."
|
This circuit is set to send a pulse after a delay of one second."
|
||||||
icon_state = "delay-10"
|
icon_state = "delay-10"
|
||||||
delay = 10
|
delay = 1 SECOND
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/delay/half_sec
|
/obj/item/integrated_circuit/time/delay/half_sec
|
||||||
name = "half-sec delay circuit"
|
name = "half-sec delay circuit"
|
||||||
@@ -56,12 +54,9 @@
|
|||||||
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"
|
||||||
number_of_inputs = 1
|
inputs = list("delay time")
|
||||||
input_names = list(
|
|
||||||
"delay time",
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/delay/custom/work()
|
/obj/item/integrated_circuit/time/delay/custom/do_work()
|
||||||
var/datum/integrated_io/delay_input = inputs[1]
|
var/datum/integrated_io/delay_input = inputs[1]
|
||||||
if(delay_input.data && isnum(delay_input.data) )
|
if(delay_input.data && isnum(delay_input.data) )
|
||||||
var/new_delay = min(delay_input.data, 1)
|
var/new_delay = min(delay_input.data, 1)
|
||||||
@@ -75,27 +70,35 @@
|
|||||||
desc = "This circuit sends an automatic pulse every four seconds."
|
desc = "This circuit sends an automatic pulse every four seconds."
|
||||||
icon_state = "tick-m"
|
icon_state = "tick-m"
|
||||||
complexity = 8
|
complexity = 8
|
||||||
number_of_inputs = 1
|
var/ticks_to_pulse = 4
|
||||||
number_of_activators = 1
|
|
||||||
var/ticks_to_pulse = 2
|
|
||||||
var/ticks_completed = 0
|
var/ticks_completed = 0
|
||||||
input_names = list(
|
var/is_running = FALSE
|
||||||
"toggle ticking"
|
inputs = list("enable ticking")
|
||||||
)
|
activators = list("outgoing pulse")
|
||||||
activator_names = list(
|
|
||||||
"outgoing pulse"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/ticker/New()
|
|
||||||
..()
|
|
||||||
processing_objects |= src
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/ticker/Destroy()
|
/obj/item/integrated_circuit/time/ticker/Destroy()
|
||||||
processing_objects -= src
|
if(is_running)
|
||||||
|
processing_objects -= src
|
||||||
|
. = ..()
|
||||||
|
|
||||||
|
/obj/item/integrated_circuit/time/ticker/on_data_written()
|
||||||
|
var/datum/integrated_io/do_tick = inputs[1]
|
||||||
|
if(do_tick.data && !is_running)
|
||||||
|
is_running = TRUE
|
||||||
|
processing_objects |= src
|
||||||
|
else if(is_running)
|
||||||
|
is_running = FALSE
|
||||||
|
processing_objects -= src
|
||||||
|
ticks_completed = 0
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/ticker/process()
|
/obj/item/integrated_circuit/time/ticker/process()
|
||||||
ticks_completed++
|
var/process_ticks = process_schedule_interval("obj")
|
||||||
if( (ticks_completed % ticks_to_pulse) == 0)
|
ticks_completed += process_ticks
|
||||||
|
if(ticks_completed >= ticks_to_pulse)
|
||||||
|
if(ticks_to_pulse >= process_ticks)
|
||||||
|
ticks_completed -= ticks_to_pulse
|
||||||
|
else
|
||||||
|
ticks_completed = 0
|
||||||
var/datum/integrated_io/pulser = activators[1]
|
var/datum/integrated_io/pulser = activators[1]
|
||||||
pulser.push_data()
|
pulser.push_data()
|
||||||
|
|
||||||
@@ -104,41 +107,32 @@
|
|||||||
desc = "This advanced circuit sends an automatic pulse every two seconds."
|
desc = "This advanced circuit sends an automatic pulse every two seconds."
|
||||||
icon_state = "tick-f"
|
icon_state = "tick-f"
|
||||||
complexity = 12
|
complexity = 12
|
||||||
ticks_to_pulse = 1
|
ticks_to_pulse = 2
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/ticker/slow
|
/obj/item/integrated_circuit/time/ticker/slow
|
||||||
name = "slow ticker"
|
name = "slow ticker"
|
||||||
desc = "This simple circuit sends an automatic pulse every six seconds."
|
desc = "This simple circuit sends an automatic pulse every six seconds."
|
||||||
icon_state = "tick-s"
|
icon_state = "tick-s"
|
||||||
complexity = 4
|
complexity = 4
|
||||||
ticks_to_pulse = 3
|
ticks_to_pulse = 6
|
||||||
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/clock
|
/obj/item/integrated_circuit/time/clock
|
||||||
name = "integrated clock"
|
name = "integrated clock"
|
||||||
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"
|
||||||
number_of_inputs = 0
|
inputs = list()
|
||||||
number_of_outputs = 4
|
outputs = list("time (string)", "hours (number)", "minutes (number)", "seconds (number)")
|
||||||
number_of_activators = 1
|
|
||||||
output_names = list(
|
|
||||||
"time (string)",
|
|
||||||
"hours (number)",
|
|
||||||
"minutes (number)",
|
|
||||||
"seconds (number)"
|
|
||||||
)
|
|
||||||
|
|
||||||
/obj/item/integrated_circuit/time/clock/work()
|
/obj/item/integrated_circuit/time/clock/do_work()
|
||||||
if(..())
|
var/datum/integrated_io/time = outputs[1]
|
||||||
var/datum/integrated_io/time = outputs[1]
|
var/datum/integrated_io/hour = outputs[2]
|
||||||
var/datum/integrated_io/hour = outputs[2]
|
var/datum/integrated_io/min = outputs[3]
|
||||||
var/datum/integrated_io/min = outputs[3]
|
var/datum/integrated_io/sec = outputs[4]
|
||||||
var/datum/integrated_io/sec = outputs[4]
|
|
||||||
|
|
||||||
time.data = time2text(station_time_in_ticks, "hh:mm:ss")
|
time.data = time2text(station_time_in_ticks, "hh:mm:ss")
|
||||||
hour.data = text2num(time2text(station_time_in_ticks, "hh"))
|
hour.data = text2num(time2text(station_time_in_ticks, "hh"))
|
||||||
min.data = text2num(time2text(station_time_in_ticks, "mm"))
|
min.data = text2num(time2text(station_time_in_ticks, "mm"))
|
||||||
sec.data = text2num(time2text(station_time_in_ticks, "ss"))
|
sec.data = text2num(time2text(station_time_in_ticks, "ss"))
|
||||||
|
|
||||||
for(var/datum/integrated_io/output/O in outputs)
|
for(var/datum/integrated_io/output/O in outputs)
|
||||||
O.push_data()
|
O.push_data()
|
||||||
@@ -12,71 +12,64 @@
|
|||||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||||
icon_state = "wirer-wire"
|
icon_state = "wirer-wire"
|
||||||
flags = CONDUCT
|
flags = CONDUCT
|
||||||
w_class = ITEMSIZE_SMALL
|
w_class = 2
|
||||||
var/datum/integrated_io/selected_io = null
|
var/datum/integrated_io/selected_io = null
|
||||||
var/mode = WIRE
|
var/mode = WIRE
|
||||||
|
|
||||||
/obj/item/device/integrated_electronics/wirer/New()
|
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/item/device/integrated_electronics/wirer/update_icon()
|
/obj/item/device/integrated_electronics/wirer/update_icon()
|
||||||
icon_state = "wirer-[mode]"
|
icon_state = "wirer-[mode]"
|
||||||
|
|
||||||
/obj/item/device/integrated_electronics/wirer/proc/wire(var/datum/integrated_io/io, mob/user)
|
/obj/item/device/integrated_electronics/wirer/proc/wire(var/datum/integrated_io/io, mob/user)
|
||||||
if(mode == WIRE)
|
if(mode == WIRE)
|
||||||
selected_io = io
|
selected_io = io
|
||||||
user << "<span class='notice'>You attach a data wire to \the [selected_io.holder]'s [selected_io.name] data channel.</span>"
|
to_chat(user, "<span class='notice'>You attach a data wire to \the [selected_io.holder]'s [selected_io.name] data channel.</span>")
|
||||||
mode = WIRING
|
mode = WIRING
|
||||||
update_icon()
|
update_icon()
|
||||||
else if(mode == WIRING)
|
else if(mode == WIRING)
|
||||||
if(io == selected_io)
|
if(io == selected_io)
|
||||||
user << "<span class='warning'>Wiring \the [selected_io.holder]'s [selected_io.name] into itself is rather pointless.</span>"
|
to_chat(user, "<span class='warning'>Wiring \the [selected_io.holder]'s [selected_io.name] into itself is rather pointless.</span>")
|
||||||
return
|
return
|
||||||
if(io.io_type != selected_io.io_type)
|
if(io.io_type != selected_io.io_type)
|
||||||
user << "<span class='warning'>Those two types of channels are incompatable. The first is a [selected_io.io_type], \
|
to_chat(user, "<span class='warning'>Those two types of channels are incompatable. The first is a [selected_io.io_type], \
|
||||||
while the second is a [io.io_type].</span>"
|
while the second is a [io.io_type].</span>")
|
||||||
return
|
return
|
||||||
selected_io.linked |= io
|
selected_io.linked |= io
|
||||||
io.linked |= selected_io
|
io.linked |= selected_io
|
||||||
|
|
||||||
user << "<span class='notice'>You connect \the [selected_io.holder]'s [selected_io.name] to \the [io.holder]'s [io.name].</span>"
|
to_chat(user, "<span class='notice'>You connect \the [selected_io.holder]'s [selected_io.name] to \the [io.holder]'s [io.name].</span>")
|
||||||
mode = WIRE
|
mode = WIRE
|
||||||
update_icon()
|
update_icon()
|
||||||
//io.updateDialog()
|
|
||||||
//selected_io.updateDialog()
|
|
||||||
selected_io.holder.interact(user) // This is to update the UI.
|
selected_io.holder.interact(user) // This is to update the UI.
|
||||||
selected_io = null
|
selected_io = null
|
||||||
|
|
||||||
else if(mode == UNWIRE)
|
else if(mode == UNWIRE)
|
||||||
selected_io = io
|
selected_io = io
|
||||||
if(!io.linked.len)
|
if(!io.linked.len)
|
||||||
user << "<span class='warning'>There is nothing connected to \the [selected_io] data channel.</span>"
|
to_chat(user, "<span class='warning'>There is nothing connected to \the [selected_io] data channel.</span>")
|
||||||
selected_io = null
|
selected_io = null
|
||||||
return
|
return
|
||||||
user << "<span class='notice'>You prepare to detach a data wire from \the [selected_io.holder]'s [selected_io.name] data channel.</span>"
|
to_chat(user, "<span class='notice'>You prepare to detach a data wire from \the [selected_io.holder]'s [selected_io.name] data channel.</span>")
|
||||||
mode = UNWIRING
|
mode = UNWIRING
|
||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
|
|
||||||
else if(mode == UNWIRING)
|
else if(mode == UNWIRING)
|
||||||
if(io == selected_io)
|
if(io == selected_io)
|
||||||
user << "<span class='warning'>You can't wire a pin into each other, so unwiring \the [selected_io.holder] from \
|
to_chat(user, "<span class='warning'>You can't wire a pin into each other, so unwiring \the [selected_io.holder] from \
|
||||||
the same pin is rather moot.</span>"
|
the same pin is rather moot.</span>")
|
||||||
return
|
return
|
||||||
if(selected_io in io.linked)
|
if(selected_io in io.linked)
|
||||||
io.linked.Remove(selected_io)
|
io.linked.Remove(selected_io)
|
||||||
selected_io.linked.Remove(io)
|
selected_io.linked.Remove(io)
|
||||||
user << "<span class='notice'>You disconnect \the [selected_io.holder]'s [selected_io.name] from \
|
to_chat(user, "<span class='notice'>You disconnect \the [selected_io.holder]'s [selected_io.name] from \
|
||||||
\the [io.holder]'s [io.name].</span>"
|
\the [io.holder]'s [io.name].</span>")
|
||||||
//io.updateDialog()
|
|
||||||
//selected_io.updateDialog()
|
|
||||||
selected_io.holder.interact(user) // This is to update the UI.
|
selected_io.holder.interact(user) // This is to update the UI.
|
||||||
selected_io = null
|
selected_io = null
|
||||||
mode = UNWIRE
|
mode = UNWIRE
|
||||||
update_icon()
|
update_icon()
|
||||||
else
|
else
|
||||||
user << "<span class='warning'>\The [selected_io.holder]'s [selected_io.name] and \the [io.holder]'s \
|
to_chat(user, "<span class='warning'>\The [selected_io.holder]'s [selected_io.name] and \the [io.holder]'s \
|
||||||
[io.name] are not connected.</span>"
|
[io.name] are not connected.</span>")
|
||||||
return
|
return
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -86,18 +79,18 @@
|
|||||||
mode = UNWIRE
|
mode = UNWIRE
|
||||||
if(WIRING)
|
if(WIRING)
|
||||||
if(selected_io)
|
if(selected_io)
|
||||||
user << "<span class='notice'>You decide not to wire the data channel.</span>"
|
to_chat(user, "<span class='notice'>You decide not to wire the data channel.</span>")
|
||||||
selected_io = null
|
selected_io = null
|
||||||
mode = UNWIRE
|
mode = WIRE
|
||||||
if(UNWIRE)
|
if(UNWIRE)
|
||||||
mode = WIRE
|
mode = WIRE
|
||||||
if(UNWIRING)
|
if(UNWIRING)
|
||||||
if(selected_io)
|
if(selected_io)
|
||||||
user << "<span class='notice'>You decide not to disconnect the data channel.</span>"
|
to_chat(user, "<span class='notice'>You decide not to disconnect the data channel.</span>")
|
||||||
selected_io = null
|
selected_io = null
|
||||||
mode = UNWIRE
|
mode = UNWIRE
|
||||||
update_icon()
|
update_icon()
|
||||||
user << "<span class='notice'>You set \the [src] to [mode].</span>"
|
to_chat(user, "<span class='notice'>You set \the [src] to [mode].</span>")
|
||||||
|
|
||||||
#undef WIRE
|
#undef WIRE
|
||||||
#undef WIRING
|
#undef WIRING
|
||||||
@@ -111,49 +104,52 @@
|
|||||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||||
icon_state = "debugger"
|
icon_state = "debugger"
|
||||||
flags = CONDUCT
|
flags = CONDUCT
|
||||||
w_class = ITEMSIZE_SMALL
|
w_class = 2
|
||||||
var/data_to_write = null
|
var/data_to_write = null
|
||||||
var/accepting_refs = 0
|
var/accepting_refs = 0
|
||||||
|
|
||||||
/obj/item/device/integrated_electronics/debugger/attack_self(mob/user)
|
/obj/item/device/integrated_electronics/debugger/attack_self(mob/user)
|
||||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
|
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
|
||||||
|
if(!CanInteract(user, physical_state))
|
||||||
|
return
|
||||||
|
|
||||||
var/new_data = null
|
var/new_data = null
|
||||||
switch(type_to_use)
|
switch(type_to_use)
|
||||||
if("string")
|
if("string")
|
||||||
accepting_refs = 0
|
accepting_refs = 0
|
||||||
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))
|
if(istext(new_data) && CanInteract(user, physical_state))
|
||||||
data_to_write = new_data
|
data_to_write = new_data
|
||||||
user << "<span class='notice'>You set \the [src]'s memory to \"[new_data]\".</span>"
|
to_chat(user, "<span class='notice'>You set \the [src]'s memory to \"[new_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))
|
if(isnum(new_data) && CanInteract(user, physical_state))
|
||||||
data_to_write = new_data
|
data_to_write = new_data
|
||||||
user << "<span class='notice'>You set \the [src]'s memory to [new_data].</span>"
|
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [new_data].</span>")
|
||||||
if("ref")
|
if("ref")
|
||||||
accepting_refs = 1
|
accepting_refs = 1
|
||||||
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 \
|
||||||
an object for a ref of that object to save it in memory.</span>"
|
an object for a ref of that object to save it in memory.</span>")
|
||||||
if("null")
|
if("null")
|
||||||
data_to_write = null
|
data_to_write = null
|
||||||
user << "<span class='notice'>You set \the [src]'s memory to absolutely nothing.</span>"
|
to_chat(user, "<span class='notice'>You set \the [src]'s memory to absolutely nothing.</span>")
|
||||||
|
|
||||||
/obj/item/device/integrated_electronics/debugger/afterattack(atom/target, mob/living/user, proximity)
|
/obj/item/device/integrated_electronics/debugger/afterattack(atom/target, mob/living/user, proximity)
|
||||||
if(accepting_refs && proximity)
|
if(accepting_refs && proximity)
|
||||||
data_to_write = target
|
data_to_write = 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>")
|
||||||
user << "<span class='notice'>You set \the [src]'s memory to a reference to [target.name] \[Ref\]. The ref scanner is \
|
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [target.name] \[Ref\]. The ref scanner is \
|
||||||
now off.</span>"
|
now off.</span>")
|
||||||
accepting_refs = 0
|
accepting_refs = 0
|
||||||
|
|
||||||
/obj/item/device/integrated_electronics/debugger/proc/write_data(var/datum/integrated_io/io, mob/user)
|
/obj/item/device/integrated_electronics/debugger/proc/write_data(var/datum/integrated_io/io, mob/user)
|
||||||
if(io.io_type == DATA_CHANNEL)
|
if(io.io_type == DATA_CHANNEL)
|
||||||
io.write_data_to_pin(data_to_write)
|
io.write_data_to_pin(data_to_write)
|
||||||
user << "<span class='notice'>You write [data_to_write] to \the [io.holder]'s [io].</span>"
|
to_chat(user, "<span class='notice'>You write '[data_to_write ? data_to_write : "NULL"]' to the '[io]' pin of \the [io.holder].</span>")
|
||||||
else if(io.io_type == PULSE_CHANNEL)
|
else if(io.io_type == PULSE_CHANNEL)
|
||||||
io.holder.work()
|
io.holder.check_then_do_work()
|
||||||
user << "<span class='notice'>You pulse \the [io.holder]'s [io].</span>"
|
to_chat(user, "<span class='notice'>You pulse \the [io.holder]'s [io].</span>")
|
||||||
|
|
||||||
io.holder.interact(user) // This is to update the UI.
|
io.holder.interact(user) // This is to update the UI.
|
||||||
|
|
||||||
@@ -162,13 +158,8 @@
|
|||||||
desc = "This kit's essential for any circuitry projects."
|
desc = "This kit's essential for any circuitry projects."
|
||||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||||
icon_state = "circuit_kit"
|
icon_state = "circuit_kit"
|
||||||
w_class = ITEMSIZE_NORMAL
|
w_class = 3
|
||||||
storage_slots = 200
|
|
||||||
max_storage_space = ITEMSIZE_COST_NORMAL * 100
|
|
||||||
max_w_class = ITEMSIZE_NORMAL
|
|
||||||
display_contents_with_number = 1
|
display_contents_with_number = 1
|
||||||
can_hold = list(/obj/item/integrated_circuit, /obj/item/device/integrated_electronics, /obj/item/device/electronic_assembly,
|
|
||||||
/obj/item/weapon/screwdriver, /obj/item/weapon/crowbar)
|
|
||||||
|
|
||||||
/obj/item/weapon/storage/bag/circuits/basic/New()
|
/obj/item/weapon/storage/bag/circuits/basic/New()
|
||||||
..()
|
..()
|
||||||
@@ -199,29 +190,32 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
for(var/thing in types_to_spawn)
|
for(var/thing in types_to_spawn)
|
||||||
var/i = 3
|
var/obj/item/integrated_circuit/ic = thing
|
||||||
while(i)
|
if(initial(ic.category) == thing)
|
||||||
|
continue
|
||||||
|
|
||||||
|
for(var/i = 1 to 4)
|
||||||
new thing(src)
|
new thing(src)
|
||||||
i--
|
|
||||||
|
|
||||||
new /obj/item/device/electronic_assembly(src)
|
new /obj/item/device/electronic_assembly(src)
|
||||||
new /obj/item/device/integrated_electronics/wirer(src)
|
new /obj/item/device/integrated_electronics/wirer(src)
|
||||||
new /obj/item/device/integrated_electronics/debugger(src)
|
new /obj/item/device/integrated_electronics/debugger(src)
|
||||||
new /obj/item/weapon/crowbar(src)
|
new /obj/item/weapon/crowbar(src)
|
||||||
new /obj/item/weapon/screwdriver(src)
|
new /obj/item/weapon/screwdriver(src)
|
||||||
|
make_exact_fit()
|
||||||
|
|
||||||
/obj/item/weapon/storage/bag/circuits/all/New()
|
/obj/item/weapon/storage/bag/circuits/all/New()
|
||||||
..()
|
..()
|
||||||
var/list/types_to_spawn = typesof(/obj/item/integrated_circuit)
|
for(var/thing in subtypesof(/obj/item/integrated_circuit))
|
||||||
|
var/obj/item/integrated_circuit/ic = thing
|
||||||
for(var/thing in types_to_spawn)
|
if(initial(ic.category) == thing)
|
||||||
var/i = 10
|
continue
|
||||||
while(i)
|
for(var/i = 1 to 10)
|
||||||
new thing(src)
|
new thing(src)
|
||||||
i--
|
|
||||||
|
|
||||||
new /obj/item/device/electronic_assembly(src)
|
new /obj/item/device/electronic_assembly(src)
|
||||||
new /obj/item/device/integrated_electronics/wirer(src)
|
new /obj/item/device/integrated_electronics/wirer(src)
|
||||||
new /obj/item/device/integrated_electronics/debugger(src)
|
new /obj/item/device/integrated_electronics/debugger(src)
|
||||||
new /obj/item/weapon/crowbar(src)
|
new /obj/item/weapon/crowbar(src)
|
||||||
new /obj/item/weapon/screwdriver(src)
|
new /obj/item/weapon/screwdriver(src)
|
||||||
|
make_exact_fit()
|
||||||
6
code/modules/integrated_electronics/~defines.dm
Normal file
6
code/modules/integrated_electronics/~defines.dm
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#undef IC_INPUT
|
||||||
|
#undef IC_OUTPUT
|
||||||
|
#undef IC_ACTIVATOR
|
||||||
|
|
||||||
|
#undef DATA_CHANNEL
|
||||||
|
#undef PULSE_CHANNEL
|
||||||
@@ -1754,44 +1754,44 @@ CIRCUITS BELOW
|
|||||||
..()
|
..()
|
||||||
name = "Custom circuitry \[Logic\] ([item_name])"
|
name = "Custom circuitry \[Logic\] ([item_name])"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/equals
|
/datum/design/circuit/integrated_circuit/logic/binary/equals
|
||||||
id = "cc-equals"
|
id = "cc-equals"
|
||||||
build_path = /obj/item/integrated_circuit/logic/equals
|
build_path = /obj/item/integrated_circuit/logic/binary/equals
|
||||||
sort_string = "WAAFA"
|
sort_string = "WAAFA"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/not
|
/datum/design/circuit/integrated_circuit/logic/unary/not
|
||||||
id = "cc-not"
|
id = "cc-not"
|
||||||
build_path = /obj/item/integrated_circuit/logic/not
|
build_path = /obj/item/integrated_circuit/logic/unary/not
|
||||||
sort_string = "WAAFB"
|
sort_string = "WAAFB"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/and
|
/datum/design/circuit/integrated_circuit/logic/binary/and
|
||||||
id = "cc-and"
|
id = "cc-and"
|
||||||
build_path = /obj/item/integrated_circuit/logic/and
|
build_path = /obj/item/integrated_circuit/logic/binary/and
|
||||||
sort_string = "WAAFC"
|
sort_string = "WAAFC"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/or
|
/datum/design/circuit/integrated_circuit/logic/binary/or
|
||||||
id = "cc-or"
|
id = "cc-or"
|
||||||
build_path = /obj/item/integrated_circuit/logic/or
|
build_path = /obj/item/integrated_circuit/logic/binary/or
|
||||||
sort_string = "WAAFD"
|
sort_string = "WAAFD"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/less_than
|
/datum/design/circuit/integrated_circuit/logic/binary/less_than
|
||||||
id = "cc-less_than"
|
id = "cc-less_than"
|
||||||
build_path = /obj/item/integrated_circuit/logic/less_than
|
build_path = /obj/item/integrated_circuit/logic/binary/less_than
|
||||||
sort_string = "WAAFE"
|
sort_string = "WAAFE"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/less_than_or_equal
|
/datum/design/circuit/integrated_circuit/logic/binary/less_than_or_equal
|
||||||
id = "cc-less_than_or_equal"
|
id = "cc-less_than_or_equal"
|
||||||
build_path = /obj/item/integrated_circuit/logic/less_than_or_equal
|
build_path = /obj/item/integrated_circuit/logic/binary/less_than_or_equal
|
||||||
sort_string = "WAAFF"
|
sort_string = "WAAFF"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/greater_than
|
/datum/design/circuit/integrated_circuit/logic/binary/greater_than
|
||||||
id = "cc-greater_than"
|
id = "cc-greater_than"
|
||||||
build_path = /obj/item/integrated_circuit/logic/greater_than
|
build_path = /obj/item/integrated_circuit/logic/binary/greater_than
|
||||||
sort_string = "WAAFG"
|
sort_string = "WAAFG"
|
||||||
|
|
||||||
/datum/design/circuit/integrated_circuit/logic/greater_than_or_equal
|
/datum/design/circuit/integrated_circuit/logic/binary/greater_than_or_equal
|
||||||
id = "cc-greater_than_or_equal"
|
id = "cc-greater_than_or_equal"
|
||||||
build_path = /obj/item/integrated_circuit/logic/greater_than_or_equal
|
build_path = /obj/item/integrated_circuit/logic/binary/greater_than_or_equal
|
||||||
sort_string = "WAAFH"
|
sort_string = "WAAFH"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,7 @@
|
|||||||
#include "code\datums\progressbar.dm"
|
#include "code\datums\progressbar.dm"
|
||||||
#include "code\datums\recipe.dm"
|
#include "code\datums\recipe.dm"
|
||||||
#include "code\datums\sun.dm"
|
#include "code\datums\sun.dm"
|
||||||
|
#include "code\datums\weakref.dm"
|
||||||
#include "code\datums\autolathe\arms.dm"
|
#include "code\datums\autolathe\arms.dm"
|
||||||
#include "code\datums\autolathe\autolathe.dm"
|
#include "code\datums\autolathe\autolathe.dm"
|
||||||
#include "code\datums\autolathe\devices.dm"
|
#include "code\datums\autolathe\devices.dm"
|
||||||
@@ -1378,6 +1379,7 @@
|
|||||||
#include "code\modules\integrated_electronics\memory.dm"
|
#include "code\modules\integrated_electronics\memory.dm"
|
||||||
#include "code\modules\integrated_electronics\time.dm"
|
#include "code\modules\integrated_electronics\time.dm"
|
||||||
#include "code\modules\integrated_electronics\tools.dm"
|
#include "code\modules\integrated_electronics\tools.dm"
|
||||||
|
#include "code\modules\integrated_electronics\~defines.dm"
|
||||||
#include "code\modules\library\lib_items.dm"
|
#include "code\modules\library\lib_items.dm"
|
||||||
#include "code\modules\library\lib_machines.dm"
|
#include "code\modules\library\lib_machines.dm"
|
||||||
#include "code\modules\library\lib_readme.dm"
|
#include "code\modules\library\lib_readme.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user