From 60b6e0ad28166574db2f67d6053344d144165aac Mon Sep 17 00:00:00 2001 From: LordNest Date: Mon, 20 Jan 2025 13:45:32 +0400 Subject: [PATCH 1/4] NTNet cameras --- mods/ntnet/code/NTNet-core.dm | 4 ++ mods/ntnet/code/NTNet-items.dm | 11 +++++ mods/ntnet/code/terminal/commands/connect.dm | 42 +++++++++++++++++++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/mods/ntnet/code/NTNet-core.dm b/mods/ntnet/code/NTNet-core.dm index 8c326defc9459..689c3ba09ad16 100644 --- a/mods/ntnet/code/NTNet-core.dm +++ b/mods/ntnet/code/NTNet-core.dm @@ -32,6 +32,10 @@ GLOBAL_LIST_INIT(NTNet_machines, list()) GLOB.NTNet_machines += src get_new_ntnet_id("PC") +/obj/machinery/camera/Initialize() + . = ..() + GLOB.NTNet_machines += src + get_new_ntnet_id("CM") /datum/terminal/proc/get_remote_ID(ID) for(var/obj/machinery/R as anything in SSmachines.get_all_machinery()) diff --git a/mods/ntnet/code/NTNet-items.dm b/mods/ntnet/code/NTNet-items.dm index 5950a898a4412..01589f60be340 100644 --- a/mods/ntnet/code/NTNet-items.dm +++ b/mods/ntnet/code/NTNet-items.dm @@ -31,11 +31,22 @@ . = ..() if(hasHUD(user, HUD_IT) && has_electronics && terminal()) to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) + if(issilicon(user)) + to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) /obj/machinery/firealarm/examine(mob/user) . = ..() if(hasHUD(user, HUD_IT)) to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) + if(issilicon(user)) + to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) + +/obj/machinery/camera/examine(mob/user) + . = ..() + if(hasHUD(user, HUD_IT)) + to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) + if(issilicon(user)) + to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) /obj/item/modular_computer/examine(mob/user) . = ..() diff --git a/mods/ntnet/code/terminal/commands/connect.dm b/mods/ntnet/code/terminal/commands/connect.dm index 02d06c02298e9..4619f2860fe8e 100644 --- a/mods/ntnet/code/terminal/commands/connect.dm +++ b/mods/ntnet/code/terminal/commands/connect.dm @@ -44,7 +44,7 @@ . += " Airlock timing: [REMOTE.normalspeed ? "STABLE" : "OVERRIDEN"].
" . += " Safety protocols: [REMOTE.safe ? "STABLE" : "OVERRIDEN"].
" . += "Required Access: [length(REMOTE.req_access)>=1 ? "([jointext(REMOTE.req_access, ", ") ])" : "ACCESS NOT REQUIRED"].
" - . += "Acces check: [has_access(REMOTE.req_access, user.GetAccess()) ? "GRANTED" : "DENIED"]." + . += "Access check: [has_access(REMOTE.req_access, user.GetAccess()) ? "GRANTED" : "DENIED"]." return if(!has_access(REMOTE.req_access, user.GetAccess())) // && !override) @@ -161,3 +161,43 @@ else . += "Syntax mismach" + +// SECURITY CAMERA + if (copytext(txt[2],1,3) == "CM") + var/NTID = txt[2] + var/obj/machinery/camera/REMOTE = terminal.get_remote_ID(NTID) + if (length(txt)==2) + . += "Outputting data about security camera([NTID]):
" + . += "Name: [REMOTE.name]

" + . += "Camera Alarm: [REMOTE.alarm_on ? "ON" : "OFF"]

" + var/camera_focus + switch(REMOTE.view_range) + if(2) + camera_focus = "DEFOCUSED" + if(7) + camera_focus = "NOMINAL" + else + camera_focus = "MISMATCHED" + . += " Focus: [camera_focus].
" + return + else if (length(txt)==3) + switch(txt[3]) + // triggering camera alarm + if("-alarm") + REMOTE.alarm_on = 1 + return "Alarm Triggered" + if("-light_up") + REMOTE.light_disabled = 0 + return "Light up" + if("-light_down") + REMOTE.light_disabled = 1 + return "Light down" + if("-defocus") + REMOTE.setViewRange(2) + return "Camera defocused" + if("-focus") + REMOTE.setViewRange(7) + return "Camera focused" + + else + . += "Syntax mismach" From c033a3ae3d87b7f3de971d7fc25832f430bbaad9 Mon Sep 17 00:00:00 2001 From: LordNest Date: Mon, 20 Jan 2025 14:24:00 +0400 Subject: [PATCH 2/4] multimeter supreme --- mods/utility_items/code/wires.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/utility_items/code/wires.dm b/mods/utility_items/code/wires.dm index d89ce6386eee5..c10b7a367983d 100644 --- a/mods/utility_items/code/wires.dm +++ b/mods/utility_items/code/wires.dm @@ -99,6 +99,7 @@ /datum/wires/apc/SolveWireFunction(function) var/sf = "" + var/obj/machinery/power/apc/APC = holder switch(function) if(APC_WIRE_IDSCAN) sf = "Port A" @@ -107,12 +108,13 @@ if(APC_WIRE_MAIN_POWER2) sf = "Port C" if(APC_WIRE_AI_CONTROL) - sf = "Port D" + sf = "Port D (NTNet ID = [APC.NTNet_id])" return sf /datum/wires/camera/SolveWireFunction(function) var/sf = "" + var/obj/machinery/camera/CAM = holder switch(function) if(CAMERA_WIRE_FOCUS) sf = "Port A" @@ -123,7 +125,7 @@ if(CAMERA_WIRE_ALARM) sf = "Port D" if(CAMERA_WIRE_NOTHING1) - sf = "Port E" + sf = "Port E (NTNet ID = [CAM.NTNet_id])" if(CAMERA_WIRE_NOTHING2) sf = "Port F" From a22568d88ddbc5bf60e7a4fbf336beb180532c95 Mon Sep 17 00:00:00 2001 From: LordNest Date: Tue, 21 Jan 2025 11:05:21 +0400 Subject: [PATCH 3/4] Air alarm superiority --- mods/ntnet/code/NTNet-core.dm | 5 ++ mods/ntnet/code/NTNet-items.dm | 7 ++ mods/ntnet/code/terminal/commands/connect.dm | 86 +++++++++++++++++++- mods/utility_items/code/wires.dm | 3 +- 4 files changed, 97 insertions(+), 4 deletions(-) diff --git a/mods/ntnet/code/NTNet-core.dm b/mods/ntnet/code/NTNet-core.dm index 689c3ba09ad16..b91f8c9d52096 100644 --- a/mods/ntnet/code/NTNet-core.dm +++ b/mods/ntnet/code/NTNet-core.dm @@ -32,6 +32,11 @@ GLOBAL_LIST_INIT(NTNet_machines, list()) GLOB.NTNet_machines += src get_new_ntnet_id("PC") +/obj/machinery/alarm/Initialize() + . = ..() + GLOB.NTNet_machines += src + get_new_ntnet_id("AA") + /obj/machinery/camera/Initialize() . = ..() GLOB.NTNet_machines += src diff --git a/mods/ntnet/code/NTNet-items.dm b/mods/ntnet/code/NTNet-items.dm index 01589f60be340..90a4ef42d2cfc 100644 --- a/mods/ntnet/code/NTNet-items.dm +++ b/mods/ntnet/code/NTNet-items.dm @@ -34,6 +34,13 @@ if(issilicon(user)) to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) +/obj/machinery/alarm/examine(mob/user) + . = ..() + if(hasHUD(user, HUD_IT)) + to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) + if(issilicon(user)) + to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) + /obj/machinery/firealarm/examine(mob/user) . = ..() if(hasHUD(user, HUD_IT)) diff --git a/mods/ntnet/code/terminal/commands/connect.dm b/mods/ntnet/code/terminal/commands/connect.dm index 4619f2860fe8e..ad381e771d213 100644 --- a/mods/ntnet/code/terminal/commands/connect.dm +++ b/mods/ntnet/code/terminal/commands/connect.dm @@ -137,6 +137,87 @@ else return "ACCESS ERROR" +// Atmospheric Alarm + if (copytext(txt[2],1,3) == "AA") + var/NTID = txt[2] + var/obj/machinery/alarm/REMOTE = terminal.get_remote_ID(NTID) + if (length(txt)==2) + . += "Outputting data about Atmospheric Alarm([NTID]):
" + . += "Name:[copytext(REMOTE.name,2)]
" + . += "Status:[REMOTE.locked ? "BLOCKED" : "OPEN"]

" + . += "AI control:[REMOTE.aidisabled ? "OUT OF SERVICE" : "ACTIVE"]

" + var/alarm_level + switch(REMOTE.danger_level) + if(1) + alarm_level = "MINOR" + if(0) + alarm_level = "CLEAR" + else + alarm_level = "SEVERE" + var/alarm_mode + switch(REMOTE.mode) + if(6) + alarm_mode = "OFF" + if(5) + alarm_mode = "FILL" + if(4) + alarm_mode = "CYCLE" + if(3) + alarm_mode = "SIPHONING" + if(2) + alarm_mode = "REPLACEMENT" + if(1) + alarm_mode = "SCRUBBING" + else + alarm_mode = "NO DATA" + . += "
Local functional data:
" + . += " Current alarm level: [alarm_level].
" + . += " Current operating mode: [alarm_mode].
" + return + + + if ((length(txt)==3) && (has_access(REMOTE.req_access, user.GetAccess() || !REMOTE.locked))) + switch(txt[3]) + //lock-unlock panel + if("-lock") + REMOTE.locked = 1 + . += "Atmospheric Alarm panel BLOCKED" + REMOTE.update_icon() + if("-unlock") + REMOTE.locked = 0 + . += "Atmospheric Alarm OPEN" + REMOTE.update_icon() + //Toggle Alarm mode + if("-mode-scrub") + REMOTE.mode = 1 + REMOTE.apply_mode() + . += "Atmospheric Alarm mode set to SCRUBBING" + if("-mode-replace") + REMOTE.mode = 2 + REMOTE.apply_mode() + . += "Atmospheric Alarm mode set to REPLACEMENT" + if("-mode-siphon") + REMOTE.mode = 3 + REMOTE.apply_mode() + . += "Atmospheric Alarm mode set to SIPHONING" + if("-mode-cycle") + REMOTE.mode = 4 + REMOTE.apply_mode() + . += "Atmospheric Alarm mode set to CYCLE" + if("-mode-fill") + REMOTE.mode = 5 + REMOTE.apply_mode() + . += "Atmospheric Alarm mode set to FILL" + if("-mode-off") + REMOTE.mode = 6 + REMOTE.apply_mode() + . += "Atmospheric Alarm mode set to OFF" + + else + return "Wrong parametr" + return + else + return "ACCESS ERROR" // FIREALARM if (copytext(txt[2],1,3) == "FA") @@ -159,9 +240,6 @@ REMOTE.detecting = !REMOTE.detecting return "Automatic switched to: [REMOTE.detecting ? "ON" : "OFF"]." - else - . += "Syntax mismach" - // SECURITY CAMERA if (copytext(txt[2],1,3) == "CM") var/NTID = txt[2] @@ -186,12 +264,14 @@ if("-alarm") REMOTE.alarm_on = 1 return "Alarm Triggered" + // camera lights (can AI toggle it?) if("-light_up") REMOTE.light_disabled = 0 return "Light up" if("-light_down") REMOTE.light_disabled = 1 return "Light down" + // camera focus (AI vision range) if("-defocus") REMOTE.setViewRange(2) return "Camera defocused" diff --git a/mods/utility_items/code/wires.dm b/mods/utility_items/code/wires.dm index c10b7a367983d..2afc7df02767a 100644 --- a/mods/utility_items/code/wires.dm +++ b/mods/utility_items/code/wires.dm @@ -83,6 +83,7 @@ /datum/wires/alarm/SolveWireFunction(function) var/sf = "" + var/obj/machinery/power/apc/AIR = holder switch(function) if(AALARM_WIRE_IDSCAN) sf = "Port A" @@ -91,7 +92,7 @@ if(AALARM_WIRE_SYPHON) sf = "Port C" if(AALARM_WIRE_AI_CONTROL) - sf = "Port D" + sf = "Port D (NTNet ID = [AIR.NTNet_id])" if(AALARM_WIRE_AALARM) sf = "Port E" From 9fb1dde34bf8fa32b041afbb9c2193ae562418e8 Mon Sep 17 00:00:00 2001 From: LordNest Date: Tue, 21 Jan 2025 13:09:03 +0400 Subject: [PATCH 4/4] if else or not if else --- mods/ntnet/code/NTNet-items.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ntnet/code/NTNet-items.dm b/mods/ntnet/code/NTNet-items.dm index 90a4ef42d2cfc..16ba7a572d273 100644 --- a/mods/ntnet/code/NTNet-items.dm +++ b/mods/ntnet/code/NTNet-items.dm @@ -31,28 +31,28 @@ . = ..() if(hasHUD(user, HUD_IT) && has_electronics && terminal()) to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) - if(issilicon(user)) + else if(issilicon(user)) to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) /obj/machinery/alarm/examine(mob/user) . = ..() if(hasHUD(user, HUD_IT)) to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) - if(issilicon(user)) + else if(issilicon(user)) to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) /obj/machinery/firealarm/examine(mob/user) . = ..() if(hasHUD(user, HUD_IT)) to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) - if(issilicon(user)) + else if(issilicon(user)) to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) /obj/machinery/camera/examine(mob/user) . = ..() if(hasHUD(user, HUD_IT)) to_chat(user, SPAN_INFO(SPAN_ITALIC("You may notice a small hologram that says: [NTNet_id]"))) - if(issilicon(user)) + else if(issilicon(user)) to_chat(user, SPAN_INFO(SPAN_ITALIC("Chosen device network ID: [NTNet_id]"))) /obj/item/modular_computer/examine(mob/user)