Добавлены наркотики и изменены ссылки в локализации

main
none 9 months ago
parent 12a6523cb3
commit 606c9e6be0

@ -1,6 +1,7 @@
{ {
"Аммиак": [ "Аммиак": [
4, 4,
"chemicals",
[ [
"Водород", "Водород",
3 3
@ -12,6 +13,7 @@
], ],
"Диэтиламин": [ "Диэтиламин": [
2, 2,
"chemicals",
[ [
"Аммиак", "Аммиак",
1 1
@ -23,6 +25,7 @@
], ],
"Хлоральгидрат": [ "Хлоральгидрат": [
1, 1,
"chemicals",
[ [
"Хлор", "Хлор",
3 3
@ -38,6 +41,7 @@
], ],
"Политриновая кислота": [ "Политриновая кислота": [
3, 3,
"chemicals",
[ [
"Серная кислота", "Серная кислота",
1 1
@ -53,6 +57,7 @@
], ],
"Фторсерная кислота": [ "Фторсерная кислота": [
4, 4,
"chemicals",
[ [
"Фтор", "Фтор",
1 1
@ -72,6 +77,7 @@
], ],
"Серная кислота": [ "Серная кислота": [
3, 3,
"chemicals",
[ [
"Водород", "Водород",
1 1
@ -87,6 +93,7 @@
], ],
"Нестабильный мутаген": [ "Нестабильный мутаген": [
3, 3,
"chemicals",
[ [
"Радий", "Радий",
1 1
@ -102,6 +109,7 @@
], ],
"Токсин хартбрейкер": [ "Токсин хартбрейкер": [
2, 2,
"medicine",
[ [
"Дексалин плюс", "Дексалин плюс",
1 1
@ -113,6 +121,7 @@
], ],
"Лексорин": [ "Лексорин": [
2, 2,
"medicine",
[ [
"Токсин хартбрейкер", "Токсин хартбрейкер",
1 1
@ -128,6 +137,7 @@
], ],
"Токсин майндбрейкер": [ "Токсин майндбрейкер": [
3, 3,
"medicine",
[ [
"Кремний", "Кремний",
1 1
@ -143,6 +153,7 @@
], ],
"Пакс": [ "Пакс": [
3, 3,
"chemicals",
[ [
"Токсин майндбрейкер", "Токсин майндбрейкер",
1 1
@ -158,6 +169,7 @@
], ],
"Тазинид": [ "Тазинид": [
1, 1,
"chemicals",
[ [
"[!] licoxide", "[!] licoxide",
1 1
@ -169,6 +181,7 @@
], ],
"Криптобиолин": [ "Криптобиолин": [
3, 3,
"medicine",
[ [
"Калий", "Калий",
1 1
@ -184,6 +197,7 @@
], ],
"Диловен": [ "Диловен": [
3, 3,
"medicine",
[ [
"Кремний", "Кремний",
1 1
@ -199,6 +213,7 @@
], ],
"Дифенгидрамин": [ "Дифенгидрамин": [
3, 3,
"medicine",
[ [
"Диэтиламин", "Диэтиламин",
1 1
@ -222,6 +237,7 @@
], ],
"Этилредоксразин": [ "Этилредоксразин": [
3, 3,
"medicine",
[ [
"Кислород", "Кислород",
1 1
@ -237,6 +253,7 @@
], ],
"Аритразин": [ "Аритразин": [
2, 2,
"medicine",
[ [
"Хироналин", "Хироналин",
1 1
@ -248,6 +265,7 @@
], ],
"Бикаридин": [ "Бикаридин": [
2, 2,
"medicine",
[ [
"Инапровалин", "Инапровалин",
1 1
@ -259,6 +277,7 @@
], ],
"Криоксадон": [ "Криоксадон": [
3, 3,
"medicine",
[ [
"Дексалин", "Дексалин",
1 1
@ -274,6 +293,7 @@
], ],
"Доксарубиксадон": [ "Доксарубиксадон": [
2, 2,
"medicine",
[ [
"Криоксадон", "Криоксадон",
1 1
@ -285,6 +305,7 @@
], ],
"Дермалин": [ "Дермалин": [
3, 3,
"medicine",
[ [
"Келотан", "Келотан",
1 1
@ -300,6 +321,7 @@
], ],
"Дексалин": [ "Дексалин": [
3, 3,
"medicine",
[ [
"Кислород", "Кислород",
2 2
@ -311,6 +333,7 @@
], ],
"Дексалин плюс": [ "Дексалин плюс": [
3, 3,
"medicine",
[ [
"Дексалин", "Дексалин",
1 1
@ -326,6 +349,7 @@
], ],
"Эпинефрин": [ "Эпинефрин": [
4, 4,
"medicine",
[ [
"Фенол", "Фенол",
1 1
@ -345,6 +369,7 @@
], ],
"Хироналин": [ "Хироналин": [
2, 2,
"medicine",
[ [
"Радий", "Радий",
1 1
@ -356,6 +381,7 @@
], ],
"Ипекак": [ "Ипекак": [
2, 2,
"medicine",
[ [
"Калий", "Калий",
1 1
@ -371,6 +397,7 @@
], ],
"Инапровалин": [ "Инапровалин": [
3, 3,
"medicine",
[ [
"Кислород", "Кислород",
1 1
@ -386,6 +413,7 @@
], ],
"Келотан": [ "Келотан": [
2, 2,
"medicine",
[ [
"Кремний", "Кремний",
1 1
@ -397,6 +425,7 @@
], ],
"Лепоразин": [ "Лепоразин": [
2, 2,
"medicine",
[ [
"Медь", "Медь",
1 1
@ -412,6 +441,7 @@
], ],
"Фалангимин": [ "Фалангимин": [
3, 3,
"medicine",
[ [
"Хироналин", "Хироналин",
1 1
@ -427,6 +457,7 @@
], ],
"Амбузол": [ "Амбузол": [
4, 4,
"medicine",
[ [
"Диловен", "Диловен",
1 1
@ -442,6 +473,7 @@
], ],
"Амбузол плюс": [ "Амбузол плюс": [
5, 5,
"medicine",
[ [
"Амбузол", "Амбузол",
5 5
@ -453,6 +485,7 @@
], ],
"Физраствор": [ "Физраствор": [
5, 5,
"medicine",
[ [
"Вода", "Вода",
4 4
@ -464,6 +497,7 @@
], ],
"Сидерлак": [ "Сидерлак": [
2, 2,
"medicine",
[ [
"Алоэ", "Алоэ",
1 1
@ -475,6 +509,7 @@
], ],
"Синаптизин": [ "Синаптизин": [
3, 3,
"medicine",
[ [
"Литий", "Литий",
1 1
@ -490,6 +525,7 @@
], ],
"Транексамовая кислота": [ "Транексамовая кислота": [
3, 3,
"medicine",
[ [
"Инапровалин", "Инапровалин",
1 1
@ -505,6 +541,7 @@
], ],
"Трикордразин": [ "Трикордразин": [
2, 2,
"medicine",
[ [
"Инапровалин", "Инапровалин",
1 1
@ -516,6 +553,7 @@
], ],
"Липозин": [ "Липозин": [
3, 3,
"medicine",
[ [
"Столовая соль", "Столовая соль",
1 1
@ -531,6 +569,7 @@
], ],
"Ультраваскулин": [ "Ультраваскулин": [
2, 2,
"medicine",
[ [
"Гистамин", "Гистамин",
2 2
@ -542,6 +581,7 @@
], ],
"Окулин": [ "Окулин": [
4, 4,
"medicine",
[ [
"Столовая соль", "Столовая соль",
1 1
@ -557,6 +597,7 @@
], ],
"Когнизин": [ "Когнизин": [
1, 1,
"medicine",
[ [
"Карпотоксин", "Карпотоксин",
1 1
@ -572,8 +613,9 @@
], ],
"Этилоксиэфедрин": [ "Этилоксиэфедрин": [
2, 2,
"chemicals",
[ [
"[!] desoxyephedrine", "Дезоксиэфедрин",
1 1
], ],
[ [
@ -583,6 +625,7 @@
], ],
"Дифенилметиламин": [ "Дифенилметиламин": [
3, 3,
"chemicals",
[ [
"Этилоксиэфедрин", "Этилоксиэфедрин",
1 1
@ -598,6 +641,7 @@
], ],
"Сигинат": [ "Сигинат": [
4, 4,
"medicine",
[ [
"Карбонат натрия", "Карбонат натрия",
1 1
@ -621,6 +665,7 @@
], ],
"Лацеринол": [ "Лацеринол": [
2, 2,
"medicine",
[ [
"Бикаридин", "Бикаридин",
1 1
@ -632,6 +677,7 @@
], ],
"Пунктураз": [ "Пунктураз": [
2, 2,
"medicine",
[ [
"Бикаридин", "Бикаридин",
1 1
@ -643,6 +689,7 @@
], ],
"Бруизин": [ "Бруизин": [
2, 2,
"medicine",
[ [
"Бикаридин", "Бикаридин",
1 1
@ -658,6 +705,7 @@
], ],
"Пиразин": [ "Пиразин": [
3, 3,
"medicine",
[ [
"Лепоразин", "Лепоразин",
1 1
@ -673,6 +721,7 @@
], ],
"Инсузин": [ "Инсузин": [
3, 3,
"medicine",
[ [
"Лепоразин", "Лепоразин",
1 1
@ -692,6 +741,7 @@
], ],
"Некрозол": [ "Некрозол": [
2, 2,
"medicine",
[ [
"Кровь", "Кровь",
3 3
@ -707,6 +757,7 @@
], ],
"Алоксадон": [ "Алоксадон": [
4, 4,
"medicine",
[ [
"Криоксадон", "Криоксадон",
1 1
@ -720,8 +771,137 @@
2 2
] ]
], ],
"Дезоксиэфедрин": [
4,
"chemicals",
[
"Эфедрин",
1
],
[
"Углерод",
1
],
[
"Йод",
1
],
[
"Фосфор",
1
]
],
"Эфедрин": [
4,
"chemicals",
[
"Масло",
1
],
[
"Водород",
1
],
[
"Сахар",
1
],
[
"Диэтиламин",
1
]
],
"Стимулятор": [
2,
"chemicals",
[
"Эфедрин",
1
],
[
"Вестин",
1
],
[
"Кислород",
2
]
],
"Импедризин": [
1,
"medicine",
[
"Ртуть",
1
],
[
"Кислород",
1
],
[
"Вода",
1
]
],
"Космические наркотики": [
3,
"medicine",
[
"Ртуть",
1
],
[
"Сахар",
1
],
[
"Литий",
1
]
],
"Ноктюрин": [
1,
"chemicals",
[
"Импедризин",
2
],
[
"Вестин",
1
]
],
"Токсин немоты": [
2,
"chemicals",
[
"Уран",
1
],
[
"Вестин",
2
],
[
"[!] spaceglue",
2
]
],
"Норэпинефриновая кислота": [
2,
"chemicals",
[
"Уран",
1
],
[
"Эпинефрин",
1
]
],
"Ацетон": [ "Ацетон": [
2, 2,
"chemicals",
[ [
"Масло", "Масло",
1 1
@ -737,6 +917,7 @@
], ],
"Фенол": [ "Фенол": [
2, 2,
"chemicals",
[ [
"Гидроксид", "Гидроксид",
1 1
@ -748,6 +929,7 @@
], ],
"Уголь": [ "Уголь": [
1, 1,
"chemicals",
[ [
"Углерод", "Углерод",
1 1
@ -759,6 +941,7 @@
], ],
"Карбонат натрия": [ "Карбонат натрия": [
4, 4,
"chemicals",
[ [
"Аммиак", "Аммиак",
1 1
@ -778,6 +961,7 @@
], ],
"Бензол": [ "Бензол": [
1, 1,
"chemicals",
[ [
"Водород", "Водород",
1 1
@ -789,6 +973,7 @@
], ],
"Гидроксид": [ "Гидроксид": [
2, 2,
"chemicals",
[ [
"Кислород", "Кислород",
1 1
@ -800,6 +985,7 @@
], ],
"Гидроксид натрия": [ "Гидроксид натрия": [
2, 2,
"chemicals",
[ [
"Гидроксид", "Гидроксид",
1 1
@ -811,6 +997,7 @@
], ],
"Силицид железа": [ "Силицид железа": [
2, 2,
"chemicals",
[ [
"Железо", "Железо",
1 1
@ -822,6 +1009,7 @@
], ],
"Полиакрилат натрия": [ "Полиакрилат натрия": [
4, 4,
"chemicals",
[ [
"Кислород", "Кислород",
2 2
@ -837,6 +1025,7 @@
], ],
"Столовая соль": [ "Столовая соль": [
2, 2,
"chemicals",
[ [
"Хлор", "Хлор",
1 1

@ -10,6 +10,7 @@ MEDICINE_R = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Re
MEDICINE = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Recipes/Reactions/medicine.yml" MEDICINE = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Recipes/Reactions/medicine.yml"
MEDICINE_LOCALISATION = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/medicine.ftl" MEDICINE_LOCALISATION = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/medicine.ftl"
NARCOTICS_R = "https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/Resources/Prototypes/Reagents/narcotics.yml"
CHEMICALS_R = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/chemicals.yml" CHEMICALS_R = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/chemicals.yml"
CHEMICALS = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Recipes/Reactions/chemicals.yml" CHEMICALS = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Recipes/Reactions/chemicals.yml"
@ -20,7 +21,7 @@ ELEMENTS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/
ELEMENTS_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/elements.ftl" ELEMENTS_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/elements.ftl"
# токсины # токсины
TOXINS = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/toxins.yml" TOXINS_R = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/toxins.yml"
TOXINS_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/toxins.ftl" TOXINS_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/toxins.ftl"
# локализация наркотиков/наркотических препаратов # локализация наркотиков/наркотических препаратов
@ -35,12 +36,13 @@ BIOLOGY_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/R
BIOLOGY_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/biological.ftl" BIOLOGY_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/biological.ftl"
# ботаника # ботаника
BOTANY = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/botany.yml" BOTANY_R = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/botany.yml"
BOTANY_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/botany.ftl" BOTANY_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/botany.ftl"
# все съедобное и питьевое # все съедобное и питьевое
FOOD = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml" #FOOD = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml"
FOOD_R = "https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml" FOOD_R = "https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml"
FOOD_R_EX = "https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/dev/Resources/Prototypes/Reagents/Consumable/Food/food.yml"
INGREDIENTS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml" INGREDIENTS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml"
DRINKS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml" DRINKS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml"
@ -93,30 +95,31 @@ class Reagent:
#print(result) #print(result)
return result return result
from db import *
def load_localisation(): def load_localisation():
data = {"elements": {}, "placeholders": {}} data = {"elements": {}, "placeholders": {}}
elements_urls = [ELEMENTS_URL, REAGENTS_URL, TOXINS_URL, GASES_URL, FOOD_URL, DRINKS_URL, BIOLOGY_URL, elements_urls = [ELEMENTS_URL, MEDICINE_R, TOXINS_R, GASES_URL, FOOD_R, FOOD_R_EX, DRINKS_URL, BIOLOGY_URL,
CONDIMENTS_URL, BOTANY_URL, ALCOHOL_URL, CHEMICALS_URL, INGREDIENTS_URL] FOOD_R, BOTANY_R, ALCOHOL_URL, CHEMICALS_R, INGREDIENTS_URL, NARCOTICS_R]
for url in elements_urls: for url in elements_urls:
response = yaml.load(requests.get(url).content.decode("utf-8"), Loader=yaml.SafeLoader) response = yaml.load(requests.get(url).content.decode("utf-8"), Loader=yaml.SafeLoader)
for i in response: for i in response:
data["elements"][i["id"]] = {"name": i["name"], "desc": i["desc"]} data["elements"][i["id"]] = {"name": i["name"], "desc": i["desc"]}
localisation_urls = [MEDICINE_LOCALISATION, ELEMENTS_LOCALISATION_URL, TOXINS_LOCALISATION_URL, localisation_urls = [MEDICINE_LOCALISATION, ELEMENTS_LOCALISATION_URL, TOXINS_LOCALISATION_URL,
GASES_LOCALISATION_URL, DRINKS_LOCALISATION_URL, FOOD_LOCALISATION_URL, GASES_LOCALISATION_URL, DRINKS_LOCALISATION_URL, FOOD_LOCALISATION_URL,
CONDIMENTS_LOCALISATION_URL, BIOLOGY_LOCALISATION_URL, NARCOTICS_LOCALISATION_URL, CONDIMENTS_LOCALISATION_URL, BIOLOGY_LOCALISATION_URL, NARCOTICS_LOCALISATION_URL,
BOTANY_LOCALISATION_URL, ALCOHOL_LOCALISATION_URL, CHEMICALS_LOCALISATION, BOTANY_LOCALISATION_URL, ALCOHOL_LOCALISATION_URL, CHEMICALS_LOCALISATION,
INGREDIENTS_LOCALISATION_URL] INGREDIENTS_LOCALISATION_URL]
for url in localisation_urls: for url in localisation_urls:
response = requests.get(url).content.decode("utf-8") response = requests.get(url).content.decode("utf-8")
for entry in parse(response).body: for entry in parse(response).body:
if isinstance(entry, ast.Message): if isinstance(entry, ast.Message):
data["placeholders"][entry.id.name] = entry.value.elements[0].value data["placeholders"][entry.id.name] = entry.value.elements[0].value
with open("locale.json", mode="w", encoding="utf-8") as localisation_file: write_db(data, 'locale.json')
json.dump(data, localisation_file, ensure_ascii=False, indent=2) # with open("locale.json", mode="w", encoding="utf-8") as localisation_file:
# json.dump(data, localisation_file, ensure_ascii=False, indent=2)
def localise(key: str) -> str: def localise(key: str) -> str:
@ -161,18 +164,18 @@ def load_recipes(url,name):
content[item["id"]]["products"] = item["products"] content[item["id"]]["products"] = item["products"]
content[item["id"]]["category"] = name content[item["id"]]["category"] = name
load_reagents(BOTANY, 'botany') load_reagents(BOTANY_R, 'botany')
load_reagents(TOXINS, 'toxins') load_reagents(TOXINS_R, 'toxins')
load_reagents(MEDICINE_R, 'medicine') load_reagents(MEDICINE_R, 'medicine')
load_reagents(NARCOTICS_R, 'narcotics')
# Не загружается? # Не загружается?
load_reagents(CHEMICALS_R, 'chemicals') load_reagents(CHEMICALS_R, 'chemicals')
#load_reagents(FOOD_R, 'food')
load_reagents(FOOD_R, 'food') load_reagents(FOOD_R, 'food')
load_reagents(FOOD_R_EX, 'food_ex')
load_recipes(MEDICINE, 'medicine') load_recipes(MEDICINE, 'medicine')
load_recipes(CHEMICALS, 'chemicals') load_recipes(CHEMICALS, 'chemicals')
load_recipes(CHEMICALS, 'chemicals')
# TODO: Включать ли токсины без крафта? (некоторые имеют крафт) # TODO: Включать ли токсины без крафта? (некоторые имеют крафт)
reagents = [Reagent(init_data=content[item]) for item in content if "reactants" in content[item]] reagents = [Reagent(init_data=content[item]) for item in content if "reactants" in content[item]]

Loading…
Cancel
Save