From 9f215cc026ca63680479c43d7448f432cb3d1dba Mon Sep 17 00:00:00 2001 From: larentoun <31931237+larentoun@users.noreply.github.com> Date: Fri, 22 Nov 2024 02:21:20 +0300 Subject: [PATCH] reagents --- .../translations/_translations.dme | 1 + .../code/ru_names/ru_name_reagents.dm | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 modular_bandastation/translations/code/ru_names/ru_name_reagents.dm diff --git a/modular_bandastation/translations/_translations.dme b/modular_bandastation/translations/_translations.dme index ee887950be7b9..2cedc44348d26 100644 --- a/modular_bandastation/translations/_translations.dme +++ b/modular_bandastation/translations/_translations.dme @@ -15,5 +15,6 @@ #include "code/ru_names/ru_name_base.dm" #include "code/ru_names/ru_name_materials.dm" #include "code/ru_names/ru_name_orderables.dm" +#include "code/ru_names/ru_name_reagents.dm" #include "code/~undefs.dm" diff --git a/modular_bandastation/translations/code/ru_names/ru_name_reagents.dm b/modular_bandastation/translations/code/ru_names/ru_name_reagents.dm new file mode 100644 index 0000000000000..631b842658723 --- /dev/null +++ b/modular_bandastation/translations/code/ru_names/ru_name_reagents.dm @@ -0,0 +1,21 @@ +/datum/reagent + /// List consists of ("name", "именительный", "родительный", "дательный", "винительный", "творительный", "предложный", "gender") + var/list/ru_names + +/// Необходимо использовать ПЕРЕД изменением var/name, и использовать только этот прок для изменения в рантайме склонений +/datum/reagent/ru_names_rename(list/new_list) + if(!length(new_list)) + return + ru_names = new_list + +/datum/reagent/New() + . = ..() + ru_names_rename(ru_names_toml(LOWER_TEXT(name))) + +/datum/reagent/declent_ru(case_id, list/ru_names_override) + var/list/list_to_use = ru_names_override || ru_names + if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id]) + return list_to_use[case_id] + if(case_id == "gender") + return + return name