From 17e16ad0c29c976dd9c9fa717316be1830f10432 Mon Sep 17 00:00:00 2001
From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Date: Wed, 23 Aug 2023 05:09:28 -0400
Subject: [PATCH] Replaces Camera bug with Camera tablet app (#77713)
## About The Pull Request
Replaces the Traitor's Camera Bug item with an application that allows
you to view camera apps.
The difference between this app and the Security one is that it does not
have an access requirement, does not make noise (it didn't previously
due to a bug, fixed in this PR), and can be installed on PDAs.
This can also be installed from syndienet, which means nukies now have a
way to see the station cameras while off the ship.
Adds Syndicate app disks, which are made of Gold. This is only used by
the Camera app as of right now.
I also fixed some issues along the way;
- Camera tablet app now properly shows cameras
- It now properly makes the noises it is supposed to
- It clears the viewers properly on the ui being closed or the app being
exited.
Syndicate app disks ddelete their apps upon being transferred over (like
maintenance disks), trying to remain consistent with previous behavior.
I also made this for a [personal project I am currently working
on](https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA). I could just make this UI
be TGUI, but I thought it could be worth trying to turn it into a better
item first.
Tracking people is much simpler now- You choose anyone from a list of
people found on cameras, and it will try to find a camera that sees
them. It follows them until you close the app or switch camera.
https://github.com/tgstation/tgstation/assets/53777086/1536ebb9-0c4f-45bb-b593-f98791ea6d23
## Why It's Good For The Game
The Camera Bug is one of the worst traitor items as of current. You can
remotely shut off a single camera, something that can be done with basic
tools you are likely carrying around anyways, and uses an HTML clunky UI
to flip through cameras.
This new Traitor item makes it much easier to use, since the camera
consoles are something you are likely already used to.
It also means emagging a tablet is slightly more useful, and golden data
disks are pretty cool.
Unfortunately this means that they no longer grant illegal tech, because
otherwise you can simply clone the app infinitely for personal use, and
deconstruct the disk itself for tech. This can be grinded into gold, but
I think if we want an illegal tech item, it'll have to find a new host.
Closes https://github.com/tgstation/tgstation/issues/74839
Closes https://github.com/tgstation/tgstation/issues/39975
Closes https://github.com/tgstation/tgstation/issues/53820
## Changelog
:cl:
balance: The Traitor's Camera bug is now a tablet app that works like a
silent camera console with an extra ability to track people through
their nearby cameras.
/:cl:
---
.../SpaceRuins/old_infiltrator.dmm | 2 +-
.../SpaceRuins/turretedoutpost.dmm | 2 +-
code/_globalvars/bitfields.dm | 14 +-
code/game/machinery/camera/camera.dm | 22 --
code/game/machinery/camera/trackable.dm | 2 +-
.../telecomms/computers/telemonitor.dm | 1 +
.../objects/effects/spawners/random/exotic.dm | 2 +-
code/game/objects/items/devices/camera_bug.dm | 319 ------------------
.../game/objects/items/storage/uplink_kits.dm | 6 +-
code/modules/jobs/job_types/scientist.dm | 1 -
.../living/silicon/ai/freelook/cameranet.dm | 11 +-
.../computers/item/computer_ui.dm | 9 +-
.../computers/item/disks/unique_disks.dm | 8 +
.../modular_computers/file_system/program.dm | 11 +-
.../file_system/programs/airestorer.dm | 2 +-
.../file_system/programs/antagonist/dos.dm | 2 +-
.../file_system/programs/borg_monitor.dm | 6 +-
.../file_system/programs/card.dm | 2 +-
.../maintenance/_maintenance_program.dm | 8 +-
.../file_system/programs/ntdownloader.dm | 2 +-
.../file_system/programs/ntnrc_client.dm | 2 +-
.../file_system/programs/radar.dm | 4 +-
.../file_system/programs/secureye.dm | 109 ++++--
.../file_system/programs/signalcommander.dm | 2 +-
.../file_system/programs/sm_monitor.dm | 2 +-
.../uplink/uplink_items/device_tools.dm | 9 +-
tgstation.dme | 2 +-
.../packages/tgui/interfaces/NtosSecurEye.tsx | 10 +-
28 files changed, 159 insertions(+), 413 deletions(-)
delete mode 100644 code/game/objects/items/devices/camera_bug.dm
create mode 100644 code/modules/modular_computers/computers/item/disks/unique_disks.dm
diff --git a/_maps/RandomRuins/SpaceRuins/old_infiltrator.dmm b/_maps/RandomRuins/SpaceRuins/old_infiltrator.dmm
index eb3d1ca2ba4..afa11afbc9a 100644
--- a/_maps/RandomRuins/SpaceRuins/old_infiltrator.dmm
+++ b/_maps/RandomRuins/SpaceRuins/old_infiltrator.dmm
@@ -215,7 +215,7 @@
pixel_y = -4;
pixel_x = -7
},
-/obj/item/camera_bug{
+/obj/item/computer_disk/syndicate/camera_app{
pixel_x = -5;
pixel_y = 9
},
diff --git a/_maps/RandomRuins/SpaceRuins/turretedoutpost.dmm b/_maps/RandomRuins/SpaceRuins/turretedoutpost.dmm
index ea8945d63a2..4be262c6fd0 100644
--- a/_maps/RandomRuins/SpaceRuins/turretedoutpost.dmm
+++ b/_maps/RandomRuins/SpaceRuins/turretedoutpost.dmm
@@ -244,7 +244,7 @@
/area/ruin/space/has_grav/turretedoutpost)
"Iq" = (
/obj/structure/table/reinforced,
-/obj/item/camera_bug,
+/obj/item/computer_disk/syndicate/camera_app,
/turf/open/floor/iron,
/area/ruin/space/has_grav/turretedoutpost)
"LS" = (
diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm
index 93b9c70f1fe..5bbad7fe0a2 100644
--- a/code/_globalvars/bitfields.dm
+++ b/code/_globalvars/bitfields.dm
@@ -282,18 +282,18 @@ DEFINE_BITFIELD(movement_type, list(
))
DEFINE_BITFIELD(obj_flags, list(
- "BLOCK_Z_IN_DOWN" = BLOCK_Z_IN_DOWN,
- "BLOCK_Z_IN_UP" = BLOCK_Z_IN_UP,
- "BLOCK_Z_OUT_DOWN" = BLOCK_Z_OUT_DOWN,
- "BLOCK_Z_OUT_UP" = BLOCK_Z_OUT_UP,
+ "IN_USE" = IN_USE,
+ "EMAGGED" = EMAGGED,
"CAN_BE_HIT" = CAN_BE_HIT,
"DANGEROUS_POSSESSION" = DANGEROUS_POSSESSION,
- "EMAGGED" = EMAGGED,
- "IN_USE" = IN_USE,
+ "UNIQUE_RENAME" = UNIQUE_RENAME,
+ "BLOCK_Z_OUT_DOWN" = BLOCK_Z_OUT_DOWN,
+ "BLOCK_Z_OUT_UP" = BLOCK_Z_OUT_UP,
+ "BLOCK_Z_IN_DOWN" = BLOCK_Z_IN_DOWN,
+ "BLOCK_Z_IN_UP" = BLOCK_Z_IN_UP,
"BLOCKS_CONSTRUCTION" = BLOCKS_CONSTRUCTION,
"BLOCKS_CONSTRUCTION_DIR" = BLOCKS_CONSTRUCTION_DIR,
"IGNORE_DENSITY" = IGNORE_DENSITY,
- "UNIQUE_RENAME" = UNIQUE_RENAME,
))
DEFINE_BITFIELD(pass_flags, list(
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 4f22cf9424a..3ab9aeb089d 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -18,7 +18,6 @@
var/status = TRUE
var/start_active = FALSE //If it ignores the random chance to start broken on round start
var/invuln = null
- var/obj/item/camera_bug/bug = null
var/datum/weakref/assembly_ref = null
var/area/myarea = null
@@ -129,12 +128,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0)
LAZYREMOVE(myarea.cameras, src)
QDEL_NULL(alarm_manager)
QDEL_NULL(assembly_ref)
- if(bug)
- bug.bugged_cameras -= c_tag
- if(bug.current == src)
- bug.current = null
- bug = null
-
QDEL_NULL(last_shown_paper)
return ..()
@@ -422,21 +415,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0)
to_chat(potential_viewer, "[span_name(user)] holds \a [item_name] up to your camera...")
return
-
- if(istype(attacking_item, /obj/item/camera_bug))
- if(!can_use())
- to_chat(user, span_notice("Camera non-functional."))
- return
- if(bug)
- to_chat(user, span_notice("Camera bug removed."))
- bug.bugged_cameras -= src.c_tag
- bug = null
- else
- to_chat(user, span_notice("Camera bugged."))
- bug = attacking_item
- bug.bugged_cameras[src.c_tag] = WEAKREF(src)
- return
-
return ..()
diff --git a/code/game/machinery/camera/trackable.dm b/code/game/machinery/camera/trackable.dm
index 86f6f4cfb90..8aedd1b80a8 100644
--- a/code/game/machinery/camera/trackable.dm
+++ b/code/game/machinery/camera/trackable.dm
@@ -21,7 +21,7 @@
///List of all non-humans trackable by cameras, split so humans take priority.
VAR_PRIVATE/static/list/others = list()
-/datum/trackable/New(mob/source)
+/datum/trackable/New(atom/source)
. = ..()
tracking_holder = source
RegisterSignal(tracking_holder, COMSIG_MOB_RESET_PERSPECTIVE, PROC_REF(cancel_target_tracking))
diff --git a/code/game/machinery/telecomms/computers/telemonitor.dm b/code/game/machinery/telecomms/computers/telemonitor.dm
index 3d12932d99d..b862a6372b7 100644
--- a/code/game/machinery/telecomms/computers/telemonitor.dm
+++ b/code/game/machinery/telecomms/computers/telemonitor.dm
@@ -98,6 +98,7 @@
screen = MAIN_VIEW
return TRUE
return TRUE
+
/obj/machinery/computer/telecomms/monitor/attackby()
. = ..()
updateUsrDialog()
diff --git a/code/game/objects/effects/spawners/random/exotic.dm b/code/game/objects/effects/spawners/random/exotic.dm
index e82b73672f8..add4faf5c50 100644
--- a/code/game/objects/effects/spawners/random/exotic.dm
+++ b/code/game/objects/effects/spawners/random/exotic.dm
@@ -9,7 +9,7 @@
loot = list( // Space loot spawner. Couple of random bits of technology-adjacent stuff including anomaly cores and BEPIS techs.
/obj/item/raw_anomaly_core/random,
/obj/item/disk/design_disk/bepis,
- /obj/item/camera_bug,
+ /obj/item/computer_disk/syndicate/camera_app,
)
/obj/effect/spawner/random/exotic/languagebook
diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm
deleted file mode 100644
index 918b7313691..00000000000
--- a/code/game/objects/items/devices/camera_bug.dm
+++ /dev/null
@@ -1,319 +0,0 @@
-
-#define BUGMODE_LIST 0
-#define BUGMODE_MONITOR 1
-#define BUGMODE_TRACK 2
-
-
-
-/obj/item/camera_bug
- name = "camera bug"
- desc = "For illicit snooping through the camera network."
- icon = 'icons/obj/device.dmi'
- icon_state = "camera_bug"
- w_class = WEIGHT_CLASS_TINY
- inhand_icon_state = "camera_bug"
- throw_speed = 4
- throw_range = 20
- item_flags = NOBLUDGEON
-
- var/obj/machinery/camera/current = null
-
- var/last_net_update = 0
- var/list/bugged_cameras = list()
-
- var/track_mode = BUGMODE_LIST
- var/last_tracked = 0
- var/refresh_interval = 50
-
- var/tracked_name = null
- var/atom/tracking = null
-
- var/last_found = null
- var/last_seen = null
-
-/obj/item/camera_bug/Initialize(mapload)
- . = ..()
- START_PROCESSING(SSobj, src)
-
-/obj/item/camera_bug/Destroy()
- STOP_PROCESSING(SSobj, src)
- get_cameras()
- for(var/cam_tag in bugged_cameras)
- var/datum/weakref/camera_ref = bugged_cameras[cam_tag]
- var/obj/machinery/camera/camera = camera_ref.resolve()
- if(camera && camera.bug == src)
- camera.bug = null
- bugged_cameras = list()
- if(tracking)
- tracking = null
- return ..()
-
-/obj/item/camera_bug/interact(mob/user)
- ui_interact(user)
-
-/obj/item/camera_bug/ui_interact(mob/user = usr)
- . = ..()
- var/datum/browser/popup = new(user, "camerabug","Camera Bug",nref=src)
- popup.set_content(menu(get_cameras()))
- popup.open()
-
-/obj/item/camera_bug/attack_self(mob/user)
- user.set_machine(src)
- interact(user)
-
-/obj/item/camera_bug/check_eye(mob/user)
- if ( loc != user || user.incapacitated() || user.is_blind() || !current )
- user.unset_machine()
- return FALSE
- if(!is_valid_z_level(get_turf(current), get_turf(user.loc)) || !current.can_use())
- to_chat(user, span_danger("[src] has lost the signal."))
- current = null
- user.unset_machine()
- return FALSE
- return TRUE
-/obj/item/camera_bug/on_unset_machine(mob/user)
- user.reset_perspective(null)
-
-/obj/item/camera_bug/proc/get_cameras()
- if( world.time > (last_net_update + 100))
- bugged_cameras = list()
- for(var/obj/machinery/camera/camera as anything in GLOB.cameranet.cameras)
- if(camera.machine_stat || !camera.can_use())
- continue
- if(length(list("ss13","mine", "rd", "labor", "ordnance", "minisat") & camera.network))
- var/datum/weakref/camera_ref = WEAKREF(camera)
- if(!camera_ref || !camera.c_tag)
- continue
- bugged_cameras[camera.c_tag] = camera_ref
- return sort_list(bugged_cameras)
-
-
-/obj/item/camera_bug/proc/menu(list/cameras)
- if(!cameras || !cameras.len)
- return "No bugged cameras found."
-
- var/html
- switch(track_mode)
- if(BUGMODE_LIST)
- html = "