TGUI Part 1: Wires, Point Defense, and Advanced Shields (#3823)

* TGUI Wires, Point Defense, and Advanced Shields

Sources:
VOREStation/VOREStation/pull/7083
VOREStation/VOREStation/pull/7118
VOREStation/VOREStation/pull/8444
VOREStation/VOREStation/pull/10131

* Maybe this?

* YOOOOOO I'M DUMB

* Fixes Energy Shields
This commit is contained in:
Zandario
2022-03-21 21:23:22 -07:00
committed by GitHub
parent 031aad3fe0
commit b18d74baa6
93 changed files with 2800 additions and 1306 deletions
+31 -11
View File
@@ -4,28 +4,34 @@
description_info = "This device disrupts shields on directly adjacent tiles (in a + shaped pattern). They are commonly installed around exterior airlocks to prevent shields from blocking EVA access."
icon = 'icons/obj/machines/shielding.dmi'
icon_state = "fdiffuser_on"
circuit = /obj/item/circuitboard/shield_diffuser
use_power = USE_POWER_ACTIVE
idle_power_usage = 25 // Previously 100.
active_power_usage = 500 // Previously 2000
anchored = 1
density = 0
anchored = TRUE
density = FALSE
level = 1
var/alarm = 0
var/enabled = 1
var/alarm = FALSE
var/enabled = TRUE
/obj/machinery/shield_diffuser/Initialize(mapload)
. = ..()
// TODO - Remove this bit once machines are converted to Initialize
if(ispath(circuit))
circuit = new circuit(src)
default_apply_parts()
var/turf/T = get_turf(src)
hide(!T.is_plating())
//If underfloor, hide the cable
//If underfloor, hide the cable^H^H diffuser
/obj/machinery/shield_diffuser/hide(var/i)
if(istype(loc, /turf))
invisibility = i ? 101 : 0
update_icon()
/obj/machinery/shield_diffuser/hides_under_flooring()
return 1
return TRUE
/obj/machinery/shield_diffuser/process(delta_time)
if(alarm)
@@ -38,6 +44,9 @@
return
for(var/direction in GLOB.cardinal)
var/turf/simulated/shielded_tile = get_step(get_turf(src), direction)
for(var/obj/effect/shield/S in shielded_tile)
S.diffuse(5)
// Legacy shield support
for(var/obj/effect/energy_field/S in shielded_tile)
qdel(S)
@@ -50,16 +59,27 @@
else
icon_state = "fdiffuser_on"
/obj/machinery/shield_diffuser/attack_hand()
/obj/machinery/shield_diffuser/attack_hand(mob/user as mob)
if((. = ..()))
return
if(alarm)
to_chat(usr, "You press an override button on \the [src], re-enabling it.")
to_chat(user, "You press an override button on \the [src], re-enabling it.")
alarm = 0
update_icon()
return
enabled = !enabled
update_use_power(enabled ? USE_POWER_ACTIVE : USE_POWER_IDLE)
update_icon()
to_chat(usr, "You turn \the [src] [enabled ? "on" : "off"].")
to_chat(user, "You turn \the [src] [enabled ? "on" : "off"].")
/obj/machinery/shield_diffuser/attackby(var/obj/item/W, var/mob/user)
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
return
if(default_part_replacement(user, W))
return
return ..()
/obj/machinery/shield_diffuser/proc/meteor_alarm(var/duration)
if(!duration)
@@ -69,6 +89,6 @@
/obj/machinery/shield_diffuser/examine(var/mob/user)
. = ..()
. += "It is [enabled ? "enabled" : "disabled"]."
to_chat(user, "It is [enabled ? "enabled" : "disabled"].")
if(alarm)
. += "A red LED labeled \"Proximity Alarm\" is blinking on the control panel."
to_chat(user, "A red LED labeled \"Proximity Alarm\" is blinking on the control panel.")