Skip to content

Commit

Permalink
Guestbook QoL (#3308)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## 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

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
sarathi and vox live some 2.5x-3x times longer than humans so yknow

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## 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:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
meemofcourse authored Aug 27, 2024
1 parent ab21c06 commit 72af4be
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 23 deletions.
2 changes: 1 addition & 1 deletion code/datums/guestbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/game/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "</span>"
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/dead/new_player/preferences_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <EM>[known_name]</EM>."
. += "You know [t_him] as <EM>[known_name]</EM>."
else
. += "You don't recognize [t_him]. You can <B>Ctrl-Shift click</b> [t_him] to memorize their face."
else
Expand Down
74 changes: 58 additions & 16 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/living/carbon/human/species_types/vox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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'
Expand Down

0 comments on commit 72af4be

Please sign in to comment.