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:
committed by
CitadelStationBot
parent
fef23bd7cc
commit
108f1c85ff
@@ -20,6 +20,11 @@
|
||||
var/charge_tick = FALSE
|
||||
var/charge_delay = 4
|
||||
var/use_cyborg_cell = TRUE
|
||||
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
|
||||
var/prefered_hud_icon = "hudstat" // Used by the AR circuit to change the hud icon.
|
||||
hud_possible = list(DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_TRACK_HUD, DIAG_CIRCUIT_HUD) //diagnostic hud overlays
|
||||
max_integrity = 50
|
||||
armor = list("melee" = 50, "bullet" = 70, "laser" = 70, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
|
||||
|
||||
@@ -32,14 +37,29 @@
|
||||
START_PROCESSING(SScircuit, src)
|
||||
materials[MAT_METAL] = round((max_complexity + max_components) / 4) * SScircuit.cost_multiplier
|
||||
|
||||
//sets up diagnostic hud view
|
||||
prepare_huds()
|
||||
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
|
||||
diag_hud.add_to_hud(src)
|
||||
diag_hud_set_circuithealth()
|
||||
diag_hud_set_circuitcell()
|
||||
diag_hud_set_circuitstat()
|
||||
diag_hud_set_circuittracking()
|
||||
|
||||
/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)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/electronic_assembly/process()
|
||||
handle_idle_power()
|
||||
check_pulling()
|
||||
|
||||
//updates diagnostic hud
|
||||
diag_hud_set_circuithealth()
|
||||
diag_hud_set_circuitcell()
|
||||
|
||||
/obj/item/device/electronic_assembly/proc/handle_idle_power()
|
||||
// First we generate power.
|
||||
for(var/obj/item/integrated_circuit/passive/power/P in assembly_components)
|
||||
@@ -127,6 +147,7 @@
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
to_chat(usr, "<span class='notice'>You pull \the [battery] out of \the [src]'s power supplier.</span>")
|
||||
battery = null
|
||||
diag_hud_set_circuitstat() //update diagnostic hud
|
||||
|
||||
if(href_list["component"])
|
||||
var/obj/item/integrated_circuit/component = locate(href_list["component"]) in assembly_components
|
||||
@@ -170,6 +191,22 @@
|
||||
|
||||
interact(usr) // To refresh the UI.
|
||||
|
||||
/obj/item/device/electronic_assembly/pickup(mob/living/user)
|
||||
. = ..()
|
||||
//update diagnostic hud when picked up, true is used to force the hud to be hidden
|
||||
diag_hud_set_circuithealth(TRUE)
|
||||
diag_hud_set_circuitcell(TRUE)
|
||||
diag_hud_set_circuitstat(TRUE)
|
||||
diag_hud_set_circuittracking(TRUE)
|
||||
|
||||
/obj/item/device/electronic_assembly/dropped(mob/user)
|
||||
. = ..()
|
||||
//update diagnostic hud when dropped
|
||||
diag_hud_set_circuithealth()
|
||||
diag_hud_set_circuitcell()
|
||||
diag_hud_set_circuitstat()
|
||||
diag_hud_set_circuittracking()
|
||||
|
||||
/obj/item/device/electronic_assembly/proc/rename()
|
||||
var/mob/M = usr
|
||||
if(!check_interactivity(M))
|
||||
@@ -232,6 +269,9 @@
|
||||
if((total_complexity + IC.complexity) > max_complexity)
|
||||
to_chat(user, "<span class='warning'>You can't seem to add the '[IC]', since this setup's too complicated for the case.</span>")
|
||||
return FALSE
|
||||
if((allowed_circuit_action_flags & IC.action_flags) != IC.action_flags)
|
||||
to_chat(user, "<span class='warning'>You can't seem to add the '[IC]', since the case doesn't support the circuit type.</span>")
|
||||
return FALSE
|
||||
|
||||
if(!user.transferItemToLoc(IC, src))
|
||||
return FALSE
|
||||
@@ -249,6 +289,16 @@
|
||||
component.assembly = src
|
||||
assembly_components |= component
|
||||
|
||||
//increment numbers for diagnostic hud
|
||||
if(component.action_flags & IC_ACTION_COMBAT)
|
||||
combat_circuits += 1;
|
||||
if(component.action_flags & IC_ACTION_LONG_RANGE)
|
||||
long_range_circuits += 1;
|
||||
|
||||
//diagnostic hud update
|
||||
diag_hud_set_circuitstat()
|
||||
diag_hud_set_circuittracking()
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/proc/try_remove_component(obj/item/integrated_circuit/IC, mob/user, silent)
|
||||
if(!opened)
|
||||
@@ -276,6 +326,16 @@
|
||||
component.assembly = null
|
||||
assembly_components.Remove(component)
|
||||
|
||||
//decriment numbers for diagnostic hud
|
||||
if(component.action_flags & IC_ACTION_COMBAT)
|
||||
combat_circuits -= 1;
|
||||
if(component.action_flags & IC_ACTION_LONG_RANGE)
|
||||
long_range_circuits -= 1;
|
||||
|
||||
//diagnostic hud update
|
||||
diag_hud_set_circuitstat()
|
||||
diag_hud_set_circuittracking()
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/afterattack(atom/target, mob/user, proximity)
|
||||
for(var/obj/item/integrated_circuit/input/S in assembly_components)
|
||||
@@ -313,6 +373,7 @@
|
||||
user.transferItemToLoc(I, loc)
|
||||
cell.forceMove(src)
|
||||
battery = cell
|
||||
diag_hud_set_circuitstat() //update diagnostic hud
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You slot \the [cell] inside \the [src]'s power supplier.</span>")
|
||||
interact(user)
|
||||
@@ -498,6 +559,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
max_components = IC_MAX_SIZE_BASE * 3
|
||||
max_complexity = IC_COMPLEXITY_BASE * 3
|
||||
allowed_circuit_action_flags = IC_ACTION_MOVEMENT | IC_ACTION_COMBAT | IC_ACTION_LONG_RANGE
|
||||
|
||||
/obj/item/device/electronic_assembly/drone/can_move()
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user