From 3299efc62904b6ea173e1f7a9fb06b6cac0c6c91 Mon Sep 17 00:00:00 2001 From: Samirakis Date: Fri, 25 Oct 2024 01:38:08 +0300 Subject: [PATCH 1/3] species_ages --- code/__DEFINES/mobs.dm | 3 --- code/__DEFINES/preferences.dm | 10 +++++++ code/game/jobs/job/engineering.dm | 2 +- code/game/jobs/job/job.dm | 16 ++++++----- code/game/jobs/job/medical.dm | 2 +- code/game/jobs/job/science.dm | 2 +- code/game/jobs/job/security.dm | 4 +-- code/game/jobs/job/supervisor.dm | 12 ++++----- code/game/jobs/job/support.dm | 2 +- code/game/machinery/computer/medical.dm | 10 +++++-- code/game/machinery/computer/security.dm | 13 ++++++--- code/modules/client/preference/preferences.dm | 11 +++++--- .../client/preference/preferences_mysql.dm | 3 ++- code/modules/mob/living/carbon/human/human.dm | 6 +++-- .../living/carbon/human/species/_species.dm | 27 +++++++++++++++++++ .../mob/living/carbon/human/species/diona.dm | 7 +++++ .../mob/living/carbon/human/species/drask.dm | 14 ++++++++++ .../mob/living/carbon/human/species/grey.dm | 7 +++++ .../mob/living/carbon/human/species/kidan.dm | 7 +++++ .../living/carbon/human/species/machine.dm | 11 ++++++++ .../mob/living/carbon/human/species/moth.dm | 13 +++++++++ .../living/carbon/human/species/nucleation.dm | 7 +++++ .../living/carbon/human/species/plasmaman.dm | 7 +++++ .../mob/living/carbon/human/species/skrell.dm | 7 +++++ .../mob/living/carbon/human/species/slime.dm | 7 +++++ .../living/carbon/human/species/tajaran.dm | 7 +++++ .../mob/living/carbon/human/species/unathi.dm | 7 +++++ .../mob/living/carbon/human/species/vox.dm | 12 +++++++++ .../living/carbon/human/species/vulpkanin.dm | 7 +++++ .../mob/living/carbon/human/species/wryn.dm | 7 +++++ code/modules/mob/new_player/new_player.dm | 3 ++- .../mob/new_player/preferences_setup.dm | 2 +- 32 files changed, 220 insertions(+), 35 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 234865da160..0e8c0873ed8 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -17,9 +17,6 @@ #define TOXIN_TO_INTERNAL_DAMAGE_MULTIPLIER 2 // coefficient wich defines ratio of toxin into internal organs damage transfer -#define AGE_MIN 17 //youngest a character can be -#define AGE_MAX 85 //oldest a character can be - #define LEFT 1 #define RIGHT 2 diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 01a0dbd5f88..5d896be0ab0 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -124,6 +124,16 @@ #define EXP_DEPT_TYPE_LIST list(EXP_TYPE_SERVICE, EXP_TYPE_MEDICAL, EXP_TYPE_ENGINEERING, EXP_TYPE_SCIENCE, EXP_TYPE_SECURITY, EXP_TYPE_COMMAND, EXP_TYPE_SILICON, EXP_TYPE_SPECIAL) + +/// Tags for 'age needed for this job' list. +#define SPECIES_AGE_MIN "Min" +#define SPECIES_AGE_MAX "Max" +#define JOB_MIN_AGE_HIGH_ED "Higher Education" +#define JOB_MIN_AGE_COMMAND "Command" + +#define AGE_SHEET list(SPECIES_AGE_MIN = 18, SPECIES_AGE_MAX = 85, JOB_MIN_AGE_HIGH_ED = 30, JOB_MIN_AGE_COMMAND = 30) + + // Defines just for parallax because its levels make storing it in the regular prefs a pain in the ass // These dont need to be bitflags because there isnt going to be more than one at a time of these active // But its gonna piss off my OCD if it isnt bitflags, so deal with it, -affected diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index ec9a69f772c..bc2361550e2 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -18,7 +18,7 @@ ACCESS_HEADS, ACCESS_CONSTRUCTION, ACCESS_SEC_DOORS, ACCESS_CE, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT, ACCESS_MINISAT, ACCESS_MECHANIC, ACCESS_MINERAL_STOREROOM) minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND exp_requirements = 3000 exp_type = EXP_TYPE_ENGINEERING outfit = /datum/outfit/job/chief_engineer diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 81a2eec7563..f972230f8dc 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -56,7 +56,7 @@ var/exp_max = 0 //Max EXP, then hide var/exp_type_max = "" - var/min_age_allowed = 0 + var/min_age_type = SPECIES_AGE_MIN var/disabilities_allowed = 1 var/transfer_allowed = TRUE // If false, ID computer will always discourage transfers to this job, even if player is eligible var/hidden_from_job_prefs = FALSE // if true, job preferences screen never shows this job. @@ -69,7 +69,7 @@ var/salary = 0 var/min_start_money = 0 var/max_start_money = 0 - + var/outfit = null ///////////////////////////////// @@ -138,11 +138,15 @@ return 0 /datum/job/proc/character_old_enough(client/C) + . = FALSE + if(!C) - return FALSE - if(C.prefs.age >= min_age_allowed) - return TRUE - return FALSE + return + + var/datum/species/species = GLOB.all_species[C.prefs.species] + if(C.prefs.age >= get_age_limits(species, min_age_type)) + . = TRUE + /datum/job/proc/species_in_blacklist(client/C) if(!C) diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index 5c05556fc24..79c4d34c984 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -16,7 +16,7 @@ ACCESS_CHEMISTRY, ACCESS_VIROLOGY, ACCESS_CMO, ACCESS_SURGERY, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_SEC_DOORS, ACCESS_PSYCHIATRIST, ACCESS_MAINT_TUNNELS, ACCESS_PARAMEDIC, ACCESS_MINERAL_STOREROOM) minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND exp_requirements = 3000 exp_type = EXP_TYPE_MEDICAL outfit = /datum/outfit/job/cmo diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index 90f25de2c95..0b92a86e0ee 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -18,7 +18,7 @@ ACCESS_RESEARCH, ACCESS_ROBOTICS, ACCESS_XENOBIOLOGY, ACCESS_AI_UPLOAD, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT, ACCESS_GATEWAY, ACCESS_XENOARCH, ACCESS_MINISAT, ACCESS_MAINT_TUNNELS, ACCESS_MINERAL_STOREROOM, ACCESS_NETWORK) minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND exp_requirements = 3000 exp_type = EXP_TYPE_SCIENCE // All science-y guys get bonuses for maxing out their tech. diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 56d0a76681b..3f9000c13d4 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -18,7 +18,7 @@ ACCESS_RESEARCH, ACCESS_ENGINE, ACCESS_MINING, ACCESS_MEDICAL, ACCESS_CONSTRUCTION, ACCESS_MAILSORTING, ACCESS_HEADS, ACCESS_HOS, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_GATEWAY, ACCESS_PILOT, ACCESS_WEAPONS) minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 3000 exp_type = EXP_TYPE_SECURITY @@ -74,7 +74,7 @@ minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_WEAPONS) alt_titles = list("Brig Sergeant") minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_HIGH_ED blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 2100 exp_type = EXP_TYPE_SECURITY diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index 3962ccab4d5..8ad7892c4dd 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -13,7 +13,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca access = list() //See get_access() minimal_access = list() //See get_access() minimal_player_age = 30 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 3000 exp_type = EXP_TYPE_COMMAND @@ -72,7 +72,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca req_admin_notify = 1 is_command = 1 minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 1200 exp_type = EXP_TYPE_COMMAND @@ -128,7 +128,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca is_command = 1 transfer_allowed = FALSE minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 1200 exp_type = EXP_TYPE_COMMAND @@ -180,7 +180,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca is_command = 1 transfer_allowed = FALSE minimal_player_age = 21 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_HIGH_ED blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 3000 exp_type = EXP_TYPE_SECURITY @@ -238,7 +238,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca is_legal = 1 transfer_allowed = FALSE minimal_player_age = 30 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 1200 exp_type = EXP_TYPE_COMMAND @@ -295,7 +295,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca minimal_access = list(ACCESS_LAWYER, ACCESS_COURT, ACCESS_SEC_DOORS, ACCESS_MAINT_TUNNELS, ACCESS_RESEARCH, ACCESS_MEDICAL, ACCESS_CONSTRUCTION, ACCESS_MAILSORTING) alt_titles = list("Human Resources Agent","Lawyer","Attorney") minimal_player_age = 30 - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_HIGH_ED blocked_race_for_job = list(SPECIES_VOX) exp_requirements = 3000 exp_type = EXP_TYPE_CREW diff --git a/code/game/jobs/job/support.dm b/code/game/jobs/job/support.dm index 7b43af99d36..14fc4eca7ee 100644 --- a/code/game/jobs/job/support.dm +++ b/code/game/jobs/job/support.dm @@ -11,7 +11,7 @@ selection_color = "#9f8545" access = list(ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_HEADS_VAULT, ACCESS_ALL_PERSONAL_LOCKERS, ACCESS_HEADS, ACCESS_SEC_DOORS, ACCESS_EVA, ACCESS_MAINT_TUNNELS, ACCESS_MAILSORTING, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_QM, ACCESS_MINT, ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MINERAL_STOREROOM) minimal_access = list(ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_HEADS_VAULT, ACCESS_ALL_PERSONAL_LOCKERS, ACCESS_HEADS, ACCESS_SECURITY, ACCESS_EVA, ACCESS_MAINT_TUNNELS, ACCESS_MAILSORTING, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_QM, ACCESS_MINT, ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MINERAL_STOREROOM) - min_age_allowed = 30 + min_age_type = JOB_MIN_AGE_COMMAND exp_requirements = 3000 exp_type = EXP_TYPE_CREW alt_titles = list("Chief Supply Manager") diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 3d1580776f8..34d300c2b78 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -346,10 +346,16 @@ return if(field == "age") + if(!active1) + return + + var/datum/species/species = active1.fields["species"] var/new_age = text2num(answer) - if(new_age < AGE_MIN || new_age > AGE_MAX) - set_temp("Invalid age. It must be between [AGE_MIN] and [AGE_MAX].", "danger") + var/age_limits = get_age_limits(species, list(SPECIES_AGE_MIN, SPECIES_AGE_MAX)) + if(new_age < age_limits[SPECIES_AGE_MIN] || new_age > age_limits[SPECIES_AGE_MAX]) + set_temp("Invalid age. It must be between [age_limits[SPECIES_AGE_MIN]] and [age_limits[SPECIES_AGE_MAX]].", "danger") return + answer = new_age if(istype(active2) && (field in active2.fields)) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index a2ea58d267d..bbc04412ee3 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -364,12 +364,19 @@ return if(field == "age") + if(!record_general) + return + + var/datum/species/species = record_general.fields["species"] var/new_age = text2num(answer) - if(new_age < AGE_MIN || new_age > AGE_MAX) - set_temp("Invalid age. It must be between [AGE_MIN] and [AGE_MAX].", "danger") + var/age_limits = get_age_limits(species, list(SPECIES_AGE_MIN, SPECIES_AGE_MAX)) + if(new_age < age_limits[SPECIES_AGE_MIN] || new_age > age_limits[SPECIES_AGE_MAX]) + set_temp("Invalid age. It must be between [age_limits[SPECIES_AGE_MIN]] and [age_limits[SPECIES_AGE_MAX]].", "danger") return + answer = new_age - else if(field == "criminal") + + if(field == "criminal") var/text = "Please enter a reason for the status change to [answer]:" if(answer == SEC_RECORD_STATUS_EXECUTE) text = "Please explain why they are being executed. Include a list of their crimes, and victims." diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 473d6d5f907..c6bf6bd40bb 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -906,7 +906,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts html += "[rank] \[ЧЕРЕЗ [(available_in_days)] ДНЕЙ]" continue if(!job.character_old_enough(user.client)) - html += "[rank] \[ВОЗРАСТ ОТ [(job.min_age_allowed)]]" + var/datum/species/current_species = GLOB.all_species[species] + html += "[rank] \[ВОЗРАСТ ОТ [current_species.age_sheet[job.min_age_type]]]" continue if(job.species_in_blacklist(user.client)) html += "[rank] \[НЕДОСТУПНО ДЛЯ ДАННОЙ РАСЫ]" @@ -1542,7 +1543,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts real_name = random_name(gender,species) user.client << output(real_name, "title_browser:update_current_character") if("age") - age = rand(AGE_MIN, AGE_MAX) + age = get_rand_age(S) if("hair") if(species in list(SPECIES_HUMAN, SPECIES_UNATHI, SPECIES_TAJARAN, SPECIES_SKRELL, SPECIES_MACNINEPERSON, SPECIES_WRYN, SPECIES_VULPKANIN, SPECIES_VOX)) h_colour = rand_hex_color() @@ -1619,10 +1620,11 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts to_chat(user, "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 .") if("age") - var/new_age = tgui_input_number(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference", age, AGE_MAX, AGE_MIN) + var/list/age_list = get_age_limits(S, list(SPECIES_AGE_MIN, SPECIES_AGE_MAX)) + var/new_age = tgui_input_number(user, "Choose your character's age:\n([age_list[SPECIES_AGE_MIN]]-[age_list[SPECIES_AGE_MAX]])", "Character Preference", age, age_list[SPECIES_AGE_MAX], age_list[SPECIES_AGE_MIN]) if(!new_age) return - age = max(min(round(text2num(new_age)), AGE_MAX), AGE_MIN) + age = clamp(round(text2num(new_age)), age_list[SPECIES_AGE_MIN], age_list[SPECIES_AGE_MAX]) if("species") var/list/new_species = list(SPECIES_HUMAN) var/prev_species = species @@ -1696,6 +1698,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts if(!(NS.bodyflags & HAS_SKIN_COLOR)) s_colour = "#000000" + age = get_rand_age(NS) alt_head = "None" //No alt heads on species that don't have them. speciesprefs = 0 //My Vox tank shouldn't change how my future Grey talks. language = LANGUAGE_NONE diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm index a1d7b7c2045..6cc2c34071a 100644 --- a/code/modules/client/preference/preferences_mysql.dm +++ b/code/modules/client/preference/preferences_mysql.dm @@ -340,7 +340,8 @@ if(!real_name) real_name = random_name(gender,species) 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)) + var/age_limits = get_age_limits(SP, list(SPECIES_AGE_MIN, SPECIES_AGE_MAX, JOB_MIN_AGE_COMMAND)) + age = sanitize_integer(age, age_limits[SPECIES_AGE_MIN], age_limits[SPECIES_AGE_MAX], age_limits[JOB_MIN_AGE_COMMAND]) h_colour = sanitize_hexcolor(h_colour) h_sec_colour = sanitize_hexcolor(h_sec_colour) f_colour = sanitize_hexcolor(f_colour) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 8c4e4cd1eb0..51c7d9e2e0c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1590,8 +1590,10 @@ Eyes need to have significantly high darksight to shine unless the mob has the X return ..() -/mob/living/carbon/human/proc/get_age_pitch(var/tolerance = 5) - return 1.0 + 0.5*(30 - age)/80 + (0.01*rand(-tolerance,tolerance)) + +/mob/living/carbon/human/proc/get_age_pitch(tolerance = 5) + return dna?.species.get_emote_pitch(src, tolerance) || 1.0 + 0.5 * (30 - age) / 80 + (0.01 * rand(-tolerance, tolerance)) + /mob/living/carbon/human/get_access_locations() . = ..() diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 3a55730a3a7..70d7d6b7c41 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -261,6 +261,10 @@ var/list/autohiss_extra_map = null var/list/autohiss_exempt = null + /// Contains info for all age related preferences. + var/list/age_sheet + + /datum/species/New() unarmed = new unarmed_type() @@ -269,6 +273,26 @@ return species_language.get_random_name(gender) +/proc/get_age_limits(datum/species/species, list/tags) + if(!islist(tags)) + tags = list(tags) + + var/list/result = list() + for(var/tag in tags) + if(species) + result[tag] = LAZYACCESS(species.age_sheet, tag) + + if(!isnum(result[tag])) + result[tag] = AGE_SHEET[tag] + + return length(result) > 1 ? result : result[tags[1]] + + +/proc/get_rand_age(datum/species/species) + var/age_limits = get_age_limits(species, list(SPECIES_AGE_MIN, SPECIES_AGE_MAX)) + return rand(age_limits[SPECIES_AGE_MIN], age_limits[SPECIES_AGE_MAX]) + + /** * Handles creation of mob organs. * @@ -1188,3 +1212,6 @@ It'll return null if the organ doesn't correspond, so include null checks when u var/obj/item/organ/external/head/HD = H.get_organ(BODY_ZONE_HEAD) return HD.hair_colour +/datum/species/proc/get_emote_pitch(mob/living/carbon/human/H, tolerance) + var/age_limits = get_age_limits(src, list(SPECIES_AGE_MIN, SPECIES_AGE_MAX)) + return 1 + 0.5 * (age_limits[SPECIES_AGE_MIN] + 10 - H.age) / age_limits[SPECIES_AGE_MAX] + (0.01 * rand(-tolerance, tolerance)) diff --git a/code/modules/mob/living/carbon/human/species/diona.dm b/code/modules/mob/living/carbon/human/species/diona.dm index 43be92752a1..12c74470e67 100644 --- a/code/modules/mob/living/carbon/human/species/diona.dm +++ b/code/modules/mob/living/carbon/human/species/diona.dm @@ -80,6 +80,13 @@ disliked_food = MEAT | RAW | EGG liked_food = VEGETABLES | FRUIT + age_sheet = list( + SPECIES_AGE_MIN = 1, + SPECIES_AGE_MAX = 90, + JOB_MIN_AGE_HIGH_ED = 26, + JOB_MIN_AGE_COMMAND = 26, + ) + /datum/species/diona/can_understand(mob/other) if(istype(other, /mob/living/simple_animal/diona)) return 1 diff --git a/code/modules/mob/living/carbon/human/species/drask.dm b/code/modules/mob/living/carbon/human/species/drask.dm index e970e3668e4..2d2b25dc886 100644 --- a/code/modules/mob/living/carbon/human/species/drask.dm +++ b/code/modules/mob/living/carbon/human/species/drask.dm @@ -1,5 +1,6 @@ #define DRASK_COOLINGSTARTTEMP 280 #define ENVIRONMENT_COOLINGSTOPTEMP 400 +#define DRASK_PITCH_SHIFT -0.1 // a bit lower emotes /datum/species/drask name = SPECIES_DRASK @@ -83,6 +84,13 @@ liked_food = DAIRY special_diet = MATERIAL_CLASS_SOAP + age_sheet = list( + SPECIES_AGE_MIN = 30, + SPECIES_AGE_MAX = 999, + JOB_MIN_AGE_HIGH_ED = 50, + JOB_MIN_AGE_COMMAND = 50, + ) + /datum/species/drask/get_species_runechat_color(mob/living/carbon/human/H) var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) return E.eye_colour @@ -123,5 +131,11 @@ return FALSE return ..() +/datum/species/drask/get_emote_pitch(mob/living/carbon/human/H, tolerance) + . = ..() + . += DRASK_PITCH_SHIFT + + #undef DRASK_COOLINGSTARTTEMP #undef ENVIRONMENT_COOLINGSTOPTEMP +#undef DRASK_PITCH_SHIFT diff --git a/code/modules/mob/living/carbon/human/species/grey.dm b/code/modules/mob/living/carbon/human/species/grey.dm index ab50b745c0e..f73f111c338 100644 --- a/code/modules/mob/living/carbon/human/species/grey.dm +++ b/code/modules/mob/living/carbon/human/species/grey.dm @@ -45,6 +45,13 @@ disliked_food = SUGAR | FRIED liked_food = VEGETABLES | GRAIN | MEAT + age_sheet = list( + SPECIES_AGE_MIN = 3, + SPECIES_AGE_MAX = 150, + JOB_MIN_AGE_HIGH_ED = 13, + JOB_MIN_AGE_COMMAND = 13, + ) + /datum/species/grey/on_species_gain(mob/living/carbon/human/H) . = ..() diff --git a/code/modules/mob/living/carbon/human/species/kidan.dm b/code/modules/mob/living/carbon/human/species/kidan.dm index e26407e63ef..5aa7b8c3933 100644 --- a/code/modules/mob/living/carbon/human/species/kidan.dm +++ b/code/modules/mob/living/carbon/human/species/kidan.dm @@ -95,6 +95,13 @@ disliked_food = FRIED | DAIRY liked_food = SUGAR | ALCOHOL | GROSS | FRUIT + age_sheet = list( + SPECIES_AGE_MIN = 12, + SPECIES_AGE_MAX = 45, + JOB_MIN_AGE_HIGH_ED = 20, + JOB_MIN_AGE_COMMAND = 20, + ) + /datum/species/kidan/get_species_runechat_color(mob/living/carbon/human/H) var/obj/item/organ/internal/eyes/E = H.get_int_organ(/obj/item/organ/internal/eyes) return E.eye_colour diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index e933bc407b7..c12df2472d3 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -95,6 +95,13 @@ disliked_food = NONE toxic_food = NONE + age_sheet = list( + SPECIES_AGE_MIN = 1, + SPECIES_AGE_MAX = 58, + JOB_MIN_AGE_HIGH_ED = 15, + JOB_MIN_AGE_COMMAND = 15, + ) + /datum/species/machine/on_species_gain(mob/living/carbon/human/H) . = ..() var/datum/action/innate/change_monitor/monitor = locate() in H.actions @@ -185,3 +192,7 @@ H.change_hair(new_style, 1) // The 1 is to enable custom sprites if(new_color) H.change_hair_color(new_color) + + +/datum/species/machine/get_emote_pitch(mob/living/carbon/human/H, tolerance) + return 1 + (0.01*rand(-tolerance,tolerance)) diff --git a/code/modules/mob/living/carbon/human/species/moth.dm b/code/modules/mob/living/carbon/human/species/moth.dm index 8040cc46d4a..4e053ec0e69 100644 --- a/code/modules/mob/living/carbon/human/species/moth.dm +++ b/code/modules/mob/living/carbon/human/species/moth.dm @@ -4,6 +4,7 @@ #define COCOON_NUTRITION_REQUIREMENT 201 #define COCOON_NUTRITION_AMOUNT -200 #define FLYSWATTER_DAMAGE_MULTIPLIER 10 +#define MOTH_PITCH_SHIFT 0.15 // a bit higher emotes /datum/species/moth name = SPECIES_MOTH @@ -81,6 +82,13 @@ liked_food = SUGAR | GROSS | FRUIT | VEGETABLES special_diet = MATERIAL_CLASS_CLOTH + age_sheet = list( + SPECIES_AGE_MIN = 3, + SPECIES_AGE_MAX = 60, + JOB_MIN_AGE_HIGH_ED = 15, + JOB_MIN_AGE_COMMAND = 15, + ) + /datum/species/moth/on_species_gain(mob/living/carbon/human/H) . = ..() H.add_movespeed_mod_immunities(type, /datum/movespeed_modifier/limbless) @@ -251,9 +259,14 @@ owner.UpdateAppearance() return ..() +/datum/species/moth/get_emote_pitch(mob/living/carbon/human/H, tolerance) + . = ..() + . += MOTH_PITCH_SHIFT + #undef COCOON_WEAVE_DELAY #undef COCOON_EMERGE_DELAY #undef COCOON_HARM_AMOUNT #undef COCOON_NUTRITION_AMOUNT #undef FLYSWATTER_DAMAGE_MULTIPLIER +#undef MOTH_PITCH_SHIFT diff --git a/code/modules/mob/living/carbon/human/species/nucleation.dm b/code/modules/mob/living/carbon/human/species/nucleation.dm index 64e391b0164..d150ca9bc5b 100644 --- a/code/modules/mob/living/carbon/human/species/nucleation.dm +++ b/code/modules/mob/living/carbon/human/species/nucleation.dm @@ -48,6 +48,13 @@ meat_type = /obj/item/reagent_containers/food/snacks/meat/humanoid/nucleation + age_sheet = list( + SPECIES_AGE_MIN = 18, + SPECIES_AGE_MAX = 230, + JOB_MIN_AGE_HIGH_ED = 30, + JOB_MIN_AGE_COMMAND = 30, + ) + /datum/species/nucleation/on_species_gain(mob/living/carbon/human/H) . = ..() diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index d58397dd029..d9982ae1f02 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -60,6 +60,13 @@ disliked_food = NONE liked_food = NONE + age_sheet = list( + SPECIES_AGE_MIN = 4, + SPECIES_AGE_MAX = 150, + JOB_MIN_AGE_HIGH_ED = 25, + JOB_MIN_AGE_COMMAND = 25, + ) + /datum/species/plasmaman/on_species_gain(mob/living/carbon/human/H) . = ..() diff --git a/code/modules/mob/living/carbon/human/species/skrell.dm b/code/modules/mob/living/carbon/human/species/skrell.dm index 2d9a03bd225..84741d29f66 100644 --- a/code/modules/mob/living/carbon/human/species/skrell.dm +++ b/code/modules/mob/living/carbon/human/species/skrell.dm @@ -80,6 +80,13 @@ male_snore_sound = list('sound/voice/skrell/snore1.ogg', 'sound/voice/skrell/snore2.ogg', 'sound/voice/skrell/snore3.ogg') whistle_sound = list('sound/voice/skrell/whistling1.ogg', 'sound/voice/skrell/whistling2.ogg') + age_sheet = list( + SPECIES_AGE_MIN = 18, + SPECIES_AGE_MAX = 400, + JOB_MIN_AGE_HIGH_ED = 25, + JOB_MIN_AGE_COMMAND = 25, + ) + /datum/species/skrell/on_species_gain(mob/living/carbon/human/H) . = ..() add_verb(H, list( diff --git a/code/modules/mob/living/carbon/human/species/slime.dm b/code/modules/mob/living/carbon/human/species/slime.dm index 1fe041aa49a..d8f86a8ea3a 100644 --- a/code/modules/mob/living/carbon/human/species/slime.dm +++ b/code/modules/mob/living/carbon/human/species/slime.dm @@ -81,6 +81,13 @@ /// Special flag used for slimeperson evolved from the slime. var/evolved_slime = FALSE + age_sheet = list( + SPECIES_AGE_MIN = 17, + SPECIES_AGE_MAX = 140, + JOB_MIN_AGE_HIGH_ED = 30, + JOB_MIN_AGE_COMMAND = 30, + ) + /datum/species/slime/on_species_gain(mob/living/carbon/human/H) . = ..() var/datum/action/innate/regrow/grow = locate() in H.actions diff --git a/code/modules/mob/living/carbon/human/species/tajaran.dm b/code/modules/mob/living/carbon/human/species/tajaran.dm index 230f8d3740a..4e3697815bf 100644 --- a/code/modules/mob/living/carbon/human/species/tajaran.dm +++ b/code/modules/mob/living/carbon/human/species/tajaran.dm @@ -78,6 +78,13 @@ disliked_food = VEGETABLES | FRUIT | GRAIN | GROSS liked_food = MEAT | RAW | DAIRY | EGG + age_sheet = list( + SPECIES_AGE_MIN = 11, + SPECIES_AGE_MAX = 44, + JOB_MIN_AGE_HIGH_ED = 19, + JOB_MIN_AGE_COMMAND = 19, + ) + /datum/species/tajaran/handle_death(gibbed, mob/living/carbon/human/H) H.stop_tail_wagging() diff --git a/code/modules/mob/living/carbon/human/species/unathi.dm b/code/modules/mob/living/carbon/human/species/unathi.dm index 1f4434c5139..bec3fcf24fb 100644 --- a/code/modules/mob/living/carbon/human/species/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/unathi.dm @@ -92,6 +92,13 @@ disliked_food = FRIED liked_food = MEAT | RAW | EGG | GROSS | FRUIT | VEGETABLES + age_sheet = list( + SPECIES_AGE_MIN = 12, + SPECIES_AGE_MAX = 70, + JOB_MIN_AGE_HIGH_ED = 22, + JOB_MIN_AGE_COMMAND = 22, + ) + /datum/species/unathi/handle_death(gibbed, mob/living/carbon/human/H) H.stop_tail_wagging() diff --git a/code/modules/mob/living/carbon/human/species/vox.dm b/code/modules/mob/living/carbon/human/species/vox.dm index 9b977acd988..78410fed588 100644 --- a/code/modules/mob/living/carbon/human/species/vox.dm +++ b/code/modules/mob/living/carbon/human/species/vox.dm @@ -103,6 +103,13 @@ liked_food = NONE special_diet = MATERIAL_CLASS_TECH + age_sheet = list( + SPECIES_AGE_MIN = 1, + SPECIES_AGE_MAX = 70, + JOB_MIN_AGE_HIGH_ED = 10, + JOB_MIN_AGE_COMMAND = 10, + ) + /datum/species/vox/handle_death(gibbed, mob/living/carbon/human/H) H.stop_tail_wagging() @@ -182,6 +189,11 @@ return ..() + +/datum/species/vox/get_emote_pitch(mob/living/carbon/human/H, tolerance) + return 1 + (0.01*rand(-tolerance,tolerance)) + + /datum/species/vox/armalis name = SPECIES_VOX_ARMALIS name_plural = "Vox Armalis" diff --git a/code/modules/mob/living/carbon/human/species/vulpkanin.dm b/code/modules/mob/living/carbon/human/species/vulpkanin.dm index 9be8a9711b0..708774dd5a5 100644 --- a/code/modules/mob/living/carbon/human/species/vulpkanin.dm +++ b/code/modules/mob/living/carbon/human/species/vulpkanin.dm @@ -71,6 +71,13 @@ disliked_food = VEGETABLES | FRUIT | GRAIN liked_food = MEAT | RAW | DAIRY | GROSS | EGG + age_sheet = list( + SPECIES_AGE_MIN = 18, + SPECIES_AGE_MAX = 80, + JOB_MIN_AGE_HIGH_ED = 30, + JOB_MIN_AGE_COMMAND = 30, + ) + /datum/species/vulpkanin/handle_death(gibbed, mob/living/carbon/human/H) H.stop_tail_wagging() diff --git a/code/modules/mob/living/carbon/human/species/wryn.dm b/code/modules/mob/living/carbon/human/species/wryn.dm index a8d45c63469..8774d576256 100644 --- a/code/modules/mob/living/carbon/human/species/wryn.dm +++ b/code/modules/mob/living/carbon/human/species/wryn.dm @@ -72,6 +72,13 @@ //Default styles for created mobs. default_hair = "Antennae" + age_sheet = list( + SPECIES_AGE_MIN = 15, + SPECIES_AGE_MAX = 55, + JOB_MIN_AGE_HIGH_ED = 22, + JOB_MIN_AGE_COMMAND = 22, + ) + /datum/species/wryn/on_species_gain(mob/living/carbon/human/H) . = ..() var/datum/action/innate/wryn_sting/wryn_sting = locate() in H.actions diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 2068742e1f8..987455b2386 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -363,7 +363,8 @@ alert(msg) return FALSE if(!thisjob.character_old_enough(client)) - var/msg = "Должность [rank] недоступна в связи с недостаточным возрастом персонажа ([client?.prefs.age]). Минимальный возраст - [thisjob.min_age_allowed]" + var/datum/species/species = GLOB.all_species[client?.prefs.species] + var/msg = "Должность [rank] недоступна в связи с недостаточным возрастом персонажа ([client?.prefs.age]). Минимальный возраст - [species.age_sheet[thisjob.min_age_type]]" to_chat(src, msg) alert(msg) return FALSE diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index c24b43186e5..f43365d46d6 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -43,7 +43,7 @@ if(S.bodyflags & HAS_SKIN_COLOR && !(S.bodyflags & HAS_ICON_SKIN_TONE)) randomize_skin_color() backbag = 2 - age = rand(AGE_MIN, AGE_MAX) + age = get_rand_age(S) /datum/preferences/proc/randomize_hair_color(var/target = "hair") From 44e30a2aa098b2e3fe2ec1993d2fda55314efce5 Mon Sep 17 00:00:00 2001 From: Valtor <156955117+Samirakis@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:15:06 +0300 Subject: [PATCH 2/3] Update code/modules/client/preference/preferences.dm Co-authored-by: Daeberdir <115735095+Daeberdir@users.noreply.github.com> --- code/modules/client/preference/preferences.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index c6bf6bd40bb..ad4bfba80bc 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -907,7 +907,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts continue if(!job.character_old_enough(user.client)) var/datum/species/current_species = GLOB.all_species[species] - html += "[rank] \[ВОЗРАСТ ОТ [current_species.age_sheet[job.min_age_type]]]" + html += "[rank] \[ВОЗРАСТ ОТ [get_age_limits(current_species, job.min_age_type)]" continue if(job.species_in_blacklist(user.client)) html += "[rank] \[НЕДОСТУПНО ДЛЯ ДАННОЙ РАСЫ]" From edd9ab11cbe216bb621b51a5fa12b63300bff652 Mon Sep 17 00:00:00 2001 From: Valtor <156955117+Samirakis@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:15:11 +0300 Subject: [PATCH 3/3] Update code/modules/mob/new_player/new_player.dm Co-authored-by: Daeberdir <115735095+Daeberdir@users.noreply.github.com> --- code/modules/mob/new_player/new_player.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 987455b2386..f68feabe24c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -364,7 +364,7 @@ return FALSE if(!thisjob.character_old_enough(client)) var/datum/species/species = GLOB.all_species[client?.prefs.species] - var/msg = "Должность [rank] недоступна в связи с недостаточным возрастом персонажа ([client?.prefs.age]). Минимальный возраст - [species.age_sheet[thisjob.min_age_type]]" + var/msg = "Должность [rank] недоступна в связи с недостаточным возрастом персонажа ([client?.prefs.age]). Минимальный возраст - [get_age_limits(species, thisjob.min_age_type)]" to_chat(src, msg) alert(msg) return FALSE