From 90d80074cb2dd038e124fc1d1d104d2952c65a1f Mon Sep 17 00:00:00 2001 From: Lexanx <61974560+Lexanx@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:00:15 +0300 Subject: [PATCH] Languages (#2940) --- code/__defines/mobs.dm | 2 +- .../preference_setup/background/02_language.dm | 15 ++++++++++++--- code/modules/nano/modules/human_appearance.dm | 2 +- mods/adherent_discharge/code/adherent.dm | 17 +++++++++++++++++ mods/diona/code/station.dm | 15 +++++++++++++++ mods/ipc_mods/code/machine.dm | 1 + 6 files changed, 47 insertions(+), 5 deletions(-) diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index bd13be60a217a..2a7b81ffa7170 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -163,7 +163,7 @@ #define FLASH_PROTECTION_MODERATE 2 #define FLASH_PROTECTION_MAJOR 3 -#define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 6) +#define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 2) //SIERRA-EDIT ORIG was /6 #define DRONE_SPAWN_DELAY round(config.respawn_delay / 3) // Incapacitation flags, used by the mob/proc/incapacitated() proc diff --git a/code/modules/client/preference_setup/background/02_language.dm b/code/modules/client/preference_setup/background/02_language.dm index eb7e08b61a869..886915a9e883a 100644 --- a/code/modules/client/preference_setup/background/02_language.dm +++ b/code/modules/client/preference_setup/background/02_language.dm @@ -44,7 +44,8 @@ else if(href_list["add_language"]) - if(length(pref.alternate_languages) >= MAX_LANGUAGES) + // if(length(pref.alternate_languages) >= MAX_LANGUAGES) // SIERRA-EDIT - ORIGINAL + if(length(pref.alternate_languages) >= total_languages()) // [SIERRA-EDIT] - EXPANDED_CULTURE_DESCRIPTOR - Перевод // alert(user, "You have already selected the maximum number of languages!") // SIERRA-EDIT - ORIGINAL alert(user, "Вы уже выбрали максимальное количество языков!") @@ -115,8 +116,12 @@ pref.alternate_languages.Insert(1, lang) pref.alternate_languages = uniquelist(pref.alternate_languages) +/* if(length(pref.alternate_languages) > MAX_LANGUAGES) - pref.alternate_languages.Cut(MAX_LANGUAGES + 1) + pref.alternate_languages.Cut(MAX_LANGUAGES + 1) // SIERRA-EDIT - ORIGINAL +*/ + if(length(pref.alternate_languages) > total_languages()) + pref.alternate_languages.Cut(total_languages() + 1) /datum/category_item/player_setup_item/background/languages/proc/get_language_text() sanitize_alt_languages() @@ -133,8 +138,12 @@ // LAZYADD(., "- [lang] Remove. [all_languages[lang].warning]
") // SIERRA-EDIT - ORIGINAL LAZYADD(., "- [lang] Убрать. [all_languages[lang].warning]
") // [/SIERRA-EDIT] +/* if(length(pref.alternate_languages) < MAX_LANGUAGES) - var/remaining_langs = MAX_LANGUAGES - length(pref.alternate_languages) + var/remaining_langs = MAX_LANGUAGES - length(pref.alternate_languages) // SIERRA-EDIT - ORIGINAL +*/ + if(length(pref.alternate_languages) < total_languages()) + var/remaining_langs = total_languages() - length(pref.alternate_languages) // [SIERRA-EDIT] - EXPANDED_CULTURE_DESCRIPTOR - Перевод // LAZYADD(., "- add ([remaining_langs] remaining)
") // SIERRA-EDIT - ORIGINAL LAZYADD(., "- Добавить ([remaining_langs] осталось)
") diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm index 3948e2c8232ba..82f2e4a751eb3 100644 --- a/code/modules/nano/modules/human_appearance.dm +++ b/code/modules/nano/modules/human_appearance.dm @@ -128,7 +128,7 @@ if (href_list["language"] && (flags & APPEARANCE_LANG)) if (href_list["language_mode"] == "add") - if ((~flags & APPEARANCE_LANG_ANY_NUMBER) && length(owner.languages) >= MAX_LANGUAGES) + if ((~flags & APPEARANCE_LANG_ANY_NUMBER) && length(owner.languages) >= (MAX_LANGUAGES + owner.species.additional_languages)) // SIERRA-EDIT added( + owner.species.additional_languages)) return if ((~flags & APPEARANCE_LANG_ANY_ORIGIN) && !(href_list["language"] in langs)) return diff --git a/mods/adherent_discharge/code/adherent.dm b/mods/adherent_discharge/code/adherent.dm index 681dec209ae83..cdeea81675e41 100644 --- a/mods/adherent_discharge/code/adherent.dm +++ b/mods/adherent_discharge/code/adherent.dm @@ -1,3 +1,6 @@ +/datum/species/adherent + additional_languages = 1 + /obj/item/organ/internal/cell/adherent var/ready_to_charge @@ -19,3 +22,17 @@ adherent_core.ready_to_charge = FALSE to_chat(src, SPAN_WARNING("You have relieved the tension of your tentacles.")) + +/singleton/cultural_info/culture/adherent + secondary_langs = list( + LANGUAGE_HUMAN_EURO, + LANGUAGE_HUMAN_CHINESE, + LANGUAGE_HUMAN_ARABIC, + LANGUAGE_HUMAN_INDIAN, + LANGUAGE_HUMAN_IBERIAN, + LANGUAGE_HUMAN_RUSSIAN, + LANGUAGE_SPACER, + LANGUAGE_VOX, + LANGUAGE_CULT, + LANGUAGE_PRIMITIVE + ) diff --git a/mods/diona/code/station.dm b/mods/diona/code/station.dm index 5d7eeb0fc8d8a..ef4e1aac863f3 100644 --- a/mods/diona/code/station.dm +++ b/mods/diona/code/station.dm @@ -1,3 +1,18 @@ + +/datum/category_item/player_setup_item/background/languages/proc/total_languages() + return MAX_LANGUAGES + pref.additional_languages + +/datum/preferences + var/additional_languages + +/datum/preferences/copy_to(mob/living/carbon/human/character, is_preview_copy = FALSE) + . = ..() + additional_languages = character.species.additional_languages + +/datum/species + var/additional_languages = 0 + /datum/species/diona slowdown = 2 thirst_factor = 0.06 + additional_languages = 2 diff --git a/mods/ipc_mods/code/machine.dm b/mods/ipc_mods/code/machine.dm index 6dd6a2fb5b82a..3de8fc23e7a86 100644 --- a/mods/ipc_mods/code/machine.dm +++ b/mods/ipc_mods/code/machine.dm @@ -3,6 +3,7 @@ #define SHOW_LAWS_POSIBRAN "Show laws posibran" /datum/species/machine passive_temp_gain = 0 // This should cause IPCs to stabilize at ~80 C in a 20 C environment.(5 is default without organ) + additional_languages = 1 /obj/machinery/organ_printer/robot/New() LAZYINITLIST(products)