Reworks pAIs (#68241)

A pretty heavy refactor for pAIs that just spilled into a rework.

Attempts to fully document and organize backend code.
Fixes a large number of bugs left untouched for a decade.
Breaks down the frontend into subcomponents.
Rebalances their software modules.
(should) fix pAI faces get removed if you activate them during alert #68242
This commit is contained in:
Jeremiah
2022-07-24 08:18:59 -07:00
committed by GitHub
parent c529eab0e0
commit 86e801987e
63 changed files with 2304 additions and 2067 deletions
-33
View File
@@ -36,39 +36,6 @@
log_admin("[key_name(src)] has robotized [M.key].")
INVOKE_ASYNC(M, /mob.proc/Robotize)
/client/proc/makepAI(turf/T in GLOB.mob_list)
set category = "Admin.Fun"
set name = "Make pAI"
set desc = "Specify a location to spawn a pAI device, then specify a key to play that pAI"
var/list/available = list()
for(var/mob/C in GLOB.mob_list)
if(C.key)
available.Add(C)
var/mob/choice = tgui_input_list(usr, "Choose a player to play the pAI", "Spawn pAI", sort_names(available))
if(isnull(choice))
return
if(!isobserver(choice))
var/confirm = tgui_alert(usr, "[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/paicard/card = new(T)
var/mob/living/silicon/pai/pai = new(card)
var/chosen_name = input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text|null
if (isnull(chosen_name))
return
pai.name = chosen_name
pai.real_name = pai.name
pai.key = choice.key
card.setPersonality(pai)
for(var/datum/pai_candidate/candidate in SSpai.candidates)
if(candidate.key == choice.key)
SSpai.candidates.Remove(candidate)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Make pAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/poll_type_to_del(search_string)
var/list/types = get_fancy_list_of_atom_types()
if (!isnull(search_string) && search_string != "")