Adds custom age limits to each species (#20878)

* Custom min/max ages for species

* fixing the pitch

* tweaking AGE_MAX

* Revert "tweaking AGE_MAX"

This reverts commit 0270ba6840.

* max_age decreased roughly by 10%

* Update code/__DEFINES/mob_defines.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* machine minimum age

* clamp

* Adjustments to ages

* age max

* Update code/modules/mob/living/carbon/human/species/_species.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* clamp and age pitch tweaks

* finally found plasmaman lifespan1

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Henri215
2023-05-22 22:04:42 +02:00
committed by GitHub
co-authored by Ryan
parent 7b2bd705b2
commit 764aed10c5
24 changed files with 33 additions and 14 deletions
+2 -2
View File
@@ -481,7 +481,7 @@
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
gender = sanitize_gender(gender, FALSE, !SP.has_gender)
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
age = sanitize_integer(age, SP.min_age, SP.max_age, initial(age))
h_colour = sanitize_hexcolor(h_colour)
h_sec_colour = sanitize_hexcolor(h_sec_colour)
f_colour = sanitize_hexcolor(f_colour)
@@ -596,7 +596,7 @@
if(S.bodyflags & HAS_SKIN_COLOR)
randomize_skin_color()
backbag = 2
age = rand(AGE_MIN, AGE_MAX)
age = rand(S.min_age, S.max_age)
/datum/character_save/proc/randomize_hair_color(target = "hair")
@@ -135,7 +135,7 @@
var/mob/new_player/N = user
N.new_player_panel_proc()
if("age")
active_character.age = rand(AGE_MIN, AGE_MAX)
active_character.age = rand(S.min_age , S.max_age)
if("hair")
if(!(S.bodyflags & BALD))
active_character.h_colour = rand_hex_color()
@@ -212,9 +212,9 @@
to_chat(user, "<font color='red'>Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .</font>")
if("age")
var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null
var/new_age = input(user, "Choose your character's age:\n([S.min_age]-[S.max_age])", "Character Preference") as num|null
if(new_age)
active_character.age = max(min(round(text2num(new_age)), AGE_MAX),AGE_MIN)
active_character.age = max(min(round(text2num(new_age)), S.max_age), S.min_age)
if("species")
var/list/new_species = list()
var/prev_species = active_character.species
@@ -230,6 +230,7 @@
to_chat(user, "<span class='warning'>Invalid species, please pick something else.</span>")
return
if(prev_species != active_character.species)
active_character.age = clamp(active_character.age, NS.min_age, NS.max_age)
if(NS.has_gender && active_character.gender == PLURAL)
active_character.gender = pick(MALE,FEMALE)
var/datum/robolimb/robohead
@@ -167,7 +167,7 @@
volume_decrease = 95
sound_volume -= volume_decrease
// special handling here: we don't want monkeys' gasps to sound through walls so you can actually walk past xenobio
playsound(user.loc, sound_path, sound_volume, TRUE, -10, frequency = H.get_age_pitch(), ignore_walls = !isnull(user.mind))
playsound(user.loc, sound_path, sound_volume, TRUE, -10, frequency = H.get_age_pitch(H.dna.species.max_age), ignore_walls = !isnull(user.mind))
/datum/emote/living/carbon/human/shake
key = "shake"
@@ -1817,8 +1817,8 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
return ..()
/mob/living/carbon/human/proc/get_age_pitch()
return 1.0 + 0.5*(30 - age)/80
/mob/living/carbon/human/proc/get_age_pitch(species_pitch = 85)
return 1.0 + 0.5 * ((species_pitch * 0.35) - age) / (0.94 * species_pitch)
/mob/living/carbon/human/get_access()
. = ..()
@@ -238,7 +238,7 @@ GLOBAL_LIST_INIT(soapy_words, list(
if(dna.species.speech_sounds && prob(dna.species.speech_chance))
returns[1] = sound(pick(dna.species.speech_sounds))
returns[2] = 50
returns[3] = get_age_pitch()
returns[3] = get_age_pitch(dna.species.max_age)
return returns
/mob/living/carbon/human/binarycheck()
@@ -3,6 +3,11 @@
var/name_plural // Pluralized name (since "[name]s" is not always valid)
var/icobase = 'icons/mob/human_races/r_human.dmi' // Normal icon set.
/// Minimum age this species can have
var/min_age = AGE_MIN
/// Maximum age this species can have
var/max_age = 85
// Damage overlay and masks.
var/damage_overlays = 'icons/mob/human_races/masks/dam_human.dmi'
var/damage_mask = 'icons/mob/human_races/masks/dam_mask_human.dmi'
@@ -1,6 +1,7 @@
/datum/species/diona
name = "Diona"
name_plural = "Dionaea"
max_age = 300
icobase = 'icons/mob/human_races/r_diona.dmi'
language = "Rootspeak"
speech_sounds = list('sound/voice/dionatalk1.ogg') //Credit https://www.youtube.com/watch?v=ufnvlRjsOTI [0:13 - 0:16]
@@ -1,6 +1,7 @@
/datum/species/drask
name = "Drask"
name_plural = "Drask"
max_age = 500
icobase = 'icons/mob/human_races/r_drask.dmi'
language = "Orluum"
eyes = "drask_eyes_s"
@@ -1,6 +1,7 @@
/datum/species/golem
name = "Golem"
name_plural = "Golems"
max_age = 300
icobase = 'icons/mob/human_races/r_golem.dmi'
@@ -1,6 +1,7 @@
/datum/species/grey
name = "Grey"
name_plural = "Greys"
max_age = 50
icobase = 'icons/mob/human_races/r_grey.dmi'
language = "Psionic Communication"
eyes = "grey_eyes_s"
@@ -1,6 +1,7 @@
/datum/species/kidan
name = "Kidan"
name_plural = "Kidan"
max_age = 55
icobase = 'icons/mob/human_races/r_kidan.dmi'
language = "Chittin"
unarmed_type = /datum/unarmed_attack/claws
@@ -1,6 +1,7 @@
/datum/species/machine
name = "Machine"
name_plural = "Machines"
max_age = 60
blurb = "Positronic intelligence really took off in the 26th century, and it is not uncommon to see independent, free-willed \
robots on many human stations, particularly in fringe systems where standards are slightly lax and public opinion less relevant \
@@ -7,6 +7,7 @@
/datum/species/moth
name = "Nian"
name_plural = "Nianae"
max_age = 64
language = "Tkachi"
icobase = 'icons/mob/human_races/r_moth.dmi'
inherent_factions = list("nian")
@@ -1,6 +1,7 @@
/datum/species/plasmaman
name = "Plasmaman"
name_plural = "Plasmamen"
max_age = 150
icobase = 'icons/mob/human_races/r_plasmaman_sb.dmi'
dangerous_existence = TRUE //So so much
//language = "Clatter"
@@ -1,6 +1,7 @@
/datum/species/skrell
name = "Skrell"
name_plural = "Skrell"
max_age = 70
icobase = 'icons/mob/human_races/r_skrell.dmi'
language = "Skrellian"
primitive_form = /datum/species/monkey/skrell
@@ -9,6 +9,7 @@
/datum/species/slime
name = "Slime People"
name_plural = "Slime People"
max_age = 130
language = "Bubblish"
icobase = 'icons/mob/human_races/r_slime.dmi'
remains_type = /obj/effect/decal/remains/slime
@@ -1,6 +1,7 @@
/datum/species/unathi
name = "Unathi"
name_plural = "Unathi"
max_age = 45
icobase = 'icons/mob/human_races/r_lizard.dmi'
language = "Sinta'unathi"
tail = "sogtail"
@@ -1,6 +1,7 @@
/datum/species/vox
name = "Vox"
name_plural = "Vox"
max_age = 54
icobase = 'icons/mob/human_races/vox/r_vox.dmi'
dangerous_existence = TRUE
language = "Vox-pidgin"
@@ -1,6 +1,7 @@
/datum/species/vulpkanin
name = "Vulpkanin"
name_plural = "Vulpkanin"
max_age = 80
icobase = 'icons/mob/human_races/r_vulpkanin.dmi'
language = "Canilunzt"
primitive_form = /datum/species/monkey/vulpkanin
+1 -1
View File
@@ -120,7 +120,7 @@
if(!istype(H))
return ..()
// special handling here: we don't want monkeys' gasps to sound through walls so you can actually walk past xenobio
playsound(user.loc, sound_path, sound_volume, TRUE, -8, frequency = H.get_age_pitch(), ignore_walls = !isnull(user.mind))
playsound(user.loc, sound_path, sound_volume, TRUE, -8, frequency = H.get_age_pitch(H.dna.species.max_age), ignore_walls = !isnull(user.mind))
/datum/emote/living/drool
key = "drool"