From 8902a680771344cda3e34f4fe8d420cdd885eecc Mon Sep 17 00:00:00 2001 From: CliffracerX Date: Fri, 30 Aug 2024 17:51:42 -0400 Subject: [PATCH] Ghostrole character selection, Mk 1 Not perfect still; ashies will require additional effort to properly support, but we're getting closer --- code/modules/mob_spawn/mob_spawn.dm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/code/modules/mob_spawn/mob_spawn.dm b/code/modules/mob_spawn/mob_spawn.dm index 3337a15b441c5..4af39c20d148a 100644 --- a/code/modules/mob_spawn/mob_spawn.dm +++ b/code/modules/mob_spawn/mob_spawn.dm @@ -32,6 +32,8 @@ var/skin_tone /// Weakref to the mob this spawner created - just if you needed to do something with it. var/datum/weakref/spawned_mob_ref + /// DOPPLER SHIFT ADDITION: allowing players to have their current character loaded + var/allow_prefs = TRUE /obj/effect/mob_spawn/Initialize(mapload) . = ..() @@ -93,7 +95,20 @@ if(!ispath(outfit_override[outfit_var]) && !isnull(outfit_override[outfit_var])) CRASH("outfit_override var on [mob_name] spawner has incorrect values! it must be an assoc list with outfit \"var\" = path | null") outfit.vars[outfit_var] = outfit_override[outfit_var] - spawned_human.equipOutfit(outfit) + //spawned_human.equipOutfit(outfit) /// DOPPLER SHIFT REMOVAL + /// DOPPLER SHIFT ADDITION BEGIN + if(allow_prefs && spawned_human.client) + spawned_human.client?.prefs.safe_transfer_prefs_to(spawned_human) + SSquirks.AssignQuirks(spawned_human, spawned_human.client) + spawned_human.equip_outfit_and_loadout(outfit, spawned_human.client?.prefs) + else + spawned_human.equipOutfit(outfit) + else if(allow_prefs && spawned_mob.client) + var/mob/living/carbon/human/spawned_human = spawned_mob + spawned_human.client?.prefs.safe_transfer_prefs_to(spawned_human) + SSquirks.AssignQuirks(spawned_human, spawned_human.client) + spawned_human.equip_outfit_and_loadout(new /datum/outfit(), spawned_human.client?.prefs) + /// DOPPLER SHIFT ADDITION END ///these mob spawn subtypes do not trigger until attacked by a ghost. /obj/effect/mob_spawn/ghost_role @@ -157,9 +172,14 @@ LAZYADD(ckeys_trying_to_spawn, user_ckey) if(prompt_ghost) - var/prompt = "Become [prompt_name]?" + var/realname = user.client?.prefs?.read_preference(/datum/preference/name/real_name) || "yourself" /// DOPPLER SHIFT ADDITION + var/prompt = "Become [prompt_name] as [realname]?" /// DOPPLER SHIFT EDIT: adding your name to it if(!temp_body && user.can_reenter_corpse && user.mind) prompt += " (Warning, You can no longer be revived!)" + /// DOPPLER SHIFT ADDITION BEGIN + if(allow_prefs) + prompt += "\nYou will be loaded in with your current character, [realname] - loadout & quirks included! Make sure they fit the role!" + /// DOPPLER SHIFT ADDITION END var/ghost_role = tgui_alert(usr, prompt, buttons = list("Yes", "No"), timeout = 10 SECONDS) if(ghost_role != "Yes" || !loc || QDELETED(user)) LAZYREMOVE(ckeys_trying_to_spawn, user_ckey)