Adds circutry to diagnostic hud, adds action flags to circuits (#35718)

cl
add: Circuits integrity, charge, and overall circuit composition is displayed on diagnostic huds. If the assembly has dangerous circuits then the status icon will display exclamation points, if the assembly can communicate with something far away a wifi icon will appear next to the status icon, and if the circuit can not operate the status icon will display an 'X'.
add: AR interface circuit which can modify the status icon if it is not displaying the exclamation points or the 'X'.
tweak: Locomotive circuits can no longer be added to assemblies that can't use them.
spellcheck: Fixed a typo in the grenade primer description.
code: Added flags to circuits that help group subsets of circuits and regulate them.
/cl

The diagnostic hud addition is meant to allow more counter play to circuits by seeing the assemblies's healths and how dangerous they are. The flags are a useful addition to the code because players shouldn't be able to put circuits in assemblies if the assembly can't use that circuit (this can also be used later for other assemblies which could use unique circuits).

The following circuits are flagged as dangerous:
weapon firing mechanism
grenade primer
thrower

The following circuits are flagged as long range:
NTNet networking circuit
integrated signaler
video camera circuit

possible AR interface displays:
default
alert
move
This commit is contained in:
Trevor Serpas
2018-02-19 19:33:11 -06:00
committed by CitadelStationBot
parent fef23bd7cc
commit 108f1c85ff
10 changed files with 179 additions and 11 deletions
@@ -171,6 +171,11 @@
var/obj/item/device/electronic_assembly/E = built
E.opened = TRUE
E.update_icon()
//reupdate diagnostic hud because it was put_in_hands() and not pickup()'ed
E.diag_hud_set_circuithealth()
E.diag_hud_set_circuitcell()
E.diag_hud_set_circuitstat()
E.diag_hud_set_circuittracking()
to_chat(usr, "<span class='notice'>[capitalize(built.name)] printed.</span>")
playsound(src, 'sound/items/jaws_pry.ogg', 50, TRUE)
@@ -205,6 +210,8 @@
to_chat(usr, "<span class='notice'>It uses advanced component designs.</span>")
else
to_chat(usr, "<span class='warning'>It uses unknown component designs. Printer upgrade is required to proceed.</span>")
if(program["unsupported_circuit"])
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>")
to_chat(usr, "<span class='notice'>Used space: [program["used_space"]]/[program["max_space"]].</span>")
to_chat(usr, "<span class='notice'>Complexity: [program["complexity"]]/[program["max_complexity"]].</span>")
to_chat(usr, "<span class='notice'>Metal cost: [program["metal_cost"]].</span>")
@@ -215,6 +222,8 @@
if(program["requires_upgrades"] && !upgraded)
to_chat(usr, "<span class='warning'>This program uses unknown component designs. Printer upgrade is required to proceed.</span>")
if(program["unsupported_circuit"])
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))