From 72af4be21ee3dd5f246c997bd5217f946a81a4ea Mon Sep 17 00:00:00 2001 From: meem <75212565+meemofcourse@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:17:24 -0400 Subject: [PATCH] Guestbook QoL (#3308) ## About The Pull Request * Guestbook now accounts for the fact that Sarathi and Vox live longer (and changes the geriatric age range's name to ancient) * Closes #3250 * Changes the Vox lore blurb placeholder with a little less placeholder placeholder ## Why It's Good For The Game sarathi and vox live some 2.5x-3x times longer than humans so yknow ## Changelog :cl: add: Vox lore blurb fix: Inconsistent capitalization when speaking due to guestbook code: Changed how the game recognizes Vox and Sarathi age /:cl: --- code/datums/guestbook.dm | 2 +- code/game/atoms.dm | 15 +++- code/game/say.dm | 2 +- .../mob/dead/new_player/preferences_setup.dm | 4 +- .../mob/living/carbon/human/examine.dm | 2 +- .../mob/living/carbon/human/human_helpers.dm | 74 +++++++++++++++---- .../living/carbon/human/species_types/vox.dm | 3 +- 7 files changed, 79 insertions(+), 23 deletions(-) diff --git a/code/datums/guestbook.dm b/code/datums/guestbook.dm index 99104f09d715..ecb7087ed08e 100644 --- a/code/datums/guestbook.dm +++ b/code/datums/guestbook.dm @@ -67,7 +67,7 @@ given_name = reject_bad_name(given_name) if(!given_name) if(!silent) - to_chat(user, span_warning("That's a pretty terrible name. You can do better.")) + to_chat(user, span_warning("That's a pretty terrible name.")) return FALSE if(!visibility_checks(user, guest, silent)) return FALSE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 00fee50bd2d0..f52b9bdace9e 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1732,7 +1732,20 @@ /// Returns the atom name that should be used on screentip /atom/proc/get_screentip_name(client/hovering_client) - return name + if(ishuman(src)) + var/mob/living/carbon/human/guy = src + var/mob/client_mob = hovering_client.mob + var/datum/guestbook/guestbook = client_mob.mind?.guestbook + if(guestbook) + var/known_name = guestbook.get_known_name(client_mob, guy) + if(known_name) + return known_name + else + return guy.get_visible_name() + else + return guy.real_name + else + return name ///Called whenever a player is spawned on the same turf as this atom. /atom/proc/join_player_here(mob/M) diff --git a/code/game/say.dm b/code/game/say.dm index 2d53eea65e75..cac8bafe5365 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -72,7 +72,7 @@ GLOBAL_LIST_INIT(freqcolor, list()) namepart = "[known_name]" else var/mob/living/carbon/human/human_narrator = reliable_narrator - namepart = "[human_narrator.get_generic_name(prefixed = TRUE, lowercase = FALSE)]" + namepart = "[human_narrator.get_generic_name(prefixed = TRUE, lowercase = TRUE)]" //End name span. var/endspanpart = "" diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index cc5a69dd095f..71b66ac54fb4 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -52,7 +52,9 @@ var/random_species_type = GLOB.species_list[pick(GLOB.roundstart_races)] pref_species = new random_species_type if(randomise[RANDOM_NAME]) - real_name = pref_species.random_name(gender,1) + real_name = pref_species.random_name(gender, TRUE) + if(randomise[RANDOM_AGE]) + age = rand(pref_species.species_age_min, pref_species.species_age_max) /datum/preferences/proc/update_preview_icon(show_gear = TRUE, show_loadout = FALSE) // Set up the dummy for its photoshoot diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 7bbe9fb1de72..cf3f5ec725ec 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -25,7 +25,7 @@ //if we have no guestbook, we just KNOW okay? var/known_name = user.mind?.guestbook ? user.mind.guestbook.get_known_name(user, src, face_name) : face_name if(known_name) - . += "You know them as [known_name]." + . += "You know [t_him] as [known_name]." else . += "You don't recognize [t_him]. You can Ctrl-Shift click [t_him] to memorize their face." else diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 9e2cfe4f1556..cd588a89b9ce 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -192,23 +192,65 @@ /mob/living/carbon/human/proc/get_age() var/obscured = check_obscured_slots() var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) - if((obscured & ITEM_SLOT_ICLOTHING) && skipface || isipc(src)) + if((obscured & ITEM_SLOT_ICLOTHING) && skipface || isipc(src) || isskeleton(src)) // sorry ladies no middle aged robots return FALSE - switch(age) - if(70 to INFINITY) - return "Geriatric" - if(60 to 70) - return "Elderly" - if(50 to 60) - return "Old" - if(40 to 50) - return "Middle-Aged" - if(24 to 40) - return FALSE //not necessary because this is basically the most common age range - if(18 to 24) - return "Young" - else - return "Puzzling" + if(islizard(src)) + switch(age) + if(175 to INFINITY) + return "Ancient" + if(130 to 175) + return "Elderly" + if(100 to 130) + return "Old" + if(65 to 100) + return "Middle-Aged" + if(40 to 65) + return FALSE + if(18 to 40) + return "Young" + else if(isvox(src)) + switch(age) + if(280 to INFINITY) + return "Ancient" + if(200 to 280) + return "Elderly" + if(160 to 200) + return "Old" + if(120 to 160) + return "Middle-Aged" + if(60 to 120) + return FALSE + if(18 to 60) + return "Young" + else if(iselzuose(src)) + switch(age) + if(300 to INFINITY) + return "Ancient" + if(260 to 300) + return "Elderly" + if(160 to 260) + return "Old" + if(100 to 160) + return "Middle-Aged" + if(40 to 100) + return FALSE // most common age range + if(18 to 40) + return "Young" + else + switch(age) + if(70 to INFINITY) + return "Ancient" + if(60 to 70) + return "Elderly" + if(50 to 60) + return "Old" + if(40 to 50) + return "Middle-Aged" + if(24 to 40) + return FALSE // most common age range + if(18 to 24) + return "Young" + return "Puzzling" /mob/living/carbon/human/proc/get_generic_name(prefixed = FALSE, lowercase = FALSE) var/final_string = "" diff --git a/code/modules/mob/living/carbon/human/species_types/vox.dm b/code/modules/mob/living/carbon/human/species_types/vox.dm index b9cc8306762e..b61b334e6ec2 100644 --- a/code/modules/mob/living/carbon/human/species_types/vox.dm +++ b/code/modules/mob/living/carbon/human/species_types/vox.dm @@ -3,7 +3,6 @@ name = "\improper Vox" id = SPECIES_VOX default_color = "6060FF" - species_age_min = 17 species_age_max = 280 species_traits = list(EYECOLOR, NO_UNDERWEAR) mutant_bodyparts = list("vox_head_quills", "vox_neck_quills") @@ -12,7 +11,7 @@ disliked_food = GRAIN liked_food = MEAT changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | ERT_SPAWN | RACE_SWAP | SLIME_EXTRACT - loreblurb = "Vox test" + loreblurb = "Vox are a big bird-like species with quills, much larger and much more long-lasting than other species. Sadly, not much else is known." attack_verb = "slash" attack_sound = 'sound/weapons/slash.ogg' miss_sound = 'sound/weapons/slashmiss.ogg'