Merge pull request #5607 from Citadel-Station-13/upstream-merge-35578

[MIRROR] Adds a debug circuitry printer, along with some assorted circuit fixes and tweaks
This commit is contained in:
deathride58
2018-02-20 15:24:26 +00:00
committed by GitHub
5 changed files with 36 additions and 25 deletions

View File

@@ -8,7 +8,7 @@
/obj/item/device/integrated_electronics/analyzer/afterattack(var/atom/A, var/mob/living/user)
if(istype(A, /obj/item/device/electronic_assembly))
var/saved = SScircuit.save_electronic_assembly(A)
var/saved = "[A.name] analyzed! On circuit printers with cloning enabled, you may use the code below to clone the circuit:<br><br><code>[SScircuit.save_electronic_assembly(A)]</code>"
if(saved)
to_chat(user, "<span class='notice'>You scan [A].</span>")
user << browse(saved, "window=circuit_scan;size=500x600;border=1;can_resize=1;can_close=1;can_minimize=1")

View File

@@ -6,6 +6,7 @@
w_class = WEIGHT_CLASS_BULKY
var/upgraded = FALSE // When hit with an upgrade disk, will turn true, allowing it to print the higher tier circuits.
var/can_clone = FALSE // Same for above, but will allow the printer to duplicate a specific assembly.
var/debug = FALSE // If it's upgraded and can clone, even without config settings.
var/current_category = null
var/recycling = FALSE // If an assembly is being emptied into this printer
var/list/program // Currently loaded save, in form of list
@@ -17,6 +18,11 @@
upgraded = TRUE
can_clone = TRUE
/obj/item/device/integrated_circuit_printer/debug //translation: "integrated_circuit_printer/local_server"
name = "debug circuit printer"
debug = TRUE
w_class = WEIGHT_CLASS_TINY
/obj/item/device/integrated_circuit_printer/Initialize()
. = ..()
AddComponent(/datum/component/material_container, list(MAT_METAL), MINERAL_MATERIAL_AMOUNT * 25, TRUE, list(/obj/item/stack, /obj/item/integrated_circuit, /obj/item/device/electronic_assembly))
@@ -92,17 +98,20 @@
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/HTML = "<center><h2>Integrated Circuit Printer</h2></center><br>"
HTML += "Metal: [materials.total_amount]/[materials.max_amount].<br><br>"
if(debug)
HTML += "<center><h3>DEBUG PRINTER -- Infinite materials. Cloning available.</h3></center>"
else
HTML += "Metal: [materials.total_amount]/[materials.max_amount].<br><br>"
if(CONFIG_GET(flag/ic_printing))
if(CONFIG_GET(flag/ic_printing) && !debug)
HTML += "Assembly cloning: [can_clone ? "Available": "Unavailable"].<br>"
HTML += "Circuits available: [upgraded ? "Advanced":"Regular"]."
HTML += "Circuits available: [upgraded || debug ? "Advanced":"Regular"]."
if(!upgraded)
HTML += "<br>Crossed out circuits mean that the printer is not sufficiently upgraded to create that circuit."
HTML += "<hr>"
if(can_clone && CONFIG_GET(flag/ic_printing))
if((can_clone && CONFIG_GET(flag/ic_printing)) || debug)
HTML += "Here you can load script for your assembly.<br>"
HTML += " <A href='?src=[REF(src)];print=load'>{Load Program}</a> "
if(!program)
@@ -160,7 +169,7 @@
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(!materials.use_amount_type(cost, MAT_METAL))
if(!debug && !materials.use_amount_type(cost, MAT_METAL))
to_chat(usr, "<span class='warning'>You need [cost] metal to build that!</span>")
return TRUE
@@ -181,7 +190,7 @@
playsound(src, 'sound/items/jaws_pry.ogg', 50, TRUE)
if(href_list["print"])
if(!CONFIG_GET(flag/ic_printing))
if(!CONFIG_GET(flag/ic_printing) && !debug)
to_chat(usr, "<span class='warning'>CentCom has disabled printing of custom circuitry due to recent allegations of copyright infringement.</span>")
return
if(!can_clone) // Copying and printing ICs is cloning
@@ -226,7 +235,7 @@
to_chat(usr, "<span class='warning'>This program uses components not supported by the specified assembly. Please change the assembly type in the save file to a supported one.</span>")
else
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(materials.use_amount_type(program["metal_cost"], MAT_METAL))
if(debug || materials.use_amount_type(program["metal_cost"], MAT_METAL))
var/obj/item/assembly = SScircuit.load_electronic_assembly(get_turf(src), program)
to_chat(usr, "<span class='notice'>[assembly] has been printed from the provided template!</span>")
playsound(src, 'sound/items/poster_being_created.ogg', 50, TRUE)