From 2bbe88a238138681e40fe50209f151de31d81bae Mon Sep 17 00:00:00 2001 From: Dip Date: Sat, 19 Sep 2020 16:33:48 -0300 Subject: [PATCH] WE'LL DO IT LIVE --- code/game/objects/structures/mirror.dm | 27 +------------------------ code/modules/awaymissions/corpse.dm | 1 + code/modules/mob/mob_helpers.dm | 28 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index e3478b08..038097ba 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -23,7 +23,7 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user - checkloadappearance(H, user) + H.checkloadappearance() //see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments! //this is largely copypasted from there. //handle facial hair (if necessary) @@ -45,31 +45,6 @@ H.update_hair() -/obj/structure/mirror/proc/checkloadappearance(mob/living/carbon/human/H, mob/user) - //Jay's mirror code suggestion - //This will be where the person gets to select their appearance instead of the random character - if (world.time <= (H.time_initialized + 900) && H.mirrorcanloadappearance == TRUE) - to_chat(H, "You peer into the mirror. Make sure you have your ID in your ID slot, if you have one.") - if(alert(user, "Would you like to load your currently loaded character's appearance?", "This can only be done up until 90s after you spawn.", "Yes", "No") == "Yes" && world.time <= (H.time_initialized + 900)) - H.client.prefs.copy_to(H) - if (H.custom_body_size) //Do they have a custom size set? - H.resize(H.custom_body_size * 0.01) - H.real_name = H.client.prefs.real_name - H.mind.name = H.real_name //Makes sure to change their mind name to their real name. - SSquirks.AssignQuirks(H, H.client, TRUE, FALSE, H.job, FALSE)//This Assigns the selected character's quirks - H.dna.update_dna_identity() //This makes sure their DNA is updated. - var/obj/item/card/id/idCard = user.get_idcard() //Time to change their ID card as well if they have one. - if (idCard != null) - idCard.update_label(H.real_name, idCard.assignment) - idCard.registered_name = H.real_name - H.mirrorcanloadappearance = FALSE //Prevents them from using the mirror again. - SEND_SOUND(H, 'sound/magic/charge.ogg') //Fluff - to_chat(H, "Your head aches for a second. You feel like this is how things should have been.") - log_game("[key_name(user)] has loaded their default appearance for a ghost role.") - message_admins("[ADMIN_LOOKUPFLW(user)] has loaded their default appearance for a ghost role.") - return - else return - /obj/structure/mirror/examine_status(mob/user) if(broken) return // no message spam diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index 35b0ef71..fc7b5e31 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -118,6 +118,7 @@ M.mind.assigned_role = assignedrole special(M, name) MM.name = M.real_name + M.checkloadappearance() if(uses > 0) uses-- if(!permanent && !uses) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 3a3dacee..e70d34c2 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -486,3 +486,31 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /mob/proc/can_hear() . = TRUE + +mob/proc/checkloadappearance() + var/mob/living/carbon/human/H = src + //This will be where the person gets to select their appearance instead of the random character + if (world.time <= (H.time_initialized + 900) && H.mirrorcanloadappearance == TRUE) + SEND_SOUND(H, 'sound/misc/server-ready.ogg') + to_chat(H, "This ghost role allows you to select your loaded character's appearance. Make sure you have your ID in your ID slot, if you have one.") + if(alert(H, "Would you like to load your currently loaded character's appearance?", "This can only be done up until 90s after you spawn.", "Yes", "No") == "Yes" && world.time <= (H.time_initialized + 900)) + H.client.prefs.copy_to(H) + if (H.custom_body_size) //Do they have a custom size set? + H.resize(H.custom_body_size * 0.01) + H.real_name = H.client.prefs.real_name + H.mind.name = H.real_name //Makes sure to change their mind name to their real name. + SSquirks.AssignQuirks(H, H.client, TRUE, FALSE, H.job, FALSE)//This Assigns the selected character's quirks + H.dna.update_dna_identity() //This makes sure their DNA is updated. + var/obj/item/card/id/idCard = H.get_idcard() //Time to change their ID card as well if they have one. + if (idCard != null) + idCard.update_label(H.real_name, idCard.assignment) + idCard.registered_name = H.real_name + H.mirrorcanloadappearance = FALSE //Prevents them from using the mirror again. + SEND_SOUND(H, 'sound/magic/charge.ogg') //Fluff + to_chat(H, "Your head aches for a second. You feel like this is how things should have been.") + log_game("[key_name(H)] has loaded their default appearance for a ghost role.") + message_admins("[ADMIN_LOOKUPFLW(H)] has loaded their default appearance for a ghost role.") + return + else + to_chat(H, "You either took too long or chose not to change. Alrighty. Remember, you have 90 seconds from spawn to get to a mirror and still do it if you wish.") + return