mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #13936 from Shadowlight213/AdminAIToggle2
Makes Admin AI interaction a logged toggle. Take 2
This commit is contained in:
@@ -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(IsAdminGhost(user))
|
||||
attack_ai(user)
|
||||
if(user.client.prefs.inquisitive_ghost)
|
||||
user.examinate(src)
|
||||
|
||||
@@ -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 += "<A href='?src=\ref[src];magbot=\ref[R]'>(<font color=blue><i>Hack</i></font>)</A> "
|
||||
dat += "<A href='?src=\ref[src];stopbot=\ref[R]'>(<font color=green><i>[R.canmove ? "Lockdown" : "Release"]</i></font>)</A> "
|
||||
|
||||
@@ -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,
|
||||
@@ -638,3 +639,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")
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user