From cb82dd950e79cea9b4b6b79d3873890c06b876fc Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Thu, 12 Feb 2015 12:19:06 +0100 Subject: [PATCH] Adds a floppy disk which provides access to the station camera network given appropriate hardware. --- code/game/gamemodes/game_mode.dm | 3 +- .../machinery/computer3/computers/camera.dm | 50 +++++++++++++++++-- code/game/machinery/computer3/networking.dm | 3 ++ .../game/machinery/computer3/program_disks.dm | 7 +++ 4 files changed, 58 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index e12b9bb021..cf85fe32b8 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -55,7 +55,8 @@ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Spy Kit", "SK"), new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"), new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP"), - new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC") + new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC"), + new/datum/uplink_item(/obj/item/weapon/disk/file/cameras/syndicate, 6, "Camera Network Access - Floppy", "SF") ), "Devices and Tools" = list( new/datum/uplink_item(/obj/item/weapon/storage/toolbox/syndicate, 1, "Fully Loaded Toolbox", "ST"), diff --git a/code/game/machinery/computer3/computers/camera.dm b/code/game/machinery/computer3/computers/camera.dm index 9342d2731f..17f14e0cbf 100644 --- a/code/game/machinery/computer3/computers/camera.dm +++ b/code/game/machinery/computer3/computers/camera.dm @@ -123,6 +123,12 @@ desc = "Monitors the prison." networks = list("Prison") +/datum/file/camnet_key/syndicate + name = "Camera Network Key" + title = "%!#BUFFER OVERFLOW" + desc = "Connects to security cameras." + networks = list("SS13") + hidden_file = 1 /* @@ -174,7 +180,7 @@ /datum/file/program/security name = "camera monitor" - desc = "Connets to the Nanotrasen Camera Network" + desc = "Connects to the Nanotrasen Camera Network" image = 'icons/ntos/camera.png' active_state = "camera-static" @@ -268,15 +274,19 @@ reset_current() usr.reset_view(null) key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key) - camera_list = null - update_icon() - computer.update_icon() + select_key(key) if(key) interact() else usr << "The screen turns to static." return +/datum/file/program/security/proc/select_key(var/selected_key) + key = selected_key + camera_list = null + update_icon() + computer.update_icon() + /datum/file/program/security/proc/set_current(var/obj/machinery/camera/C) if(current == C) return @@ -300,3 +310,35 @@ // Atlantis: Required for camnetkeys to work. /datum/file/program/security/hidden hidden_file = 1 + +/* + Camera monitoring program + + Works much as the parent program, except: + * It requires a camera to be found using the proximity network card. + * It begins with all cam-access. +*/ + +/datum/file/program/security/syndicate + name = "camer# moni!%r" + desc = "Cons the Nanotrash Camera Network" + var/special_key = new/datum/file/camnet_key/syndicate + var/camera_conn = null + + interact() + if(!interactable()) + return + + if(!computer.net) + computer.Crash(MISSING_PERIPHERAL) + return + + camera_conn = computer.net.connect_to(/obj/machinery/camera,camera_conn) + + if(!camera_conn) + computer.Crash(NETWORK_FAILURE) + return + + // On interact, override camera key selection + select_key(special_key) + ..() diff --git a/code/game/machinery/computer3/networking.dm b/code/game/machinery/computer3/networking.dm index 4e39da0406..27d7789008 100644 --- a/code/game/machinery/computer3/networking.dm +++ b/code/game/machinery/computer3/networking.dm @@ -169,6 +169,9 @@ if(typekey == null) typekey = /obj/machinery var/list/machines = list() + for(var/obj/O in T) + if(istype(O,typekey)) + machines += O for(var/d in cardinal) var/turf/T2 = get_step(T,d) for(var/obj/O in T2) diff --git a/code/game/machinery/computer3/program_disks.dm b/code/game/machinery/computer3/program_disks.dm index 201fff3939..e9a649499b 100644 --- a/code/game/machinery/computer3/program_disks.dm +++ b/code/game/machinery/computer3/program_disks.dm @@ -28,6 +28,13 @@ icon_state = "datadisk_arcade" spawn_files = list(/datum/file/program/security) +/obj/item/weapon/disk/file/cameras/syndicate + name = "Camera Viewer" + desc = "A program install disk. A crude skull has been drawn on it and there is a list of items:\nFloppy Drive\nCamera Card\nNetwork Card: Adjacent\nPosition laptop nearby camera, enjoy." + icon = 'icons/obj/stock_parts.dmi' + icon_state = "datadisk_arcade" + spawn_files = list(/datum/file/program/security/syndicate) + /obj/item/weapon/disk/file/card name = "ID Card Modifier" desc = "A program install disk."