Files
ff006aa4a5 verb macro system (pr 1/3) (#96720)
## About The Pull Request

just macro-izes all the usages of verbs in the codebase as a
pre-requisite to my follow up pr that serializes all the verbs arguments
so we can tgui-ify the command bar, so we can then put it on the
onscreen map.

this also basically does the same as #94487 so can easily be integrated
into the verb queueing stuff... but does not actually do any verb
queueing by itself. basically im just trying to be
https://github.com/tgstation/tgstation/labels/Atomic
## Why It's Good For The Game
it doesn't really do anything by itself but it does let us do more stuff

## Changelog
🆑
code: the backend to all verbs in the game has been played with, please
report any issues to github
/🆑

---------

Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
2026-07-04 02:45:07 -04:00

42 lines
1.4 KiB
Plaintext

ADMIN_VERB(makepAI, R_FUN, "Make pAI", "Specify a location to spawn a pAI device, then specify a key to play that pAI", ADMIN_CATEGORY_FUN, turf/target in GLOB.mob_list)
var/list/available = list()
for(var/mob/player as anything in GLOB.player_list)
if(player.client && player.key)
available.Add(player)
var/mob/choice = tgui_input_list(user, "Choose a player to play the pAI", "Spawn pAI", sort_names(available))
if(isnull(choice))
return
var/chosen_name = input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text|null
if (isnull(chosen_name))
return
if(!isobserver(choice))
var/confirm = tgui_alert(user, "[choice.key] isn't ghosting right now. Are you sure you want to yank them out of their body and place them in this pAI?", "Spawn pAI Confirmation", list("Yes", "No"))
if(confirm != "Yes")
return
var/obj/item/pai_card/card = new(target)
var/mob/living/silicon/pai/pai = new(card)
pai.name = chosen_name
pai.real_name = pai.name
pai.PossessByPlayer(choice.key)
card.set_personality(pai)
if(SSpai.candidates[user.key])
SSpai.candidates -= user.key
BLACKBOX_LOG_ADMIN_VERB("Make pAI")
/**
* Creates a new pAI.
*
* @param {boolean} delete_old - If TRUE, deletes the old pAI.
*/
/mob/proc/make_pai(delete_old)
var/obj/item/pai_card/card = new(src)
var/mob/living/silicon/pai/pai = new(card)
pai.PossessByPlayer(key)
pai.name = name
card.set_personality(pai)
if(delete_old)
qdel(src)