[READY] A few additions, tweaks, and fixes for integrated circuits (#36270)
* A few additions, tweaks, and fixes for integrated circuits, and some very minor tweaks to hydroponics and carbon/silicon examine() to support those changes. 🆑 SailorDave rscadd: A new manipulation circuit, the Seed Extractor. Extracts seeds from produce, and outputs a list of the extracted seeds. rscadd: A new list circuit, the List Filter. Searches through a list for anything matching the desired element and outputs two lists: one containing just the matches, and the other with matches filtered out. rscadd: A new list circuit, the Set circuit. Removes duplicate entries from a list. tweak: The Plant Manipulation circuit can now plant seeds, and outputs a list of harvested plants. tweak: Reagent circuits can now irrigate connected hydroponic trays and inject blood samples into Replica pods. tweak: The Examiner circuit outputs worn items and other examined details of carbon and silicon mobs into the description pin. tweak: List Advanced Locator circuit now accepts refs as well as strings. bugfix: Fixed the Power Transmitter circuit not properly displaying a message when activated. bugfix: Medical Analyzer circuit can now properly scan non-human mobs. /🆑 Additional details: - Plant Manipulation: obj/item/seeds harvest() proc and obj/machinery/hydroponics attack_hand() procs were adjusted slightly to allow this, returning a list when harvested. - Seed Extractor Module: obj/machinery/seed_extractor /proc/seedify() was adjusted to return a list of seeds. - Hydroponics replica pod was adjusted to be injectable|drawable, and use reagents and on_reagent_change() rather than a hardcoded attackby(), so other injection methods can use it to allow blood sampling/future reagent reactions regardless of type. - IC Examiner Module returns a list of examine() messages from mob/living/carbon, mob/living/carbon/human, mob/living/carbon/silicon, and mob/living/carbon/silicon/ai in the description data pin, rather than outputting null since they had an empty desc var. The relevant examine procs were adjusted to return their messages. - IC get_data() and set_pin_data() adjusted to return text/num properly and to WEAKREF/un-WEAKREF the contents of passed lists. * fixes errors from screwy merge conflicts and replaces illegal proc name * re-added a traits tag that accidentally got removed * review changes * plant analyzer outputs irrigation status and connected trays, search circuit uses 2 Cx down from 6 * examiner outputs the occupied turf of the examined object and can also scan turfs * string inputs on circuit pins now use multiline input; fixed edit/remove not working on list pins; fixed large screens not outputting visible messages when held * locomotion now has a cooldown of 0.1sec and their complexity + pathfinder complexity reduced * assemblies can open doors they have access to from a card reader through collision * Merge master branch; fixes pathfinder AStar runtime; fixes tile pointer; fixes material manager self-ref; various grammar touchups * review changes * fixes improper weakref type checking * fixes seed extractor merge confict, removes unnecessary weakref change * dang ol merge undoing my changes HECK * updated to robbym's tile pointer PR with clearer var names * added missing "not scanned" results to tile analyzer, removes duplicate circuit entries(???? how)
This commit is contained in:
committed by
CitadelStationBot
parent
3d4acf38a1
commit
187fb97388
@@ -23,6 +23,7 @@
|
||||
var/use_cyborg_cell = TRUE
|
||||
var/ext_next_use = 0
|
||||
var/atom/collw
|
||||
var/obj/item/card/id/access_card
|
||||
var/allowed_circuit_action_flags = IC_ACTION_COMBAT | IC_ACTION_LONG_RANGE //which circuit flags are allowed
|
||||
var/combat_circuits = 0 //number of combat cicuits in the assembly, used for diagnostic hud
|
||||
var/long_range_circuits = 0 //number of long range cicuits in the assembly, used for diagnostic hud
|
||||
@@ -66,6 +67,10 @@
|
||||
/obj/item/device/electronic_assembly/Collide(atom/AM)
|
||||
collw = AM
|
||||
.=..()
|
||||
if((istype(collw, /obj/machinery/door/airlock) || istype(collw, /obj/machinery/door/window)) && (!isnull(access_card)))
|
||||
var/obj/machinery/door/D = collw
|
||||
if(D.check_access(access_card))
|
||||
D.open()
|
||||
|
||||
/obj/item/device/electronic_assembly/Initialize()
|
||||
.=..()
|
||||
@@ -81,10 +86,13 @@
|
||||
diag_hud_set_circuitstat()
|
||||
diag_hud_set_circuittracking()
|
||||
|
||||
access_card = new /obj/item/card/id(src)
|
||||
|
||||
/obj/item/device/electronic_assembly/Destroy()
|
||||
STOP_PROCESSING(SScircuit, src)
|
||||
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
|
||||
diag_hud.remove_from_hud(src)
|
||||
QDEL_NULL(access_card)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/electronic_assembly/process()
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/proc/set_pin_data(pin_type, pin_number, datum/new_data)
|
||||
if(islist(new_data))
|
||||
for(var/i in 1 to length(new_data))
|
||||
if (istype(new_data) && !isweakref(new_data))
|
||||
new_data[i] = WEAKREF(new_data[i])
|
||||
if (istype(new_data) && !isweakref(new_data))
|
||||
new_data = WEAKREF(new_data)
|
||||
var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number)
|
||||
@@ -55,6 +59,10 @@
|
||||
return
|
||||
|
||||
/datum/integrated_io/proc/get_data()
|
||||
if(islist(data))
|
||||
for(var/i in 1 to length(data))
|
||||
if(isweakref(data[i]))
|
||||
data[i] = data[i].resolve()
|
||||
if(isweakref(data))
|
||||
return data.resolve()
|
||||
return data
|
||||
|
||||
@@ -185,7 +185,7 @@ D [1]/ ||
|
||||
var/new_data = null
|
||||
switch(type_to_use)
|
||||
if("string")
|
||||
new_data = stripped_input(user, "Now type in a string.","[src] string writing", istext(default) ? default : null, no_trim = TRUE)
|
||||
new_data = stripped_multiline_input(user, "Now type in a string.","[src] string writing", istext(default) ? default : null, no_trim = TRUE)
|
||||
if(istext(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input "+new_data+" into the pin.</span>")
|
||||
return new_data
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
t += "List length: [my_list.len]<br>"
|
||||
t += "<a href='?src=[REF(src)]'>\[Refresh\]</a> | "
|
||||
t += "<a href='?src=[REF(src)];add=1'>\[Add\]</a> | "
|
||||
t += "<a href='?src=[REF(src)];remove=1'>\[Remove\]</a> | "
|
||||
t += "<a href='?src=[REF(src)];edit=1'>\[Edit\]</a> | "
|
||||
t += "<a href='?src=[REF(src)];swap=1'>\[Swap\]</a> | "
|
||||
t += "<a href='?src=[REF(src)];clear=1'>\[Clear\]</a><br>"
|
||||
t += "<hr>"
|
||||
@@ -43,7 +45,7 @@
|
||||
return
|
||||
if(!position)
|
||||
return
|
||||
var/target_entry = my_list.Find(position)
|
||||
var/target_entry = my_list[position]
|
||||
if(target_entry)
|
||||
my_list.Remove(target_entry)
|
||||
|
||||
@@ -67,7 +69,7 @@
|
||||
if(holder.check_interactivity(user) && target_entry)
|
||||
var/edited_entry = ask_for_data_type(user, target_entry)
|
||||
if(edited_entry)
|
||||
target_entry = edited_entry
|
||||
my_list[my_list.Find(target_entry)] = edited_entry
|
||||
|
||||
/datum/integrated_io/lists/proc/edit_in_list_by_position(mob/user, var/position)
|
||||
var/list/my_list = data
|
||||
@@ -76,11 +78,11 @@
|
||||
return
|
||||
if(!position)
|
||||
return
|
||||
var/target_entry = my_list.Find(position)
|
||||
var/target_entry = my_list[position]
|
||||
if(target_entry)
|
||||
var/edited_entry = ask_for_data_type(user, target_entry)
|
||||
if(edited_entry)
|
||||
target_entry = edited_entry
|
||||
my_list[position] = edited_entry
|
||||
|
||||
/datum/integrated_io/lists/proc/swap_inside_list(mob/user, var/first_target, var/second_target)
|
||||
var/list/my_list = data
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name = "string pin"
|
||||
|
||||
/datum/integrated_io/string/ask_for_pin_data(mob/user)
|
||||
var/new_data = stripped_input(user, "Please type in a string.","[src] string writing", no_trim = TRUE)
|
||||
var/new_data = stripped_multiline_input(user, "Please type in a string.","[src] string writing", no_trim = TRUE)
|
||||
if(holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data ? "[new_data]" : "NULL"] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
Reference in New Issue
Block a user