Files
BatrachophrenoandGitHub 7172d3dbe3 NTNet Extensibility (#22908)
Fixes https://github.com/Aurorastation/Aurora.3/issues/21944

Spiritual successor of
https://github.com/Aurorastation/Aurora.3/pull/22352
Cherrypicked changes from the C3 Crew Management branch, this PR
contains all NTNet extensibility features, including Field Relay
construction, off-site camera usage (contingent on standing up remote
hardware and being out of jamming), etc. This also fixes a handful of
outstanding telecomms and view/mobeye-related bugs adjacent to where I
was working.

changes:
- rscadd: "Adds NTNet extensibility, requires new machinery constructed
on away-site z-levels."
- rscadd: "Breaks NTNet Relay machinery into Quantum Relay ('core' obj
on Horizon) and Field Relay (deployable off-site constructions)."
- qol: "Embedded cameras (basically every video camera EXCEPT those
which are installed on walls) can now be viewed from NTNet-connected
z-level, not just connected ones."
- rscadd: "Adds several public camera monitor consoles to the Horizon
(near where public sensor grid feed consoles already exist)."
- rscadd: "Adds some spare camera console boards to Horizon technical
storage."
- qol: "Adds action button for 'cancel-camera-view' verb while viewing
cameras or looking up/down z-level."
- bugfix: "Fixes Jockey comms (frequency was missing from ANTAG_FREQS)."
- bugfix: "Fixes look-up/look-down actions intermittently failing
without first using cancel-camera-view."
2026-08-02 01:24:45 +00:00

202 lines
6.1 KiB
Plaintext

/obj/item/camera_assembly
name = "camera assembly"
desc = "A pre-fabricated security camera kit, ready to be assembled and mounted to a surface."
icon = 'icons/obj/monitors.dmi'
icon_state = "cameracase"
w_class = WEIGHT_CLASS_SMALL
anchored = 0
matter = list(MATERIAL_ALUMINIUM = 700, MATERIAL_GLASS = 300)
// Motion, EMP-Proof, X-Ray
var/list/obj/item/possible_upgrades = list(/obj/item/assembly/prox_sensor, /obj/item/stack/material/osmium, /obj/item/stock_parts/scanning_module)
var/list/upgrades = list()
var/camera_name
var/camera_network
var/state = 0
var/busy = 0
/*
0 = Nothing done to it
1 = Wrenched in place
2 = Welded in place
3 = Wires attached to it (you can now attach/dettach upgrades)
4 = Screwdriver panel closed and is fully built (you cannot attach upgrades)
*/
/obj/item/camera_assembly/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(0)
// State 0
if(attacking_item.tool_behaviour == TOOL_WRENCH && isturf(src.loc))
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You wrench the assembly into place.")
anchored = 1
state = 1
update_icon()
auto_turn()
return TRUE
if(1)
// State 1
if(attacking_item.tool_behaviour == TOOL_WELDER)
if(weld(attacking_item, user))
to_chat(user, "You weld the assembly securely into place.")
anchored = 1
state = 2
return TRUE
else if(attacking_item.tool_behaviour == TOOL_WRENCH)
attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unattach the assembly from its place.")
anchored = 0
update_icon()
state = 0
return TRUE
if(2)
// State 2
if(attacking_item.tool_behaviour == TOOL_CABLECOIL)
var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(2))
to_chat(user, SPAN_NOTICE("You add wires to the assembly."))
state = 3
else
to_chat(user, SPAN_WARNING("You need 2 coils of wire to wire the assembly."))
return TRUE
else if(attacking_item.tool_behaviour == TOOL_WELDER)
if(weld(attacking_item, user))
to_chat(user, "You unweld the assembly from its place.")
state = 1
anchored = 1
return TRUE
if(3)
// State 3
if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
attacking_item.play_tool_sound(get_turf(src), 50)
var/input = sanitize( tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Station,Security,Secret",
"Set Network", (camera_network ? camera_network : NETWORK_STATION)) )
if(!input)
to_chat(usr, "No input found please hang up and try your call again.")
return TRUE
var/list/tempnetwork = text2list(input, ",")
if(tempnetwork.len < 1)
to_chat(usr, "No network found please hang up and try your call again.")
return TRUE
var/area/camera_area = get_area(src)
var/area_display_name = get_area_display_name(camera_area)
var/temptag = "[sanitize(area_display_name)] ([rand(1, 999)])"
input = sanitizeSafe( tgui_input_text(user, "How would you like to name the camera?", "Set Camera Name", (camera_name ? camera_name : temptag), MAX_NAME_LEN), MAX_NAME_LEN )
state = 4
var/obj/structure/machinery/camera/C = new(src.loc)
QDEL_NULL(C.assembly)
src.forceMove(C)
C.assembly = src
C.auto_turn()
C.replace_networks(uniquelist(tempnetwork))
C.c_tag = input
C.setPowerUsage()
if(C.isMotion() && !(SSmachinery.processing[C]))
START_PROCESSING_MACHINE(C, MACHINERY_PROCESS_SELF)
C.update_coverage()
for(var/i = 5; i >= 0; i -= 1)
var/direct = tgui_input_list(user, "Direction?", "Assembling Camera", list("Confirm", "NORTH", "EAST", "SOUTH", "WEST"))
if(direct != "Confirm")
C.dir = text2dir(direct)
C.set_pixel_offsets()
if(i != 0)
var/confirm = tgui_input_list(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", list("Yes", "No"))
if(confirm == "Yes")
break
return TRUE
else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER)
new/obj/item/stack/cable_coil(get_turf(src), 2)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
to_chat(user, "You cut the wires from the circuits.")
state = 2
return TRUE
// Upgrades!
var/upgrade_type
for(var/possible_upgrade in possible_upgrades)
if(istype(attacking_item, possible_upgrade))
upgrade_type = possible_upgrade
break
if(upgrade_type)
if(state != 3)
to_chat(user, SPAN_WARNING("You need to wire the assembly before installing upgrades."))
return TRUE
if(locate(upgrade_type) in upgrades)
to_chat(user, SPAN_WARNING("\The [src] already has that upgrade installed."))
return TRUE
if(istype(attacking_item, /obj/item/stock_parts/scanning_module))
var/obj/item/stock_parts/scanning_module/SM = attacking_item
if(SM.rating < 2)
to_chat(user, SPAN_WARNING("That scanning module doesn't seem advanced enough."))
return TRUE
to_chat(user, "You attach \the [attacking_item] into the assembly inner circuits.")
upgrades += attacking_item
user.remove_from_mob(attacking_item)
attacking_item.forceMove(src)
return TRUE
// Taking out upgrades
else if(attacking_item.tool_behaviour == TOOL_CROWBAR && upgrades.len)
if(state != 3)
to_chat(user, SPAN_WARNING("You need access to the wired circuits before removing upgrades."))
return TRUE
var/obj/U = locate(/obj) in upgrades
if(U)
to_chat(user, "You unattach an upgrade from the assembly.")
attacking_item.play_tool_sound(get_turf(src), 50)
U.forceMove(get_turf(src))
upgrades -= U
return
..()
/obj/item/camera_assembly/update_icon()
if(anchored)
icon_state = "camera1"
else
icon_state = "cameracase"
/obj/item/camera_assembly/attack_hand(mob/user as mob)
if(!anchored)
..()
/obj/item/camera_assembly/proc/weld(var/obj/item/weldingtool/WT, var/mob/user)
if(busy)
return 0
if(!WT.isOn())
return 0
to_chat(user, SPAN_NOTICE("You start to weld the [src].."))
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
user.flash_act(FLASH_PROTECTION_MAJOR)
busy = 1
if(WT.use_tool(src, user, 20, volume = 50))
busy = 0
if(!WT.isOn())
return 0
return 1
busy = 0
return 0