mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
Ports advanced shield generators from Baystation
- Creates new advanced shield generators, designed to replace old hull and bubble shield generators. - Upgrades the floor mounted and handheld shield diffusers. - Makes underfloor shield diffusers actually constructable. - Handheld diffusers orderable via uplink. - Removes supply packs and research datums for the old generators, but leaves their code in place for maps that still use them. - Integrates with the meteor and electrical storm events. - Integrates with mob AI (they know how to attack it)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
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/weapon/circuitboard/shield_diffuser
|
||||
use_power = USE_POWER_ACTIVE
|
||||
idle_power_usage = 25 // Previously 100.
|
||||
active_power_usage = 500 // Previously 2000
|
||||
@@ -13,12 +14,17 @@
|
||||
var/alarm = 0
|
||||
var/enabled = 1
|
||||
|
||||
/obj/machinery/shield_diffuser/New()
|
||||
..()
|
||||
/obj/machinery/shield_diffuser/Initialize()
|
||||
. = ..()
|
||||
// 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
|
||||
@@ -38,6 +44,9 @@
|
||||
return
|
||||
for(var/direction in 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)
|
||||
@@ -71,4 +91,4 @@
|
||||
. = ..()
|
||||
to_chat(user, "It is [enabled ? "enabled" : "disabled"].")
|
||||
if(alarm)
|
||||
to_chat(user, "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.")
|
||||
|
||||
Reference in New Issue
Block a user