[MIRROR] Compromised APCs now flicker their darkblue screen, and it cannot be seen from cameras. [MDB IGNORE] (#25627)

* Compromised APCs now flicker their darkblue screen, and it cannot be seen from cameras.

* Update atom_hud.dm

* Update hud.dm

* Update apc.dm

---------

Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-12-15 11:18:02 -05:00
committed by GitHub
co-authored by zxaber Bloop
parent b3900d5d42
commit f96b1e24b7
12 changed files with 47 additions and 23 deletions
+1 -3
View File
@@ -80,10 +80,8 @@
#define UPSTATE_BROKE (1<<3)
/// The APC is undergoing maintenance.
#define UPSTATE_MAINT (1<<4)
/// The APC is emagged or malfed.
#define UPSTATE_BLUESCREEN (1<<5)
/// The APCs wires are exposed.
#define UPSTATE_WIREEXP (1<<6)
#define UPSTATE_WIREEXP (1<<5)
// update_overlay
// Bitflags:
+5 -2
View File
@@ -45,6 +45,8 @@
#define FAN_HUD "21"
/// Mech camera HUD
#define DIAG_CAMERA_HUD "22"
/// Steady Hacked APC effect, visible only to Malf AIs
#define MALF_APC_HUD "23"
// SKYRAT EDIT ADDITION BEGIN - gun permits and DNR
/// ammo of guns
@@ -72,8 +74,9 @@
#define DATA_HUD_SENTIENT_DISEASE 8
#define DATA_HUD_AI_DETECT 9
#define DATA_HUD_FAN 10
#define DATA_HUD_PERMIT 11 //SKYRAT EDIT
#define DATA_HUD_DNR 12 // SKYRAT EDIT
#define DATA_HUD_MALF_APC 11
#define DATA_HUD_PERMIT 12 //SKYRAT EDIT
#define DATA_HUD_DNR 13 // SKYRAT EDIT
/// cooldown for being shown the images for any particular data hud
#define ADD_HUD_TO_COOLDOWN 20
+1
View File
@@ -18,6 +18,7 @@ GLOBAL_LIST_INIT(huds, list(
DATA_HUD_SENTIENT_DISEASE = new/datum/atom_hud/sentient_disease(),
DATA_HUD_AI_DETECT = new/datum/atom_hud/ai_detector(),
DATA_HUD_FAN = new/datum/atom_hud/data/human/fan_hud(),
DATA_HUD_MALF_APC = new/datum/atom_hud/data/malf_apc(),
DATA_HUD_PERMIT = new/datum/atom_hud/data/human/permit(), // SKYRAT EDIT ADDITION
DATA_HUD_DNR = new/datum/atom_hud/data/human/dnr(), // SKYRAT EDIT ADDITION
))
+10
View File
@@ -81,6 +81,9 @@
for(var/mob/camera/ai_eye/eye as anything in GLOB.aiEyes)
eye.update_ai_detect_hud()
/datum/atom_hud/data/malf_apc
hud_icons = list(MALF_APC_HUD)
/* MED/SEC/DIAG HUD HOOKS */
/*
@@ -572,3 +575,10 @@ Diagnostic HUDs!
var/image/holder = hud_list[DIAG_AIRLOCK_HUD]
holder.icon_state = "electrified"
set_hud_image_active(DIAG_AIRLOCK_HUD)
/// Applies hacked overlay for malf AIs
/obj/machinery/power/apc/proc/set_hacked_hud()
var/image/holder = hud_list[MALF_APC_HUD]
holder.loc = get_turf(src)
SET_PLANE(holder,ABOVE_LIGHTING_PLANE,src)
set_hud_image_active(MALF_APC_HUD)
@@ -50,6 +50,9 @@
owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/malf.ogg', 100, FALSE, pressure_affected = FALSE, use_reverb = FALSE)
owner.current.grant_language(/datum/language/codespeak, source = LANGUAGE_MALF)
var/datum/atom_hud/data/hackyhud = GLOB.huds[DATA_HUD_MALF_APC]
hackyhud.show_to(owner.current)
return ..()
/datum/antagonist/malf_ai/on_removal()
+2 -2
View File
@@ -1044,10 +1044,10 @@
apc.malfhack = TRUE
apc.locked = TRUE
apc.coverlocked = TRUE
apc.flicker_hacked_icon()
apc.set_hacked_hud()
playsound(get_turf(src), 'sound/machines/ding.ogg', 50, TRUE, ignore_walls = FALSE)
to_chat(src, "Hack complete. [apc] is now under your exclusive control.")
apc.update_appearance()
/mob/living/silicon/ai/verb/deploy_to_shell(mob/living/silicon/robot/target)
set category = "AI Commands"
+13 -10
View File
@@ -18,11 +18,6 @@
set_light(light_on_range)
return
if(update_state & UPSTATE_BLUESCREEN)
set_light_color(LIGHT_COLOR_BLUE)
set_light(light_on_range)
return
set_light(0)
/obj/machinery/power/apc/update_icon_state()
@@ -39,9 +34,6 @@
if(update_state & UPSTATE_BROKE)
icon_state = "apc-b"
return ..()
if(update_state & UPSTATE_BLUESCREEN)
icon_state = "apcemag"
return ..()
if(update_state & UPSTATE_WIREEXP)
icon_state = "apcewires"
return ..()
@@ -85,8 +77,6 @@
if(cell)
new_update_state |= UPSTATE_CELL_IN
else if((obj_flags & EMAGGED) || malfai)
new_update_state |= UPSTATE_BLUESCREEN
else if(panel_open)
new_update_state |= UPSTATE_WIREEXP
@@ -116,3 +106,16 @@
// Used in process so it doesn't update the icon too much
/obj/machinery/power/apc/proc/queue_icon_update()
icon_update_needed = TRUE
// Shows a dark-blue interface for a moment. Shouldn't appear on cameras.
/obj/machinery/power/apc/proc/flicker_hacked_icon()
var/image/hacker_image = image(icon = 'icons/obj/machines/wallmounts.dmi', loc = src, icon_state = "apcemag", layer = FLOAT_LAYER)
var/list/mobs_to_show = list()
// Collecting mobs the APC can see for this animation, rather than mobs that can see the APC. Important distinction, intended such that mobs on camera / with XRAY cannot see the flicker.
for(var/mob/viewer in view(src))
if(viewer.client)
mobs_to_show += viewer.client
if(malfai?.client)
mobs_to_show |= malfai.client
flick_overlay_global(hacker_image, mobs_to_show, 1 SECONDS)
hacked_flicker_counter = rand(3, 5) //The counter is decrimented in the process() proc, which runs every two seconds.
+11 -1
View File
@@ -71,6 +71,8 @@
var/malfhack = FALSE //New var for my changes to AI malf. --NeoFite
///Reference to our ai hacker
var/mob/living/silicon/ai/malfai = null //See above --NeoFite
///Counter for displaying the hacked overlay to mobs within view
var/hacked_flicker_counter = 0
///State of the electronics inside (missing, installed, secured)
var/has_electronics = APC_ELECTRONICS_MISSING
///used for the Blackout malf module
@@ -154,6 +156,10 @@
offset_old = pixel_x
pixel_x = -APC_PIXEL_OFFSET
hud_list = list(
MALF_APC_HUD = image(icon = 'icons/mob/huds/hud.dmi', icon_state = "apc_hacked", pixel_x = src.pixel_x, pixel_y = src.pixel_y)
)
//Assign it to its area. If mappers already assigned an area string fast load the area from it else get the current area
var/area/our_area = get_area(loc)
if(areastring)
@@ -227,7 +233,6 @@
QDEL_NULL(cell)
if(terminal)
disconnect_terminal()
return ..()
/obj/machinery/power/apc/proc/assign_to_area(area/target_area = get_area(src))
@@ -482,6 +487,11 @@
force_update = TRUE
return
if(obj_flags & EMAGGED || malfai)
hacked_flicker_counter = hacked_flicker_counter - 1
if(hacked_flicker_counter <= 0)
flicker_hacked_icon()
//dont use any power from that channel if we shut that power channel off
lastused_light = APC_CHANNEL_IS_ON(lighting) ? area.power_usage[AREA_USAGE_LIGHT] + area.power_usage[AREA_USAGE_STATIC_LIGHT] : 0
lastused_equip = APC_CHANNEL_IS_ON(equipment) ? area.power_usage[AREA_USAGE_EQUIP] + area.power_usage[AREA_USAGE_STATIC_EQUIP] : 0
+1
View File
@@ -220,6 +220,7 @@
locked = FALSE
balloon_alert(user, "interface damaged")
update_appearance()
flicker_hacked_icon()
return TRUE
// damage and destruction acts
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

@@ -22,9 +22,4 @@
set_light(light_on_range)
return TRUE
if(update_state & UPSTATE_BLUESCREEN)
set_light_color(LIGHT_COLOR_BLUE)
set_light(light_on_range)
return TRUE
set_light(0)