Reimagines the imaginary friend as a fancy new smite. (#61218)

Fixed imaginary friends being unable to turn by movement or holding down ctrl. I assume this was broken when abstract_move was implemented.

Makes some tweaks to the Imaginary Friend mob. It no longer cares about any brain traumas and can exist standalone.

Added the ability to take a set of datum prefs as an argument. It will attempt to create an imaginary friend as per those datum prefs.

This imaginary friend can be a cyborg or an AI core.

Takes this improved behaviour and packages it into a brand new smite that allows admins to inflict anyone with a permanent imaginary friend. This is not tied to a brain trauma. You can probably give imaginary friends imaginary friends. You can probably give the AI eye an imaginary friend. I have not tested this. It is probably a bad idea.

You can give simplemobs imaginary friends. Basic mobs. Silicons.

You choose whether the imaginary friend takes on the preferences of the person you choose to be the imaginary friend or is random
This commit is contained in:
Timberpoes
2021-09-05 16:23:09 +01:00
committed by GitHub
parent bdd91deca1
commit 7df1931ab0
3 changed files with 111 additions and 9 deletions
@@ -0,0 +1,56 @@
/**
* Custom imaginary friend.
*
* Allows the admin to select the ckey to put into the imaginary friend and whether the imaginary friend looks like the
* ckey's character.
*
* Is not tied to the brain trauma and can be used on all mobs, technically. Including cyborgs and simple/basic mobs.
*
* Warranty void if used on AI eyes or other imaginary friends. Please smite responsibly.
**/
/datum/smite/custom_imaginary_friend
name = "Imaginary Friend (Special)"
var/client/friend_candidate_client
var/random_appearance
/datum/smite/custom_imaginary_friend/configure(client/user)
friend_candidate_client = tgui_input_list(user, "Pick the player to put in control.", "New Imaginary Friend", sortList(GLOB.clients))
if(QDELETED(friend_candidate_client))
to_chat(user, span_notice("Selected player no longer has a client, aborting."))
return FALSE
if(isliving(friend_candidate_client.mob) && (tgui_alert(user, "This player already has a living mob ([friend_candidate_client.mob]). Do you still want to turn them into an Imaginary Friend?", "Remove player from mob?", list("Do it!", "Cancel")) == "Cancel"))
return
if(QDELETED(friend_candidate_client))
to_chat(user, span_notice("Selected player no longer has a client, aborting."))
return FALSE
if(friend_candidate_client.prefs)
random_appearance = tgui_alert(user, "Do you want the imaginary friend to look like and be named after [friend_candidate_client]'s current preferences ([friend_candidate_client.prefs.real_name])?", "Imaginary Friend Appearance?", list("Look-a-like", "Random")) == "Random"
else
random_appearance = TRUE
/datum/smite/custom_imaginary_friend/effect(client/user, mob/living/target)
. = ..()
if(QDELETED(target))
to_chat(user, span_warning("The target mob no longer exists, aborting."))
return
if(QDELETED(friend_candidate_client))
to_chat(user, span_warning("Imaginary friend candidate no longer has a client, aborting."))
return
if(isliving(friend_candidate_client.mob))
friend_candidate_client.mob.ghostize(can_reenter_corpse = TRUE)
var/mob/camera/imaginary_friend/friend_mob
if(random_appearance)
friend_mob = new /mob/camera/imaginary_friend(get_turf(target), target)
else
friend_mob = new /mob/camera/imaginary_friend(get_turf(target), target, friend_candidate_client.prefs)
friend_mob.key = friend_candidate_client.key