AI deploy to shell verb does not take an input (#94664)

## About The Pull Request

Fixes #94663 
It seems that using the "Deploy to Shell" verb as an AI will launch a
popup asking which mob in view you want to trigger the verb as, which is
obviously unintended behaviour.
I've resolved this by moving all of the behaviour to a proc which the
verb calls, so existing code which passes in a mob should still function
as it did previously.

There might be a different way to do this but I'll be honest I try not
to ever add verbs so I don't know what it is.

## Why It's Good For The Game

When you use a verb from the verb panel you implicitly expect to be the
mob using the verb, not to have to select yourself from a list first.

## Changelog

🆑
fix: AI shell deployment verb no longer requires you to select yourself
from a list first
/🆑
This commit is contained in:
Jacquerel
2025-12-31 11:53:27 -05:00
committed by GitHub
parent 62283c9f5b
commit d8e62bc499
3 changed files with 10 additions and 5 deletions
@@ -17,5 +17,5 @@
if(.)
return
var/mob/living/silicon/ai/our_ai = user.mob
our_ai.deploy_to_shell(our_ai.redeploy_action.last_used_shell)
our_ai.select_shell(our_ai.redeploy_action.last_used_shell)
return TRUE
+8 -3
View File
@@ -957,10 +957,14 @@
playsound(get_turf(src), 'sound/machines/ding.ogg', 50, TRUE, ignore_walls = FALSE)
to_chat(src, "Hack complete. [apc] is now under your exclusive control.")
/mob/living/silicon/ai/verb/deploy_to_shell(mob/living/silicon/robot/target)
/mob/living/silicon/ai/verb/deploy_to_shell()
set category = "AI Commands"
set desc = "Transfer to an available remote body."
set name = "Deploy to Shell"
select_shell()
/mob/living/silicon/ai/proc/select_shell(mob/living/silicon/robot/target)
if(incapacitated)
return
if(control_disabled)
@@ -976,6 +980,7 @@
if(!LAZYLEN(possible))
to_chat(src, "No usable AI shell beacons detected.")
return
if(!target || !(target in possible)) //If the AI is looking for a new shell, or its pre-selected shell is no longer valid
target = tgui_input_list(src, "Which body to control?", "Direct Control", sort_names(possible))
@@ -1003,7 +1008,7 @@
var/mob/living/silicon/ai/AI = owner
if(!AI)
return
AI.deploy_to_shell()
AI.select_shell()
/datum/action/innate/deploy_last_shell
name = "Reconnect to shell"
@@ -1017,7 +1022,7 @@
return
if(last_used_shell)
var/mob/living/silicon/ai/AI = owner
AI.deploy_to_shell(last_used_shell)
AI.select_shell(last_used_shell)
else
Remove(owner) //If the last shell is blown, destroy it.
@@ -955,7 +955,7 @@
/mob/living/silicon/robot/attack_ai(mob/user)
if(shell && (!connected_ai || connected_ai == user))
var/mob/living/silicon/ai/AI = user
AI.deploy_to_shell(src)
AI.select_shell(src)
/mob/living/silicon/robot/mouse_buckle_handling(mob/living/M, mob/living/user)
//Don't try buckling on INTENT_HARM so that silicons can search people's inventories without loading them