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
+52 -2
View File
@@ -52,10 +52,10 @@
/datum/atom_hud/data/diagnostic
/datum/atom_hud/data/diagnostic/basic
hud_icons = list (DIAG_HUD, DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_BOT_HUD, DIAG_TRACK_HUD, DIAG_AIRLOCK_HUD)
hud_icons = list (DIAG_HUD, DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_BOT_HUD, DIAG_CIRCUIT_HUD, DIAG_TRACK_HUD, DIAG_AIRLOCK_HUD)
/datum/atom_hud/data/diagnostic/advanced
hud_icons = list (DIAG_HUD, DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_BOT_HUD, DIAG_TRACK_HUD, DIAG_AIRLOCK_HUD, DIAG_PATH_HUD)
hud_icons = list (DIAG_HUD, DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_BOT_HUD, DIAG_CIRCUIT_HUD, DIAG_TRACK_HUD, DIAG_AIRLOCK_HUD, DIAG_PATH_HUD)
/datum/atom_hud/data/bot_path
hud_icons = list(DIAG_PATH_HUD)
@@ -415,6 +415,56 @@
else
holder.icon_state = ""
/*~~~~~~~~~~~~
Circutry!
~~~~~~~~~~~~~*/
/obj/item/device/electronic_assembly/proc/diag_hud_set_circuithealth(hide = FALSE)
var/image/holder = hud_list[DIAG_CIRCUIT_HUD]
var/icon/I = icon(icon, icon_state, dir)
holder.pixel_y = I.Height() - world.icon_size
if((!isturf(loc))||hide) //if not on the ground dont show overlay
holder.icon_state = null
else
holder.icon_state = "huddiag[RoundDiagBar(obj_integrity/max_integrity)]"
/obj/item/device/electronic_assembly/proc/diag_hud_set_circuitcell(hide = FALSE)
var/image/holder = hud_list[DIAG_BATT_HUD]
var/icon/I = icon(icon, icon_state, dir)
holder.pixel_y = I.Height() - world.icon_size
if((!isturf(loc))||hide) //if not on the ground dont show overlay
holder.icon_state = null
else if(battery)
var/chargelvl = battery.charge/battery.maxcharge
holder.icon_state = "hudbatt[RoundDiagBar(chargelvl)]"
else
holder.icon_state = "hudnobatt"
/obj/item/device/electronic_assembly/proc/diag_hud_set_circuitstat(hide = FALSE) //On, On and dangerous, or Off
var/image/holder = hud_list[DIAG_STAT_HUD]
var/icon/I = icon(icon, icon_state, dir)
holder.pixel_y = I.Height() - world.icon_size
if((!isturf(loc))||hide) //if not on the ground dont show overlay
holder.icon_state = null
else if(!battery)
holder.icon_state = "hudoffline"
else if(battery.charge == 0)
holder.icon_state = "hudoffline"
else if(combat_circuits) //has a circuit that can harm people
holder.icon_state = "hudwarn"
else //Bot is on and not dangerous
holder.icon_state = prefered_hud_icon
/obj/item/device/electronic_assembly/proc/diag_hud_set_circuittracking(hide = FALSE)
var/image/holder = hud_list[DIAG_TRACK_HUD]
var/icon/I = icon(icon, icon_state, dir)
holder.pixel_y = I.Height() - world.icon_size
if((!isturf(loc))||hide) //if not on the ground dont show overlay
holder.icon_state = null
else if(long_range_circuits)
holder.icon_state = "hudtracking"
else
holder.icon_state = null
/*~~~~~~~~~~~~
Airlocks!
~~~~~~~~~~~~~*/