From deac088c470bb3e6c03db6690dad19af733c98c0 Mon Sep 17 00:00:00 2001 From: Shadowlight213 Date: Tue, 22 Dec 2015 18:24:18 -0800 Subject: [PATCH 1/2] Adds a toggle for Admin AI interaction and makes it logged. Also fixes Admin interaction with emagging borgs via the robotics console --- code/_onclick/observer.dm | 2 +- code/game/machinery/computer/robot.dm | 2 +- code/modules/admin/admin_verbs.dm | 12 +++++++++++- code/modules/client/client defines.dm | 1 + code/modules/mob/mob_helpers.dm | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 8ef1b37a686..974bae0d993 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -43,7 +43,7 @@ // Oh by the way this didn't work with old click code which is why clicking shit didn't spam you /atom/proc/attack_ghost(mob/dead/observer/user) if(user.client) - if(check_rights(R_ADMIN, 0)) + if(check_rights(R_ADMIN, 0) && user.client.AI_Interact) attack_ai(user) if(user.client.prefs.inquisitive_ghost) user.examinate(src) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 9ac4e207cc3..a5b90751f49 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -59,7 +59,7 @@ dat += " Slaved to [R.connected_ai.name] |" else dat += " Independent from AI |" - if (istype(user, /mob/living/silicon)) + if (istype(user, /mob/living/silicon) || IsAdminGhost(usr)) if(((issilicon(user) && is_special_character(user)) || IsAdminGhost(usr)) && !R.emagged) dat += "(Hack) " dat += "([R.canmove ? "Lockdown" : "Release"]) " diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 366889c8df8..d42d9b28bef 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -60,7 +60,8 @@ var/list/admin_verbs_admin = list( /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ /client/proc/cmd_admin_local_narrate, /*sends text to all mobs within view of atom*/ /client/proc/cmd_admin_create_centcom_report, - /client/proc/toggle_antag_hud /*toggle display of the admin antag hud*/ + /client/proc/toggle_antag_hud, /*toggle display of the admin antag hud*/ + /client/proc/toggle_AI_interact /*toggle admin ability to interact with machines as an AI*/ ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, @@ -636,3 +637,12 @@ var/list/admin_verbs_hideable = list( testing("Spawned test mob with name \"[mob.name]\" at [tile.x],[tile.y],[tile.z]") while (!area && --j > 0) + +/client/proc/toggle_AI_interact() + set name = "Toggle Admin AI Interact" + set category = "Admin" + set desc = "Allows you to interact with most machines as an AI would as a ghost" + + AI_Interact = !AI_Interact + log_admin("[key_name(usr)] has [AI_Interact ? "activated" : "deactivated"] Admin AI Interact") + message_admins("[key_name_admin(usr)] has [AI_Interact ? "activated" : "deactivated"] their AI interaction") \ No newline at end of file diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index e5b4a1d2895..ad9ea063694 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -5,6 +5,7 @@ //////////////// var/datum/admins/holder = null var/buildmode = 0 + var/AI_Interact = 0 var/jobbancache = null //Used to cache this client's jobbans to save on DB queries var/last_message = "" //Contains the last message sent by this client - used to protect against copy-paste spamming. diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 2792e69b0f1..0b51dc021d1 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -373,7 +373,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return /proc/IsAdminGhost(var/mob/user) - if(check_rights(R_ADMIN, 0) && istype(user, /mob/dead/observer)) + if(check_rights(R_ADMIN, 0) && istype(user, /mob/dead/observer) && user.client.AI_Interact) return 1 else return 0 \ No newline at end of file From c2a35a7ab8a80735f329735fa6d1dbee9f844f92 Mon Sep 17 00:00:00 2001 From: Shadowlight213 Date: Fri, 25 Dec 2015 15:07:06 -0800 Subject: [PATCH 2/2] Changes click check --- code/_onclick/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 974bae0d993..411f562888b 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -43,7 +43,7 @@ // Oh by the way this didn't work with old click code which is why clicking shit didn't spam you /atom/proc/attack_ghost(mob/dead/observer/user) if(user.client) - if(check_rights(R_ADMIN, 0) && user.client.AI_Interact) + if(IsAdminGhost(user)) attack_ai(user) if(user.client.prefs.inquisitive_ghost) user.examinate(src)