From ea815d1c93ff453f15f650381fdc5176e41156c7 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 19 May 2024 03:30:35 -0300 Subject: [PATCH] push --- code/modules/mob/living/silicon/ai/ai.dm | 51 ++---------------------- tgstation.dme | 1 + 2 files changed, 5 insertions(+), 47 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index efe94a3261..541f467e9b 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -100,7 +100,6 @@ var/display_icon_override var/emote_display = "Neutral" //text string of the current emote we set for the status displays, to prevent logins resetting it. - // TODO: Currently unused, needs port from TG. var/datum/robot_control/robot_control // TODO: Currently unused, needs port from TG. /// Station alert datum for showing alerts UI @@ -203,8 +202,7 @@ QDEL_NULL(spark_system) QDEL_NULL(malf_picker) QDEL_NULL(doomsday_device) - // TODO: Port implementation of these from TG or remove the unused code. - // QDEL_NULL(robot_control) + QDEL_NULL(robot_control) // QDEL_NULL(alert_control) QDEL_NULL(aiMulti) QDEL_NULL(aiPDA) @@ -480,24 +478,6 @@ else to_chat(src, "Target is not on or near any active cameras on the station.") return - if(href_list["callbot"]) //Command a bot to move to a selected location. - if(call_bot_cooldown > world.time) - to_chat(src, "Error: Your last call bot command is still processing, please wait for the bot to finish calculating a route.") - return - Bot = locate(href_list["callbot"]) in GLOB.alive_mob_list - if(!Bot || Bot.remote_disabled || src.control_disabled) - return //True if there is no bot found, the bot is manually emagged, or the AI is carded with wireless off. - waypoint_mode = 1 - to_chat(src, "Set your waypoint by clicking on a valid location free of obstructions.") - return - if(href_list["interface"]) //Remotely connect to a bot! - Bot = locate(href_list["interface"]) in GLOB.alive_mob_list - if(!Bot || Bot.remote_disabled || src.control_disabled) - return - Bot.attack_ai(src) - if(href_list["botrefresh"]) //Refreshes the bot control panel. - botcall() - return if (href_list["ai_take_control"]) //Mech domination var/obj/vehicle/sealed/mecha/M = locate(href_list["ai_take_control"]) in GLOB.mechas_list @@ -544,33 +524,11 @@ set category = "AI Commands" set name = "Access Robot Control" set desc = "Wirelessly control various automatic robots." - if(incapacitated()) - return - if(control_disabled) - to_chat(src, "Wireless control is disabled.") - return - var/turf/ai_current_turf = get_turf(src) - var/ai_Zlevel = ai_current_turf.z - var/d - d += "Query network status
" - d += "" + if(!robot_control) + robot_control = new(src) - for (Bot in GLOB.alive_mob_list) - if(Bot.z == ai_Zlevel && !Bot.remote_disabled) //Only non-emagged bots on the same Z-level are detected! - var/bot_mode = Bot.get_mode() - d += "" - //If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all. - d += "" - d += "" - d += "" - d += "" - d += "" - d = format_text(d) - - var/datum/browser/popup = new(src, "botcall", "Remote Robot Control", 700, 400) - popup.set_content(d) - popup.open() + robot_control.ui_interact(src) /mob/living/silicon/ai/proc/set_waypoint(atom/A) var/turf/turf_check = get_turf(A) @@ -595,7 +553,6 @@ Bot.call_bot(src, waypoint) call_bot_cooldown = 0 - /mob/living/silicon/ai/triggerAlarm(class, area/home, cameras, obj/source) if(source.z != z) return diff --git a/tgstation.dme b/tgstation.dme index 7d0afa0259..a201f09456 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2840,6 +2840,7 @@ #include "code\modules\mob\living\silicon\ai\login.dm" #include "code\modules\mob\living\silicon\ai\logout.dm" #include "code\modules\mob\living\silicon\ai\multicam.dm" +#include "code\modules\mob\living\silicon\ai\robot_control.dm" #include "code\modules\mob\living\silicon\ai\say.dm" #include "code\modules\mob\living\silicon\ai\vox_sounds.dm" #include "code\modules\mob\living\silicon\ai\freelook\cameranet.dm"

Name

Status

Location

Control

[Bot.hacked ? "(!)" : ""] [Bot.name] ([Bot.model])[bot_mode][get_area_name(Bot, TRUE)]InterfaceCall