From 01d6a5b3185ea381348b88ad452814968c4da435 Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Mon, 11 Jul 2022 21:10:24 +0200 Subject: [PATCH 01/10] Added potential multi language support. The selected language itself is not yet saved in the settings storage. I also started the translation process, by removing hardcoded strings and replacing them with keys, so they are found in the JSON files. And lastly added a new menu entry, which looks really messy, but changing the language works. --- .gitignore | 1 + assets/lang/de_DE.json | 11 ++ assets/lang/en_US.json | 27 ++++ assets/lang/schema.json | 30 ++++ pokete.py | 29 ++-- pokete_classes/achievements.py | 6 +- pokete_classes/constants.py | 5 + pokete_classes/entities/__init__.py | 0 pokete_classes/entities/language_entity.py | 13 ++ pokete_classes/language.py | 134 ++++++++++++++++++ pokete_classes/mods.py | 6 +- pokete_classes/movemap.py | 6 +- pokete_classes/ui/menu.py | 94 ++++++++++++ .../ui/overlays/language_overlay.py | 49 +++++++ pokete_data/npcs.py | 13 +- pokete_data/trainers.py | 7 +- tests/__init__.py | 0 tests/classes/__init__.py | 0 tests/classes/test_language.py | 27 ++++ 19 files changed, 432 insertions(+), 26 deletions(-) create mode 100644 assets/lang/de_DE.json create mode 100644 assets/lang/en_US.json create mode 100644 assets/lang/schema.json create mode 100644 pokete_classes/constants.py create mode 100644 pokete_classes/entities/__init__.py create mode 100644 pokete_classes/entities/language_entity.py create mode 100644 pokete_classes/language.py create mode 100644 pokete_classes/ui/menu.py create mode 100644 pokete_classes/ui/overlays/language_overlay.py create mode 100644 tests/__init__.py create mode 100644 tests/classes/__init__.py create mode 100644 tests/classes/test_language.py diff --git a/.gitignore b/.gitignore index 371e9168..f0d75359 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ templates .idea scrap_engine.py +venv diff --git a/assets/lang/de_DE.json b/assets/lang/de_DE.json new file mode 100644 index 00000000..e6effe91 --- /dev/null +++ b/assets/lang/de_DE.json @@ -0,0 +1,11 @@ +{ + "$schema": "schema.json", + "error.import.scrap_engine": "Es scheint als hättest du die Erweiterung 'scrap-engine' nicht installiert", + "ui.inventory.title": "Inventar", + "ui.lang.en_us": "Englisch (Amerikanisch)", + "ui.lang.de_de": "Deutsch", + "dialog.center.welcome": "Willkommen im Pokete-Center", + "dialog.center.action": "Was möchtest du tun?", + "dialog.center.healed": "Deine Pokete sind nun geheilt!", + "dialog.center.list": "1: Schaue dein Team an\n 2: Heil alle deine Pokete\n 3: Knuddel mit deinen Pokete" +} diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json new file mode 100644 index 00000000..badba253 --- /dev/null +++ b/assets/lang/en_US.json @@ -0,0 +1,27 @@ +{ + "$schema": "schema.json", + "error.import.scrap_engine": "You seem to not have the 'scrap-engine' package installed", + "ui.inventory.title": "Inventory", + "ui.lang.en_us": "English (American)", + "ui.lang.de_de": "German", + "dialog.center.welcome": "Welcome to the Pokete-Center", + "dialog.center.action": "What do you want to do?", + "dialog.center.list": "1: See your full deck\n 2: Heal all your Poketes\n 3: Cuddle with the Poketes", + "dialog.center.healed": "Your Poketes are now healed!", + "dialog.shop.welcome": "Welcome to the Pokete-Shop", + "dialog.shop.action": "Wanna buy something?", + "dialog.shop.leave": "Have a great day!", + "dialog.trader.welcome": "I'm a trader.", + "dialog.trader.action": "Here you can trade one of your Poketes for one from another trainer.", + "npc.test_npc.hey": "Hey.", + "npc.old_man.greet": "Hello, young trainer.", + "npc.old_man.talk": "When I was your age... I also was a trainer.", + "npc.old_man.found_hyperball": "One day I found this very special Poketeball...", + "npc.old_man.hyperball": "A Hyperball!", + "npc.old_man.rarest": "It's one of the oldest and rarest of them all.", + "npc.old_man.keep": "You can keep it!", + "trainer.playmap1.franz.fight": "Wanna fight?", + "trainer.playmap1.franz.lose1": "Hahaha!", + "trainer.playmap1.franz.lose2": "You're a loser!", + "trainer.playmap1.franz.win": "You're a very good trainer!" +} diff --git a/assets/lang/schema.json b/assets/lang/schema.json new file mode 100644 index 00000000..de69d4fd --- /dev/null +++ b/assets/lang/schema.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Pokete Translation File Schema", + "properties": { + "error.import.scrap_engine": { + "type": "string" + }, + "ui.inventory.title": { + "type": "string" + }, + "ui.lang.en_us": { + "type": "string" + }, + "ui.lang.de_de": { + "type": "string" + }, + "dialog.center.welcome": { + "type": "string" + }, + "dialog.center.action": { + "type": "string" + }, + "dialog.center.list": { + "type": "string" + }, + "dialog.center.healed": { + "type": "string" + } + } +} diff --git a/pokete.py b/pokete.py index 3c556f7f..8bc9afb8 100755 --- a/pokete.py +++ b/pokete.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- """This software is licensed under the GPL3 You should have gotten an copy of the GPL3 license anlonside this software Feel free to contribute what ever you want to this game @@ -51,6 +52,8 @@ from pokete_classes.dex import Dex from pokete_classes.loops import std_loop from pokete_classes.periodic_event_manager import PeriodicEventManager +from pokete_classes.language import _ +from pokete_classes.ui.overlays.language_overlay import LanguageOverlay from pokete_general_use_fns import liner, sort_vers, parse_args from release import SPEED_OF_TIME @@ -259,9 +262,9 @@ def action(self, ob): int(mvp.movemap.width / 2), 3, [ - "Welcome to the Pokete-Center", - "What do you want to do?", - "1: See your full deck\n 2: Heal all your Poketes\n 3: Cuddle with the Poketes" + "dialog.center.welcome", + "dialog.center.action", + "dialog.center.list" ] ) while True: @@ -277,7 +280,7 @@ def action(self, ob): heal(figure) time.sleep(SPEED_OF_TIME * 0.5) mvp.movemap.text(int(mvp.movemap.width / 2), 3, - ["...", "Your Poketes are now healed!"]) + ["...", "dialog.center.healed"]) break elif action.triggers(Action.CANCEL, Action.ACT_3): break @@ -295,12 +298,12 @@ def action(self, ob): _ev.clear() mvp.movemap.full_show() mvp.movemap.text(int(mvp.movemap.width / 2), 3, - ["Welcome to the Pokete-Shop", - "Wanna buy something?"]) + ["dialog.shop.welcome", + "dialog.shop.action"]) buy() mvp.movemap.full_show(init=True) mvp.movemap.text(int(mvp.movemap.width / 2), 3, - ["Have a great day!"]) + ["dialog.shop.leave"]) class CenterMap(PlayMap): @@ -324,9 +327,8 @@ def __init__(self, _he, _wi): self.dor_back1 = CenterDoor(" ", state="float") self.dor_back2 = CenterDoor(" ", state="float") self.trader = NPC("trader", - ["I'm a trader.", - "Here you can trade one of your Poketes for \ -one from another trainer."], + ["dialog.trader.welcome", + "dialog.trader.action"], "swap_poke") # adding self.dor_back1.add(self, int(self.width / 2), 8) @@ -506,7 +508,7 @@ class Inv: def __init__(self, _map): self.map = _map - self.box = ChooseBox(_map.height - 3, 35, "Inventory", + self.box = ChooseBox(_map.height - 3, 35, _("ui.inventory.title"), f"{Action.REMOVE.mapping}:remove") self.box2 = Box(7, 21) self.money_label = se.Text(f"${figure.get_money()}") @@ -641,6 +643,7 @@ def __init__(self, _map): self.about_label = se.Text("About", state="float") self.save_label = se.Text("Save", state="float") self.exit_label = se.Text("Exit", state="float") + self.language_label = se.Text("Language", state="float") self.realname_label = se.Text(session_info["user"], state="float") self.char_label = se.Text(figure.char, state="float") self.box.add_c_obs([self.playername_label, @@ -655,7 +658,7 @@ def __init__(self, _map): {True: "On", False: "Off"}), VisSetting("Load mods", "load_mods", {True: "On", False: "Off"}), - self.mods_label, self.ach_label, + self.language_label, self.mods_label, self.ach_label, self.about_label, self.save_label, self.exit_label]) # adding @@ -708,6 +711,8 @@ def __call__(self, pevm): about() elif i == self.ach_label: AchievementOverview()(mvp.movemap) + elif i == self.language_label: + LanguageOverlay()(mvp.movemap) else: i.change() elif action.triggers(Action.UP, Action.DOWN): diff --git a/pokete_classes/achievements.py b/pokete_classes/achievements.py index ea033c99..bfe256b6 100644 --- a/pokete_classes/achievements.py +++ b/pokete_classes/achievements.py @@ -2,7 +2,6 @@ import datetime import logging -import scrap_engine as se from pokete_general_use_fns import liner from .hotkeys import ACTION_DIRECTIONS, Action, get_action from .loops import std_loop, easy_exit_loop @@ -10,6 +9,11 @@ from .color import Color from .notify import notifier +try: + import scrap_engine as se +except ImportError: + print("You seem to not have the 'scrap-engine' package installed") + class Achievement: """The Achievement class that groups identifier, title and description diff --git a/pokete_classes/constants.py b/pokete_classes/constants.py new file mode 100644 index 00000000..39e0cdff --- /dev/null +++ b/pokete_classes/constants.py @@ -0,0 +1,5 @@ +from pathlib import Path + +# Holds the path to the main pokete folder. Every path related task should be +# referring to this constant to get access to all the internal files. READ-ONLY +CWD: Path = Path(__file__).parent.parent.resolve() diff --git a/pokete_classes/entities/__init__.py b/pokete_classes/entities/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pokete_classes/entities/language_entity.py b/pokete_classes/entities/language_entity.py new file mode 100644 index 00000000..62288545 --- /dev/null +++ b/pokete_classes/entities/language_entity.py @@ -0,0 +1,13 @@ +from pathlib import Path +from dataclasses import dataclass +from ..constants import CWD + + +@dataclass(frozen=True) +class LanguageEntity: + """ + Stores general information about a language. This is READ-ONLY so this + data class is marked as frozen to prevent accidental writes. + """ + name: str = "en_US" + path: Path = (CWD / "assets" / "lang" / "en_US.json").resolve() diff --git a/pokete_classes/language.py b/pokete_classes/language.py new file mode 100644 index 00000000..8bf65f46 --- /dev/null +++ b/pokete_classes/language.py @@ -0,0 +1,134 @@ +from __future__ import annotations +from pathlib import Path +import json +import locale +from .entities.language_entity import LanguageEntity +from .color import Color + + +def get_system_locale() -> str: + """ + Fetches the main language of the user's operating system. + + Returns: ISO language code + """ + locale.setlocale(locale.LC_ALL, "") + return locale.getlocale(locale.LC_CTYPE)[0] + + +class Language: + """ + Class for loading and managing translation files. + """ + + __instance = None + + @classmethod + def instance(cls) -> Language: + """ + Returns: Singleton instance of language class + """ + if Language.__instance is None: + Language.__instance = Language() + return Language.__instance + + def __init__(self, default_lang=None): + self._language_file: dict = dict() + self.language: LanguageEntity = LanguageEntity() + self.language_path: Path = self.language.path.parent + self.change_language(default_lang or get_system_locale()) + + def str(self, key: str) -> str: + """ + Fetch a localized string at from the currently used language. + + Args: + key: Identifier of the string to fetch + + Returns: Localized string + """ + if key in self._language_file: + return str(self._language_file.get(key)) + + # Temporarily - So previous code is not broken + return key + + # raise RuntimeWarning(f"No entry with key '{key}' was found in the + # translation file '{self.language.path}'") + + def change_language(self, language: str) -> LanguageEntity: + """ + Changes the current language. If parsed language identifier is invalid + then the fallback language 'en_US' will be used. + + Args: + language: Language file to look for + + Returns: Language entity. Will fall back to 'en_US' if no translation + file has been found. + """ + self.language = self._get_language_entity(language) + self._load_language_file(self.language.path) + return self.language + + def get_selected_language(self) -> LanguageEntity: + """ + Returns + + Returns: Selected language + """ + return self.language + + def get_languages(self) -> list: + """ + Fetches and returns a list of all available language files. + + Returns: List of available language files in the assets directory + """ + available_languages = [] + + for item in self.language_path.glob("*.json"): + if item.is_file(): + language_name = item.name.replace(".json", "") + + if language_name != "schema": + available_languages.append(language_name) + + return available_languages + + def _get_language_entity(self, language: str) -> LanguageEntity: + """ + This method will return a language entity, which contains its name + and its absolute path. + + Args: + language: Language file to look for + + Returns: Language entity. Will fall back to 'en_US' if no translation + file has been found. + """ + entity = LanguageEntity() + + language_file = self.language_path / f"{language}.json" + + if language_file.exists() and language_file.is_file(): + entity = LanguageEntity(language, language_file.resolve()) + + return entity + + def _load_language_file(self, language_path: Path) -> None: + """ + Loads the language file into the internal dictionary. + + Args: + language_path: Path to the language file + """ + with open(language_path, encoding="utf-8") as language_file: + self._language_file = json.load(language_file) + + +# For convenient use later in the program ~ origin +_ = Language.instance().str + +if __name__ == "__main__": + print(f"\033[31;1mDo not execute this!{Color.reset}") diff --git a/pokete_classes/mods.py b/pokete_classes/mods.py index d540363a..0222ac98 100644 --- a/pokete_classes/mods.py +++ b/pokete_classes/mods.py @@ -1,5 +1,5 @@ """This file contains all classes related to mods""" - +from .color import Color from .side_loops import About from .ui_elements import InfoBox from .settings import settings @@ -16,7 +16,7 @@ def __init__(self): class ModError(Exception): """ - An Error that is thrown, when an inproper module is loaded + An Error that is thrown, when an improper module is loaded ARGS: name: The mod's name err: The error that was thrown""" @@ -45,4 +45,4 @@ def __init__(self, _map, mod_info): if __name__ == "__main__": - print("\033[31;1mDo not execute this!\033[0m") + print(f"\033[31;1mDo not execute this!{Color.reset}") diff --git a/pokete_classes/movemap.py b/pokete_classes/movemap.py index 2cfac1e0..47ed111f 100644 --- a/pokete_classes/movemap.py +++ b/pokete_classes/movemap.py @@ -10,6 +10,7 @@ from .color import Color from .event import _ev from .hotkeys import Action +from .language import Language, _ from release import SPEED_OF_TIME @@ -23,6 +24,7 @@ class Movemap(gm.GameSubmap): def __init__(self, height, width): super().__init__(obmp.ob_maps["playmap_1"], 0, 0, height=height, width=width, name="movemap") + self.language = Language.instance() self.name_label = se.Text("") self.balls_label = se.Text("") self.label_bg = se.Square(" ", self.width, 1, state="float") @@ -74,8 +76,8 @@ def text(self, x, y, inp_arr): self.assure_distance(x, y, 17, 10) self.multitext.rechar("") self.multitext.add(self, x - self.x + 1, y - self.y) - arr = [" < " + i + (" >" if j != len(inp_arr) - 1 else "") - for j, i in enumerate(inp_arr)] + arr = [" < " + _(key) + (" >" if index != len(inp_arr) - 1 else "") + for index, key in enumerate(inp_arr)] for text in arr: # Clear events and animate text appearing until any key is pressed. Then wait until another key is pressed to close dialogue. _ev.clear() diff --git a/pokete_classes/ui/menu.py b/pokete_classes/ui/menu.py new file mode 100644 index 00000000..fcd0ea7a --- /dev/null +++ b/pokete_classes/ui/menu.py @@ -0,0 +1,94 @@ +import scrap_engine as se +from ..ui_elements import ChooseBox + +class Menu: + """Menu to manage settings and other stuff in + ARGS: + _map: se.Map this will be shown on""" + + def __init__(self, _map): + self.map = _map + self.box = ChooseBox(_map.height - 3, 35, "Menu") + self.playername_label = se.Text("Playername: ", state="float") + self.represent_char_label = se.Text("Char: ", state="float") + self.mods_label = se.Text("Mods", state="float") + self.ach_label = se.Text("Achievements", state="float") + self.about_label = se.Text("About", state="float") + self.save_label = se.Text("Save", state="float") + self.exit_label = se.Text("Exit", state="float") + self.language_label = se.Text("Language", state="float") + self.realname_label = se.Text(session_info["user"], state="float") + self.char_label = se.Text(figure.char, state="float") + self.box.add_c_obs([self.playername_label, + self.represent_char_label, + VisSetting("Autosave", "autosave", + {True: "On", False: "Off"}), + VisSetting("Animations", "animations", + {True: "On", False: "Off"}), + VisSetting("Save trainers", "save_trainers", + {True: "On", False: "Off"}), + VisSetting("Audio", "audio", + {True: "On", False: "Off"}), + VisSetting("Load mods", "load_mods", + {True: "On", False: "Off"}), + self.language_label, self.mods_label, self.ach_label, + self.about_label, self.save_label, + self.exit_label]) + # adding + self.box.add_ob(self.realname_label, + self.playername_label.rx + self.playername_label.width, + self.playername_label.ry) + self.box.add_ob(self.char_label, + self.represent_char_label.rx + + self.represent_char_label.width, + self.represent_char_label.ry) + + def __call__(self, pevm): + """Opens the menu""" + self.realname_label.rechar(figure.name) + self.char_label.rechar(figure.char) + with self.box.add(self.map, self.map.width - self.box.width, 0): + _ev.clear() + while True: + action = get_action() + if action.triggers(Action.ACCEPT): + # Fuck python for not having case statements - lxgr + # but it does lmao - Magnus + if (i := self.box.c_obs[self.box.index.index]) ==\ + self.playername_label: + figure.name = text_input(self.realname_label, self.map, + figure.name, 18, 17) + self.map.name_label_rechar(figure.name) + elif i == self.represent_char_label: + inp = text_input(self.char_label, self.map, + figure.char, 18, 1) + # excludes bad unicode: + if len(inp.encode("utf-8")) != 1: + inp = "a" + notifier.notify("Error", "Bad character", + "The chosen character has to be a \ +valid single-space character!") + figure.rechar(inp) + elif i == self.mods_label: + ModInfo(mvp.movemap, mods.mod_info)() + elif i == self.save_label: + # When will python3.10 come out? + with InfoBox("Saving....", info="", _map=self.map): + # Shows a box displaying "Saving...." while saving + save() + time.sleep(SPEED_OF_TIME * 1.5) + elif i == self.exit_label: + save() + exit() + elif i == self.about_label: + about() + elif i == self.ach_label: + AchievementOverview()(mvp.movemap) + else: + i.change() + elif action.triggers(Action.UP, Action.DOWN): + self.box.input(action) + elif action.triggers(Action.CANCEL, Action.MENU): + break + std_loop(pevm=pevm) + self.map.full_show() diff --git a/pokete_classes/ui/overlays/language_overlay.py b/pokete_classes/ui/overlays/language_overlay.py new file mode 100644 index 00000000..b92f0d9a --- /dev/null +++ b/pokete_classes/ui/overlays/language_overlay.py @@ -0,0 +1,49 @@ +import scrap_engine as se +from ...language import _ +from ...loops import std_loop, easy_exit_loop +from ...hotkeys import get_action, ACTION_DIRECTIONS, Action +from ...language import Language +from ...ui_elements import BetterChooseBox +from ...movemap import Movemap + +HARDCODED_LANGUAGE_NAMES = { + "en_US": "English", + "de_DE": "German" +} + + +class LanguageOverlay(BetterChooseBox): + + def __init__(self): + super(LanguageOverlay, self).__init__( + 4, + [se.Text(" ")], + name="Languages" + ) + self.language = Language.instance() + + def __call__(self, _map: Movemap): + available_languages = self.language.get_languages() + languages = [] + + for language in available_languages: + key = f"ui.lang.{str(language).lower()}" + languages.append(se.Text(f"({HARDCODED_LANGUAGE_NAMES[language]}) {_(key)}")) + + self.set_items(4, languages) + + self.map = _map + with self: + while True: + action = get_action() + + if action.triggers(*ACTION_DIRECTIONS): + self.input(action) + elif action.triggers(Action.CANCEL): + break + elif action.triggers(Action.ACCEPT): + item = self.get_item(*self.index).ind + self.language.change_language(available_languages[item]) + + std_loop() + self.map.show() diff --git a/pokete_data/npcs.py b/pokete_data/npcs.py index c7c37bef..9c90de41 100644 --- a/pokete_data/npcs.py +++ b/pokete_data/npcs.py @@ -1,17 +1,18 @@ npcs = { "test_npc": { - "texts": ["Hey."], + "texts": ["npc.test_npc.hey"], "fn": None, "map": "playmap_3", "x": 49, "y": 14 }, "old_man": { - "texts": ["Hello, young trainer.", - "When I was your age... I also was a trainer.", - "One day I found this very special Poketeball...", - "A Hyperball!", "It's one of the oldest and rarest of them all.", - "You can keep it!"], + "texts": ["npc.old_man.greet", + "npc.old_man.talk", + "npc.old_man.found_hyperball", + "npc.old_man.hyperball", + "npc.old_man.rarest", + "npc.old_man.keep"], "fn": "playmap_10_old_man", "map": "playmap_10", "x": 4, diff --git a/pokete_data/trainers.py b/pokete_data/trainers.py index 0ff7ced7..cb765582 100644 --- a/pokete_data/trainers.py +++ b/pokete_data/trainers.py @@ -2,8 +2,11 @@ "playmap_1": [{ "pokes": [("poundi", 60)], "args": ("Franz", "He", - ["Wanna fight?"], ["Hahaha!", "You're a loser!"], - ["You're a very good trainer!"], 30, 10) + ["trainer.playmap1.franz.fight"], [ + "trainer.playmap1.franz.lose1", + "trainer.playmap1.franz.lose2" + ], + ["trainer.playmap1.franz.win"], 30, 10) }, ], "cave_1": [{ diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/classes/__init__.py b/tests/classes/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/classes/test_language.py b/tests/classes/test_language.py new file mode 100644 index 00000000..d410105d --- /dev/null +++ b/tests/classes/test_language.py @@ -0,0 +1,27 @@ +from unittest import TestCase +from pathlib import Path +from pokete_classes.language import Language +from pokete_classes.constants import CWD + + +class TestLanguage(TestCase): + def setUp(self) -> None: + # Only directly instanced for this particular unit test + self.language = Language("dummy") + + def test_get_language_entity(self): + dummy_file_path: Path = (CWD / "assets" / "lang" / "schema.json").resolve() + entity = self.language._get_language_entity("schema") + self.assertEqual(entity.name, "schema") + self.assertEqual(entity.path, dummy_file_path) + + def test_change_language(self): + self.language.change_language("schema") + self.assertEqual(self.language.str("title"), "Pokete Translation File Schema") + + with self.assertRaises(RuntimeWarning): + self.language.str("invalid_key") + + def test_get_languages(self): + langs = self.language.get_languages() + self.assertEqual(langs, ["en_US"]) From 5ca7a89df978c1facf0f29d9697d024095571a29 Mon Sep 17 00:00:00 2001 From: lxgr-linux Date: Tue, 12 Jul 2022 12:29:32 +0200 Subject: [PATCH 02/10] made outsourced menu work, added default settings and language setting --- pokete.py | 108 +++---------------------------------- pokete_classes/language.py | 6 +++ pokete_classes/menu.py | 106 ++++++++++++++++++++++++++++++++++++ pokete_classes/settings.py | 12 +++-- pokete_classes/ui/menu.py | 3 ++ 5 files changed, 130 insertions(+), 105 deletions(-) create mode 100644 pokete_classes/menu.py diff --git a/pokete.py b/pokete.py index 8bc9afb8..b7b4ec99 100755 --- a/pokete.py +++ b/pokete.py @@ -25,7 +25,7 @@ from pokete_classes.color import Color from pokete_classes.ui_elements import Box, ChooseBox, InfoBox, BetterChooseBox from pokete_classes.classes import PlayMap -from pokete_classes.settings import settings, VisSetting +from pokete_classes.settings import settings from pokete_classes.inv_items import invitems, LearnDisc from pokete_classes.types import types from pokete_classes.providers import ProtoFigure @@ -33,9 +33,9 @@ from pokete_classes.audio import audio from pokete_classes.side_loops import ResizeScreen, LoadingScreen, About, Help from pokete_classes.input import text_input, ask_bool, ask_text, ask_ok -from pokete_classes.mods import ModError, ModInfo, DummyMods +from pokete_classes.mods import ModError, DummyMods from pokete_classes.pokete_care import PoketeCare, DummyFigure -from pokete_classes import deck, detail, game, timer, ob_maps as obmp, \ +from pokete_classes import deck, detail, game, timer, menu, ob_maps as obmp, \ movemap as mvp, fightmap as fm # import pokete_classes.generic_map_handler as gmh from pokete_classes.landscape import Meadow, Water, Sand, HighGrass, Poketeball @@ -56,8 +56,7 @@ from pokete_classes.ui.overlays.language_overlay import LanguageOverlay from pokete_general_use_fns import liner, sort_vers, parse_args -from release import SPEED_OF_TIME -from release import VERSION, CODENAME, SAVEPATH +from release import SPEED_OF_TIME, VERSION, CODENAME, SAVEPATH __t = time.time() @@ -628,101 +627,6 @@ def add(self): return items -class Menu: - """Menu to manage settings and other stuff in - ARGS: - _map: se.Map this will be shown on""" - - def __init__(self, _map): - self.map = _map - self.box = ChooseBox(_map.height - 3, 35, "Menu") - self.playername_label = se.Text("Playername: ", state="float") - self.represent_char_label = se.Text("Char: ", state="float") - self.mods_label = se.Text("Mods", state="float") - self.ach_label = se.Text("Achievements", state="float") - self.about_label = se.Text("About", state="float") - self.save_label = se.Text("Save", state="float") - self.exit_label = se.Text("Exit", state="float") - self.language_label = se.Text("Language", state="float") - self.realname_label = se.Text(session_info["user"], state="float") - self.char_label = se.Text(figure.char, state="float") - self.box.add_c_obs([self.playername_label, - self.represent_char_label, - VisSetting("Autosave", "autosave", - {True: "On", False: "Off"}), - VisSetting("Animations", "animations", - {True: "On", False: "Off"}), - VisSetting("Save trainers", "save_trainers", - {True: "On", False: "Off"}), - VisSetting("Audio", "audio", - {True: "On", False: "Off"}), - VisSetting("Load mods", "load_mods", - {True: "On", False: "Off"}), - self.language_label, self.mods_label, self.ach_label, - self.about_label, self.save_label, - self.exit_label]) - # adding - self.box.add_ob(self.realname_label, - self.playername_label.rx + self.playername_label.width, - self.playername_label.ry) - self.box.add_ob(self.char_label, - self.represent_char_label.rx - + self.represent_char_label.width, - self.represent_char_label.ry) - - def __call__(self, pevm): - """Opens the menu""" - self.realname_label.rechar(figure.name) - self.char_label.rechar(figure.char) - with self.box.add(self.map, self.map.width - self.box.width, 0): - _ev.clear() - while True: - action = get_action() - if action.triggers(Action.ACCEPT): - # Fuck python for not having case statements - lxgr - # but it does lmao - Magnus - if (i := self.box.c_obs[self.box.index.index]) ==\ - self.playername_label: - figure.name = text_input(self.realname_label, self.map, - figure.name, 18, 17) - self.map.name_label_rechar(figure.name) - elif i == self.represent_char_label: - inp = text_input(self.char_label, self.map, - figure.char, 18, 1) - # excludes bad unicode: - if len(inp.encode("utf-8")) != 1: - inp = "a" - notifier.notify("Error", "Bad character", - "The chosen character has to be a \ -valid single-space character!") - figure.rechar(inp) - elif i == self.mods_label: - ModInfo(mvp.movemap, mods.mod_info)() - elif i == self.save_label: - # When will python3.10 come out? - with InfoBox("Saving....", info="", _map=self.map): - # Shows a box displaying "Saving...." while saving - save() - time.sleep(SPEED_OF_TIME * 1.5) - elif i == self.exit_label: - save() - exit() - elif i == self.about_label: - about() - elif i == self.ach_label: - AchievementOverview()(mvp.movemap) - elif i == self.language_label: - LanguageOverlay()(mvp.movemap) - else: - i.change() - elif action.triggers(Action.UP, Action.DOWN): - self.box.input(action) - elif action.triggers(Action.CANCEL, Action.MENU): - break - std_loop(pevm=pevm) - self.map.full_show() - - # General use functions ####################### @@ -1017,7 +921,7 @@ def _game(_map): Action.INVENTORY: [inv, ()], Action.POKEDEX: [pokete_dex, ()], Action.CLOCK: [timer.clock, (mvp.movemap,)], - Action.MENU: [menu, (pevm,)], + Action.MENU: [menu.menu, (pevm, figure, mods, about)], Action.HELP: [help_page, ()] } if _map.weather is not None: @@ -1522,7 +1426,7 @@ def recogniser(): RoadMap.check_maps() roadmap = RoadMap(figure) deck.deck = deck.Deck(height - 1, width, figure, abb_funcs) - menu = Menu(mvp.movemap) + menu.menu = menu.Menu(mvp.movemap) about = About(VERSION, CODENAME, mvp.movemap) inv = Inv(mvp.movemap) buy = Buy(figure, mvp.movemap) diff --git a/pokete_classes/language.py b/pokete_classes/language.py index 8bf65f46..a2d78916 100644 --- a/pokete_classes/language.py +++ b/pokete_classes/language.py @@ -6,6 +6,12 @@ from .color import Color +HARDCODED_LANGUAGE_NAMES = { + "en_US": "English", + "de_DE": "German" +} + + def get_system_locale() -> str: """ Fetches the main language of the user's operating system. diff --git a/pokete_classes/menu.py b/pokete_classes/menu.py new file mode 100644 index 00000000..2c5c6a04 --- /dev/null +++ b/pokete_classes/menu.py @@ -0,0 +1,106 @@ +import scrap_engine as se +from . import movemap as mvp +from .ui_elements import ChooseBox, InfoBox +from .mods import ModInfo +from .settings import VisSetting +from .hotkeys import get_action, Action +from .loops import std_loop +from .input import text_input +from .language import HARDCODED_LANGUAGE_NAMES +from .achievements import AchievementOverview + + +class Menu: + """Menu to manage settings and other stuff in + ARGS: + _map: se.Map this will be shown on""" + + def __init__(self, _map): + self.map = _map + self.box = ChooseBox(_map.height - 3, 35, "Menu") + self.playername_label = se.Text("Playername: ", state="float") + self.represent_char_label = se.Text("Char: ", state="float") + self.mods_label = se.Text("Mods", state="float") + self.ach_label = se.Text("Achievements", state="float") + self.about_label = se.Text("About", state="float") + self.save_label = se.Text("Save", state="float") + self.exit_label = se.Text("Exit", state="float") + self.realname_label = se.Text("", state="float") + self.char_label = se.Text("", state="float") + self.box.add_c_obs([self.playername_label, + self.represent_char_label, + VisSetting("Autosave", "autosave", + {True: "On", False: "Off"}), + VisSetting("Animations", "animations", + {True: "On", False: "Off"}), + VisSetting("Save trainers", "save_trainers", + {True: "On", False: "Off"}), + VisSetting("Audio", "audio", + {True: "On", False: "Off"}), + VisSetting("Load mods", "load_mods", + {True: "On", False: "Off"}), + VisSetting("Language", "language", + HARDCODED_LANGUAGE_NAMES), + self.mods_label, self.ach_label, + self.about_label, self.save_label, + self.exit_label]) + # adding + self.box.add_ob(self.realname_label, + self.playername_label.rx + self.playername_label.width, + self.playername_label.ry) + self.box.add_ob(self.char_label, + self.represent_char_label.rx + + self.represent_char_label.width, + self.represent_char_label.ry) + + def __call__(self, pevm, figure, mods, about): + """Opens the menu""" + self.realname_label.rechar(figure.name) + self.char_label.rechar(figure.char) + with self.box.add(self.map, self.map.width - self.box.width, 0): + while True: + action = get_action() + if action.triggers(Action.ACCEPT): + # Fuck python for not having case statements - lxgr + # but it does lmao - Magnus + if (i := self.box.c_obs[self.box.index.index]) ==\ + self.playername_label: + figure.name = text_input(self.realname_label, self.map, + figure.name, 18, 17) + self.map.name_label_rechar(figure.name) + elif i == self.represent_char_label: + inp = text_input(self.char_label, self.map, + figure.char, 18, 1) + # excludes bad unicode: + if len(inp.encode("utf-8")) != 1: + inp = "a" + notifier.notify("Error", "Bad character", + "The chosen character has to be a \ +valid single-space character!") + figure.rechar(inp) + elif i == self.mods_label: + ModInfo(mvp.movemap, mods.mod_info)() + elif i == self.save_label: + # When will python3.10 come out? + with InfoBox("Saving....", info="", _map=self.map): + # Shows a box displaying "Saving...." while saving + save() + time.sleep(SPEED_OF_TIME * 1.5) + elif i == self.exit_label: + save() + exit() + elif i == self.about_label: + about() + elif i == self.ach_label: + AchievementOverview()(mvp.movemap) + else: + i.change() + elif action.triggers(Action.UP, Action.DOWN): + self.box.input(action) + elif action.triggers(Action.CANCEL, Action.MENU): + break + std_loop(pevm=pevm) + self.map.full_show() + + +menu = None diff --git a/pokete_classes/settings.py b/pokete_classes/settings.py index 7fb28a5e..0f8e77f5 100644 --- a/pokete_classes/settings.py +++ b/pokete_classes/settings.py @@ -46,8 +46,14 @@ class Settings: def __init__(self): self.settings = [] - self.keywords = ["autosave", "animations", "save_trainers", - "load_mods", "audio"] + self.keywords = { + "autosave": True, + "animations": True, + "save_trainers": True, + "load_mods": False, + "audio": True, + "language": "en_US" + } def from_dict(self, src): """Setts the settings from a dict @@ -57,7 +63,7 @@ def from_dict(self, src): self.settings.append(Setting(i, src[i])) for i in self.keywords: if i not in [j.name for j in self.settings]: - self.settings.append(Setting(i, True)) + self.settings.append(Setting(i, self.keywords[i])) def __call__(self, name): """Gets a Setting object diff --git a/pokete_classes/ui/menu.py b/pokete_classes/ui/menu.py index fcd0ea7a..392daa88 100644 --- a/pokete_classes/ui/menu.py +++ b/pokete_classes/ui/menu.py @@ -92,3 +92,6 @@ def __call__(self, pevm): break std_loop(pevm=pevm) self.map.full_show() + + +menu = None From 11242cbf30e70486d67a462c8b04dd41d8a194ab Mon Sep 17 00:00:00 2001 From: lxgr-linux Date: Tue, 12 Jul 2022 13:25:08 +0200 Subject: [PATCH 03/10] integrated language with settings --- pokete.py | 9 +- pokete_classes/constants.py | 2 +- pokete_classes/entities/__init__.py | 0 pokete_classes/entities/language_entity.py | 13 --- pokete_classes/language.py | 78 ++++----------- pokete_classes/movemap.py | 5 +- pokete_classes/settings.py | 8 +- pokete_classes/ui/menu.py | 97 ------------------- .../ui/overlays/language_overlay.py | 49 ---------- 9 files changed, 34 insertions(+), 227 deletions(-) delete mode 100644 pokete_classes/entities/__init__.py delete mode 100644 pokete_classes/entities/language_entity.py delete mode 100644 pokete_classes/ui/menu.py delete mode 100644 pokete_classes/ui/overlays/language_overlay.py diff --git a/pokete.py b/pokete.py index b7b4ec99..ad668b0b 100755 --- a/pokete.py +++ b/pokete.py @@ -52,8 +52,7 @@ from pokete_classes.dex import Dex from pokete_classes.loops import std_loop from pokete_classes.periodic_event_manager import PeriodicEventManager -from pokete_classes.language import _ -from pokete_classes.ui.overlays.language_overlay import LanguageOverlay +from pokete_classes.language import lang from pokete_general_use_fns import liner, sort_vers, parse_args from release import SPEED_OF_TIME, VERSION, CODENAME, SAVEPATH @@ -507,7 +506,7 @@ class Inv: def __init__(self, _map): self.map = _map - self.box = ChooseBox(_map.height - 3, 35, _("ui.inventory.title"), + self.box = ChooseBox(_map.height - 3, 35, lang.str("ui.inventory.title"), f"{Action.REMOVE.mapping}:remove") self.box2 = Box(7, 21) self.money_label = se.Text(f"${figure.get_money()}") @@ -519,7 +518,9 @@ def __init__(self, _map): def __call__(self): """Opens the inventory""" - _ev.clear() + self.box.name_label.rechar( + lang.str("ui.inventory.title") + ) items = self.add() with self.box.add(self.map, self.map.width - 35, 0): while True: diff --git a/pokete_classes/constants.py b/pokete_classes/constants.py index 39e0cdff..bdac3b4d 100644 --- a/pokete_classes/constants.py +++ b/pokete_classes/constants.py @@ -2,4 +2,4 @@ # Holds the path to the main pokete folder. Every path related task should be # referring to this constant to get access to all the internal files. READ-ONLY -CWD: Path = Path(__file__).parent.parent.resolve() +CWD: Path = Path(__file__).parents[1] diff --git a/pokete_classes/entities/__init__.py b/pokete_classes/entities/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/pokete_classes/entities/language_entity.py b/pokete_classes/entities/language_entity.py deleted file mode 100644 index 62288545..00000000 --- a/pokete_classes/entities/language_entity.py +++ /dev/null @@ -1,13 +0,0 @@ -from pathlib import Path -from dataclasses import dataclass -from ..constants import CWD - - -@dataclass(frozen=True) -class LanguageEntity: - """ - Stores general information about a language. This is READ-ONLY so this - data class is marked as frozen to prevent accidental writes. - """ - name: str = "en_US" - path: Path = (CWD / "assets" / "lang" / "en_US.json").resolve() diff --git a/pokete_classes/language.py b/pokete_classes/language.py index a2d78916..32b3f258 100644 --- a/pokete_classes/language.py +++ b/pokete_classes/language.py @@ -2,8 +2,9 @@ from pathlib import Path import json import locale -from .entities.language_entity import LanguageEntity from .color import Color +from .constants import CWD +from .settings import settings HARDCODED_LANGUAGE_NAMES = { @@ -27,22 +28,15 @@ class Language: Class for loading and managing translation files. """ - __instance = None - - @classmethod - def instance(cls) -> Language: - """ - Returns: Singleton instance of language class - """ - if Language.__instance is None: - Language.__instance = Language() - return Language.__instance - def __init__(self, default_lang=None): + self._old_language_code = self.language_code self._language_file: dict = dict() - self.language: LanguageEntity = LanguageEntity() - self.language_path: Path = self.language.path.parent - self.change_language(default_lang or get_system_locale()) + self.language_path: Path = CWD / "assets" / "lang" + self._load_language_file() + + @property + def language_code(self): + return settings("language").val def str(self, key: str) -> str: """ @@ -53,6 +47,10 @@ def str(self, key: str) -> str: Returns: Localized string """ + if self._old_language_code != self.language_code: + self._old_language_code = self.language_code + self._load_language_file() + if key in self._language_file: return str(self._language_file.get(key)) @@ -62,29 +60,6 @@ def str(self, key: str) -> str: # raise RuntimeWarning(f"No entry with key '{key}' was found in the # translation file '{self.language.path}'") - def change_language(self, language: str) -> LanguageEntity: - """ - Changes the current language. If parsed language identifier is invalid - then the fallback language 'en_US' will be used. - - Args: - language: Language file to look for - - Returns: Language entity. Will fall back to 'en_US' if no translation - file has been found. - """ - self.language = self._get_language_entity(language) - self._load_language_file(self.language.path) - return self.language - - def get_selected_language(self) -> LanguageEntity: - """ - Returns - - Returns: Selected language - """ - return self.language - def get_languages(self) -> list: """ Fetches and returns a list of all available language files. @@ -102,39 +77,26 @@ def get_languages(self) -> list: return available_languages - def _get_language_entity(self, language: str) -> LanguageEntity: + def _load_language_file(self) -> None: """ - This method will return a language entity, which contains its name - and its absolute path. + Loads the language file into the internal dictionary. Args: - language: Language file to look for - - Returns: Language entity. Will fall back to 'en_US' if no translation - file has been found. + language_path: Path to the language file """ - entity = LanguageEntity() - language_file = self.language_path / f"{language}.json" + language_path = self.language_path / f"{self.language_code}.json" - if language_file.exists() and language_file.is_file(): - entity = LanguageEntity(language, language_file.resolve()) + # if not (language_path.exists() and language_path.is_file()): - return entity - def _load_language_file(self, language_path: Path) -> None: - """ - Loads the language file into the internal dictionary. - - Args: - language_path: Path to the language file - """ with open(language_path, encoding="utf-8") as language_file: self._language_file = json.load(language_file) # For convenient use later in the program ~ origin -_ = Language.instance().str +# _ = Language.instance().str +lang = Language() if __name__ == "__main__": print(f"\033[31;1mDo not execute this!{Color.reset}") diff --git a/pokete_classes/movemap.py b/pokete_classes/movemap.py index 47ed111f..ddd25b9d 100644 --- a/pokete_classes/movemap.py +++ b/pokete_classes/movemap.py @@ -10,7 +10,7 @@ from .color import Color from .event import _ev from .hotkeys import Action -from .language import Language, _ +from .language import lang from release import SPEED_OF_TIME @@ -24,7 +24,6 @@ class Movemap(gm.GameSubmap): def __init__(self, height, width): super().__init__(obmp.ob_maps["playmap_1"], 0, 0, height=height, width=width, name="movemap") - self.language = Language.instance() self.name_label = se.Text("") self.balls_label = se.Text("") self.label_bg = se.Square(" ", self.width, 1, state="float") @@ -76,7 +75,7 @@ def text(self, x, y, inp_arr): self.assure_distance(x, y, 17, 10) self.multitext.rechar("") self.multitext.add(self, x - self.x + 1, y - self.y) - arr = [" < " + _(key) + (" >" if index != len(inp_arr) - 1 else "") + arr = [" < " + lang.str(key) + (" >" if index != len(inp_arr) - 1 else "") for index, key in enumerate(inp_arr)] for text in arr: # Clear events and animate text appearing until any key is pressed. Then wait until another key is pressed to close dialogue. diff --git a/pokete_classes/settings.py b/pokete_classes/settings.py index 0f8e77f5..49f6dcb2 100644 --- a/pokete_classes/settings.py +++ b/pokete_classes/settings.py @@ -45,7 +45,7 @@ class Settings: """Contains all possible settings""" def __init__(self): - self.settings = [] + """Initializes with fallback values""" self.keywords = { "autosave": True, "animations": True, @@ -54,11 +54,15 @@ def __init__(self): "audio": True, "language": "en_US" } + self.settings = [ + Setting(i, self.keywords[i]) for i in self.keywords + ] def from_dict(self, src): """Setts the settings from a dict ARGS: src: The Dict""" + self.settings = [] for i in src: self.settings.append(Setting(i, src[i])) for i in self.keywords: @@ -71,7 +75,7 @@ def __call__(self, name): name: The Settings name RETURNS: Setting object""" - return [i for i in self.settings if i.name == name][0] + return next(i for i in self.settings if i.name == name) def to_dict(self): """Returns a dict of all current settings""" diff --git a/pokete_classes/ui/menu.py b/pokete_classes/ui/menu.py deleted file mode 100644 index 392daa88..00000000 --- a/pokete_classes/ui/menu.py +++ /dev/null @@ -1,97 +0,0 @@ -import scrap_engine as se -from ..ui_elements import ChooseBox - -class Menu: - """Menu to manage settings and other stuff in - ARGS: - _map: se.Map this will be shown on""" - - def __init__(self, _map): - self.map = _map - self.box = ChooseBox(_map.height - 3, 35, "Menu") - self.playername_label = se.Text("Playername: ", state="float") - self.represent_char_label = se.Text("Char: ", state="float") - self.mods_label = se.Text("Mods", state="float") - self.ach_label = se.Text("Achievements", state="float") - self.about_label = se.Text("About", state="float") - self.save_label = se.Text("Save", state="float") - self.exit_label = se.Text("Exit", state="float") - self.language_label = se.Text("Language", state="float") - self.realname_label = se.Text(session_info["user"], state="float") - self.char_label = se.Text(figure.char, state="float") - self.box.add_c_obs([self.playername_label, - self.represent_char_label, - VisSetting("Autosave", "autosave", - {True: "On", False: "Off"}), - VisSetting("Animations", "animations", - {True: "On", False: "Off"}), - VisSetting("Save trainers", "save_trainers", - {True: "On", False: "Off"}), - VisSetting("Audio", "audio", - {True: "On", False: "Off"}), - VisSetting("Load mods", "load_mods", - {True: "On", False: "Off"}), - self.language_label, self.mods_label, self.ach_label, - self.about_label, self.save_label, - self.exit_label]) - # adding - self.box.add_ob(self.realname_label, - self.playername_label.rx + self.playername_label.width, - self.playername_label.ry) - self.box.add_ob(self.char_label, - self.represent_char_label.rx - + self.represent_char_label.width, - self.represent_char_label.ry) - - def __call__(self, pevm): - """Opens the menu""" - self.realname_label.rechar(figure.name) - self.char_label.rechar(figure.char) - with self.box.add(self.map, self.map.width - self.box.width, 0): - _ev.clear() - while True: - action = get_action() - if action.triggers(Action.ACCEPT): - # Fuck python for not having case statements - lxgr - # but it does lmao - Magnus - if (i := self.box.c_obs[self.box.index.index]) ==\ - self.playername_label: - figure.name = text_input(self.realname_label, self.map, - figure.name, 18, 17) - self.map.name_label_rechar(figure.name) - elif i == self.represent_char_label: - inp = text_input(self.char_label, self.map, - figure.char, 18, 1) - # excludes bad unicode: - if len(inp.encode("utf-8")) != 1: - inp = "a" - notifier.notify("Error", "Bad character", - "The chosen character has to be a \ -valid single-space character!") - figure.rechar(inp) - elif i == self.mods_label: - ModInfo(mvp.movemap, mods.mod_info)() - elif i == self.save_label: - # When will python3.10 come out? - with InfoBox("Saving....", info="", _map=self.map): - # Shows a box displaying "Saving...." while saving - save() - time.sleep(SPEED_OF_TIME * 1.5) - elif i == self.exit_label: - save() - exit() - elif i == self.about_label: - about() - elif i == self.ach_label: - AchievementOverview()(mvp.movemap) - else: - i.change() - elif action.triggers(Action.UP, Action.DOWN): - self.box.input(action) - elif action.triggers(Action.CANCEL, Action.MENU): - break - std_loop(pevm=pevm) - self.map.full_show() - - -menu = None diff --git a/pokete_classes/ui/overlays/language_overlay.py b/pokete_classes/ui/overlays/language_overlay.py deleted file mode 100644 index b92f0d9a..00000000 --- a/pokete_classes/ui/overlays/language_overlay.py +++ /dev/null @@ -1,49 +0,0 @@ -import scrap_engine as se -from ...language import _ -from ...loops import std_loop, easy_exit_loop -from ...hotkeys import get_action, ACTION_DIRECTIONS, Action -from ...language import Language -from ...ui_elements import BetterChooseBox -from ...movemap import Movemap - -HARDCODED_LANGUAGE_NAMES = { - "en_US": "English", - "de_DE": "German" -} - - -class LanguageOverlay(BetterChooseBox): - - def __init__(self): - super(LanguageOverlay, self).__init__( - 4, - [se.Text(" ")], - name="Languages" - ) - self.language = Language.instance() - - def __call__(self, _map: Movemap): - available_languages = self.language.get_languages() - languages = [] - - for language in available_languages: - key = f"ui.lang.{str(language).lower()}" - languages.append(se.Text(f"({HARDCODED_LANGUAGE_NAMES[language]}) {_(key)}")) - - self.set_items(4, languages) - - self.map = _map - with self: - while True: - action = get_action() - - if action.triggers(*ACTION_DIRECTIONS): - self.input(action) - elif action.triggers(Action.CANCEL): - break - elif action.triggers(Action.ACCEPT): - item = self.get_item(*self.index).ind - self.language.change_language(available_languages[item]) - - std_loop() - self.map.show() From b9eead8ce7119c601eace89f3aba5647329a914b Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Tue, 12 Jul 2022 18:04:35 +0200 Subject: [PATCH 04/10] I changed the language class a bit, instead of using the settings instance directly in the class, it is passed in as parameter (DI), so I could test the class properly. Furthermore I have added a new method in the Settings class to get the setting via a method call, instead of relying on magic functions. I have also added a fallback language (en_US), which can be modified in the constants.py file, to load these language strings if no translation can be found in the current language file. --- pokete_classes/constants.py | 3 ++ pokete_classes/language.py | 48 ++++++++++++++++++--------- pokete_classes/settings.py | 22 +++++++++--- tests/classes/__init__.py | 0 tests/classes/test_language.py | 27 --------------- tests/pokete_classes/test_language.py | 28 ++++++++++++++++ 6 files changed, 81 insertions(+), 47 deletions(-) delete mode 100644 tests/classes/__init__.py delete mode 100644 tests/classes/test_language.py create mode 100644 tests/pokete_classes/test_language.py diff --git a/pokete_classes/constants.py b/pokete_classes/constants.py index bdac3b4d..1ff41024 100644 --- a/pokete_classes/constants.py +++ b/pokete_classes/constants.py @@ -3,3 +3,6 @@ # Holds the path to the main pokete folder. Every path related task should be # referring to this constant to get access to all the internal files. READ-ONLY CWD: Path = Path(__file__).parents[1] + +# Standard fallback language code +FALLBACK_LANGUAGE = "en_US" diff --git a/pokete_classes/language.py b/pokete_classes/language.py index 32b3f258..f5220553 100644 --- a/pokete_classes/language.py +++ b/pokete_classes/language.py @@ -3,9 +3,8 @@ import json import locale from .color import Color -from .constants import CWD -from .settings import settings - +from .constants import CWD, FALLBACK_LANGUAGE +from .settings import Settings, settings HARDCODED_LANGUAGE_NAMES = { "en_US": "English", @@ -28,15 +27,17 @@ class Language: Class for loading and managing translation files. """ - def __init__(self, default_lang=None): - self._old_language_code = self.language_code + def __init__(self, _settings: Settings, default_code=None): + self.settings = _settings + self._old_language_code = default_code or self.language_code self._language_file: dict = dict() + self._fallback_file: dict | None = None self.language_path: Path = CWD / "assets" / "lang" self._load_language_file() @property def language_code(self): - return settings("language").val + return self.settings.get("language").val def str(self, key: str) -> str: """ @@ -53,6 +54,12 @@ def str(self, key: str) -> str: if key in self._language_file: return str(self._language_file.get(key)) + else: + if self._fallback_file is None: + self._load_language_file_fallback() + + if key in self._fallback_file: + return str(self._fallback_file.get(key)) # Temporarily - So previous code is not broken return key @@ -80,23 +87,34 @@ def get_languages(self) -> list: def _load_language_file(self) -> None: """ Loads the language file into the internal dictionary. - - Args: - language_path: Path to the language file """ + self._language_file = self.__load_language_file_generic(self.language_code) - language_path = self.language_path / f"{self.language_code}.json" + def _load_language_file_fallback(self) -> None: + """ + Loads the fallback language file into internal dictionary. It will be + accessed if translation keys are missing from the currently used translation. + """ + self._fallback_file = self.__load_language_file_generic(FALLBACK_LANGUAGE) - # if not (language_path.exists() and language_path.is_file()): + def __load_language_file_generic(self, filename: str) -> dict: + """ + Loads a language file and returns its content as dictionary. + """ + language_path = self.language_path / f"{filename}.json" + if language_path.exists() and language_path.is_file(): + with open(language_path, encoding="utf-8") as file: + return json.load(file) - with open(language_path, encoding="utf-8") as language_file: - self._language_file = json.load(language_file) + raise RuntimeError("No language file with code " + f"'{filename}' found in path " + f"'{language_path}'.") # For convenient use later in the program ~ origin -# _ = Language.instance().str -lang = Language() +# Dependency injection for code testing +lang = Language(settings) if __name__ == "__main__": print(f"\033[31;1mDo not execute this!{Color.reset}") diff --git a/pokete_classes/settings.py b/pokete_classes/settings.py index 49f6dcb2..bfcd465b 100644 --- a/pokete_classes/settings.py +++ b/pokete_classes/settings.py @@ -1,7 +1,8 @@ -"""Contains classes and objects related to settings""" +"""Contains pokete_classes and objects related to settings""" import logging import scrap_engine as se +from .color import Color class Setting: @@ -58,8 +59,8 @@ def __init__(self): Setting(i, self.keywords[i]) for i in self.keywords ] - def from_dict(self, src): - """Setts the settings from a dict + def from_dict(self, src: dict) -> None: + """Sets the settings from a dict ARGS: src: The Dict""" self.settings = [] @@ -69,7 +70,7 @@ def from_dict(self, src): if i not in [j.name for j in self.settings]: self.settings.append(Setting(i, self.keywords[i])) - def __call__(self, name): + def __call__(self, name: str) -> Setting: """Gets a Setting object ARGS: name: The Settings name @@ -77,9 +78,20 @@ def __call__(self, name): Setting object""" return next(i for i in self.settings if i.name == name) - def to_dict(self): + def get(self, name: str) -> Setting: + """ + Replacement for __call__ magic function. Gets a setting object. + + Returns: Setting object + """ + return self.__call__(name) + + def to_dict(self) -> dict: """Returns a dict of all current settings""" return {i.name: i.val for i in self.settings} settings = Settings() + +if __name__ == "__main__": + print(f"\033[31;1mDo not execute this!{Color.reset}") diff --git a/tests/classes/__init__.py b/tests/classes/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/classes/test_language.py b/tests/classes/test_language.py deleted file mode 100644 index d410105d..00000000 --- a/tests/classes/test_language.py +++ /dev/null @@ -1,27 +0,0 @@ -from unittest import TestCase -from pathlib import Path -from pokete_classes.language import Language -from pokete_classes.constants import CWD - - -class TestLanguage(TestCase): - def setUp(self) -> None: - # Only directly instanced for this particular unit test - self.language = Language("dummy") - - def test_get_language_entity(self): - dummy_file_path: Path = (CWD / "assets" / "lang" / "schema.json").resolve() - entity = self.language._get_language_entity("schema") - self.assertEqual(entity.name, "schema") - self.assertEqual(entity.path, dummy_file_path) - - def test_change_language(self): - self.language.change_language("schema") - self.assertEqual(self.language.str("title"), "Pokete Translation File Schema") - - with self.assertRaises(RuntimeWarning): - self.language.str("invalid_key") - - def test_get_languages(self): - langs = self.language.get_languages() - self.assertEqual(langs, ["en_US"]) diff --git a/tests/pokete_classes/test_language.py b/tests/pokete_classes/test_language.py new file mode 100644 index 00000000..22015a23 --- /dev/null +++ b/tests/pokete_classes/test_language.py @@ -0,0 +1,28 @@ +from unittest import TestCase +from unittest.mock import patch +from pokete_classes.language import Language +from pokete_classes.settings import Settings, Setting + + +class TestLanguage(TestCase): + @patch("pokete_classes.settings.Settings") + def setUp(self, mock_settings: Settings) -> None: + # Only directly instanced for this particular unit test + self.mock = mock_settings + self.mock.get.return_value = Setting("language", "schema") + self.language = Language(self.mock, "schema") + + def test_language_code(self): + code = self.language.language_code + self.assertEqual(2, self.mock.get.call_count) + self.assertEqual(self.mock.get("language").val, code) + + def test_change_language(self): + self.assertEqual("Pokete Translation File Schema", self.language.str("title")) + + # with self.assertRaises(RuntimeWarning): + # self.language.str("invalid_key") + + def test_get_languages(self): + langs = self.language.get_languages() + self.assertCountEqual(["en_US", "de_DE"], langs) From eb5f342d74527e344c4b5332380ebef9a6785b8f Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Tue, 12 Jul 2022 19:06:04 +0200 Subject: [PATCH 05/10] Replaced some hardcoded strings with string keys, it is still incomplete. --- assets/lang/de_DE.json | 4 ++- assets/lang/en_US.json | 62 +++++++++++++++++++++++++++++++++- pokete_classes/achievements.py | 13 +++---- pokete_classes/attack.py | 19 ++++++++--- pokete_classes/buy.py | 3 +- pokete_classes/deck.py | 16 ++++----- pokete_classes/detail.py | 33 +++++++++--------- pokete_classes/dex.py | 21 ++++++------ pokete_classes/effects.py | 51 +++++++++++++--------------- pokete_classes/menu.py | 30 ++++++++-------- 10 files changed, 162 insertions(+), 90 deletions(-) diff --git a/assets/lang/de_DE.json b/assets/lang/de_DE.json index e6effe91..45722eea 100644 --- a/assets/lang/de_DE.json +++ b/assets/lang/de_DE.json @@ -7,5 +7,7 @@ "dialog.center.welcome": "Willkommen im Pokete-Center", "dialog.center.action": "Was möchtest du tun?", "dialog.center.healed": "Deine Pokete sind nun geheilt!", - "dialog.center.list": "1: Schaue dein Team an\n 2: Heil alle deine Pokete\n 3: Knuddel mit deinen Pokete" + "dialog.center.list": "1: Schaue dein Team an\n 2: Heil alle deine Pokete\n 3: Knuddel mit deinen Pokete", + "ui.menu.language": "Sprache", + "ui.about.title": "Über" } diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json index badba253..dab1a67d 100644 --- a/assets/lang/en_US.json +++ b/assets/lang/en_US.json @@ -1,9 +1,49 @@ { "$schema": "schema.json", "error.import.scrap_engine": "You seem to not have the 'scrap-engine' package installed", + "ui.dialog.yes": "Yes", + "ui.dialog.no": "No", + "ui.dialog.at": "At", + "ui.dialog.exit": "Exit", + "ui.dialog.active": "Active", + "ui.dialog.move": "Move", + "ui.dialog.move_to": "Move to", + "ui.dialog.cant_free_all": "You can't free all your Poketes", + "ui.dialog.free": "Free", + "ui.dialog.free_pokete": "Do you really want to free %s?", + "ui.details.title": "Details", + "ui.details.attacks": "Attacks", + "ui.details.attack": "Attack", + "ui.details.defense": "Defense", + "ui.details.abilities": "Abilities", + "ui.details.initiative": "Initiative", + "ui.details.nature": "Nature", + "ui.details.use_ability": "Use ability", + "ui.menu.title": "Menu", + "ui.menu.playername": "Playername", + "ui.menu.playername_char": "Char", + "ui.menu.save": "Save", + "ui.menu.quit_game": "Quit Game", + "ui.menu.autosave": "Autosave", + "ui.menu.animations": "Animations", + "ui.menu.save_trainers": "Save trainers", + "ui.menu.audio": "Audio", + "ui.menu.language": "Language", + "ui.about.title": "About", + "ui.mods.title": "Mods", + "ui.mods.load": "Load mods", + "ui.dex.title": "Poketedex", "ui.inventory.title": "Inventory", + "ui.achievements.title": "Achievements", + "ui.achievements.achieved": "Achieved: ", + "ui.achievements.unlocked": "Achievement unlocked!", + "ui.shop.title": "Shop", "ui.lang.en_us": "English (American)", "ui.lang.de_de": "German", + "dialog.time.day": "Day", + "dialog.time.night": "Night", + "dialog.time.always": "Always", + "dialog.evolution.evolve": "Evolves into", "dialog.center.welcome": "Welcome to the Pokete-Center", "dialog.center.action": "What do you want to do?", "dialog.center.list": "1: See your full deck\n 2: Heal all your Poketes\n 3: Cuddle with the Poketes", @@ -13,6 +53,23 @@ "dialog.shop.leave": "Have a great day!", "dialog.trader.welcome": "I'm a trader.", "dialog.trader.action": "Here you can trade one of your Poketes for one from another trainer.", + "dialog.attack.hp": "HP", + "dialog.attack.ap": "AP", + "dialog.attack.attack": "Attack", + "dialog.attack.type": "Type", + "dialog.effect.not_affected": "%s is not affected by", + "dialog.effect.now": "%s is now", + "dialog.effect.already": "%s is already", + "dialog.effect.still": "%s is still", + "dialog.effect.isnt": "%s isn't", + "dialog.effect.anymore": "anymore!", + "dialog.effect.cant_attack": "and can't attack!", + "dialog.effect.paralysis.description": "Paralyses the enemy and stops it from attacking. \nThis is reverted randomly.", + "dialog.effect.sleep.description": "Makes the enemy fall asleep and stops it from attacking. \nThis is reverted randomly.", + "dialog.effect.burn.description": "Sets the enemy on fire and damages them with 2 HP every round. \nThis is reverted randomly.", + "dialog.effect.poison.description": "Poisons the enemy and damages the enemy with 1 HP every round.\n This is reverted randomly.", + "dialog.effect.confusion.description": "Makes the enemy hurt it self. This is reverted randomly.", + "dialog.effect.freeze.description": "Freezes the enemy and stops it from attacking. \nThis is reverted randomly.", "npc.test_npc.hey": "Hey.", "npc.old_man.greet": "Hello, young trainer.", "npc.old_man.talk": "When I was your age... I also was a trainer.", @@ -23,5 +80,8 @@ "trainer.playmap1.franz.fight": "Wanna fight?", "trainer.playmap1.franz.lose1": "Hahaha!", "trainer.playmap1.franz.lose2": "You're a loser!", - "trainer.playmap1.franz.win": "You're a very good trainer!" + "trainer.playmap1.franz.win": "You're a very good trainer!", + "log.achievements.unlocked": "[Achievements] Unlocked %s", + "log.effects.add": "[Effect][%s] Added to %s", + "log.effects.remove": "[Effect][%s] Removed from %s" } diff --git a/pokete_classes/achievements.py b/pokete_classes/achievements.py index bfe256b6..53f7c972 100644 --- a/pokete_classes/achievements.py +++ b/pokete_classes/achievements.py @@ -3,6 +3,7 @@ import datetime import logging from pokete_general_use_fns import liner +from .language import lang from .hotkeys import ACTION_DIRECTIONS, Action, get_action from .loops import std_loop, easy_exit_loop from .ui_elements import BetterChooseBox, LabelBox @@ -55,9 +56,9 @@ def achieve(self, identifier): if not self.is_achieved(identifier): ach = [i for i in self.achievements if i.identifier == identifier][0] - notifier.notify(ach.title, "Achievement unlocked!", ach.desc) + notifier.notify(ach.title, lang.str("ui.achievements.unlocked"), ach.desc) self.achieved.append((identifier, str(datetime.date.today()))) - logging.info("[Achievements] Unlocked %s", identifier) + logging.info(lang.str("log.achievements.unlocked"), identifier) def is_achieved(self, identifier): """Whether or not an identifier is achieved @@ -78,12 +79,12 @@ def __init__(self, ach, ach_ob): is_ach = ach_ob.is_achieved(ach.identifier) date = [i[-1] for i in ach_ob.achieved if i[0] == ach.identifier][0] if is_ach else "" - label = se.Text("Achieved: ", state="float")\ - + se.Text("Yes" if is_ach else "No", + label = se.Text(lang.str("ui.achievements.achieved"), state="float")\ + + se.Text(lang.str("ui.dialog.yes") if is_ach else lang.str("ui.dialog.no"), esccode=Color.thicc + (Color.green if is_ach else Color.grey), state="float")\ - + (se.Text("\nAt: " + date, state="float") if is_ach else se.Text(""))\ + + (se.Text(f"\n{lang.str('ui.dialog.at')}: " + date, state="float") if is_ach else se.Text(""))\ + se.Text("\n" + liner(ach.desc, 30), state="float") super().__init__(label, name=ach.title, info=f"{Action.CANCEL.mapping}:close") @@ -93,7 +94,7 @@ class AchievementOverview(BetterChooseBox): """Overview for Achievements""" def __init__(self): - super().__init__(4, [se.Text(" ")], name="Achievements") + super().__init__(4, [se.Text(" ")], name="ui.achievements.title") def __call__(self, _map): """Input loop diff --git a/pokete_classes/attack.py b/pokete_classes/attack.py index fb55c112..945e5955 100644 --- a/pokete_classes/attack.py +++ b/pokete_classes/attack.py @@ -6,6 +6,7 @@ from .effects import effects from .types import types from .color import Color +from .language import lang from release import SPEED_OF_TIME @@ -34,12 +35,20 @@ def __init__(self, index, pref=""): # labels self.label_name = se.Text(self.name, esccode=Color.underlined, state="float") - self.label_ap = se.Text(f"AP:{self.ap}/{self.max_ap}", state="float") - self.label_factor = se.Text(f"Attack:{self.factor}", state="float") + self.label_ap = se.Text( + f"{lang.str('dialog.attack.ap')}:{self.ap}/{self.max_ap}", + state="float" + ) + self.label_factor = se.Text( + f"{lang.str('dialog.attack.attack')}:{self.factor}", + state="float" + ) self.label_desc = se.Text(self.desc[:10], state="float") - self.label_type = se.Text("Type:", state="float") \ - + se.Text(self.type.name.capitalize(), - esccode=self.type.color, state="float") + self.label_type = se.Text( + f"{lang.str('dialog.attack.type')}:", + state="float" + ) + se.Text(self.type.name.capitalize(), + esccode=self.type.color, state="float") self.pref = pref self.label = self.make_label() diff --git a/pokete_classes/buy.py b/pokete_classes/buy.py index 830df369..eab9ffa0 100644 --- a/pokete_classes/buy.py +++ b/pokete_classes/buy.py @@ -6,6 +6,7 @@ from .loops import std_loop from .ui_elements import Box, ChooseBox from .inv_items import invitems +from .language import lang class Buy: @@ -15,7 +16,7 @@ class Buy: _map: The se.Map the menu is shown on""" def __init__(self, figure, _map): - self.box = ChooseBox(_map.height - 3, 35, "Shop") + self.box = ChooseBox(_map.height - 3, 35, lang.str("ui.shop.title")) self.box2 = Box(7, 21) self.fig = figure self.map = _map diff --git a/pokete_classes/deck.py b/pokete_classes/deck.py index bbf4b566..fbcef5e9 100644 --- a/pokete_classes/deck.py +++ b/pokete_classes/deck.py @@ -13,6 +13,7 @@ from .loops import std_loop from .color import Color from .poke import Poke +from .language import lang from .ui_elements import StdFrame2 @@ -22,9 +23,9 @@ class Deck(detail.Informer): def __init__(self, height, width, figure, abb_funcs): self.map = gm.GameMap(height, width) self.submap = gm.GameSubmap(self.map, 0, 0, height, width, "decksubmap") - self.exit_label = se.Text(f"{Action.DECK.mapping}: Exit ") - self.move_label = se.Text(f"{Action.MOVE_POKETE.mapping}: Move ") - self.move_free = se.Text(f"{Action.FREE_POKETE.mapping}: Free") + self.exit_label = se.Text(f"{Action.DECK.mapping}: {lang.str('ui.dialog.exit')} ") + self.move_label = se.Text(f"{Action.MOVE_POKETE.mapping}: {lang.str('ui.dialog.move')} ") + self.move_free = se.Text(f"{Action.FREE_POKETE.mapping}: {lang.str('ui.dialog.free')}") self.index = se.Object("*") self.figure = figure self.abb_funcs = abb_funcs @@ -85,7 +86,7 @@ def __call__(self, p_len, label="Your full deck", in_fight=False): if not indici: indici.append(self.index.index) self.move_label.rechar( - f"{Action.MOVE_POKETE.mapping}: Move to " + f"{Action.MOVE_POKETE.mapping}: {lang.str('ui.dialog.move_to')} " ) else: indici.append(self.index.index) @@ -101,7 +102,7 @@ def __call__(self, p_len, label="Your full deck", in_fight=False): + len(pokes[self.index.index].text_name.text) + 1, pokes[self.index.index].text_name.y) self.move_label.rechar( - f"{Action.MOVE_POKETE.mapping}: Move " + f"{Action.MOVE_POKETE.mapping}: {lang.str('ui.dialog.move')} " ) self.submap.full_show() elif action.triggers(Action.FREE_POKETE): @@ -113,9 +114,8 @@ def __call__(self, p_len, label="Your full deck", in_fight=False): if poke.identifier != "__fallback__" ] ) <= 1: - ask_ok(self.submap, "You can't free all your Poketes") - elif ask_bool(self.submap, f"Do you really want to free \ -{self.figure.pokes[self.index.index].name}?"): + ask_ok(self.submap, lang.str("ui.dialog.cant_free_all")) + elif ask_bool(self.submap, lang.str("ui.dialog.free_pokete") % self.figure.pokes[self.index.index].name): self.rem_pokes(pokes) self.figure.pokes[self.index.index] = Poke("__fallback__", 10, 0) diff --git a/pokete_classes/detail.py b/pokete_classes/detail.py index 224ee2d0..d45ab728 100644 --- a/pokete_classes/detail.py +++ b/pokete_classes/detail.py @@ -6,6 +6,7 @@ from pokete_classes.hotkeys import Action, get_action from .loops import std_loop from .event import _ev +from .language import lang from .ui_elements import StdFrame2, ChooseBox from .color import Color @@ -59,16 +60,16 @@ class Detail(Informer): def __init__(self, height, width): self.map = gm.GameMap(height, width) - self.name_label = se.Text("Details", esccode=Color.thicc) - self.name_attacks = se.Text("Attacks", esccode=Color.thicc) + self.name_label = se.Text(lang.str("ui.details.title"), esccode=Color.thicc) + self.name_attacks = se.Text(lang.str("ui.details.attacks"), esccode=Color.thicc) self.frame = StdFrame2(17, self.map.width, state="float") - self.attack_defense = se.Text("Attack: Defense:") - self.world_actions_label = se.Text("Abilities:") - self.type_label = se.Text("Type:") - self.initiative_label = se.Text("Initiative:") - self.exit_label = se.Text(f"{Action.DECK.mapping}: Exit") - self.nature_label = se.Text(f"{Action.NATURE_INFO.mapping}: Nature") - self.ability_label = se.Text(f"{Action.ABILITIES}: Use ability") + self.attack_defense = se.Text(f"{lang.str('ui.details.attack')}: {lang.str('ui.details.defense')}:") + self.world_actions_label = se.Text(f"{lang.str('ui.details.abilities')}:") + self.type_label = se.Text(f"{lang.str('dialog.attack.type')}:") + self.initiative_label = se.Text(f"{lang.str('ui.details.initiative')}:") + self.exit_label = se.Text(f"{Action.DECK.mapping}: {lang.str('ui.dialog.exit')}") + self.nature_label = se.Text(f"{Action.NATURE_INFO.mapping}: {lang.str('ui.details.nature')}") + self.ability_label = se.Text(f"{Action.ABILITIES}: {lang.str('ui.details.use_ability')}") self.line_sep1 = se.Square("-", self.map.width - 2, 1, state="float") self.line_sep2 = se.Square("-", self.map.width - 2, 1, state="float") self.line_middle = se.Square("|", 1, 10, state="float") @@ -97,16 +98,16 @@ def __call__(self, poke, abb=True): abb_obs = [i for i in poke.attack_obs if i.world_action != ""] if abb_obs != [] and abb: - self.world_actions_label.rechar("Abilities:" + self.world_actions_label.rechar(f"{lang.str('ui.details.abilities')}:" + " ".join([i.name for i in abb_obs])) - self.ability_label.rechar("3: Use ability") + self.ability_label.rechar(f"3: {lang.str('ui.details.use_ability')}") else: self.world_actions_label.rechar("") self.ability_label.rechar("") - self.attack_defense.rechar(f"Attack:{poke.atc}\ -{(4 - len(str(poke.atc))) * ' '}Defense:{poke.defense}") - self.initiative_label.rechar(f"Initiative:{poke.initiative}") + self.attack_defense.rechar(f"{lang.str('ui.details.attack')}:{poke.atc}\ +{(4 - len(str(poke.atc))) * ' '}{lang.str('ui.details.defense')}:{poke.defense}") + self.initiative_label.rechar(f"{lang.str('ui.details.initiative')}:{poke.initiative}") for obj, _x, _y in zip([poke.desc, poke.text_type], [34, 41], [2, 5]): obj.add(self.map, _x, _y) for atc, _x, _y in zip(poke.attack_obs, [1, @@ -117,7 +118,7 @@ def __call__(self, poke, abb=True): atc.temp_i = 0 atc.temp_j = -30 atc.label_desc.rechar(atc.desc[:int(self.map.width / 2 - 1)]) - atc.label_ap.rechar(f"AP:{atc.ap}/{atc.max_ap}") + atc.label_ap.rechar(f"{lang.str('dialog.attack.ap')}:{atc.ap}/{atc.max_ap}") for label, __x, __y in zip([atc.label_name, atc.label_factor, atc.label_type, atc.label_ap, atc.label_desc], @@ -142,7 +143,7 @@ def __call__(self, poke, abb=True): poke.nature.info(self.map) elif action.triggers(Action.ABILITIES): if abb_obs != [] and abb: - with ChooseBox(len(abb_obs) + 2, 25, name="Abilities", + with ChooseBox(len(abb_obs) + 2, 25, name=lang.str("ui.details.abilities"), c_obs=[se.Text(i.name) for i in abb_obs]).center_add(self.map)\ as box: diff --git a/pokete_classes/dex.py b/pokete_classes/dex.py index 551d475b..36c6fa5d 100644 --- a/pokete_classes/dex.py +++ b/pokete_classes/dex.py @@ -6,6 +6,7 @@ import pokete_classes.movemap as mvp from pokete_general_use_fns import liner from .loops import std_loop, easy_exit_loop +from .language import lang from .poke import Poke from .color import Color from .nature import PokeNature @@ -18,7 +19,7 @@ class Dex: figure: Figure object""" def __init__(self, figure): - self.box = ChooseBox(mvp.movemap.height - 3, 35, "Poketedex", + self.box = ChooseBox(mvp.movemap.height - 3, 35, lang.str("ui.dex.title"), info=f"{Action.CANCEL.mapping}:close") self.detail_box = Box(16, 35) self.figure = figure @@ -48,9 +49,9 @@ def detail(self, poke): poke.nature = PokeNature.dummy() poke.set_vars() active = { - True: ("Night", Color.thicc + Color.blue), - False: ("Day", Color.thicc + Color.yellow), - None: ("Always", "") + True: (lang.str("dialog.time.night"), Color.thicc + Color.blue), + False: (lang.str("dialog.time.day"), Color.thicc + Color.yellow), + None: (lang.str("dialog.time.always"), "") }[poke.night_active] desc_text = liner(poke.desc.text.replace("\n", " ") + (f"""\n\n Evolves into { @@ -63,14 +64,14 @@ def detail(self, poke): self.detail_box.name_label.rechar(poke.name) self.detail_box.add_ob(poke.ico, 3, 2) self.detail_desc.rechar(desc_text) - self.detail_info.rechar("Type: ") + self.detail_info.rechar(f"{lang.str('dialog.attack.type')}: ") self.detail_info += se.Text(poke.type.name.capitalize(), esccode=poke.type.color) + se.Text(f""" -HP: {poke.hp} -Attack: {poke.atc} -Defense: {poke.defense} -Initiative: {poke.initiative} -Active: """) + se.Text(active[0], esccode=active[1]) +{lang.str('dialog.attack.hp')}: {poke.hp} +{lang.str('ui.details.attack')}: {poke.atc} +{lang.str('ui.details.defense')}: {poke.defense} +{lang.str('ui.details.initiative')}: {poke.initiative} +{lang.str('ui.dialog.active')}: """) + se.Text(active[0], esccode=active[1]) with self.detail_box.center_add(mvp.movemap): easy_exit_loop() diff --git a/pokete_classes/effects.py b/pokete_classes/effects.py index f8a906e3..1ca7f56e 100644 --- a/pokete_classes/effects.py +++ b/pokete_classes/effects.py @@ -5,6 +5,7 @@ import logging import scrap_engine as se from .color import Color +from .language import lang from release import SPEED_OF_TIME class Effect(): @@ -46,7 +47,7 @@ def add(self, obj): ARGS: obj: The Poke the effect is added to""" if obj.type.name in self.exclude: - obj.ico.map.outp.rechar(f'{obj.ext_name} is not affected by ') + obj.ico.map.outp.rechar((lang.str("dialog.effect.not_affected") % obj.ext_name) + " ") obj.ico.map.outp.append(se.Text(self.name, esccode=self.str_esccode, state="float"), @@ -55,14 +56,14 @@ def add(self, obj): self.obj = obj self.obj.effects.append(self) self.add_label() - self.obj.ico.map.outp.rechar(f'{obj.ext_name} is now ') + self.obj.ico.map.outp.rechar((lang.str("dialog.effect.now") % obj.ext_name) + " ") self.obj.ico.map.outp.append(se.Text(self.name, esccode=self.str_esccode, state="float"), se.Text("!", state="float")) - logging.info("[Effect][%s] Added to %s", self.name, obj.name) + logging.info(lang.str('log.effects.add'), self.name, obj.name) else: - obj.ico.map.outp.rechar(f'{obj.ext_name} is already ') + obj.ico.map.outp.rechar((lang.str("dialog.effect.already") % obj.ext_name) + " ") obj.ico.map.outp.append(se.Text(self.name, esccode=self.str_esccode, state="float"), @@ -85,7 +86,7 @@ def add_label(self): def readd(self): """Readds label and shows text""" self.add_label() - self.obj.ico.map.outp.outp(f'{self.obj.ext_name} is still ') + self.obj.ico.map.outp.outp((lang.str("dialog.effect.still") % self.obj.ext_name) + " ") self.obj.ico.map.outp.append(se.Text(self.name, esccode=self.str_esccode, state="float"), @@ -95,16 +96,15 @@ def readd(self): def remove(self): """Removes itself from the current pokete with a certain chance""" if random.randint(0, self.rem_chance) == 0: - self.obj.ico.map.outp.outp(f'{self.obj.ext_name} isn\'t ') + self.obj.ico.map.outp.outp((lang.str("dialog.effect.isnt") % self.obj.ext_name) + " ") self.obj.ico.map.outp.append(se.Text(self.name, esccode=self.str_esccode, state="float"), - se.Text(" anymore!", state="float")) + se.Text(" " + lang.str("dialog.effect.anymore"), state="float")) i = self.obj.effects.index(self) del self.obj.effects[i] self.cleanup(i) - logging.info("[Effect][%s] Removed from %s", self.name, - self.obj.name) + logging.info(lang.str("log.effects.remove"), self.name, self.obj.name) self.obj = None time.sleep(SPEED_OF_TIME * 2) @@ -124,12 +124,14 @@ def cleanup(self, j=None): def effect(self): """The action that's executed every attack round""" - self.obj.ico.map.outp.outp(f'{self.obj.ext_name} is still ') - self.obj.ico.map.outp.append(se.Text(self.name, - esccode=self.str_esccode, - state="float"), - se.Text(" and can\'t attack!", - state="float")) + self.obj.ico.map.outp.outp((lang.str("dialog.effect.still") % self.obj.ext_name) + " ") + self.obj.ico.map.outp.append( + se.Text(self.name, + esccode=self.str_esccode, + state="float"), + se.Text(" " + lang.str("dialog.effect.cant_attack"), + state="float") + ) time.sleep(SPEED_OF_TIME * 0.5) return 1 @@ -144,8 +146,7 @@ def ret_md(cls): class EffectParalyzation(Effect): """Effect see desc""" - desc = "Paralyses the enemy and stops it from attacking. \ -This is reverted randomly." + desc = lang.str("dialog.effect.paralysis.description") c_name = "paralyzation" def __init__(self, obj=None): @@ -155,8 +156,7 @@ def __init__(self, obj=None): class EffectSleep(Effect): """Effect see desc""" - desc = "Makes the enemy fall asleep and stops it from attacking. \ -This is reverted randomly." + desc = lang.str("dialog.effect.sleep.description") c_name = "sleep" def __init__(self, obj=None): @@ -165,8 +165,7 @@ def __init__(self, obj=None): class EffectBurning(Effect): """Effect see desc""" - desc = "Sets the enemy on fire and damages them with 2 HP every round. \ -This is reverted randomly." + desc = lang.str("dialog.effect.burn.description") c_name = "burning" def __init__(self, obj=None): @@ -194,8 +193,7 @@ def effect(self): class EffectPoison(EffectBurning): """Effect see desc""" - desc = "Poisons the enemy and damages the enemy with 1 HP every round.\ - This is reverted randomly." + desc = lang.str("dialog.effect.poison.description") c_name = "poison" def __init__(self, obj=None): @@ -207,7 +205,7 @@ def __init__(self, obj=None): class EffectConfusion(Effect): """Effect see desc""" - desc = "Makes the enemy hurt it self. This is reverted randomly." + desc = lang.str("dialog.effect.confusion.description") c_name = "confusion" def __init__(self, obj=None): @@ -215,7 +213,7 @@ def __init__(self, obj=None): exclude=["undead"]) def effect(self): - self.obj.ico.map.outp.outp(f'{self.obj.ext_name} is still ') + self.obj.ico.map.outp.outp((lang.str("dialog.effect.still") % self.obj.ext_name) + " ") self.obj.ico.map.outp.append(se.Text(self.name, esccode=self.str_esccode, state="float"), @@ -226,8 +224,7 @@ def effect(self): class EffectFreezing(Effect): """Effect see desc""" - desc = "Freezes the enemy and stops it from attacking. \ -This is reverted randomly." + desc = lang.str("dialog.effect.freeze.description") c_name = "freezing" def __init__(self, obj=None): diff --git a/pokete_classes/menu.py b/pokete_classes/menu.py index 2c5c6a04..ffc7ab40 100644 --- a/pokete_classes/menu.py +++ b/pokete_classes/menu.py @@ -6,7 +6,7 @@ from .hotkeys import get_action, Action from .loops import std_loop from .input import text_input -from .language import HARDCODED_LANGUAGE_NAMES +from .language import HARDCODED_LANGUAGE_NAMES, lang from .achievements import AchievementOverview @@ -17,29 +17,29 @@ class Menu: def __init__(self, _map): self.map = _map - self.box = ChooseBox(_map.height - 3, 35, "Menu") - self.playername_label = se.Text("Playername: ", state="float") - self.represent_char_label = se.Text("Char: ", state="float") - self.mods_label = se.Text("Mods", state="float") - self.ach_label = se.Text("Achievements", state="float") - self.about_label = se.Text("About", state="float") - self.save_label = se.Text("Save", state="float") - self.exit_label = se.Text("Exit", state="float") + self.box = ChooseBox(_map.height - 3, 35, lang.str("ui.menu.title")) + self.playername_label = se.Text(f"{lang.str('ui.menu.playername')}: ", state="float") + self.represent_char_label = se.Text(f"{lang.str('ui.menu.playername_char')}: ", state="float") + self.mods_label = se.Text(lang.str("ui.mods.title"), state="float") + self.ach_label = se.Text(lang.str("ui.achievements.title"), state="float") + self.about_label = se.Text(lang.str("ui.about.title"), state="float") + self.save_label = se.Text(lang.str("ui.menu.save"), state="float") + self.exit_label = se.Text(lang.str("ui.menu.quit_game"), state="float") self.realname_label = se.Text("", state="float") self.char_label = se.Text("", state="float") self.box.add_c_obs([self.playername_label, self.represent_char_label, - VisSetting("Autosave", "autosave", + VisSetting(lang.str("ui.menu.autosave"), "autosave", {True: "On", False: "Off"}), - VisSetting("Animations", "animations", + VisSetting(lang.str("ui.menu.animations"), "animations", {True: "On", False: "Off"}), - VisSetting("Save trainers", "save_trainers", + VisSetting(lang.str("ui.menu.save_trainers"), "save_trainers", {True: "On", False: "Off"}), - VisSetting("Audio", "audio", + VisSetting(lang.str("ui.menu.audio"), "audio", {True: "On", False: "Off"}), - VisSetting("Load mods", "load_mods", + VisSetting(lang.str("ui.mods.load"), "load_mods", {True: "On", False: "Off"}), - VisSetting("Language", "language", + VisSetting(lang.str("ui.menu.language"), "language", HARDCODED_LANGUAGE_NAMES), self.mods_label, self.ach_label, self.about_label, self.save_label, From 80db693cb9aaca64e0d2324fcbfc271b65de8ca8 Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Thu, 14 Jul 2022 22:35:04 +0200 Subject: [PATCH 06/10] More removed hard coded language strings. Also added some German translation. --- assets/lang/de_DE.json | 189 +++++++++++++++++++++++++++++++++- assets/lang/en_US.json | 109 +++++++++++++++++++- pokete_classes/fightmap.py | 134 ++++++++++++------------ pokete_classes/general.py | 9 +- pokete_classes/health_bar.py | 5 +- pokete_classes/hotkeys.py | 5 +- pokete_classes/input.py | 7 +- pokete_classes/inv_items.py | 5 +- pokete_classes/landscape.py | 10 +- pokete_classes/learnattack.py | 14 ++- pokete_classes/menu.py | 21 ++-- pokete_classes/mods.py | 18 ++-- pokete_classes/movemap.py | 14 +-- pokete_classes/nature.py | 15 ++- pokete_classes/npcs.py | 18 ++-- pokete_classes/poke.py | 34 +++--- pokete_classes/roadmap.py | 9 +- pokete_classes/side_loops.py | 20 ++-- pokete_classes/timer.py | 3 +- 19 files changed, 465 insertions(+), 174 deletions(-) diff --git a/assets/lang/de_DE.json b/assets/lang/de_DE.json index 45722eea..c9f11b67 100644 --- a/assets/lang/de_DE.json +++ b/assets/lang/de_DE.json @@ -1,13 +1,194 @@ { "$schema": "schema.json", - "error.import.scrap_engine": "Es scheint als hättest du die Erweiterung 'scrap-engine' nicht installiert", + "assert.input.text_length": "Text darf nicht länger als 12 Zeichen sein!", + "assert.pokete.attack_length": "Dein Pokete %s kann nicht mehr als 4 Attacken erlernen!", + "error.input.single_space_character": "Das ausgewählte Zeichen muss ein gültiger Leerzeichen sein!", + "error.import.scrap_engine": "Es scheint als hättest du das Paket 'scrap-engine' nicht installiert", + "error.exception.road_map_exception": "%s %s has no mapstation", + "error.mod.attributes": "Dem Mod %s fehlen Eigenschaften!\n%s", + "ui.pokete.title": "Pokete v%s -- %s\nvon lxgr-linux ", + "ui.dialog.yes": "Ja", + "ui.dialog.no": "Nein", + "ui.dialog.select_yes": "[Y]Ja", + "ui.dialog.select_no": "[N]ein", + "ui.dialog.select_ok": "[O]k", + "ui.dialog.min_window_size": "Minimale Fenstergröße ist 70x20", + "ui.dialog.on": "An", + "ui.dialog.off": "Aus", + "ui.dialog.nothing": "Nichts", + "ui.dialog.succeeded": "Erfolgreich", + "ui.dialog.failed": "Fehlgeschlagen", + "ui.dialog.answer": "Antwort", + "ui.dialog.lost": "Verloren", + "ui.dialog.won": "Gewonnen", + "ui.dialog.close": "Schließen", + "ui.dialog.at": "Um", + "ui.dialog.exit": "Verlassen", + "ui.dialog.active": "Aktiv", + "ui.dialog.move": "Bewegen", + "ui.dialog.move_to": "Bewegen nach", + "ui.dialog.cant_free_all": "Du kannst nicht alle deine Pokete freilassen", + "ui.dialog.free": "Freilassen", + "ui.dialog.free_pokete": "Möchtest du wirklich %s freilassen?", + "ui.details.title": "Details", + "ui.details.attacks": "Attacken", + "ui.details.attack": "Angriff", + "ui.details.defense": "Verteidigung", + "ui.details.abilities": "Fähigkeiten", + "ui.details.initiative": "Initiative", + "ui.details.nature": "Natur", + "ui.details.nature.very": "sehr", + "ui.details.nature.description": "Das heißt es hat %s Angriff, %s Verteidigung\nund %s Initiative Punkte mehr im vergleich zu normalen\nPokete seiner Art.", + "ui.details.use_ability": "Benutze Fähigkeit", + "ui.details.denominator.equal": "das gleiche", + "ui.details.denominator.less_than": "weniger", + "ui.details.denominator.greater_than": "mehr", + "ui.movemap.deck": "Deck", + "ui.movemap.map": "Karte", + "ui.movemap.inventory_abbr": "Inv.", + "ui.movemap.clock": "Uhr", + "ui.movemap.help": "Hilfe", + "ui.hotkeys.not_set": "Die folgenden Tasten sind nicht belegt:\n%s\nSoll die Standardbelegung für diese Tasten geladen werden?", + "ui.menu.title": "Menü", + "ui.menu.playername": "Spielername", + "ui.menu.playername_char": "Zeichen", + "ui.menu.save": "Speichern", + "ui.menu.quit_game": "Spiel verlassen", + "ui.menu.autosave": "Auto. Speichern", + "ui.menu.animations": "Animationen", + "ui.menu.save_trainers": "Speichere Trainer", + "ui.menu.audio": "Audio", + "ui.menu.language": "Sprache", + "ui.menu.saving": "Speichern...", + "ui.about.title": "Über", + "ui.mods.title": "Mods", + "ui.mods.load": "Lade mods", + "ui.mods.description": "Mods sind %s!\nUm ein Mod zu laden, muss es ins Unterverzeichnis '/mods' eingefügt werden\nund anschließend im Mod Menü aktiviert werden.", + "ui.mods.currently.singular": "Derzeitig ist %d Mod geladen:", + "ui.mods.currently.plural": "Derzeitig sind %d Mods geladen:", + "ui.mods.enabled": "aktiviert", + "ui.mods.disabled": "deaktiviert", + "ui.dex.title": "Poketedex", "ui.inventory.title": "Inventar", + "ui.achievements.title": "Errungenschaften", + "ui.achievements.achieved": "Errungen: ", + "ui.achievements.unlocked": "Errungenschaft freigeschaltet!", + "ui.shop.title": "Geschäft", + "ui.roadmap.title": "Roadmap", + "ui.roadmap.find": "Hier kannst du finden:", + "ui.controls.title": "Tastaturbelegung", + "ui.help.controls.up": "Oben", + "ui.help.controls.down": "Unten", + "ui.help.controls.left": "Links", + "ui.help.controls.right": "Rechts", + "ui.help.controls.menu": "Menü", + "ui.help.text": "Wenn du in das hohe Gras läufst (';') triffst du vielleicht auf\nein wildes Pokete, welche besiegt oder gefangen werden können.\nNPCs sprechen mit dir sobald du gegen sie läufst.\nFür mehr Informationen wie dieses Spiel gespielt wird, \nkannst du hier nachlesen (Englisch): https://git.io/JRRqe", "ui.lang.en_us": "Englisch (Amerikanisch)", "ui.lang.de_de": "Deutsch", + "dialog.time.day": "Tag", + "dialog.time.night": "Nacht", + "dialog.time.always": "Immer", + "dialog.evolution.look": "Schau!", + "dialog.evolution.evolving": "%s\n%s entwickelt sich!", + "dialog.evolution.evolved": "%s entwickelte sich zu %s!", + "dialog.evolution.evolve": "Entwickelt sich zu", "dialog.center.welcome": "Willkommen im Pokete-Center", "dialog.center.action": "Was möchtest du tun?", + "dialog.center.list": "1: Sehe dein Deck\n 2: Heile alle Pokete\n 3: Knuddeln mit deinen Pokete", "dialog.center.healed": "Deine Pokete sind nun geheilt!", - "dialog.center.list": "1: Schaue dein Team an\n 2: Heil alle deine Pokete\n 3: Knuddel mit deinen Pokete", - "ui.menu.language": "Sprache", - "ui.about.title": "Über" + "dialog.shop.welcome": "Willkommen im Pokete-Geschäft", + "dialog.shop.action": "Möchtest du was kaufen?", + "dialog.shop.leave": "Hab noch einen schönen Tag!", + "dialog.trader.welcome": "Ich bin ein Händler.", + "dialog.trader.action": "Hier kannst du deine Pokete mit anderen Spielern tauschen.", + "dialog.attack.what_to_do": "Was möchtest du tun?", + "dialog.attack.no_items": "Du hast keine Items mehr!", + "dialog.attack.run_question": "Möchtest du wirklich weglaufen?", + "dialog.attack.failed_run": "Weglaufen fehlgeschlagen!", + "dialog.attack.success_run": "Du bist entkommen!", + "dialog.attack.encounter": "Ein wildes %s ist erschienen!", + "dialog.attack.start_fight": "%s hat einen Kampf begonnen!", + "dialog.attack.opponent.attack": "%s\n%s benutzt %s gegen dich!", + "dialog.attack.opponent.used": "%s benutzt %s!", + "dialog.attack.player.attack": "Du benutzt %s", + "dialog.attack.player.swap_pokete": "Möchtest du ein anderes Pokete auswählen?", + "dialog.attack.player.swap_pokete.confirm": "Du hast %s gewählt", + "dialog.attack.player.throw": "Du hast %s geworfen!", + "dialog.attack.pokete.defeat": "%s wurde besiegt!", + "dialog.attack.pokete.no_ap": "%s hat alle seine Angriffspunkte aufgebraucht!", + "dialog.attack.pokete.won": "%s hat gewonnen!", + "dialog.attack.pokete.levelup": "%s erreicht Level %d!", + "dialog.attack.pokete.caught": "Du hast ein %s gefangen!", + "dialog.attack.pokete.missed": "Verfehlt!", + "dialog.attack.pokete.learn_attack": "%s möchte %s lernen!", + "dialog.attack.pokete.learned_attack": "%s hat %s gelernt!", + "dialog.attack.noop": "Das kannst du in einem Kampf nicht tun!", + "dialog.attack.blackout": "Alle deine Pokete wurden besiegt. Du versuchst schnell\nzum zuletzt besuchten Poketecenter zurückzulaufen um deine Pokete zu heilen!\nAuf dem Weg dahin fiel dir %d$ aus deinen Taschen!", + "dialog.attack.deck": "Dein Deck", + "dialog.attack.won": "gewonnen", + "dialog.attack.lvl": "Lvl", + "dialog.attack.hp": "KP", + "dialog.attack.xp": "EXP", + "dialog.attack.ap": "AP", + "dialog.attack.attacks": "Attacken", + "dialog.attack.attack": "Attacke", + "dialog.attack.attack_info": "Attacken Info", + "dialog.attack.run": "Fliehen!", + "dialog.attack.type": "Typ", + "dialog.attack.info": "Info", + "dialog.attack.effective": "Das ist sehr effiktiv!", + "dialog.attack.not_effective": "Das ist nicht effiktiv!", + "dialog.attack.missed": "%s verfehlt!", + "dialog.attack.attack_used": "%s benutzt %s! %s", + "dialog.attack.hurt_itself": "%s hat sich selbst verletzt!", + "dialog.inventory.prefix_ld_disk": "LD", + "dialog.inventory.teach_disc": "Bringt einem Pokete die Attacke %s bei.", + "dialog.effect.not_affected": "%s ist nicht betroffen von", + "dialog.effect.now": "%s ist jetzt", + "dialog.effect.already": "%s ist bereits", + "dialog.effect.still": "%s ist immernoch", + "dialog.effect.isnt": "%s ist noch nicht", + "dialog.effect.anymore": "!", + "dialog.effect.cant_attack": "und kann nicht angreifen!", + "dialog.effect.paralysis.description": "Paralyses the enemy and stops it from attacking. \nThis is reverted randomly.", + "dialog.effect.sleep.description": "Makes the enemy fall asleep and stops it from attacking. \nThis is reverted randomly.", + "dialog.effect.burn.description": "Sets the enemy on fire and damages them with 2 HP every round. \nThis is reverted randomly.", + "dialog.effect.poison.description": "Poisons the enemy and damages the enemy with 1 HP every round.\n This is reverted randomly.", + "dialog.effect.confusion.description": "Makes the enemy hurt it self. This is reverted randomly.", + "dialog.effect.freeze.description": "Freezes the enemy and stops it from attacking. \nThis is reverted randomly.", + "dialog.walk.collected_item.singular": "You found a %s!", + "dialog.walk.collected_item.plural": "You found %d %ss!", + "npc.interaction.give": "%s gifted you a %s.\nDo you want to accept it?", + "npc.interaction.twenty_dollars": "Here is $20!", + "npc.test_npc.hey": "Hey.", + "npc.old_man.greet": "Hello, young trainer.", + "npc.old_man.talk": "When I was your age... I also was a trainer.", + "npc.old_man.found_hyperball": "One day I found this very special Poketeball...", + "npc.old_man.hyperball": "A Hyperball!", + "npc.old_man.rarest": "It's one of the oldest and rarest of them all.", + "npc.old_man.keep": "You can keep it!", + "trainer.playmap1.franz.fight": "Wanna fight?", + "trainer.playmap1.franz.lose1": "Hahaha!", + "trainer.playmap1.franz.lose2": "You're a loser!", + "trainer.playmap1.franz.win": "You're a very good trainer!", + "log.achievements.unlocked": "[Achievements] Unlocked %s", + "log.general.player": "Player", + "log.general.enemy": "Enemy", + "log.effects.add": "[Effect][%s] Added to %s", + "log.effects.remove": "[Effect][%s] Removed from %s", + "log.fight.ran_away": "[Fight] Ended, ran away", + "log.fight.end_fight": "[Fight] Ended, fight item", + "log.fight.start_fight": "[Fight] Started between %s and ", + "log.fight.end_fight_won": "[Fight] Ended, %s (%s) won", + "log.fight.pokete_caught": "[Fight][%s] Caught %s", + "log.fight.pokete_missed": "[Fight][%s] Missed", + "log.fight.ap_potion_used": "[Fight][ap_potion] Used", + "log.fight.blackout": "[Fight] You lost all Poketes and ran away!", + "log.npc.interaction": "[NPC][%s] Interaction", + "log.npc.walk_check": "[NPC][%s] %s walk check to (%d|%d)", + "log.npc.match_info": "[NPC][%s] %s against player", + "log.pokete.gained_xp": "[Pokete][%s] Gained %d XP (current: %d)", + "log.pokete.level_up": "[Pokete][%s] Reached level %d", + "log.pokete.used_attack": "[Pokete][%s] Used %s: %s", + "log.pokete.evolved": "[Pokete] %s evolved into %s" } diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json index dab1a67d..3384f7ef 100644 --- a/assets/lang/en_US.json +++ b/assets/lang/en_US.json @@ -1,8 +1,27 @@ { "$schema": "schema.json", + "assert.input.text_length": "Text has to be longer than 12 characters!", + "assert.pokete.attack_length": "A Pokete %s can't have more than 4 attacks!", + "error.input.single_space_character": "The chosen character has to be a valid single-space character!", "error.import.scrap_engine": "You seem to not have the 'scrap-engine' package installed", + "error.exception.road_map_exception": "%s %s has no mapstation", + "error.mod.attributes": "The mod %s lacks attributes!\n%s", + "ui.pokete.title": "Pokete v%s -- %s\nby lxgr-linux ", "ui.dialog.yes": "Yes", "ui.dialog.no": "No", + "ui.dialog.select_yes": "[Y]es", + "ui.dialog.select_no": "[N]o", + "ui.dialog.select_ok": "[O]k", + "ui.dialog.min_window_size": "Minimum window size is 70x20", + "ui.dialog.on": "On", + "ui.dialog.off": "Off", + "ui.dialog.nothing": "Nothing", + "ui.dialog.succeeded": "Succeeded", + "ui.dialog.failed": "Failed", + "ui.dialog.answer": "Answer", + "ui.dialog.lost": "Lost", + "ui.dialog.won": "Won", + "ui.dialog.close": "Close", "ui.dialog.at": "At", "ui.dialog.exit": "Exit", "ui.dialog.active": "Active", @@ -18,7 +37,18 @@ "ui.details.abilities": "Abilities", "ui.details.initiative": "Initiative", "ui.details.nature": "Nature", + "ui.details.nature.very": "very", + "ui.details.nature.description": "That means it has %s attack, %s defense\nand %s initiative points compared to normal Poketes\nof its kind.", "ui.details.use_ability": "Use ability", + "ui.details.denominator.equal": "the same", + "ui.details.denominator.less_than": "less", + "ui.details.denominator.greater_than": "more", + "ui.movemap.deck": "Deck", + "ui.movemap.map": "Map", + "ui.movemap.inventory_abbr": "Inv.", + "ui.movemap.clock": "Clock", + "ui.movemap.help": "Help", + "ui.hotkeys.not_set": "The following keys are not set:\n%s\nShould defaults be loaded for those keys?", "ui.menu.title": "Menu", "ui.menu.playername": "Playername", "ui.menu.playername_char": "Char", @@ -29,20 +59,38 @@ "ui.menu.save_trainers": "Save trainers", "ui.menu.audio": "Audio", "ui.menu.language": "Language", + "ui.menu.saving": "Saving...", "ui.about.title": "About", "ui.mods.title": "Mods", "ui.mods.load": "Load mods", + "ui.mods.description": "Mods are %s!\nTo load a mod, it has to be places in '/mods' subdirectory,\nand mods have to be enabled in the menu.", + "ui.mods.currently.singular": "Currently %d mod is loaded:", + "ui.mods.currently.plural": "Currently %d mods are loaded:", + "ui.mods.enabled": "enabled", + "ui.mods.disabled": "disabled", "ui.dex.title": "Poketedex", "ui.inventory.title": "Inventory", "ui.achievements.title": "Achievements", "ui.achievements.achieved": "Achieved: ", "ui.achievements.unlocked": "Achievement unlocked!", "ui.shop.title": "Shop", + "ui.roadmap.title": "Roadmap", + "ui.roadmap.find": "Here you can find:", + "ui.controls.title": "Controls", + "ui.help.controls.up": "Up", + "ui.help.controls.down": "Down", + "ui.help.controls.left": "Left", + "ui.help.controls.right": "Right", + "ui.help.controls.menu": "Menu", + "ui.help.text": "When walking into the high grass (';') you may get attacked\nby wild Poketes, those can be killed or weakened and caught.\nNPCs will talk to you when walking up to them.\nFor more information about how to play this game, check out\nhttps://git.io/JRRqe", "ui.lang.en_us": "English (American)", "ui.lang.de_de": "German", "dialog.time.day": "Day", "dialog.time.night": "Night", "dialog.time.always": "Always", + "dialog.evolution.look": "Look!", + "dialog.evolution.evolving": "%s\n%s is evolving!", + "dialog.evolution.evolved": "%s evolved into %s!", "dialog.evolution.evolve": "Evolves into", "dialog.center.welcome": "Welcome to the Pokete-Center", "dialog.center.action": "What do you want to do?", @@ -53,10 +101,48 @@ "dialog.shop.leave": "Have a great day!", "dialog.trader.welcome": "I'm a trader.", "dialog.trader.action": "Here you can trade one of your Poketes for one from another trainer.", + "dialog.attack.what_to_do": "What do you want to do?", + "dialog.attack.no_items": "You don't have any items left!", + "dialog.attack.run_question": "Do you really want to run away?", + "dialog.attack.failed_run": "You failed to run away!", + "dialog.attack.success_run": "You ran away!", + "dialog.attack.encounter": "A wild %s appeared!", + "dialog.attack.start_fight": "%s started a fight!", + "dialog.attack.opponent.attack": "%s\n%s used %s against you!", + "dialog.attack.opponent.used": "%s used %s!", + "dialog.attack.player.attack": "You used %s", + "dialog.attack.player.swap_pokete": "Do you want to choose another Pokete?", + "dialog.attack.player.swap_pokete.confirm": "You have choosen %s", + "dialog.attack.player.throw": "Your threw a %s!", + "dialog.attack.pokete.defeat": "%s is defeated!", + "dialog.attack.pokete.no_ap": "%s has used all its' attacks!", + "dialog.attack.pokete.won": "%s won!", + "dialog.attack.pokete.levelup": "%s reached lvl %d!", + "dialog.attack.pokete.caught": "You caught %s!", + "dialog.attack.pokete.missed": "You missed!", + "dialog.attack.pokete.learn_attack": "%s want to learn %s!", + "dialog.attack.pokete.learned_attack": "%s learned %s!", + "dialog.attack.noop": "You can't do that in a duel!", + "dialog.attack.blackout": "All your Poketes have been defeated and you ran\nback to the last Poketecenter you visited to heal them!\nOn the way there, $%d fell out of your pocket!", + "dialog.attack.deck": "Your deck", + "dialog.attack.won": "won", + "dialog.attack.lvl": "Lvl", "dialog.attack.hp": "HP", + "dialog.attack.xp": "XP", "dialog.attack.ap": "AP", + "dialog.attack.attacks": "Attacks", "dialog.attack.attack": "Attack", + "dialog.attack.attack_info": "Attack Info", + "dialog.attack.run": "Run!", "dialog.attack.type": "Type", + "dialog.attack.info": "Info", + "dialog.attack.effective": "That was very effective!", + "dialog.attack.not_effective": "That was not effective!", + "dialog.attack.missed": "%s missed!", + "dialog.attack.attack_used": "%s used %s! %s", + "dialog.attack.hurt_itself": "%s hurt itself!", + "dialog.inventory.prefix_ld_disk": "LD", + "dialog.inventory.teach_disc": "Teaches a Pokete the attack %s.", "dialog.effect.not_affected": "%s is not affected by", "dialog.effect.now": "%s is now", "dialog.effect.already": "%s is already", @@ -70,6 +156,10 @@ "dialog.effect.poison.description": "Poisons the enemy and damages the enemy with 1 HP every round.\n This is reverted randomly.", "dialog.effect.confusion.description": "Makes the enemy hurt it self. This is reverted randomly.", "dialog.effect.freeze.description": "Freezes the enemy and stops it from attacking. \nThis is reverted randomly.", + "dialog.walk.collected_item.singular": "You found a %s!", + "dialog.walk.collected_item.plural": "You found %d %ss!", + "npc.interaction.give": "%s gifted you a %s.\nDo you want to accept it?", + "npc.interaction.twenty_dollars": "Here is $20!", "npc.test_npc.hey": "Hey.", "npc.old_man.greet": "Hello, young trainer.", "npc.old_man.talk": "When I was your age... I also was a trainer.", @@ -82,6 +172,23 @@ "trainer.playmap1.franz.lose2": "You're a loser!", "trainer.playmap1.franz.win": "You're a very good trainer!", "log.achievements.unlocked": "[Achievements] Unlocked %s", + "log.general.player": "Player", + "log.general.enemy": "Enemy", "log.effects.add": "[Effect][%s] Added to %s", - "log.effects.remove": "[Effect][%s] Removed from %s" + "log.effects.remove": "[Effect][%s] Removed from %s", + "log.fight.ran_away": "[Fight] Ended, ran away", + "log.fight.end_fight": "[Fight] Ended, fight item", + "log.fight.start_fight": "[Fight] Started between %s and ", + "log.fight.end_fight_won": "[Fight] Ended, %s (%s) won", + "log.fight.pokete_caught": "[Fight][%s] Caught %s", + "log.fight.pokete_missed": "[Fight][%s] Missed", + "log.fight.ap_potion_used": "[Fight][ap_potion] Used", + "log.fight.blackout": "[Fight] You lost all Poketes and ran away!", + "log.npc.interaction": "[NPC][%s] Interaction", + "log.npc.walk_check": "[NPC][%s] %s walk check to (%d|%d)", + "log.npc.match_info": "[NPC][%s] %s against player", + "log.pokete.gained_xp": "[Pokete][%s] Gained %d XP (current: %d)", + "log.pokete.level_up": "[Pokete][%s] Reached level %d", + "log.pokete.used_attack": "[Pokete][%s] Used %s: %s", + "log.pokete.evolved": "[Pokete] %s evolved into %s" } diff --git a/pokete_classes/fightmap.py b/pokete_classes/fightmap.py index e2bb4ee2..0499842b 100644 --- a/pokete_classes/fightmap.py +++ b/pokete_classes/fightmap.py @@ -7,7 +7,7 @@ import pokete_data as p_data from pokete_general_use_fns import liner from pokete_classes import animations, ob_maps as obmp, movemap as mvp, \ - deck, game_map as gm + deck, game_map as gm from .hotkeys import ACTION_UP_DOWN, Action, get_action from .audio import audio from .loops import std_loop @@ -19,6 +19,7 @@ from .achievements import achievements from .inv_items import invitems from .settings import settings +from .language import lang from release import SPEED_OF_TIME @@ -30,9 +31,10 @@ class FightMap(gm.GameMap): def __init__(self, height, width): super().__init__(height, width, name="fightmap") - self.box = ChooseBox(6, 25, "Attacks", - f"{Action.INFO.mapping}:Info", index_x=1) - self.invbox = ChooseBox(height - 3, 35, "Inventory") + self.box = ChooseBox(6, 25, lang.str("dialog.attack.attacks"), + f"{Action.INFO.mapping}:{lang.str('dialog.attack.info')}", + index_x=1) + self.invbox = ChooseBox(height - 3, 35, lang.str("ui.inventory.title")) # icos self.deadico1 = se.Text(r""" \ / @@ -56,10 +58,10 @@ def __init__(self, height, width): self.p_sideline = se.Square("|", 1, 4, state="float") self.outp = OutP("", state="float") self.label = se.Text( - f"{Action.CHOOSE_ATTACK.mapping}: Attack " - f"{Action.RUN.mapping}: Run! " - f"{Action.CHOOSE_ITEM.mapping}: Inv. " - f"{Action.CHOOSE_POKE.mapping}: Deck" + f"{Action.CHOOSE_ATTACK.mapping}: {lang.str('dialog.attack.attack')} " + f"{Action.RUN.mapping}: {lang.str('dialog.attack.run')} " + f"{Action.CHOOSE_ITEM.mapping}: {lang.str('ui.movemap.inventory_abbr')} " + f"{Action.CHOOSE_POKE.mapping}: {lang.str('ui.movemap.deck')}" ) # adding self.outp.add(self, 1, self.height - 4) @@ -73,7 +75,8 @@ def __init__(self, height, width): self.frame_small.add(self, 0, self.height - 5) self.label.add(self, 0, self.height - 1) # Attack info box - self.atk_info_box = LabelBox(se.Text(""), "Attack Info") + self.atk_info_box = LabelBox(se.Text(""), + lang.str('dialog.attack.attack_info')) self.show_atk_info_box = False def clean_up(self, *providers): @@ -129,7 +132,6 @@ def add_1(self, player, enem): if enem.curr.identifier in player.caught_pokes: enem.curr.pball_small.add(self, len(self.e_underline.text) - 1, 1) - def add_2(self, player): """Adds player labels with sleeps ARGS: @@ -180,14 +182,14 @@ def get_attack(self, attack_obs): if self.show_atk_info_box: self.atk_info_box.add(self, 27, self.height - 7) self.show() - while True:#158 + while True: # 158 action = get_action() if action.triggers(*ACTION_UP_DOWN): self.box.input(action) self.rechar_atk_info_box(attack_obs) self.show() elif action.triggers(Action.ACCEPT) or (0 <= action.get_number() - < len(attack_obs)): + < len(attack_obs)): attack = attack_obs[ self.box.index.index if action.triggers(Action.ACCEPT) else action.get_number() @@ -240,13 +242,13 @@ def get_figure_attack(self, figure, enem): figure: The players provider enem: The enemys provider""" quick_attacks = [ - Action.QUICK_ATC_1, Action.QUICK_ATC_2, - Action.QUICK_ATC_3, Action.QUICK_ATC_4 - ][:len(figure.curr.attack_obs)] + Action.QUICK_ATC_1, Action.QUICK_ATC_2, + Action.QUICK_ATC_3, Action.QUICK_ATC_4 + ][:len(figure.curr.attack_obs)] self.outp.append(se.Text(("\n" if "\n" not in self.outp.text - else "") + - "What do you want to do?", - state="float")) + else "") + + lang.str("dialog.attack.what_to_do"), + state="float")) while True: # Inputloop for general options action = get_action() if action.triggers(*quick_attacks): @@ -264,29 +266,31 @@ def get_figure_attack(self, figure, enem): elif action.triggers(Action.RUN): if ( type(enem) is Trainer - or not ask_bool(self, "Do you really want to run away?") + or not ask_bool(self, + lang.str("dialog.attack.run_question")) ): continue - if (random.randint(0, 100) < max(5, min(50 - (figure.curr.initiative - enem.curr.initiative), 95))): - self.outp.outp("You failed to run away!") + if (random.randint(0, 100) < max(5, min(50 - ( + figure.curr.initiative - enem.curr.initiative), 95))): + self.outp.outp(lang.str("dialog.attack.failed_run")) time.sleep(SPEED_OF_TIME * 1) return "" audio.switch("xDeviruchi - Decisive Battle (End).wav") - self.outp.outp("You ran away!") + self.outp.outp(lang.str("dialog.attack.success_run")) time.sleep(SPEED_OF_TIME * 2) self.clean_up(figure, enem) - logging.info("[Fight] Ended, ran away") + logging.info(lang.str("log.fight.ran_away")) audio.switch(figure.map.song) - return "won" + return lang.str("dialog.attack.won") elif action.triggers(Action.CHOOSE_ITEM): items = [getattr(invitems, i) - for i in figure.inv - if getattr(invitems, i).fn is not None - and figure.inv[i] > 0] + for i in figure.inv + if getattr(invitems, i).fn is not None + and figure.inv[i] > 0] if not items: self.outp.outp( - "You don't have any items left!\n" - "What do you want to do?" + f"{lang.str('dialog.attack.no_items')}\n" + f"{lang.str('dialog.attack.what_to_do')}" ) continue item = self.get_item(items, figure.inv) @@ -296,10 +300,10 @@ def get_figure_attack(self, figure, enem): if (i := getattr(fightitems, item.fn)(figure, enem)) == 1: continue elif i == 2: - logging.info("[Fight] Ended, fightitem") + logging.info(lang.str("log.fight.end_fight")) time.sleep(SPEED_OF_TIME * 2) audio.switch(figure.map.song) - return "won" + return lang.str("dialog.attack.won") return "" elif action.triggers(Action.CHOOSE_POKE): if not self.choose_poke(figure): @@ -316,13 +320,11 @@ def fight(self, providers): Provider that won the fight""" audio.switch("xDeviruchi - Decisive Battle (Loop).wav") index = 0 - logging.info( - "[Fight] Started between %s", - "and ".join( - f"{prov.curr.name} ({type(prov)}) lvl. {prov.curr.lvl()}" - for prov in providers - ) - ) + logging.info(lang.str("log.fight.start_fight").join( + f"{prov.curr.name} ({type(prov)}) lvl. {prov.curr.lvl()}" + for prov in providers + )) + weather = providers[0].map.weather for prov in providers: prov.index_conf() @@ -331,19 +333,18 @@ def fight(self, providers): self.add_1(*providers) for prov in providers: if type(prov) is NatureProvider: - self.outp.outp(f"A wild {prov.curr.name} appeared!") + self.outp.outp(lang.str("dialog.attack.encounter") % prov.curr.name) elif type(prov) is Trainer: - self.outp.outp(f"{prov.name} started a fight!") + self.outp.outp(lang.str("dialog.attack.start_fight") % prov.name) time.sleep(SPEED_OF_TIME * 1) - self.outp.outp( - f'{self.outp.text}\n{prov.gender} used {prov.curr.name} ' - 'against you!' + self.outp.outp(lang.str("dialog.attack.opponent.attack") + % (self.outp.text, prov.gender, prov.curr.name) ) time.sleep(SPEED_OF_TIME * 1) self.add_2(providers[0]) self.fast_change([providers[0].curr.ico, self.deadico2, self.deadico1, providers[0].curr.ico], providers[0].curr.ico) - self.outp.outp(f"You used {providers[0].curr.name}") + self.outp.outp(lang.str("dialog.attack.player.attack") % providers[0].curr.name) self.show() time.sleep(SPEED_OF_TIME * 0.5) index = providers.index( @@ -372,12 +373,13 @@ def fight(self, providers): loser = prov winner = providers[(i + 1) % 2] if winner is not None: - self.outp.outp(f"{loser.curr.ext_name} is dead!") + self.outp.outp(lang.str("dialog.attack.pokete.defeat") % loser.curr.ext_name) elif all(i.ap == 0 for i in player.curr.attack_obs): winner = providers[(index + 1) % 2] loser = player time.sleep(SPEED_OF_TIME * 2) - self.outp.outp(f"{player.curr.ext_name} has used all its' attacks!") + self.outp.outp( + lang.str("dialog.attack.pokete.no_ap")) time.sleep(SPEED_OF_TIME * 3) if winner is not None: if ( @@ -389,7 +391,7 @@ def fight(self, providers): elif ( loser.curr.player and any(p.hp > 0 for p in loser.pokes[:6]) - and ask_bool(self, "Do you want to choose another Pokete?") + and ask_bool(self, lang.str("dialog.attack.player.swap_pokete")) ): success = self.choose_poke(loser) if not success: @@ -411,7 +413,7 @@ def fight(self, providers): self.fast_change( [ico, self.deadico2, self.deadico1, ico], ico ) - self.outp.outp(f"{loser.name} used {loser.curr.name}!") + self.outp.outp(lang.str("dialog.attack.opponent.used") % (loser.name, loser.curr.name)) self.show() time.sleep(SPEED_OF_TIME * 2) else: @@ -423,16 +425,15 @@ def fight(self, providers): poke.lose_xp + max(0, poke.lvl() - winner.curr.lvl()) for poke in loser.pokes ) * (2 if not isinstance(loser, NatureProvider) else 1) - self.outp.outp( - f"{winner.curr.ext_name} won!" + - (f'\nXP + {_xp}' if winner.curr.player else '') + self.outp.outp((lang.str("dialog.attack.pokete.won") % winner.curr.ext_name) + + (f'\n{lang.str("dialog.attack.xp")} + {_xp}' if winner.curr.player else '') ) if winner.curr.player and isinstance(loser, Trainer): achievements.achieve("first_duel") if winner.curr.player and winner.curr.add_xp(_xp): time.sleep(SPEED_OF_TIME * 1) self.outp.outp( - f"{winner.curr.name} reached lvl {winner.curr.lvl()}!" + lang.str("dialog.attack.pokete.levelup") % (winner.curr.name, winner.curr.lvl()) ) winner.curr.moves.shine() time.sleep(SPEED_OF_TIME * 0.5) @@ -447,9 +448,8 @@ def fight(self, providers): self.show() self.clean_up(*providers) mvp.movemap.balls_label_rechar(winner.pokes) - logging.info( - "[Fight] Ended, %s(%s) won", - winner.curr.name, "player" if winner.curr.player else "enemy" + logging.info(lang.str("log.fight.end_fight_won") + % (winner.curr.name, lang.str("log.general.player") if winner.curr.player else lang.str("log.general.enemy")) ) audio.switch(providers[0].map.song) return winner @@ -464,13 +464,13 @@ def choose_poke(self, player, allow_exit=True): self.clean_up(player) index = None while index is None: - index = deck.deck(6, "Your deck", True) + index = deck.deck(6, lang.str("dialog.attack.deck"), True) if allow_exit: break if index is not None: player.play_index = index self.add_player(player) - self.outp.outp(f"You have choosen {player.curr.name}") + self.outp.outp(lang.str("dialog.attack.player.swap_pokete.confirm") % player.curr.name) for j in player.curr.effects: time.sleep(SPEED_OF_TIME * 1) j.readd() @@ -504,11 +504,12 @@ def throw(self, obj, enem, chance, name): None: To let the enemy attack""" if not isinstance(enem, NatureProvider): - fightmap.outp.outp("You can't do that in a duel!") + fightmap.outp.outp(lang.str("dialog.attack.noop")) return 1 - fightmap.outp.rechar(f"You threw a {name.capitalize()}!") - fightmap.fast_change([enem.curr.ico, fightmap.deadico1, fightmap.deadico2, - fightmap.pball], enem.curr.ico) + fightmap.outp.rechar(lang.str("dialog.attack.player.throw") % name.capitalize()) + fightmap.fast_change( + [enem.curr.ico, fightmap.deadico1, fightmap.deadico2, + fightmap.pball], enem.curr.ico) time.sleep(SPEED_OF_TIME * random.choice([1, 2, 3, 4])) obj.remove_item(name) catch_chance = 20 if obj.map == obmp.ob_maps["playmap_1"] else 0 @@ -520,22 +521,22 @@ def throw(self, obj, enem, chance, name): enem.curr.full_hp], k=1)[0]: audio.switch("xDeviruchi - Decisive Battle (End).wav") obj.add_poke(enem.curr) - fightmap.outp.outp(f"You caught {enem.curr.name}!") + fightmap.outp.outp(lang.str("dialog.attack.pokete.caught") % enem.curr.name) time.sleep(SPEED_OF_TIME * 2) fightmap.pball.remove() fightmap.clean_up(obj, enem) mvp.movemap.balls_label_rechar(obj.pokes) - logging.info("[Fighitem][%s] Caught %s", name, enem.curr.name) + logging.info(lang.str("log.fight.pokete_caught"), name, enem.curr.name) achievements.achieve("first_poke") if all(poke in obj.caught_pokes for poke in p_data.pokes): achievements.achieve("catch_em_all") return 2 - fightmap.outp.outp("You missed!") + fightmap.outp.outp(lang.str("dialog.attack.pokete.missed")) fightmap.show() fightmap.pball.remove() enem.curr.ico.add(fightmap, enem.curr.ico.x, enem.curr.ico.y) fightmap.show() - logging.info("[Fighitem][%s] Missed", name) + logging.info(lang.str("log.fight.pokete_missed"), name) return None def potion(self, obj, enem, hp, name): @@ -577,12 +578,11 @@ def ap_potion(self, obj, enem): obj.remove_item("ap_potion") for atc in obj.curr.attack_obs: atc.set_ap(atc.max_ap) - logging.info("[Fighitem][ap_potion] Used") + logging.info(lang.str("log.fight.ap_potion_used")) fightitems = FightItems() fightmap = None - if __name__ == "__main__": print("\033[31;1mDo not execute this!\033[0m") diff --git a/pokete_classes/general.py b/pokete_classes/general.py index d3f1c5fd..1007a746 100644 --- a/pokete_classes/general.py +++ b/pokete_classes/general.py @@ -4,6 +4,7 @@ from pokete_classes import movemap as mvp from .doors import DoorToCenter from .input import ask_ok +from .language import lang def check_walk_back(figure, self=None): @@ -13,12 +14,10 @@ def check_walk_back(figure, self=None): amount = round(figure.get_money() / 3) figure.add_money(-amount) heal(figure) - ask_ok(mvp.movemap, f"""All your Poketes have died and you ran -back to the last Pokecenter you visited to heal them! -On the way there, ${amount} fell out of your pocket!""") + ask_ok(mvp.movemap, lang.str("dialog.attack.blackout") % amount) figure.remove() figure.map = figure.last_center_map - logging.info("[Figure] You lost all Poketes and ran away!") + logging.info(lang.str("log.fight.blackout")) DoorToCenter().action(figure) @@ -30,7 +29,7 @@ def heal(figure): poke.hp = poke.full_hp poke.effects = [] poke.miss_chance = poke.full_miss_chance - poke.text_hp.rechar(f"HP:{poke.hp}") + poke.text_hp.rechar(f"{lang.str('dialog.attack.hp')}:{poke.hp}") poke.set_vars() poke.hp_bar.make(poke.hp) mvp.movemap.balls_label_rechar(figure.pokes) diff --git a/pokete_classes/health_bar.py b/pokete_classes/health_bar.py index 63c8428e..064d266c 100644 --- a/pokete_classes/health_bar.py +++ b/pokete_classes/health_bar.py @@ -4,6 +4,7 @@ import scrap_engine as se from .color import Color from release import SPEED_OF_TIME +from .language import lang class HealthBar(se.Text): @@ -32,11 +33,11 @@ def update(self, oldhp): oldhp: The pokes former hp""" while oldhp != self.poke.hp and oldhp > 0: oldhp += -1 if oldhp > self.poke.hp else 1 - self.poke.text_hp.rechar(f"HP:{oldhp}", esccode=Color.yellow) + self.poke.text_hp.rechar(f"{lang.str('dialog.attack.hp')}:{oldhp}", esccode=Color.yellow) self.make(oldhp) time.sleep(SPEED_OF_TIME * 0.1) self.poke.ico.map.show() - self.poke.text_hp.rechar(f"HP:{oldhp}") + self.poke.text_hp.rechar(f"{lang.str('dialog.attack.hp')}:{oldhp}") time.sleep(SPEED_OF_TIME * 0.1) diff --git a/pokete_classes/hotkeys.py b/pokete_classes/hotkeys.py index 77b71246..4128e92a 100644 --- a/pokete_classes/hotkeys.py +++ b/pokete_classes/hotkeys.py @@ -2,6 +2,7 @@ from collections import defaultdict from pokete_general_use_fns import liner from .event import _ev +from .language import lang class Action(Enum): @@ -180,9 +181,7 @@ def hotkeys_from_save(save, _map, version_change): if get_mapping(action, new_hotkey_mappings) is None ] if unset: - if version_change or ask_bool(_map, f"""The folowing keys are not set: -{liner(", ".join([i.name for i in unset]), 60)} -Should defaults be loaded for those keys?"""): + if version_change or ask_bool(_map, lang.str("ui.hotkeys.not_set") % {liner(", ".join([i.name for i in unset]), 60)}): for action in unset: key = action.mapping new_hotkey_mappings[key].append(action) diff --git a/pokete_classes/input.py b/pokete_classes/input.py index 787b9570..e2124a7f 100644 --- a/pokete_classes/input.py +++ b/pokete_classes/input.py @@ -5,6 +5,7 @@ from .loops import std_loop from .ui_elements import InfoBox, InputBox from .event import _ev +from .language import lang def text_input(obj, _map, name, wrap_len, max_len=1000000): @@ -52,9 +53,9 @@ def ask_bool(_map, text): ARGS: _map: The map the question should be asked on text: The actual question""" - assert len(text) >= 12, "Text has to be longer then 12 characters!" + assert len(text) >= 12, lang.str("assert.input.text_length") text_len = sorted([len(i) for i in text.split('\n')])[-1] - with InfoBox(f"{text}\n{round(text_len / 2 - 6) * ' '}[Y]es [N]o", + with InfoBox(f"{text}\n{round(text_len / 2 - 6) * ' '}{lang.str('ui.dialog.select_yes')} {lang.str('ui.dialog.select_no')}", info="", _map=_map): while True: action = get_action() @@ -90,7 +91,7 @@ def ask_ok(_map, text): text: The question it self""" assert len(text) >= 4, "Text has to be longer then 4 characters!" text_len = sorted([len(i) for i in text.split('\n')])[-1] - with InfoBox(f"{text}\n{round(text_len / 2 - 2) * ' '} [O]k ", name="Info", + with InfoBox(f"{text}\n{round(text_len / 2 - 2) * ' '} {lang.str('ui.dialog.select_ok')} ", name=lang.str("dialog.attack.info"), info="", _map=_map): while True: action = get_action() diff --git a/pokete_classes/inv_items.py b/pokete_classes/inv_items.py index 58350a79..4980a444 100644 --- a/pokete_classes/inv_items.py +++ b/pokete_classes/inv_items.py @@ -1,6 +1,7 @@ """All classes needed for Item management""" import pokete_data as p_data +from .language import lang class Items: @@ -42,9 +43,9 @@ class LearnDisc(InvItem): def __init__(self, attack_name): self.attack_name = attack_name self.attack_dict = p_data.attacks[attack_name] - pretty_name = f"LD-{self.attack_dict['name']}" + pretty_name = f"{lang.str('dialog.inventory.prefix_ld_disk')}-{self.attack_dict['name']}" name = f"ld_{attack_name}" - desc = f"Teaches a Pokete the attack '{self.attack_dict['name']}'." + desc = lang.str("dialog.inventory.teach_disc") % self.attack_dict['name'] super().__init__(name, pretty_name, desc, 0) diff --git a/pokete_classes/landscape.py b/pokete_classes/landscape.py index 54ee810a..79b45ec2 100644 --- a/pokete_classes/landscape.py +++ b/pokete_classes/landscape.py @@ -9,6 +9,7 @@ from .general import check_walk_back from .poke import Poke from .input import ask_ok +from .language import lang class HighGrass(se.Object): @@ -148,6 +149,11 @@ def action(self, ob): self.figure.give_item(item, amount) self.remove() mvp.movemap.full_show() - ask_ok(mvp.movemap, f"You found {amount if amount > 1 else 'a'} \ -{p_data.items[item]['pretty_name']}{'s' if amount > 1 else ''}!") + + if amount > 1: + text_string = lang.str("dialog.walk.collected_item.plural") % (amount, p_data.items[item]['pretty_name']) + else: + text_string = lang.str("dialog.walk.collected_item.singular") % p_data.items[item]['pretty_name'] + + ask_ok(mvp.movemap, text_string) self.figure.used_npcs.append(self.name) diff --git a/pokete_classes/learnattack.py b/pokete_classes/learnattack.py index af3a452e..686163db 100644 --- a/pokete_classes/learnattack.py +++ b/pokete_classes/learnattack.py @@ -10,6 +10,7 @@ from .ui_elements import ChooseBox, Box from .detail import Detail from .attack import Attack +from .language import lang class AttackInfo(Box): @@ -30,7 +31,7 @@ def __init__(self, attack, _map): self.map = _map self.add_ob(atc.label_type, 2, 1) self.add_ob(atc.label_factor, 2, 2) - self.add_ob(se.Text(f"AP:{atc.max_ap}"), 2, 3) + self.add_ob(se.Text(f"{lang.str('dialog.attack.ap')}:{atc.max_ap}"), 2, 3) self.add_ob(desc_label, 2, 4) def __enter__(self): @@ -50,8 +51,8 @@ def __init__(self, poke, _map): self.map = _map self.poke = poke self.box = ChooseBox( - 6, 25, name="Attacks", - info=f"{Action.DECK.mapping}:Details, {Action.INFO.mapping}:Info") + 6, 25, name=lang.str("dialog.attack.attacks"), + info=f"{Action.DECK.mapping}:{lang.str('ui.details.title')}, {Action.INFO.mapping}:{lang.str('dialog.attack.info')}") def __call__(self, attack=None): """Starts the learning process @@ -76,9 +77,7 @@ def __call__(self, attack=None): new_attack = random.choice(full_pool) else: new_attack = attack - if ask_bool(self.map, - f"{self.poke.name} wants to learn \ -{attacks[new_attack]['name']}!"): + if ask_bool(self.map, lang.str("dialog.attack.pokete.learn_attack") % (self.poke.name, attacks[new_attack]['name'])): if len(self.poke.attacks) < 4: self.poke.attacks.append(new_attack) self.poke.attack_obs.append(Attack(new_attack, @@ -96,8 +95,7 @@ def __call__(self, attack=None): i = self.box.index.index self.poke.attacks[i] = new_attack self.poke.attack_obs[i] = Attack(new_attack, i + 1) - ask_ok(self.map, f"{self.poke.name} learned \ -{attacks[new_attack]['name']}!") + ask_ok(self.map, lang.str("dialog.attack.pokete.learned_attack") % (self.poke.name, attacks[new_attack]['name'])) break elif action.triggers(Action.DECK): Detail(self.map.height, self.map.width)\ diff --git a/pokete_classes/menu.py b/pokete_classes/menu.py index ffc7ab40..cc098a5b 100644 --- a/pokete_classes/menu.py +++ b/pokete_classes/menu.py @@ -16,6 +16,9 @@ class Menu: _map: se.Map this will be shown on""" def __init__(self, _map): + on = lang.str("ui.dialog.on") + off = lang.str("ui.dialog.off") + self.map = _map self.box = ChooseBox(_map.height - 3, 35, lang.str("ui.menu.title")) self.playername_label = se.Text(f"{lang.str('ui.menu.playername')}: ", state="float") @@ -30,15 +33,15 @@ def __init__(self, _map): self.box.add_c_obs([self.playername_label, self.represent_char_label, VisSetting(lang.str("ui.menu.autosave"), "autosave", - {True: "On", False: "Off"}), + {True: on, False: off}), VisSetting(lang.str("ui.menu.animations"), "animations", - {True: "On", False: "Off"}), + {True: on, False: off}), VisSetting(lang.str("ui.menu.save_trainers"), "save_trainers", - {True: "On", False: "Off"}), + {True: on, False: off}), VisSetting(lang.str("ui.menu.audio"), "audio", - {True: "On", False: "Off"}), + {True: on, False: off}), VisSetting(lang.str("ui.mods.load"), "load_mods", - {True: "On", False: "Off"}), + {True: on, False: off}), VisSetting(lang.str("ui.menu.language"), "language", HARDCODED_LANGUAGE_NAMES), self.mods_label, self.ach_label, @@ -74,16 +77,14 @@ def __call__(self, pevm, figure, mods, about): # excludes bad unicode: if len(inp.encode("utf-8")) != 1: inp = "a" - notifier.notify("Error", "Bad character", - "The chosen character has to be a \ -valid single-space character!") + notifier.notify("Error", "Bad character", lang.str("error.input.single_space_character")) figure.rechar(inp) elif i == self.mods_label: ModInfo(mvp.movemap, mods.mod_info)() elif i == self.save_label: # When will python3.10 come out? - with InfoBox("Saving....", info="", _map=self.map): - # Shows a box displaying "Saving...." while saving + with InfoBox(lang.str("ui.menu.saving"), info="", _map=self.map): + # Shows a box displaying "Saving..." while saving save() time.sleep(SPEED_OF_TIME * 1.5) elif i == self.exit_label: diff --git a/pokete_classes/mods.py b/pokete_classes/mods.py index 0222ac98..e63b21b8 100644 --- a/pokete_classes/mods.py +++ b/pokete_classes/mods.py @@ -3,6 +3,7 @@ from .side_loops import About from .ui_elements import InfoBox from .settings import settings +from .language import lang class DummyMods: @@ -24,7 +25,7 @@ class ModError(Exception): def __init__(self, name, err): self.name = name self.err = err - super().__init__(f"The mod '{name}' lacks attributes!\n{err}") + super().__init__(lang.str("error.mod.attributes") % (name, err)) class ModInfo(About): @@ -34,14 +35,13 @@ class ModInfo(About): mod_info: mod_info dict""" def __init__(self, _map, mod_info): - self.text = f""" -Mods are { {True: 'enabled', False: 'disabled'}[settings("load_mods").val] }! -To load a mod, it has to be placed in '/mods', -and mods have to be enabled in the menu. - -Currently {len(mod_info)} mod{"s are" if len(mod_info) != 1 else " is"} loaded: - """ + "\n ".join(f"{i}-{mod_info[i]}" for i in mod_info) + "\n" - self.box = InfoBox(self.text, name="Mods", _map=_map) + lang_key = f"ui.mods.currently.{'singular' if len(mod_info) == 1 else 'plural'}" + mod_status = f"ui.mods.{ {True: 'enabled', False: 'disabled'}[settings('load_mods').val]}" + + self.text = f"{lang.str('ui.mods.description') % lang.str(mod_status)}" \ + f"\n\n{lang.str(lang_key)}" + "\n ".join( + f"{i}-{mod_info[i]}" for i in mod_info) + "\n " + self.box = InfoBox(self.text, name=lang.str("ui.mods.title"), _map=_map) if __name__ == "__main__": diff --git a/pokete_classes/movemap.py b/pokete_classes/movemap.py index ddd25b9d..d6173a6b 100644 --- a/pokete_classes/movemap.py +++ b/pokete_classes/movemap.py @@ -28,13 +28,13 @@ def __init__(self, height, width): self.balls_label = se.Text("") self.label_bg = se.Square(" ", self.width, 1, state="float") self.label = se.Text( - f"{Action.DECK.mapping}: Deck " - f"{Action.EXIT_GAME.mapping}: Quit " - f"{Action.MAP.mapping}: Map " - f"{Action.INVENTORY.mapping}: Inv. " - f"{Action.POKEDEX.mapping}: Pokedex " - f"{Action.CLOCK.mapping}: Clock " - f"{Action.HELP.mapping}: help" + f"{Action.DECK.mapping}: {lang.str('ui.movemap.deck')} " + f"{Action.EXIT_GAME.mapping}: {lang.str('ui.menu.quit_game')} " + f"{Action.MAP.mapping}: {lang.str('ui.movemap.map')} " + f"{Action.INVENTORY.mapping}: {lang.str('ui.movemap.inventory_abbr')} " + f"{Action.POKEDEX.mapping}: {lang.str('ui.dex.title')} " + f"{Action.CLOCK.mapping}: {lang.str('ui.movemap.clock')} " + f"{Action.HELP.mapping}: {lang.str('ui.movemap.help')}" ) self.code_label = OutP("") self.multitext = OutP("", state="float") diff --git a/pokete_classes/nature.py b/pokete_classes/nature.py index 00b5f058..7e8eca39 100644 --- a/pokete_classes/nature.py +++ b/pokete_classes/nature.py @@ -8,6 +8,7 @@ from .hotkeys import Action from .ui_elements import LabelBox from .color import Color +from .language import lang from .loops import easy_exit_loop @@ -88,24 +89,22 @@ def __init__(self, p_n): atc = self.get_amount(p_n.nature.atc) defense = self.get_amount(p_n.nature.defense) init = self.get_amount(p_n.nature.initiative) - text = se.Text(f"Nature: {'very ' if p_n.grade == 2 else ''}") \ + text = se.Text(f"{lang.str('ui.details.nature')}: {lang.str('ui.details.nature.very') + ' ' if p_n.grade == 2 else ''}") \ + se.Text(p_n.nature.name, esccode=Color.thicc + p_n.nature.esccode) \ - + se.Text(liner(f"\n\n That means it has {atc} attack, \ -{defense} defense and {init} initiative points compared to normal Poketes \ -of its kind.", 40, pre="")) + + se.Text(liner("\n\n" + (lang.str("ui.details.nature.description") % (atc, defense, init)), 40, pre="")) super().__init__( - text, name="Nature", info=f"{Action.CANCEL.mapping}:close" + text, name=lang.str("ui.details.nature"), info=f"{Action.CANCEL.mapping}:close" ) @staticmethod def get_amount(val): """Gets the amount denominator for a value""" if val == 1: - return "the same" + return lang.str("ui.details.denominator.equal") elif val < 1: - return "less" - return "more" + return lang.str("ui.details.denominator.less_than") + return lang.str("ui.details.denominator.greater_than") def __call__(self, _map): """Shows the box diff --git a/pokete_classes/npcs.py b/pokete_classes/npcs.py index c787291d..cf9d8d01 100644 --- a/pokete_classes/npcs.py +++ b/pokete_classes/npcs.py @@ -15,6 +15,7 @@ from .settings import settings from .ui_elements import ChooseBox from .general import check_walk_back +from .language import lang from release import SPEED_OF_TIME @@ -92,7 +93,7 @@ def action(self): """Interaction with the NPC triggered by NPCTrigger.action""" if self.used and settings("save_trainers").val: return - logging.info("[NPC][%s] Interaction", self.name) + logging.info(lang.str("log.npc.interaction"), self.name) mvp.movemap.full_show() time.sleep(SPEED_OF_TIME * 0.7) self.exclamate() @@ -116,8 +117,8 @@ def check_walk(self, x, y): for j in self.map.obmap[i.ry + self.y][i.rx + self.x]) for i in vec.obs][1:]) - logging.info("[NPC][%s] %s walk check to (%d|%d)", - self.name, 'Succeeded' if ret else 'Failed', x, y) + logging.info(lang.str("log.npc.walk_check"), + self.name, lang.str("ui.dialog.succeeded") if ret else lang.str("ui.dialog.failed"), x, y) return ret def walk_point(self, x, y): @@ -145,8 +146,7 @@ def give(self, name, item): item: Item name""" item = getattr(invitems, item) self.set_used() - if ask_bool(mvp.movemap, f"{name} gifted you a '{item.pretty_name}'. \ -Do you want to accept it?"): + if ask_bool(mvp.movemap, lang.str("npc.interaction.give") % (name, item.pretty_name)): self.fig.give_item(item.name) @property @@ -177,7 +177,7 @@ def chat(self): keys = list(q_a["a"].keys()) c_b = ChooseBox(len(keys) + 2, sorted(len(i) for i in keys)[-1] + 6, - name="Answer", + name=lang.str("ui.dialog.answer"), c_obs=[se.Text(i, state="float") for i in keys]) c_b.frame.corners[0].rechar("^") @@ -254,13 +254,13 @@ def action(self): ) is_winner = (winner == self) self.text({True: self.lose_texts, - False: self.win_texts + ["Here's $20!"]} + False: self.win_texts + [lang.str("npc.interaction.twenty_dollars")]} [is_winner]) heal(self) if is_winner else None if not is_winner: self.fig.add_money(20) self.set_used() - logging.info("[NPC][%s] %s against player", self.name, - 'Lost' if not is_winner else 'Won') + logging.info(lang.str("log.npc.match_info"), self.name, + lang.str("ui.dialog.lost") if not is_winner else lang.str("ui.dialog.won")) self.walk_point(o_x, o_y + (1 if o_y > self.y else -1)) check_walk_back(self.fig) diff --git a/pokete_classes/poke.py b/pokete_classes/poke.py index 775dcf49..09f13628 100644 --- a/pokete_classes/poke.py +++ b/pokete_classes/poke.py @@ -15,6 +15,7 @@ from .moves import Moves from .types import types from .effects import effects +from .language import lang from .learnattack import LearnAttack from .nature import PokeNature from release import SPEED_OF_TIME @@ -56,8 +57,7 @@ def __init__(self, poke, xp, _hp="SKIP", _ap=None, _attacks=None, self.type = self.types[0] self.effects = [] if _attacks is not None: - assert (len(_attacks) <= 4), f"A Pokete {poke} \ -can't have more than 4 attacks!" + assert (len(_attacks) <= 4), lang.str("assert.pokete.attack_length") % poke else: _attacks = self.inf["attacks"][:4] self.attacks = [atc for atc in _attacks @@ -86,15 +86,15 @@ def __init__(self, poke, xp, _hp="SKIP", _ap=None, _attacks=None, self.ico.add_ob(se.Text(ico["txt"], state="float", esccode=esccode, ignore=f'{esccode} {Color.reset}'), 0, 0) - self.text_hp = se.Text(f"HP:{self.hp}", state="float") - self.text_lvl = se.Text(f"Lvl:{self.lvl()}", state="float") + self.text_hp = se.Text(f"{lang.str('dialog.attack.hp')}:{self.hp}", state="float") + self.text_lvl = se.Text(f"{lang.str('dialog.attack.lvl')}:{self.lvl()}", state="float") self.text_name = se.Text(self.name, esccode=Color.underlined + (Color.yellow if self.shiny else ""), state="float") self.text_xp = se.Text( - f"XP:{self.xp - (self.lvl() ** 2 - 1)}/\ + f"{lang.str('dialog.attack.xp')}:{self.xp - (self.lvl() ** 2 - 1)}/\ {((self.lvl() + 1) ** 2 - 1) - (self.lvl() ** 2 - 1)}", state="float") self.text_type = se.Text(self.type.name.capitalize(), @@ -153,9 +153,9 @@ def add_xp(self, _xp): self.text_xp.rechar(f"XP:{self.xp - (self.lvl() ** 2 - 1)}/\ {((self.lvl() + 1) ** 2 - 1) - (self.lvl() ** 2 - 1)}") self.text_lvl.rechar(f"Lvl:{self.lvl()}") - logging.info("[Poke][%s] Gained %dxp (curr:%d)", self.name, _xp, self.xp) + logging.info(lang.str("log.pokete.gained_xp"), self.name, _xp, self.xp) if old_lvl < self.lvl(): - logging.info("[Poke][%s] Reached lvl. %d", self.name, self.lvl()) + logging.info(lang.str("log.pokete.level_up"), self.name, self.lvl()) return True return False @@ -198,10 +198,10 @@ def attack(self, attack, enem, fightmap, weather): / (enem.defense if enem.defense >= 1 else 1)) * random_factor * eff) eff_text = { - eff < 1: "\nThat was not effective! ", - eff > 1: "\nThat was very effective! ", + eff < 1: f"\n{lang.str('dialog.attack.not_effective')} ", + eff > 1: f"\n{lang.str('dialog.attack.effective')} ", eff == 1 or n_hp == 0: "", - random_factor == 0: f"{self.name} missed!"}[True] + random_factor == 0: lang.str("dialog.attack.missed") % self.name}[True] enem.hp -= max(n_hp, 0) enem.hp = max(enem.hp, 0) time.sleep(SPEED_OF_TIME * 0.4) @@ -211,15 +211,15 @@ def attack(self, attack, enem, fightmap, weather): getattr(AttackActions(), attack.action)(self, enem) attack.set_ap(attack.ap - 1) fightmap.outp.outp( - f'{self.ext_name} used {attack.name}! {eff_text}') + lang.str("dialog.attack.attack_used") % (self.ext_name, attack.name, eff_text)) if enem == self: time.sleep(SPEED_OF_TIME * 1) - fightmap.outp.outp(f'{self.ext_name} hurt itself!') + fightmap.outp.outp(lang.str("dialog.attack.hurt_itself") % self.ext_name) if random_factor != 0: attack.give_effect(enem) for obj in [enem, self] if enem != self else [enem]: obj.hp_bar.update(obj.oldhp) - logging.info("[Poke][%s] Used %s: %s", self.name, attack.name, + logging.info(lang.str("log.pokete.used_attack"), self.name, attack.name, str({"eff": eff, "n_hp": n_hp})) fightmap.show() @@ -244,9 +244,9 @@ def evolve(self, figure, _map): self.ico.add(evomap, round(evomap.width / 2 - 4), round((evomap.height - 8) / 2)) self.moves.shine() - evomap.outp.outp("Look!") + evomap.outp.outp(lang.str("dialog.evolution.look")) time.sleep(SPEED_OF_TIME * 0.5) - evomap.outp.outp(f"{evomap.outp.text}\n{self.name} is evolving!") + evomap.outp.outp(lang.str("dialog.evolution.evolving") % (evomap.outp.text, self.name)) time.sleep(SPEED_OF_TIME * 1) for i in range(8): for j, k in zip([self.ico, new.ico], [new.ico, self.ico]): @@ -261,7 +261,7 @@ def evolve(self, figure, _map): evomap.show() time.sleep(SPEED_OF_TIME * 0.01) new.moves.shine() - evomap.outp.outp(f"{self.name} evolved into {new.name}!") + evomap.outp.outp(lang.str("dialog.evolution.evolved") % (self.name, new.name)) time.sleep(SPEED_OF_TIME * 5) for i in range(max(len(p_data.pokes[new.identifier]["attacks"]) - len(self.attack_obs), 0)): @@ -269,7 +269,7 @@ def evolve(self, figure, _map): figure.pokes[figure.pokes.index(self)] = new if new.identifier not in figure.caught_pokes: figure.caught_pokes.append(new.identifier) - logging.info("[Poke] %s evolved into %s", self.name, new.name) + logging.info(lang.str("log.pokete.evolved"), self.name, new.name) del self return True diff --git a/pokete_classes/roadmap.py b/pokete_classes/roadmap.py index aedef3e1..071bab17 100644 --- a/pokete_classes/roadmap.py +++ b/pokete_classes/roadmap.py @@ -7,6 +7,7 @@ from .hotkeys import ACTION_DIRECTIONS, Action, ActionList, get_action from .loops import std_loop, easy_exit_loop from .color import Color +from .language import lang from .ui_elements import Box, InfoBox @@ -15,7 +16,7 @@ class RoadMapException(Exception): def __init__(self, _map): self.map = _map - text = f"{_map} {_map.name} has no mapstation" + text = lang.str("error.exception.road_map_exception") % (_map, _map.name) super().__init__(text) @@ -103,7 +104,7 @@ class RoadMap: def __init__(self, fig): self.fig = fig - self.box = Box(11, 40, "Roadmap", f"{Action.CANCEL.mapping}:close") + self.box = Box(11, 40, lang.str("ui.roadmap.title"), f"{Action.CANCEL.mapping}:close") self.info_label = se.Text("", state="float") self.box.add_ob(self.info_label, self.box.width-2, 0) for sta, _dict in p_data.stations.items(): @@ -157,8 +158,8 @@ def __call__(self, _map, choose=False): i.poke_args.get("pokes", []) + i.w_poke_args.get("pokes", []))) with InfoBox(liner(self.sta.desc - + "\n\n Here you can find: " + - (p_list if p_list != "" else "Nothing"), + + f"\n\n {lang.str('ui.roadmap.find')} " + + (p_list if p_list != "" else lang.str("ui.dialog.nothing")), 30), self.sta.name, _map=_map): easy_exit_loop() std_loop() diff --git a/pokete_classes/side_loops.py b/pokete_classes/side_loops.py index 751c4e1a..4476f6cf 100644 --- a/pokete_classes/side_loops.py +++ b/pokete_classes/side_loops.py @@ -6,6 +6,7 @@ from pokete_general_use_fns import liner from .loops import easy_exit_loop from .ui_elements import InfoBox, StdFrame +from .language import lang class About: @@ -16,8 +17,7 @@ class About: _map: se.Map this will be displayed on""" def __init__(self, ver, cname, _map): - self.box = InfoBox(liner(f"""Pokete v{ver} -- {cname} -by lxgr-linux + self.box = InfoBox(liner(f"""{lang.str('ui.pokete.title')} This software is licensed under the GPL3, you should have gotten a copy of the GPL3 license alongside this software. Feel free to contribute what ever you want to this game, new Pokete contributions are especially welcome. @@ -38,16 +38,12 @@ class Help(About): def __init__(self, _map): self.map = _map - self.box = InfoBox("""Controls: -'w':up, 'a':left, -'s':down, 'd':right, -'e':menu + self.box = InfoBox(f"""{lang.str('ui.controls.title')}: +'w':{lang.str('ui.help.controls.up')}, 'a':{lang.str('ui.help.controls.left')}, +'s':{lang.str('ui.help.controls.down')}, 'd':{lang.str('ui.help.controls.right')}, +'e':{lang.str('ui.help.controls.menu')} -When walking into the high grass (';') you may get attacked -by wild Poketes, those can be killed or weakened and caught. -NPCs will talk to you when walking up to them. -For more information about how to play this game, check out -https://git.io/JRRqe""", name="Help", _map=self.map) +{lang.str('ui.help.text')}""", name=lang.str("ui.movemap.help"), _map=self.map) class ResizeScreen(): @@ -56,7 +52,7 @@ class ResizeScreen(): def __init__(self): width, height = os.get_terminal_size() self.map = gm.GameMap(height, width) - self.warning_label = se.Text("Minimum windowsize is 70x20") + self.warning_label = se.Text(lang.str("ui.dialog.min_window_size")) self.size_label = se.Text(f"{width}x{height}") self.frame = StdFrame(height - 1, width) self.warning_label.add(self.map, int(width / 2) - 13, diff --git a/pokete_classes/timer.py b/pokete_classes/timer.py index 58be13d4..56d65465 100644 --- a/pokete_classes/timer.py +++ b/pokete_classes/timer.py @@ -7,6 +7,7 @@ from .hotkeys import Action, get_action from .ui_elements import Box from .loops import std_loop +from .language import lang from release import SPEED_OF_TIME time = None @@ -104,7 +105,7 @@ class Clock(Box): def __init__(self, time): self.time = time - super().__init__(9, 28, "Clock", f"{Action.CANCEL.mapping}:close") + super().__init__(9, 28, lang.str("ui.movemap.clock"), f"{Action.CANCEL.mapping}:close") def __call__(self, _map): """Shows the clock From 95de05c71326c05ee7c2b9bff15ca79d14fbb257 Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Fri, 5 Aug 2022 15:34:44 +0200 Subject: [PATCH 07/10] Added more translation stuff and removed hardcoded strings I may have added some additional whitespaces in the used data structures. But I think that is not such a huge problem. --- assets/lang/de_DE.json | 12 +- assets/lang/en_US.json | 478 ++++++++++++++++- pokete_classes/achievements.py | 6 +- pokete_classes/attack.py | 4 +- pokete_classes/dex.py | 2 +- pokete_classes/inv_items.py | 6 +- pokete_classes/landscape.py | 6 +- pokete_classes/npcs.py | 2 +- pokete_classes/poke.py | 4 +- pokete_data/achievements.py | 12 +- pokete_data/attacks.py | 927 +++++++++++++++++++++------------ pokete_data/items.py | 32 +- pokete_data/mapstations.py | 162 +++--- pokete_data/poketes.py | 103 ++-- pokete_data/weather.py | 8 +- 15 files changed, 1267 insertions(+), 497 deletions(-) diff --git a/assets/lang/de_DE.json b/assets/lang/de_DE.json index c9f11b67..4dd19b59 100644 --- a/assets/lang/de_DE.json +++ b/assets/lang/de_DE.json @@ -110,7 +110,7 @@ "dialog.attack.start_fight": "%s hat einen Kampf begonnen!", "dialog.attack.opponent.attack": "%s\n%s benutzt %s gegen dich!", "dialog.attack.opponent.used": "%s benutzt %s!", - "dialog.attack.player.attack": "Du benutzt %s", + "dialog.attack.player.attack": "Du schaffst das %s!", "dialog.attack.player.swap_pokete": "Möchtest du ein anderes Pokete auswählen?", "dialog.attack.player.swap_pokete.confirm": "Du hast %s gewählt", "dialog.attack.player.throw": "Du hast %s geworfen!", @@ -131,9 +131,9 @@ "dialog.attack.xp": "EXP", "dialog.attack.ap": "AP", "dialog.attack.attacks": "Attacken", - "dialog.attack.attack": "Attacke", + "dialog.attack.attack": "Angriff", "dialog.attack.attack_info": "Attacken Info", - "dialog.attack.run": "Fliehen!", + "dialog.attack.run": "Fliehen", "dialog.attack.type": "Typ", "dialog.attack.info": "Info", "dialog.attack.effective": "Das ist sehr effiktiv!", @@ -171,9 +171,9 @@ "trainer.playmap1.franz.lose1": "Hahaha!", "trainer.playmap1.franz.lose2": "You're a loser!", "trainer.playmap1.franz.win": "You're a very good trainer!", - "log.achievements.unlocked": "[Achievements] Unlocked %s", - "log.general.player": "Player", - "log.general.enemy": "Enemy", + "log.achievements.unlocked": "[Achievements] Freigeschaltet %s", + "log.general.player": "Spieler", + "log.general.enemy": "Gegner", "log.effects.add": "[Effect][%s] Added to %s", "log.effects.remove": "[Effect][%s] Removed from %s", "log.fight.ran_away": "[Fight] Ended, ran away", diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json index 3384f7ef..45f43e3e 100644 --- a/assets/lang/en_US.json +++ b/assets/lang/en_US.json @@ -167,10 +167,480 @@ "npc.old_man.hyperball": "A Hyperball!", "npc.old_man.rarest": "It's one of the oldest and rarest of them all.", "npc.old_man.keep": "You can keep it!", - "trainer.playmap1.franz.fight": "Wanna fight?", - "trainer.playmap1.franz.lose1": "Hahaha!", - "trainer.playmap1.franz.lose2": "You're a loser!", - "trainer.playmap1.franz.win": "You're a very good trainer!", + "achievement.first_poke.title": "First Pokete", + "achievement.first_poke.description": "Catch your first Pokete!", + "achievement.first_duel.title": "First duel", + "achievement.first_duel.description": "Fight against your first trainer!", + "achievement.catch_em_all.title": "Catch em all", + "achievement.catch_em_all.description": "Catch all Poketes and fill your Pokete-Dex!", + "attack.tackle.title": "Tackle", + "attack.tackle.description": "Tackles the enemy very hard.", + "attack.cry.title": "Cry", + "attack.cry.description": "So loud that it confuses the enemy.", + "attack.bite.title": "Bite", + "attack.bite.description": "A hard bite with sharp teeth.", + "attack.power_bite.title": "Power Bite", + "attack.power_bite.description": "The hardest bite you can think of.", + "attack.chocer.title": "Choker", + "attack.chocer.description": "Chokes the enemy and makes it weaker.", + "attack.tail_wipe.title": "Tail Swipe", + "attack.tail_wipe.description": "Swipes through the enemy's face.", + "attack.meat_skewer.title": "Meat Skewer", + "attack.meat_skewer.description": "Drills a horn deep in the enemy's flesh.", + "attack.snooze.title": "Snooze", + "attack.snooze.description": "Makes the enemy sleepy.", + "attack.supercow_power.title": "Supercow Power", + "attack.supercow_power.description": "Makes the Pokete angry and strong.", + "attack.poison_bite.title": "Poison Bite", + "attack.poison_bite.description": "Makes the enemy weaker.", + "attack.poison_thorn.title": "Poison Thorn", + "attack.poison_thorn.description": "Stabs a venomous thorn into the enemy's flesh.", + "attack.pepple_fire.title": "Pebble Fire", + "attack.pepple_fire.description": "Fires pebbles at the enemy and makes it blind.", + "attack.sand_throw.title": "Sand Throw", + "attack.sand_throw.description": "Throws sand at the enemy and makes it blind.", + "attack.politure.title": "Polish", + "attack.politure.description": "Upgrades defense and attack points.", + "attack.brick_throw.title": "Brick Throw", + "attack.brick_throw.description": "Throws an Euler brick at the enemy.", + "attack.rock_smash.title": "Rock Smash", + "attack.rock_smash.description": "Pounds the enemy with the Pokete's full weight.", + "attack.dia_stab.title": "Dia Stab", + "attack.dia_stab.description": "Stabs the enemy with a giant diamond spike.", + "attack.dazzle.title": "Dazzle", + "attack.dazzle.description": "Shines a bright light at the enemy and dazzles them.", + "attack.dia_spikes.title": "Dia spikes", + "attack.dia_spikes.description": "Throws a heck of a lot of diamond spikes at the enemy.", + "attack.earch_quake.title": "Earthquake", + "attack.earch_quake.description": "Moves the ground with tremendous force.", + "attack.power_roll.title": "Power Roll", + "attack.power_roll.description": "Rolls over the enemy.", + "attack.toe_breaker.title": "Toe Breaker", + "attack.toe_breaker.description": "Breaks the enemy's toes.", + "attack.ground_hit.title": "Ground Hit", + "attack.ground_hit.description": "Damages the enemy with an unpredictable hit out of the ground.", + "attack.dick_energy.title": "Dick Energy", + "attack.dick_energy.description": "Collects a great amount of energy in the Pokete's tip.", + "attack.hiding.title": "Hiding", + "attack.hiding.description": "Makes the Pokete hide under the ground to minimize damage.", + "attack.fire_bite.title": "Fire Bite", + "attack.fire_bite.description": "Burns and bites the enemy at the same time.", + "attack.ash_throw.title": "Ash Throw", + "attack.ash_throw.description": "Throws ashes in the enemy's eyes.", + "attack.flame_throw.title": "Flame Throw", + "attack.flame_throw.description": "Hans! Get ze Flammenwerfer!", + "attack.fire_ball.title": "Fire Ball", + "attack.fire_ball.description": "Casts a fireball at the enemy.", + "attack.flying.title": "Flying", + "attack.flying.description": "Gives the Pokete the ability to fly you around.", + "attack.pick.title": "Peck", + "attack.pick.description": "A peck at the enemy's weakest spot.", + "attack.wind_blow.title": "Wind Blow", + "attack.wind_blow.description": "Casts a gust of wind at the enemy.", + "attack.storm_gust.title": "Storm Gale", + "attack.storm_gust.description": "Casts a vicious and violent storm full of rain and hail, hitting the enemy in its weakest spots and makes it want to die.", + "attack.schmetter.title": "Schmetter", + "attack.schmetter.description": "Schmetters the enemy away.", + "attack.eye_pick.title": "Eye Peck", + "attack.eye_pick.description": "Pecks at one of the enemy's eyes.", + "attack.wing_hit.title": "Wing Hit", + "attack.wing_hit.description": "Hits the enemy with a wing.", + "attack.brooding.title": "Brooding", + "attack.brooding.description": "Regenerates 2 HP.", + "attack.power_pick.title": "Power Peck", + "attack.power_pick.description": "A harsh pecking on the enemy's head.", + "attack.bubble_gun.title": "Bubble Gun", + "attack.bubble_gun.description": "Fires some bubbles at the enemy.", + "attack.bubble_bomb.title": "Bubble Bomb", + "attack.bubble_bomb.description": "A deadly bubble.", + "attack.bubble_shield.title": "Bubble Shield", + "attack.bubble_shield.description": "Creates a giant bubble that protects the Pokete.", + "attack.wet_slap.title": "Wet Slap", + "attack.wet_slap.description": "Gives the enemy a cold and wet slap in the face.", + "attack.shell_pinch.title": "Shell Pinch", + "attack.shell_pinch.description": "Pinches the enemy with its strong shell.", + "attack.heart_touch.title": "Heart Touch", + "attack.heart_touch.description": "Touches the enemy's heart with cold, ghostly claws.", + "attack.confusion.title": "Confusion", + "attack.confusion.description": "Confuses the enemy.", + "attack.mind_blow.title": "Mind Blow", + "attack.mind_blow.description": "Causes confusion deep in the enemy's mind.", + "attack.shock.title": "Shock", + "attack.shock.description": "Gives the enemy a shock.", + "attack.charging.title": "Charging", + "attack.charging.description": "Charges up the Pokete.", + "attack.mega_arch.title": "Mega Arch", + "attack.mega_arch.description": "Gives the enemy a massive shock.", + "attack.special_smell.title": "Special Smell", + "attack.special_smell.description": "Spreads a special smell that will make the enemy confused but very happy.", + "attack.apple_drop.title": "Apple Drop", + "attack.apple_drop.description": "Makes an apple drop on the enemy's head.", + "attack.super_sucker.title": "Super Sucker", + "attack.super_sucker.description": "Sucks 2 HP from the enemy and adds to its own.", + "attack.sucker.title": "Sucker", + "attack.sucker.description": "Sucks 1 HP from the enemy and adds to its own.", + "attack.root_strangler.title": "Root Strangler", + "attack.root_strangler.description": "Uses old and crusty roots to strangle the enemy.", + "attack.root_slap.title": "Root Slap", + "attack.root_slap.description": "Uses old and crusty roots to slap the enemy.", + "attack.the_old_roots_hit.title": "The Old Roots Hit", + "attack.the_old_roots_hit.description": "An ancient attack that summons the deepest and oldest roots from deep in the earth to defeat the enemy.", + "attack.leaf_storm.title": "Leaf Storm", + "attack.leaf_storm.description": "Blasts a bunch of spiky leaves at the enemy.", + "attack.bark_hardening.title": "Bark Hardening", + "attack.bark_hardening.description": "Hardens its outer layers to protect itself.", + "attack.poison_spores.title": "Poison Spores", + "attack.poison_spores.description": "Ejects some poisonous spores onto the enemy.", + "attack.branch_stab.title": "Branch Stab", + "attack.branch_stab.description": "Stabs the enemy with a branch, preferably in the enemy's eyes.", + "attack.freeze.title": "Freeze", + "attack.freeze.description": "Freezes the enemy.", + "attack.snow_storm.title": "Snow Storm", + "attack.snow_storm.description": "Summons a snow storm full of ice spikes onto the enemy.", + "attack.sword_of_ice.title": "Sword of Ice", + "attack.sword_of_ice.description": "Stabs a giant ice spike into the enemy.", + "attack.spikes.title": "Spikes", + "attack.spikes.description": "Stabs the enemy with some small ice spikes.", + "item.poketeball.title": "Poketeball", + "item.poketeball.description": "A ball you can use to catch Poketes", + "item.superball.title": "Superball", + "item.superball.description": "A ball you can use to catch Poketes with an increased chance", + "item.hyperball.title": "Poketeball", + "item.hyperball.description": "A ball you can use to catch Poketes", + "item.healing_potion.title": "Healing potion", + "item.healing_potion.description": "Heals a Pokete with 5 HP", + "item.super_potion.title": "Super potion", + "item.super_potion.description": "Heals a Pokete with 15 HP", + "item.ap_potion.title": "AP potion", + "item.ap_potion.description": "Refills the Poketes attack APs.", + "item.treat.title": "Treat", + "item.treat.description": "Upgrades a Pokete by a whole level.", + "item.shut_the_fuck_up_stone.title": "'Shut the fuck up' stone", + "item.shut_the_fuck_up_stone.description": "Makes trainer leaving you alone", + "mapstation.playmap_1.description": "A small town.", + "mapstation.cave_1.description": "A dark cave full of batos.", + "mapstation.playmap_2.description": "Part of light areas near Josi Town.", + "mapstation.playmap_3.description": "A small sunny village.", + "mapstation.playmap_4.description": "The shores of the great Sunnydale lake.", + "mapstation.playmap_6.description": "The woodland edge at the foot of a great mountain full of caves.", + "mapstation.playmap_7.description": "A dark and mysterious cave.", + "mapstation.playmap_8.description": "An abandoned fisher village.", + "mapstation.playmap_11.description": "The shore of a lake near an olf fisher village.", + "mapstation.playmap_12.description": "A dense forest near Deepens forest.", + "mapstation.playmap_13.description": "Deepens forest, a big town in the middle of the deepest forest, populated by thousands of people and cultural center of the region.", + "mapstation.playmap_15.description": "A small clearing near Deepens forest.", + "mapstation.playmap_16.description": "A small 'village', that's not even worth talking about.", + "mapstation.playmap_18.description": "A small see at the foot of the Big mountain.", + "mapstation.playmap_19.description": "A dark and big cave in the Big mountain.", + "mapstation.playmap_21.description": "The great Rock-ville is the biggest city in the region around the Big mountain. With the Rocky hotel it's also a tourist hotspot.", + "mapstation.playmap_28.description": "A foggy place full of ghosts and plants.", + "mapstation.playmap_30.description": "With its plant Poketes, Flowy Town may be the greenest spot in the Pokete world and with the great git-tree it may also be one of the most spectacular.", + "mapstation.playmap_33.description": "Part of the great agracultural landscape near Agrawos.", + "mapstation.playmap_35.description": "Part of the great agracultural landscape near Agrawos.", + "mapstation.playmap_40.description": "A Great beach, with great weather, always.", + "mapstation.playmap_39.description": "The great city of Agrawos, agricultural and cultural center of the whole region. It's famous for its great Pokete-Arena and its master trainer. Check out the MowCow-Burger restaurant, which offers the best, juiciest and most delicious Mowcow-burgers, cut from the happiest and most delicious Mowcows anywhere to find!", + "pokete.__fallback__.name": "", + "pokete.__fallback__.description": "", + "pokete.steini.name": "Steini", + "pokete.steini.description": "A squared stone that can be readily found just lying around.", + "pokete.mowcow.name": "Mowcow", + "pokete.mowcow.description": "A cow-like creature found in meadows.", + "pokete.bigstone.name": "Bigstone", + "pokete.bigstone.description": "A big and heavy stone made from one of the hardest materials.", + "pokete.poundi.name": "Poundi", + "pokete.poundi.description": "A powerful and heavy stone Pokete that lives in mountain caves.", + "pokete.lilstone.name": "Lilstone", + "pokete.lilstone.description": "A small but powerful stone Pokete that lives in the mountains.", + "pokete.rosi.name": "Rosi", + "pokete.rosi.description": "A plant Pokete that's often mistaken for a normal flower.", + "pokete.wheeto.name": "Wheeto", + "pokete.wheeto.description": "A plant Pokete found in Agrawos; it has special 'Powers'.", + "pokete.saugh.name": "Saugh", + "pokete.saugh.description": "The dark and fiery souls of those who got burned to death by the hot sun!", + "pokete.gobost.name": "Gobost", + "pokete.gobost.description": "A scary ghost Pokete that lives in caves and old houses.", + "pokete.angrilo.name": "Angrilo", + "pokete.angrilo.description": "A ghost Pokete that will scare your pants off.", + "pokete.vogli.name": "Vogli", + "pokete.vogli.description": "A very common bird Pokete; it lives everywhere.", + "pokete.voglo.name": "Voglo", + "pokete.voglo.description": "A very aggressive bird Pokete that can only be found in the woods.", + "pokete.voglus.name": "Voglus", + "pokete.voglus.description": "A very aggressive and hard to find bird Pokete.", + "pokete.ostri.name": "Ostri", + "pokete.ostri.description": "A very aggressive bird Pokete that lives near deserts; \nit will try to peck out your eyes.", + "pokete.karpi.name": "Karpi", + "pokete.karpi.description": "A harmless water Pokete that can be found everywhere.", + "pokete.würgos.name": "Würgos", + "pokete.würgos.description": "A dangerous snake Pokete.", + "pokete.choka.name": "Choka", + "pokete.choka.description": "A fucking dangerous and enormous snake Pokete.", + "pokete.treenator.name": "Treenator", + "pokete.treenator.description": "A scary and dangerous apple tree.", + "pokete.bato.name": "Bato", + "pokete.bato.description": "An annoying flying rat.", + "pokete.bator.name": "Bator", + "pokete.bator.description": "A chongus flying rat.", + "pokete.blub.name": "Blub", + "pokete.blub.description": "Very delicious and low fat water Pokete.", + "pokete.owol.name": "Owol", + "pokete.owol.description": "A nocturnal Pokete that is looking for small children to eat as a midnight snack.", + "pokete.rato.name": "Rato", + "pokete.rato.description": "An annoying rat.", + "pokete.ratatat.name": "Ratatat", + "pokete.ratatat.description": "A damn dangerous and enourmous rat; it will bite of your leg.", + "pokete.hornita.name": "Hornita", + "pokete.hornita.description": "A majestic horse that is always looking for something to pick with its horn.", + "pokete.horny.name": "Horny", + "pokete.horny.description": "A teenage unicorn in the middle of puberty.", + "pokete.bushy.name": "Bushy", + "pokete.bushy.description": "A bush, and just a bush. But watch out!", + "pokete.wolfior.name": "Wolfior", + "pokete.wolfior.description": "A fiery wolf straight from hell that likes to burn 11 years old butts off.", + "pokete.wolfiro.name": "Wolfiro", + "pokete.wolfiro.description": "A fiery wolf from hell on steroids.", + "pokete.rollator.name": "Rollator", + "pokete.rollator.description": "A big chunk of stone and dirt that rolls around.", + "pokete.clampi.name": "Clampi", + "pokete.clampi.description": "A shell that lives deep in the sea or near bays; it's pretty hard to crack.", + "pokete.crabbat.name": "Crabbat", + "pokete.crabbat.description": "A crusty Pokete that loves to pinch big toes.", + "pokete.rustacean.name": "Rustacean", + "pokete.rustacean.description": "A crusty Pokete that will pinch your toes and check whether \nor not you borrowed something.", + "pokete.electrode.name": "Electrode", + "pokete.electrode.description": "A small floating ball that will give you a shock.", + "pokete.cubl.name": "Cubl", + "pokete.cubl.description": "A small ice cube.", + "pokete.spikl.name": "Spikl", + "pokete.spikl.description": "A block of ice.", + "pokete.confuso.name": "Confuso", + "pokete.confuso.description": "A ball floating around in dark woods and caves, \nthat will confuse the shit out of you.", + "pokete.poisopla.name": "Poisopla", + "pokete.poisopla.description": "A unsuspicious plant.", + "pokete.megapois.name": "Megapois", + "pokete.megapois.description": "A not at all suspicious plant.", + "pokete.corcos_day.name": "Corcos", + "pokete.corcos_day.description": "A small heavy thing that can be found on the ground; it may reveal something wonderful later.", + "pokete.corcos_night.name": "Corcos", + "pokete.corcos_night.description": "A small heavy thing that can be found on the ground; it may reveal something wonderful later.", + "pokete.raupathor_day.name": "Raupathor", + "pokete.raupathor_day.description": "A small caterpillar found on leaves.", + "pokete.raupathor_night.name": "Raupathor", + "pokete.raupathor_night.description": "A small caterpillar found on leaves.", + "pokete.schmetterling.name": "Schmetterling", + "pokete.schmetterling.description": "A butterfly that will schmetter you away.", + "pokete.mothor.name": "Mothor", + "pokete.mothor.description": "A dark butterfly that will schmetter you away.", + "pokete.lil_nut.name": "Lil Nut", + "pokete.lil_nut.description": "A very small whatever that sticks out of the ground.", + "pokete.dicki.name": "Dicki", + "pokete.dicki.description": "A little whatever that sticks out of the ground.", + "pokete.dicko.name": "Dicko", + "pokete.dicko.description": "An even bigger whatever that sticks out of the ground.", + "pokete.diamondos.name": "Diamondos", + "pokete.diamondos.description": "A precious diamond that can only be found in the darkest caves.", + "trainer.playmap_1.franz.dialog1": "Wanna fight?", + "trainer.playmap_1.franz.lose1": "Hahaha!", + "trainer.playmap_1.franz.lose2": "You're a loser!", + "trainer.playmap_1.franz.win1": "You're a very good trainer!", + "trainer.cave_1.monica.dialog1": "Hello, noble traveler", + "trainer.cave_1.monica.dialog2": "Are you willing to fight me?", + "trainer.cave_1.monica.lose1": "Hahaha!", + "trainer.cave_1.monica.lose2": "Looooser!", + "trainer.cave_1.monica.win1": "Congratulations!", + "trainer.cave_1.monica.win2": "Have a great day!", + "trainer.playmap_2.wanderer_murrad.dialog1": "Isn't it a great day?", + "trainer.playmap_2.wanderer_murrad.dialog2": "I traveled here from a distant country", + "trainer.playmap_2.wanderer_murrad.dialog3": "Do you want to fight against my rare Pokete?", + "trainer.playmap_2.wanderer_murrad.lose": "It is stronger than you might have expected", + "trainer.playmap_2.wanderer_murrad.win1": "Oh, I didn't think you could defeat my Pokete!", + "trainer.playmap_2.wanderer_murrad.win2": "You are a very good trainer!", + "trainer.playmap_3.markus.dialog1": "Hey!", + "trainer.playmap_3.markus.dialog2": "Welcome to Sunnydale!", + "trainer.playmap_3.markus.dialog3": "But first, we must fight!", + "trainer.playmap_3.markus.lose1": "Hahaha!", + "trainer.playmap_3.markus.lose2": "Hahaha!", + "trainer.playmap_3.markus.lose3": "You're a loser!", + "trainer.playmap_3.markus.win1": "Damn, I lost!", + "trainer.playmap_4.kevin.dialog1": "Yo!", + "trainer.playmap_4.kevin.dialog2": "Whaddup?", + "trainer.playmap_4.kevin.dialog3": "Wanna see my sick-ass Pokete?", + "trainer.playmap_4.kevin.lose1": "Yeaaah!", + "trainer.playmap_4.kevin.lose2": "My Pokete is sooo sick!", + "trainer.playmap_4.kevin.win1": "Daaaamn", + "trainer.playmap_4.kevin.win2": "Your Pokete is nooot from this planet!", + "trainer.playmap_5.caveman_marc.dialog1": "Oh!", + "trainer.playmap_5.caveman_marc.dialog2": "I haven't seen anyone down here for a while", + "trainer.playmap_5.caveman_marc.dialog3": "Can I show you my rare Pokete which can only be found in this cave?", + "trainer.playmap_5.caveman_marc.lose1": "Oh!", + "trainer.playmap_5.caveman_marc.lose2": "My Pokete is not just rare", + "trainer.playmap_5.caveman_marc.lose3": "It's also strong", + "trainer.playmap_5.caveman_marc.win1": "Congratulations!", + "trainer.playmap_5.caveman_marc.win2": "I hope you can also catch one!", + "trainer.playmap_6.eva.dialog1": "Hi!", + "trainer.playmap_6.eva.dialog2": "Fight?", + "trainer.playmap_6.eva.lose1": "Loser", + "trainer.playmap_6.eva.win1": "I lost!", + "trainer.playmap_7.caveman_dieter.dialog1": "Oh!", + "trainer.playmap_7.caveman_dieter.dialog2": "I didn't see you coming", + "trainer.playmap_7.caveman_dieter.lose1": "My Steini is old but classy", + "trainer.playmap_7.caveman_dieter.win1": "You're a great trainer!", + "trainer.playmap_8.woodsman_bert.dialog1": "Do you see this abandoned house?", + "trainer.playmap_8.woodsman_bert.dialog2": "I caught this Pokete in there!", + "trainer.playmap_8.woodsman_bert.lose1": "It's pretty cool huh?!", + "trainer.playmap_8.woodsman_bert.win1": "Oh, yours is better than mine!", + "trainer.playmap_11.fishermans_friend.dialog1": "G'day, young trainer", + "trainer.playmap_11.fishermans_friend.dialog2": "I've lived here for years", + "trainer.playmap_11.fishermans_friend.lose1": "Those years of training were worth it", + "trainer.playmap_11.fishermans_friend.win1": "I haven't trained my Pokete in years!", + "trainer.playmap_12.brother_justin.dialog1": "Hey, my brother and I want to fight!", + "trainer.playmap_12.brother_justin.lose1": "Haha, you're bad!", + "trainer.playmap_12.brother_justin.win1": "Damn!", + "trainer.playmap_12.brother_justus.dialog1": "Now it's my turn!", + "trainer.playmap_12.brother_justus.lose1": "Haha, you're bad!", + "trainer.playmap_12.brother_justus.win1": "Damn!", + "trainer.playmap_13.citizen.dialog1": "Hello, fellow stranger!", + "trainer.playmap_13.citizen.dialog2": "This town is known for its bird Poketes", + "trainer.playmap_13.citizen.lose1": "Haha, you're bad!", + "trainer.playmap_13.citizen.win1": "Damn!", + "trainer.playmap_14.first_trainer.dialog1": "Welcome to the Deepest Forest Pokete Arena", + "trainer.playmap_14.first_trainer.dialog2": "I'm your first enemy!", + "trainer.playmap_14.first_trainer.lose1": "Haha, you're bad!", + "trainer.playmap_14.first_trainer.win1": "Good luck!", + "trainer.playmap_14.second_trainer.dialog1": "Now it's my turn!", + "trainer.playmap_14.second_trainer.lose1": "Haha, you're bad!", + "trainer.playmap_14.second_trainer.win1": "Good luck with the next trainer!", + "trainer.playmap_14.third_trainer.dialog1": "Let's see what other Poketes you have!", + "trainer.playmap_14.third_trainer.lose1": "Haha, you're bad!", + "trainer.playmap_14.third_trainer.win1": "Good luck with the last trainer!", + "trainer.playmap_14.last_trainer.dialog1": "I'm your last enemy!", + "trainer.playmap_14.last_trainer.lose1": "Haha, you're bad!", + "trainer.playmap_14.last_trainer.win1": "Oh!", + "trainer.playmap_14.last_trainer.win2": "You were able to defeat me?", + "trainer.playmap_14.last_trainer.win3": "You can now leave Deepest Forest", + "trainer.playmap_15.samantha.dialog1": "Hey, you!", + "trainer.playmap_15.samantha.dialog2": "My Pokete is very effective against bird Poketes", + "trainer.playmap_15.samantha.lose1": "You see, it's effective", + "trainer.playmap_15.samantha.win1": "Oh no", + "trainer.playmap_15.samantha.win2": "I guess yours is even more effective than mine!", + "trainer.playmap_15.jessica.dialog1": "Hey you!", + "trainer.playmap_15.jessica.lose1": "Haha, you're a loser!", + "trainer.playmap_15.jessica.win1": "Oh no", + "trainer.playmap_18.bert.dialog1": "Hey!", + "trainer.playmap_18.bert.dialog2": "This region is full of stone and ground Poketes", + "trainer.playmap_18.bert.lose1": "Haha, you're bad!", + "trainer.playmap_18.bert.win1": "Oh, I lost!", + "trainer.playmap_18.karen.dialog1": "I don't think you can walk here", + "trainer.playmap_18.karen.dialog2": "I demand a fight with you!", + "trainer.playmap_18.karen.lose1": "Go home, little zoomer.", + "trainer.playmap_18.karen.win1": "I want to talk to your manager!", + "trainer.playmap_19.brian.dialog1": "Hello fellow cave diver!", + "trainer.playmap_19.brian.lose1": "Oooooh!", + "trainer.playmap_19.brian.lose2": "You're a loooser!", + "trainer.playmap_19.brian.win1": "Oh!", + "trainer.playmap_19.brian.win2": "You were lucky!", + "trainer.playmap_19.simon.dialog1": "Yoooo!", + "trainer.playmap_19.simon.dialog2": "What's up?", + "trainer.playmap_19.simon.lose1": "You're a loooser!", + "trainer.playmap_19.simon.win1": "Duck!", + "trainer.playmap_21.rock_hard_rick.dialog1": "Hello trainer!", + "trainer.playmap_21.rock_hard_rick.dialog2": "Welcome to Rock-ville, the highest place in the Pokete world and home of all stone Poketes.", + "trainer.playmap_21.rock_hard_rick.dialog3": "When leaving this town through the 'Cave of Doom' you have to fight against the best trainers of this town.", + "trainer.playmap_21.rock_hard_rick.dialog4": "But first, you have to fight me!", + "trainer.playmap_21.rock_hard_rick.lose1": "If I'm a problem for you, you might not be able to fight the other trainers.", + "trainer.playmap_21.rock_hard_rick.win1": "Oh", + "trainer.playmap_21.rock_hard_rick.win2": "I guess you will be a challenge for our trainers!", + "trainer.playmap_27.bertold.dialog1": "We are the elite of Rock-ville!", + "trainer.playmap_27.bertold.lose1": "You're a loooser!", + "trainer.playmap_27.bertold.win1": "You were lucky!", + "trainer.playmap_27.gerard.dialog1": "My Steini will rip out your Pokete's heart!", + "trainer.playmap_27.gerard.lose1": "You're a loooser!", + "trainer.playmap_27.gerard.win1": "The other trainers wont be as easy!", + "trainer.playmap_27.jessica.dialog1": "You wont be ready for my Treenator!", + "trainer.playmap_27.jessica.lose1": "You're a loooser!", + "trainer.playmap_27.jessica.win1": "Our best trainer will defeat you though!", + "trainer.playmap_27.first_trainer.dialog1": "Let's have a fair fight!", + "trainer.playmap_27.first_trainer.lose1": "You're a loooser!", + "trainer.playmap_27.first_trainer.win1": "I wish you the best luck on your journey!", + "trainer.playmap_28.steven_the_big.dialog1": "I don't think you ever met an Electrode!", + "trainer.playmap_28.steven_the_big.lose1": "You're a loooser!", + "trainer.playmap_28.steven_the_big.win1": "Hmph!", + "trainer.playmap_28.steven_the_big.win2": "It's not as great as I thought!", + "trainer.playmap_28.laurena.dialog1": "I trained my Steini for years to get to this level", + "trainer.playmap_28.laurena.dialog2": "I will win!", + "trainer.playmap_28.laurena.lose1": "You're a loooser!", + "trainer.playmap_28.laurena.win1": "Ohhh nooo!", + "trainer.playmap_28.laurena.win2": "NOT MY STEINI!!!1!!1", + "trainer.playmap_28.laurin.dialog1": "Poisopla is one of the strongest local Poketes!", + "trainer.playmap_28.laurin.dialog2": "And it will kill your lame Pokete!", + "trainer.playmap_28.laurin.lose1": "You're a loooser!", + "trainer.playmap_28.laurin.win1": "It won't be as easy in 'Flowy Town'!", + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.dialog1": "You have to beat my Pokete to enter 'Flowy Town'", + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.dialog2": "I guess it'll confuse you!", + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.lose1": "You're a loooser!", + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.win1": "I wish you the best of luck in 'Flowy Town'!", + "trainer.playmap_30.guy_at_the_entrance.dialog1": "Welcome to 'Flowy Town', home of the flowers.", + "trainer.playmap_30.guy_at_the_entrance.lose1": "You're a loooser!", + "trainer.playmap_30.guy_at_the_entrance.win1": "I wish you the best of luck fighting against our best trainers!", + "trainer.playmap_31.luther.dialog1": "Welcome to the 'Flowy Town' Arena!", + "trainer.playmap_31.luther.lose1": "You're a loooser!", + "trainer.playmap_31.luther.win1": "You were lucky!", + "trainer.playmap_31.heavy_hans.dialog1": "I don't think your Pokete is better than mine!", + "trainer.playmap_31.heavy_hans.lose1": "Your journey came to a fast end!", + "trainer.playmap_31.heavy_hans.win1": "The other trainers wont be as easy!", + "trainer.playmap_31.aurelia.dialog1": "You wont be ready for my Treenator!", + "trainer.playmap_31.aurelia.lose1": "You're a loooser!", + "trainer.playmap_31.aurelia.win1": "Our best trainer will defeat you though!", + "trainer.playmap_31.master_of_the_flowers.dialog1": "I'm the Master of the plants and I have one of the rarest plant Poketes!", + "trainer.playmap_31.master_of_the_flowers.lose1": "You're a loooser!", + "trainer.playmap_31.master_of_the_flowers.win1": "This was unfortunate!", + "trainer.playmap_33.cowsay.dialog1": "This apt has supercow-powers!", + "trainer.playmap_33.cowsay.lose1": "You're a loooser!", + "trainer.playmap_33.cowsay.win1": "I hope you'll also catch one!!", + "trainer.playmap_35.farmer_gert.dialog1": "Welcome to the fields of Agrawos!", + "trainer.playmap_35.farmer_gert.dialog2": "This is the farming part of the city of Agrawos!", + "trainer.playmap_35.farmer_gert.dialog3": "You have to pass my field to reach Agrawos!", + "trainer.playmap_35.farmer_gert.lose1": "I don't think you'll ever get there!", + "trainer.playmap_35.farmer_gert.win1": "Have fun in Agrawos!", + "trainer.playmap_35.farmer_doora.dialog1": "This is a cool Pokete I found on my field!", + "trainer.playmap_35.farmer_doora.lose1": "It's cool, innit?!", + "trainer.playmap_35.farmer_doora.win1": "I guess have still have to train it. :(", + "trainer.playmap_35.farmer_ralf.dialog1": "DIE!", + "trainer.playmap_35.farmer_ralf.lose1": "HAHAHA, IM BETTER THAN YOU!", + "trainer.playmap_35.farmer_ralf.win1": "NOOOOOO; WHYYY ARE YOU BETTER ??!!!1!!!111", + "trainer.playmap_39.gardener_angela.dialog1": "Have you already fought our lead trainer?", + "trainer.playmap_39.gardener_angela.dialog2": "If so, look at this cool Pokete!", + "trainer.playmap_39.gardener_angela.lose1": "You're a loooser!", + "trainer.playmap_39.gardener_angela.win1": "Cool, huh?", + "trainer.playmap_40.angler_gustav.dialog1": "My Pokete will blow you away!", + "trainer.playmap_40.angler_gustav.lose1": "You're a loooser!", + "trainer.playmap_40.angler_gustav.win1": "Cool, huh?", + "trainer.playmap_41.farmer_daniel.dialog1": "Howdy, partner!", + "trainer.playmap_41.farmer_daniel.dialog2": "How ya doin?", + "trainer.playmap_41.farmer_daniel.dialog3": "My Pokete is one of a kind", + "trainer.playmap_41.farmer_daniel.dialog4": "The good stuff!", + "trainer.playmap_41.farmer_daniel.lose1": "Uhhh yeah!", + "trainer.playmap_41.farmer_daniel.lose2": "The good stuff...!", + "trainer.playmap_41.farmer_daniel.win1": "I guess it's not the good stuff", + "trainer.playmap_46.farmer_martin.dialog1": "Howdy, partner!", + "trainer.playmap_46.farmer_martin.dialog2": "I will be your first challenger!", + "trainer.playmap_46.farmer_martin.lose1": "You'll do better next time.", + "trainer.playmap_46.farmer_martin.win1": "I wish you the best of luck", + "trainer.playmap_46.the_undetermined.dialog1": "I see you're not as bad as we thought!", + "trainer.playmap_46.the_undetermined.lose1": "You'll do better next time.", + "trainer.playmap_46.the_undetermined.win1": "I wish you the best of luck", + "trainer.playmap_46.gardener_daniela.dialog1": "Look at my newest creation!", + "trainer.playmap_46.gardener_daniela.lose1": "You'll do better next time.", + "trainer.playmap_46.gardener_daniela.win1": "I wish you the best of luck", + "trainer.playmap_46.leader_sebastian.dialog1": "So, I'll be your last opponent.", + "trainer.playmap_46.leader_sebastian.dialog2": "Let's have a fair fight!", + "trainer.playmap_46.leader_sebastian.lose1": "You'll do better next time.", + "trainer.playmap_46.leader_sebastian.win1": "You're quite a good trainer.", + "trainer.playmap_46.leader_sebastian.win2": "Hopefully you can beat all other trainers with whom you may cross paths!", + "weather.rain.info": "It's raining!", + "weather.thunderstorm.info": "There is a thunderstorm going on!", + "weather.foggy.info": "It's foggy!", + "weather.sunny.info": "It's a hot sunny day!", "log.achievements.unlocked": "[Achievements] Unlocked %s", "log.general.player": "Player", "log.general.enemy": "Enemy", diff --git a/pokete_classes/achievements.py b/pokete_classes/achievements.py index 53f7c972..8e27fc6a 100644 --- a/pokete_classes/achievements.py +++ b/pokete_classes/achievements.py @@ -26,8 +26,8 @@ class Achievement: def __init__(self, identifier, title, desc): self.identifier = identifier - self.title = title - self.desc = desc + self.title = lang.str(title) + self.desc = lang.str(desc) class Achievements: @@ -94,7 +94,7 @@ class AchievementOverview(BetterChooseBox): """Overview for Achievements""" def __init__(self): - super().__init__(4, [se.Text(" ")], name="ui.achievements.title") + super().__init__(4, [se.Text(" ")], name=lang.str("ui.achievements.title")) def __call__(self, _map): """Input loop diff --git a/pokete_classes/attack.py b/pokete_classes/attack.py index 945e5955..a9746530 100644 --- a/pokete_classes/attack.py +++ b/pokete_classes/attack.py @@ -19,14 +19,14 @@ class Attack: def __init__(self, index, pref=""): inf = attacks[index] # Attributes - self.name = inf["name"] + self.name = lang.str(inf["name"]) self.factor = inf["factor"] self.action = inf["action"] self.world_action = inf["world_action"] self.move = inf["move"] self.miss_chance = inf["miss_chance"] self.min_lvl = inf["min_lvl"] - self.desc = inf["desc"] + self.desc = lang.str(inf["desc"]) self.effect = inf["effect"] self.is_generic = inf["is_generic"] self.ap = inf["ap"] diff --git a/pokete_classes/dex.py b/pokete_classes/dex.py index 36c6fa5d..3d5e3a71 100644 --- a/pokete_classes/dex.py +++ b/pokete_classes/dex.py @@ -85,7 +85,7 @@ def __call__(self): sorted([(pokes[j]["types"][0], j, pokes[j]) for j in list(pokes)[1:]])} self.obs = [se.Text(f"{i + 1} \ -{p_dict[poke]['name'] if poke in self.figure.caught_pokes else '???'}", +{lang.str(p_dict[poke]['name']) if poke in self.figure.caught_pokes else '???'}", state="float") for i, poke in enumerate(p_dict)] self.add_c_obs() diff --git a/pokete_classes/inv_items.py b/pokete_classes/inv_items.py index 4980a444..a4da1788 100644 --- a/pokete_classes/inv_items.py +++ b/pokete_classes/inv_items.py @@ -28,9 +28,9 @@ class InvItem: fn: The associated method name in FightItems""" def __init__(self, name, pretty_name, desc, price, fn=None): - self.name = name + self.name = lang.str(name) self.pretty_name = pretty_name - self.desc = desc + self.desc = lang.str(desc) self.price = price self.fn = fn @@ -41,7 +41,7 @@ class LearnDisc(InvItem): attack_name: The name of the attack being taught""" def __init__(self, attack_name): - self.attack_name = attack_name + self.attack_name = lang.str(attack_name) self.attack_dict = p_data.attacks[attack_name] pretty_name = f"{lang.str('dialog.inventory.prefix_ld_disk')}-{self.attack_dict['name']}" name = f"ld_{attack_name}" diff --git a/pokete_classes/landscape.py b/pokete_classes/landscape.py index 79b45ec2..02777d67 100644 --- a/pokete_classes/landscape.py +++ b/pokete_classes/landscape.py @@ -151,9 +151,11 @@ def action(self, ob): mvp.movemap.full_show() if amount > 1: - text_string = lang.str("dialog.walk.collected_item.plural") % (amount, p_data.items[item]['pretty_name']) + text_string = lang.str("dialog.walk.collected_item.plural") % \ + lang.str((amount, p_data.items[item]['pretty_name'])) else: - text_string = lang.str("dialog.walk.collected_item.singular") % p_data.items[item]['pretty_name'] + text_string = lang.str("dialog.walk.collected_item.singular") % \ + lang.str(p_data.items[item]['pretty_name']) ask_ok(mvp.movemap, text_string) self.figure.used_npcs.append(self.name) diff --git a/pokete_classes/npcs.py b/pokete_classes/npcs.py index cf9d8d01..1b0b6e15 100644 --- a/pokete_classes/npcs.py +++ b/pokete_classes/npcs.py @@ -57,7 +57,7 @@ def get(cls, name): def __init__(self, name, texts, fn=None, chat=None, side_trigger=True): super().__init__(0, 0) - self.name = name + self.name = lang.str(name) self.texts = texts self.__fn = fn if chat is None: diff --git a/pokete_classes/poke.py b/pokete_classes/poke.py index 09f13628..04364270 100644 --- a/pokete_classes/poke.py +++ b/pokete_classes/poke.py @@ -48,7 +48,7 @@ def __init__(self, poke, xp, _hp="SKIP", _ap=None, _attacks=None, self.defense = 0 self.initiative = 0 self.hp = self.inf["hp"] - self.name = self.inf["name"] + self.name = lang.str(self.inf["name"]) self.miss_chance = self.inf["miss_chance"] self.lose_xp = self.inf["lose_xp"] self.evolve_poke = self.inf["evolve_poke"] @@ -77,7 +77,7 @@ def __init__(self, poke, xp, _hp="SKIP", _ap=None, _attacks=None, # Labels self.hp_bar = HealthBar(self) self.hp_bar.make(self.hp) - self.desc = se.Text(liner(self.inf["desc"], se.screen_width - 34)) + self.desc = se.Text(liner(lang.str(self.inf["desc"]), se.screen_width - 34)) self.ico = se.Box(4, 11) for ico in self.inf["ico"]: esccode = (str.join("", [getattr(Color, i) for i in ico["esc"]]) diff --git a/pokete_data/achievements.py b/pokete_data/achievements.py index 7267b416..e59eb76a 100644 --- a/pokete_data/achievements.py +++ b/pokete_data/achievements.py @@ -2,15 +2,15 @@ achievements = { "first_poke": { - "title": "First Pokete", - "desc": "Catch your first Pokete!" + "title": "achievement.first_poke.title", + "desc": "achievement.first_poke.description" }, "first_duel": { - "title": "First duel", - "desc": "Fight against your first trainer!" + "title": "achievement.first_duel.title", + "desc": "achievement.first_duel.description" }, "catch_em_all": { - "title": "Catch em all", - "desc": "Catch all Poketes and fill your Pokete-Dex!" + "title": "achievement.catch_em_all.title", + "desc": "achievement.catch_em_all.description" }, } diff --git a/pokete_data/attacks.py b/pokete_data/attacks.py index b278cd31..5d6bf3c4 100644 --- a/pokete_data/attacks.py +++ b/pokete_data/attacks.py @@ -1,914 +1,1189 @@ attacks = { # normal attacks "tackle": { - "name": "Tackle", - "factor": 3 / 2, + "name": "attack.tackle.title", + "factor": 1.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Tackles the enemy very hard.", - "types": ["normal"], + "desc": "attack.tackle.description", + "types": [ + "normal" + ], "effect": None, "is_generic": True, - "ap": 30, + "ap": 30 }, "cry": { - "name": "Cry", + "name": "attack.cry.title", "factor": 0, "action": "cry", "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "So loud that it confuses the enemy.", - "types": ["normal"], + "desc": "attack.cry.description", + "types": [ + "normal" + ], "effect": None, "is_generic": False, - "ap": 10, + "ap": 10 }, "bite": { - "name": "Bite", + "name": "attack.bite.title", "factor": 1.75, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 0, - "desc": "A hard bite with sharp teeth.", - "types": ["normal"], + "desc": "attack.bite.description", + "types": [ + "normal" + ], "effect": None, "is_generic": False, - "ap": 30, + "ap": 30 }, "power_bite": { - "name": "Power Bite", + "name": "attack.power_bite.title", "factor": 8, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 30, - "desc": "The hardest bite you can think of.", - "types": ["normal"], + "desc": "attack.power_bite.description", + "types": [ + "normal" + ], "effect": None, "is_generic": False, - "ap": 5, + "ap": 5 }, "chocer": { - "name": "Choker", + "name": "attack.chocer.title", "factor": 1, "action": "chocer", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Chokes the enemy and makes it weaker.", - "types": ["normal", "snake"], + "desc": "attack.chocer.description", + "types": [ + "normal", + "snake" + ], "effect": "paralyzation", "is_generic": True, - "ap": 15, + "ap": 15 }, "tail_wipe": { - "name": "Tail Swipe", + "name": "attack.tail_wipe.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.5, "min_lvl": 10, - "desc": "Swipes through the enemy's face.", - "types": ["normal"], + "desc": "attack.tail_wipe.description", + "types": [ + "normal" + ], "effect": None, "is_generic": False, - "ap": 10, + "ap": 10 }, "meat_skewer": { - "name": "Meat Skewer", + "name": "attack.meat_skewer.title", "factor": 3.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.7, "min_lvl": 0, - "desc": "Drills a horn deep in the enemy's flesh.", - "types": ["normal"], + "desc": "attack.meat_skewer.description", + "types": [ + "normal" + ], "effect": None, "is_generic": False, - "ap": 10, + "ap": 10 }, "snooze": { - "name": "Snooze", + "name": "attack.snooze.title", "factor": 0, "action": "snooze", "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 15, - "desc": "Makes the enemy sleepy.", - "types": ["normal"], + "desc": "attack.snooze.description", + "types": [ + "normal" + ], "effect": "sleep", "is_generic": False, - "ap": 15, + "ap": 15 }, "supercow_power": { - "name": "Supercow Power", + "name": "attack.supercow_power.title", "factor": 0, "action": "self.atc += 1", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 10, - "desc": "Makes the Pokete angry and strong.", - "types": ["normal"], + "desc": "attack.supercow_power.description", + "types": [ + "normal" + ], "effect": None, "is_generic": False, - "ap": 10, + "ap": 10 }, # poison attacks "poison_bite": { - "name": "Poison Bite", + "name": "attack.poison_bite.title", "factor": 1, "action": None, "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.3, "min_lvl": 0, - "desc": "Makes the enemy weaker.", - "types": ["poison", "snake"], + "desc": "attack.poison_bite.description", + "types": [ + "poison", + "snake" + ], "effect": "poison", "is_generic": True, - "ap": 10, + "ap": 10 }, "poison_thorn": { - "name": "Poison Thorn", + "name": "attack.poison_thorn.title", "factor": 2.75, "action": None, "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.1, "min_lvl": 15, - "desc": "Stabs a venomous thorn into the enemy's flesh.", - "types": ["poison"], + "desc": "attack.poison_thorn.description", + "types": [ + "poison" + ], "effect": "poison", "is_generic": False, - "ap": 20, + "ap": 20 }, # stone attacks "pepple_fire": { - "name": "Pebble Fire", + "name": "attack.pepple_fire.title", "factor": 1, "action": "cry", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Fires pebbles at the enemy and makes it blind.", - "types": ["stone"], + "desc": "attack.pepple_fire.description", + "types": [ + "stone" + ], "effect": None, "is_generic": True, - "ap": 5, + "ap": 5 }, "sand_throw": { - "name": "Sand Throw", + "name": "attack.sand_throw.title", "factor": 1, "action": "cry", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Throws sand at the enemy and makes it blind.", - "types": ["stone"], + "desc": "attack.sand_throw.description", + "types": [ + "stone" + ], "effect": None, "is_generic": False, - "ap": 5, + "ap": 5 }, "politure": { - "name": "Polish", + "name": "attack.politure.title", "factor": 0, "action": "politure", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Upgrades defense and attack points.", - "types": ["stone"], + "desc": "attack.politure.description", + "types": [ + "stone" + ], "effect": None, "is_generic": True, - "ap": 15, + "ap": 15 }, "brick_throw": { - "name": "Brick Throw", + "name": "attack.brick_throw.title", "factor": 2, "action": None, "world_action": "", - "move": ["throw"], + "move": [ + "throw" + ], "miss_chance": 0.3, "min_lvl": 15, - "desc": "Throws an Euler brick at the enemy.", - "types": ["stone"], + "desc": "attack.brick_throw.description", + "types": [ + "stone" + ], "effect": None, "is_generic": True, - "ap": 20, + "ap": 20 }, "rock_smash": { - "name": "Rock Smash", + "name": "attack.rock_smash.title", "factor": 5, "action": None, "world_action": "", - "move": ["pound"], + "move": [ + "pound" + ], "miss_chance": 0.1, "min_lvl": 15, - "desc": "Pounds the enemy with the Pokete's full weight.", - "types": ["stone"], + "desc": "attack.rock_smash.description", + "types": [ + "stone" + ], "effect": None, "is_generic": True, - "ap": 5, + "ap": 5 }, "dia_stab": { - "name": "Dia Stab", + "name": "attack.dia_stab.title", "factor": 5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 15, - "desc": "Stabs the enemy with a giant diamond spike.", - "types": ["stone"], + "desc": "attack.dia_stab.description", + "types": [ + "stone" + ], "effect": None, "is_generic": False, - "ap": 5, + "ap": 5 }, "dazzle": { - "name": "Dazzle", + "name": "attack.dazzle.title", "factor": 1.5, "action": None, "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 10, - "desc": "Shines a bright light at the enemy and dazzles them.", - "types": ["stone"], + "desc": "attack.dazzle.description", + "types": [ + "stone" + ], "effect": "paralyzation", "is_generic": False, - "ap": 20, + "ap": 20 }, "dia_spikes": { - "name": "Dia spikes", + "name": "attack.dia_spikes.title", "factor": 2, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0, "min_lvl": 20, - "desc": "Throws a heck of a lot of diamond spikes at the enemy.", - "types": ["stone"], + "desc": "attack.dia_spikes.description", + "types": [ + "stone" + ], "effect": None, "is_generic": False, - "ap": 20, + "ap": 20 }, # ground attacks "earch_quake": { - "name": "Earthquake", + "name": "attack.earch_quake.title", "factor": 4, "action": None, "world_action": "", - "move": ["pound"], + "move": [ + "pound" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Moves the ground with tremendous force.", - "types": ["ground"], + "desc": "attack.earch_quake.description", + "types": [ + "ground" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "power_roll": { - "name": "Power Roll", + "name": "attack.power_roll.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Rolls over the enemy.", - "types": ["ground"], + "desc": "attack.power_roll.description", + "types": [ + "ground" + ], "effect": None, "is_generic": True, - "ap": 15, + "ap": 15 }, "toe_breaker": { - "name": "Toe Breaker", + "name": "attack.toe_breaker.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.3, "min_lvl": 0, - "desc": "Breaks the enemy's toes.", - "types": ["ground"], + "desc": "attack.toe_breaker.description", + "types": [ + "ground" + ], "effect": None, "is_generic": True, - "ap": 20, + "ap": 20 }, "ground_hit": { - "name": "Ground Hit", + "name": "attack.ground_hit.title", "factor": 3, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 0, - "desc": "Damages the enemy with an unpredictable hit out of the ground.", - "types": ["ground"], + "desc": "attack.ground_hit.description", + "types": [ + "ground" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "dick_energy": { - "name": "Dick Energy", + "name": "attack.dick_energy.title", "factor": 0, "action": "dick_energy", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Collects a great amount of energy in the Pokete's tip.", - "types": ["ground"], + "desc": "attack.dick_energy.description", + "types": [ + "ground" + ], "effect": None, "is_generic": False, - "ap": 15, + "ap": 15 }, "hiding": { - "name": "Hiding", + "name": "attack.hiding.title", "factor": 0, "action": "hiding", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 20, - "desc": "Makes the Pokete hide under the ground to minimize damage.", - "types": ["ground"], + "desc": "attack.hiding.description", + "types": [ + "ground" + ], "effect": None, "is_generic": False, - "ap": 15, + "ap": 15 }, - # Fire attacks "fire_bite": { - "name": "Fire Bite", + "name": "attack.fire_bite.title", "factor": 2, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Burns and bites the enemy at the same time.", - "types": ["fire"], + "desc": "attack.fire_bite.description", + "types": [ + "fire" + ], "effect": "burning", "is_generic": True, - "ap": 15, + "ap": 15 }, "ash_throw": { - "name": "Ash Throw", + "name": "attack.ash_throw.title", "factor": 0.5, "action": "cry", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0, "min_lvl": 15, - "desc": "Throws ashes in the enemy's eyes.", - "types": ["fire"], + "desc": "attack.ash_throw.description", + "types": [ + "fire" + ], "effect": None, "is_generic": True, - "ap": 15, + "ap": 15 }, "flame_throw": { - "name": "Flame Throw", + "name": "attack.flame_throw.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.3, "min_lvl": 15, - "desc": "Hans! Get ze Flammenwerfer!", - "types": ["fire"], + "desc": "attack.flame_throw.description", + "types": [ + "fire" + ], "effect": "burning", "is_generic": True, - "ap": 10, + "ap": 10 }, - "fire_ball": { - "name": "Fire Ball", + "name": "attack.fire_ball.title", "factor": 4, "action": None, "world_action": "", - "move": ["fireball"], + "move": [ + "fireball" + ], "miss_chance": 0, "min_lvl": 25, - "desc": "Casts a fireball at the enemy.", - "types": ["fire"], + "desc": "attack.fire_ball.description", + "types": [ + "fire" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, # flying attacks "flying": { - "name": "Flying", + "name": "attack.flying.title", "factor": 1.5, "action": None, "world_action": "teleport", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 0, - "desc": "Gives the Pokete the ability to fly you around.", - "types": ["flying"], + "desc": "attack.flying.description", + "types": [ + "flying" + ], "effect": None, "is_generic": False, - "ap": 30, + "ap": 30 }, "pick": { - "name": "Peck", + "name": "attack.pick.title", "factor": 1.7, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 0, - "desc": "A peck at the enemy's weakest spot.", - "types": ["flying", "bird"], + "desc": "attack.pick.description", + "types": [ + "flying", + "bird" + ], "effect": None, "is_generic": True, - "ap": 30, + "ap": 30 }, "wind_blow": { - "name": "Wind Blow", + "name": "attack.wind_blow.title", "factor": 2, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Casts a gust of wind at the enemy.", - "types": ["flying"], + "desc": "attack.wind_blow.description", + "types": [ + "flying" + ], "effect": None, "is_generic": True, - "ap": 20, + "ap": 20 }, "storm_gust": { - "name": "Storm Gale", + "name": "attack.storm_gust.title", "factor": 6, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Casts a vicious and violent storm full of rain and hail, hitting the enemy in its weakest spots " - "and makes it want to die.", - "types": ["flying"], + "desc": "attack.storm_gust.description", + "types": [ + "flying" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "schmetter": { - "name": "Schmetter", + "name": "attack.schmetter.title", "factor": 1.7, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 0, - "desc": "Schmetters the enemy away.", - "types": ["flying"], + "desc": "attack.schmetter.description", + "types": [ + "flying" + ], "effect": None, "is_generic": False, - "ap": 30, + "ap": 30 }, "eye_pick": { - "name": "Eye Peck", + "name": "attack.eye_pick.title", "factor": 2.5, "action": "eye_pick", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.6, "min_lvl": 0, - "desc": "Pecks at one of the enemy's eyes.", - "types": ["flying", "bird"], + "desc": "attack.eye_pick.description", + "types": [ + "flying", + "bird" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "wing_hit": { - "name": "Wing Hit", + "name": "attack.wing_hit.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.5, "min_lvl": 0, - "desc": "Hits the enemy with a wing.", - "types": ["flying"], + "desc": "attack.wing_hit.description", + "types": [ + "flying" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "brooding": { - "name": "Brooding", + "name": "attack.brooding.title", "factor": 0, "action": "brooding", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 15, - "desc": "Regenerates 2 HP.", - "types": ["flying", "bird"], + "desc": "attack.brooding.description", + "types": [ + "flying", + "bird" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "power_pick": { - "name": "Power Peck", + "name": "attack.power_pick.title", "factor": 2, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.4, "min_lvl": 0, - "desc": "A harsh pecking on the enemy's head.", - "types": ["flying", "bird"], + "desc": "attack.power_pick.description", + "types": [ + "flying", + "bird" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, # water attacks "bubble_gun": { - "name": "Bubble Gun", + "name": "attack.bubble_gun.title", "factor": 2, "action": None, "world_action": "", - "move": ["gun"], + "move": [ + "gun" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Fires some bubbles at the enemy.", - "types": ["water"], + "desc": "attack.bubble_gun.description", + "types": [ + "water" + ], "effect": None, "is_generic": True, - "ap": 20, + "ap": 20 }, "bubble_bomb": { - "name": "Bubble Bomb", + "name": "attack.bubble_bomb.title", "factor": 6, "action": "cry", "world_action": "", - "move": ["bomb", "downgrade"], + "move": [ + "bomb", + "downgrade" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "A deadly bubble.", - "types": ["water"], + "desc": "attack.bubble_bomb.description", + "types": [ + "water" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "bubble_shield": { - "name": "Bubble Shield", + "name": "attack.bubble_shield.title", "factor": 0, "action": "hiding", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Creates a giant bubble that protects the Pokete.", - "types": ["water"], + "desc": "attack.bubble_shield.description", + "types": [ + "water" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "wet_slap": { - "name": "Wet Slap", + "name": "attack.wet_slap.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 10, - "desc": "Gives the enemy a cold and wet slap in the face.", - "types": ["water"], + "desc": "attack.wet_slap.description", + "types": [ + "water" + ], "effect": None, "is_generic": True, - "ap": 15, + "ap": 15 }, "shell_pinch": { - "name": "Shell Pinch", + "name": "attack.shell_pinch.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.1, "min_lvl": 15, - "desc": "Pinches the enemy with its strong shell.", - "types": ["water"], + "desc": "attack.shell_pinch.description", + "types": [ + "water" + ], "effect": None, "is_generic": False, - "ap": 20, + "ap": 20 }, # undead attacks "heart_touch": { - "name": "Heart Touch", + "name": "attack.heart_touch.title", "factor": 4, "action": "heart_touch", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0, "min_lvl": 20, - "desc": "Touches the enemy's heart with cold, ghostly claws.", - "types": ["undead"], + "desc": "attack.heart_touch.description", + "types": [ + "undead" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "confusion": { - "name": "Confusion", + "name": "attack.confusion.title", "factor": 0, "action": None, "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Confuses the enemy.", - "types": ["undead"], + "desc": "attack.confusion.description", + "types": [ + "undead" + ], "effect": "confusion", "is_generic": True, - "ap": 40, + "ap": 40 }, "mind_blow": { - "name": "Mind Blow", + "name": "attack.mind_blow.title", "factor": 0, "action": None, "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Causes confusion deep in the enemy's mind.", - "types": ["undead"], + "desc": "attack.mind_blow.description", + "types": [ + "undead" + ], "effect": "confusion", "is_generic": True, - "ap": 15, + "ap": 15 }, # electro attacks "shock": { - "name": "Shock", - "factor": 3 / 2, + "name": "attack.shock.title", + "factor": 1.5, "action": None, "world_action": "", - "move": ["arch"], + "move": [ + "arch" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Gives the enemy a shock.", - "types": ["electro"], + "desc": "attack.shock.description", + "types": [ + "electro" + ], "effect": None, "is_generic": True, - "ap": 30, + "ap": 30 }, "charging": { - "name": "Charging", + "name": "attack.charging.title", "factor": 0, "action": "dick_energy", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 10, - "desc": "Charges up the Pokete.", - "types": ["electro"], + "desc": "attack.charging.description", + "types": [ + "electro" + ], "effect": None, "is_generic": True, - "ap": 15, + "ap": 15 }, "mega_arch": { - "name": "Mega Arch", + "name": "attack.mega_arch.title", "factor": 5, "action": None, "world_action": "", - "move": ["arch"], + "move": [ + "arch" + ], "miss_chance": 0.2, "min_lvl": 15, - "desc": "Gives the enemy a massive shock.", - "types": ["electro"], + "desc": "attack.mega_arch.description", + "types": [ + "electro" + ], "effect": "paralyzation", "is_generic": True, - "ap": 10, + "ap": 10 }, # plant attacks "special_smell": { - "name": "Special Smell", + "name": "attack.special_smell.title", "factor": 0, "action": None, "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0.1, "min_lvl": 0, - "desc": "Spreads a special smell that will make the enemy confused but very happy.", - "types": ["plant"], + "desc": "attack.special_smell.description", + "types": [ + "plant" + ], "effect": "confusion", "is_generic": False, - "ap": 10, + "ap": 10 }, "apple_drop": { - "name": "Apple Drop", + "name": "attack.apple_drop.title", "factor": 1.7, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.3, "min_lvl": 0, - "desc": "Makes an apple drop on the enemy's head.", - "types": ["plant"], + "desc": "attack.apple_drop.description", + "types": [ + "plant" + ], "effect": None, "is_generic": False, - "ap": 30, + "ap": 30 }, "super_sucker": { - "name": "Super Sucker", + "name": "attack.super_sucker.title", "factor": 0, "action": "super_sucker", "world_action": "", - "move": ["downgrade", "shine"], + "move": [ + "downgrade", + "shine" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Sucks 2 HP from the enemy and adds to its own.", - "types": ["plant"], + "desc": "attack.super_sucker.description", + "types": [ + "plant" + ], "effect": None, "is_generic": False, - "ap": 10, + "ap": 10 }, "sucker": { - "name": "Sucker", + "name": "attack.sucker.title", "factor": 0, "action": "sucker", "world_action": "", - "move": ["downgrade", "shine"], + "move": [ + "downgrade", + "shine" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Sucks 1 HP from the enemy and adds to its own.", - "types": ["plant"], + "desc": "attack.sucker.description", + "types": [ + "plant" + ], "effect": None, "is_generic": False, - "ap": 20, + "ap": 20 }, "root_strangler": { - "name": "Root Strangler", + "name": "attack.root_strangler.title", "factor": 1, "action": None, "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 20, - "desc": "Uses old and crusty roots to strangle the enemy.", - "types": ["plant"], + "desc": "attack.root_strangler.description", + "types": [ + "plant" + ], "effect": "paralyzation", "is_generic": True, - "ap": 15, + "ap": 15 }, "root_slap": { - "name": "Root Slap", + "name": "attack.root_slap.title", "factor": 1.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.2, "min_lvl": 0, - "desc": "Uses old and crusty roots to slap the enemy.", - "types": ["plant"], + "desc": "attack.root_slap.description", + "types": [ + "plant" + ], "effect": None, "is_generic": True, - "ap": 30, + "ap": 30 }, "the_old_roots_hit": { - "name": "The Old Roots Hit", + "name": "attack.the_old_roots_hit.title", "factor": 50, "action": None, "world_action": "", - "move": ["shine", "shine", "attack"], + "move": [ + "shine", + "shine", + "attack" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "An ancient attack that summons the deepest and oldest roots from deep in the earth to defeat the enemy.", - "types": ["plant"], + "desc": "attack.the_old_roots_hit.description", + "types": [ + "plant" + ], "effect": None, "is_generic": False, - "ap": 1, + "ap": 1 }, "leaf_storm": { - "name": "Leaf Storm", + "name": "attack.leaf_storm.title", "factor": 5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0, "min_lvl": 20, - "desc": "Blasts a bunch of spiky leaves at the enemy.", - "types": ["plant"], + "desc": "attack.leaf_storm.description", + "types": [ + "plant" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "bark_hardening": { - "name": "Bark Hardening", + "name": "attack.bark_hardening.title", "factor": 0, "action": "bark_hardening", "world_action": "", - "move": ["shine"], + "move": [ + "shine" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Hardens its outer layers to protect itself.", - "types": ["plant"], + "desc": "attack.bark_hardening.description", + "types": [ + "plant" + ], "effect": None, "is_generic": True, - "ap": 15, + "ap": 15 }, "poison_spores": { - "name": "Poison Spores", + "name": "attack.poison_spores.title", "factor": 0, "action": None, "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Ejects some poisonous spores onto the enemy.", - "types": ["plant"], + "desc": "attack.poison_spores.description", + "types": [ + "plant" + ], "effect": "poison", "is_generic": False, - "ap": 15, + "ap": 15 }, "branch_stab": { - "name": "Branch Stab", + "name": "attack.branch_stab.title", "factor": 4, "action": "cry", "world_action": "", - "move": ["attack", "downgrade"], + "move": [ + "attack", + "downgrade" + ], "miss_chance": 0.2, "min_lvl": 15, - "desc": "Stabs the enemy with a branch, preferably in the enemy's eyes.", - "types": ["plant"], + "desc": "attack.branch_stab.description", + "types": [ + "plant" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, # ice attacks "freeze": { - "name": "Freeze", + "name": "attack.freeze.title", "factor": 0, "action": None, "world_action": "", - "move": ["downgrade"], + "move": [ + "downgrade" + ], "miss_chance": 0.1, "min_lvl": 10, - "desc": "Freezes the enemy.", - "types": ["ice"], + "desc": "attack.freeze.description", + "types": [ + "ice" + ], "effect": "freezing", "is_generic": True, - "ap": 10, + "ap": 10 }, "snow_storm": { - "name": "Snow Storm", + "name": "attack.snow_storm.title", "factor": 2.5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Summons a snow storm full of ice spikes onto the enemy.", - "types": ["ice"], + "desc": "attack.snow_storm.description", + "types": [ + "ice" + ], "effect": None, "is_generic": True, - "ap": 20, + "ap": 20 }, "sword_of_ice": { - "name": "Sword of Ice", + "name": "attack.sword_of_ice.title", "factor": 5, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0.3, "min_lvl": 20, - "desc": "Stabs a giant ice spike into the enemy.", - "types": ["ice"], + "desc": "attack.sword_of_ice.description", + "types": [ + "ice" + ], "effect": None, "is_generic": True, - "ap": 10, + "ap": 10 }, "spikes": { - "name": "Spikes", + "name": "attack.spikes.title", "factor": 1.75, "action": None, "world_action": "", - "move": ["attack"], + "move": [ + "attack" + ], "miss_chance": 0, "min_lvl": 0, - "desc": "Stabs the enemy with some small ice spikes.", - "types": ["ice"], + "desc": "attack.spikes.description", + "types": [ + "ice" + ], "effect": None, "is_generic": True, - "ap": 30, - }, + "ap": 30 + } } if __name__ == "__main__": diff --git a/pokete_data/items.py b/pokete_data/items.py index 8cb7f399..04f9e128 100644 --- a/pokete_data/items.py +++ b/pokete_data/items.py @@ -1,49 +1,49 @@ items = { "poketeball": { - "pretty_name": "Poketeball", - "desc": "A ball you can use to catch Poketes", + "pretty_name": "item.poketeball.title", + "desc": "item.poketeball.description", "price": 2, "fn": "poketeball" }, "superball": { - "pretty_name": "Superball", - "desc": "A ball you can use to catch Poketes with an increased chance", + "pretty_name": "item.superball.title", + "desc": "item.superball.description", "price": 10, "fn": "superball" }, "hyperball": { - "pretty_name": "Hyperball", - "desc": "For catching Poketes with a waaay higher chance", + "pretty_name": "item.hyperball.title", + "desc": "item.hyperball.description", "price": None, "fn": "hyperball" }, "healing_potion": { - "pretty_name": "Healing potion", - "desc": "Heals a Pokete with 5 HP", + "pretty_name": "item.healing_potion.title", + "desc": "item.healing_potion.description", "price": 15, "fn": "heal_potion" }, "super_potion": { - "pretty_name": "Super potion", - "desc": "Heals a Pokete with 15 HP", + "pretty_name": "item.super_potion.title", + "desc": "item.super_potion.description", "price": 25, "fn": "super_potion" }, "ap_potion": { - "pretty_name": "AP potion", - "desc": "Refills the Poketes attack APs.", + "pretty_name": "item.ap_potion.title", + "desc": "item.ap_potion.description", "price": 100, "fn": "ap_potion" }, "treat": { - "pretty_name": "Treat", - "desc": "Upgrades a Pokete by a whole level.", + "pretty_name": "item.treat.title", + "desc": "item.treat.description", "price": None, "fn": None }, "shut_the_fuck_up_stone": { - "pretty_name": "'Shut the fuck up' stone", - "desc": "Makes trainer leaving you alone", + "pretty_name": "item.shut_the_fuck_up_stone.title", + "desc": "item.shut_the_fuck_up_stone.description", "price": None, "fn": None }, diff --git a/pokete_data/mapstations.py b/pokete_data/mapstations.py index f5e08d47..b43dae00 100644 --- a/pokete_data/mapstations.py +++ b/pokete_data/mapstations.py @@ -1,10 +1,12 @@ stations = { "playmap_1": { "gen": { - "additionals": ["intromap"], + "additionals": [ + "intromap" + ], "width": 2, "height": 1, - "desc": "A small town.", + "desc": "mapstation.playmap_1.description", "w_next": "cave_1" }, "add": { @@ -17,9 +19,9 @@ "additionals": [], "width": 1, "height": 2, - "desc": "A dark cave full of batos.", + "desc": "mapstation.cave_1.description", "s_next": "playmap_1", - "d_next": "playmap_2", + "d_next": "playmap_2" }, "add": { "x": 6, @@ -31,9 +33,9 @@ "additionals": [], "width": 2, "height": 1, - "desc": "Part of light areas near Josi Town.", + "desc": "mapstation.playmap_2.description", "a_next": "cave_1", - "d_next": "playmap_3", + "d_next": "playmap_3" }, "add": { "x": 7, @@ -42,13 +44,15 @@ }, "playmap_3": { "gen": { - "additionals": ["playmap_49"], + "additionals": [ + "playmap_49" + ], "width": 2, "height": 1, - "desc": "A small sunny village.", + "desc": "mapstation.playmap_3.description", "a_next": "playmap_2", "w_next": "playmap_4", - "s_next": "playmap_6", + "s_next": "playmap_6" }, "add": { "x": 9, @@ -57,10 +61,12 @@ }, "playmap_4": { "gen": { - "additionals": ["playmap_5"], + "additionals": [ + "playmap_5" + ], "width": 1, "height": 3, - "desc": "The shores of the great Sunnydale lake.", + "desc": "mapstation.playmap_4.description", "s_next": "playmap_3", "d_next": "playmap_28" }, @@ -74,11 +80,10 @@ "additionals": [], "width": 1, "height": 2, - "desc": "The woodland edge at the foot of a great mountain full of \ -caves.", + "desc": "mapstation.playmap_6.description", "w_next": "playmap_3", "a_next": "playmap_7", - "d_next": "playmap_8", + "d_next": "playmap_8" }, "add": { "x": 10, @@ -90,8 +95,8 @@ "additionals": [], "width": 1, "height": 1, - "desc": "A dark and mysterious cave.", - "d_next": "playmap_6", + "desc": "mapstation.playmap_7.description", + "d_next": "playmap_6" }, "add": { "x": 9, @@ -100,13 +105,16 @@ }, "playmap_8": { "gen": { - "additionals": ["playmap_10", "playmap_9"], + "additionals": [ + "playmap_10", + "playmap_9" + ], "width": 2, "height": 1, - "desc": "An abandoned fisher village.", + "desc": "mapstation.playmap_8.description", "a_next": "playmap_6", "s_next": "playmap_11", - "d_next": "playmap_12", + "d_next": "playmap_12" }, "add": { "x": 11, @@ -118,8 +126,8 @@ "additionals": [], "width": 1, "height": 1, - "desc": "The shore of a lake near an olf fisher village.", - "w_next": "playmap_8", + "desc": "mapstation.playmap_11.description", + "w_next": "playmap_8" }, "add": { "x": 11, @@ -131,9 +139,9 @@ "width": 2, "additionals": [], "height": 1, - "desc": "A dense forest near Deepens forest.", + "desc": "mapstation.playmap_12.description", "a_next": "playmap_8", - "w_next": "playmap_13", + "w_next": "playmap_13" }, "add": { "x": 13, @@ -142,13 +150,15 @@ }, "playmap_13": { "gen": { - "additionals": ["playmap_14", "playmap_20"], + "additionals": [ + "playmap_14", + "playmap_20" + ], "width": 1, "height": 2, - "desc": "Deepens forest, a big town in the middle of the deepest \ -forest, populated by thousands of people and cultural center of the region.", + "desc": "mapstation.playmap_13.description", "s_next": "playmap_12", - "w_next": "playmap_15", + "w_next": "playmap_15" }, "add": { "x": 14, @@ -160,9 +170,9 @@ "additionals": [], "width": 2, "height": 1, - "desc": "A small clearing near Deepens forest.", + "desc": "mapstation.playmap_15.description", "s_next": "playmap_13", - "d_next": "playmap_16", + "d_next": "playmap_16" }, "add": { "x": 14, @@ -171,12 +181,14 @@ }, "playmap_16": { "gen": { - "additionals": ["playmap_17"], + "additionals": [ + "playmap_17" + ], "width": 1, "height": 1, - "desc": "A small 'village', that's not even worth talking about.", + "desc": "mapstation.playmap_16.description", "a_next": "playmap_15", - "d_next": "playmap_18", + "d_next": "playmap_18" }, "add": { "x": 16, @@ -188,9 +200,9 @@ "additionals": [], "width": 2, "height": 1, - "desc": "A small see at the foot of the Big mountain.", + "desc": "mapstation.playmap_18.description", "a_next": "playmap_16", - "w_next": "playmap_19", + "w_next": "playmap_19" }, "add": { "x": 17, @@ -202,9 +214,9 @@ "additionals": [], "width": 1, "height": 1, - "desc": "A dark and big cave in the Big mountain.", + "desc": "mapstation.playmap_19.description", "s_next": "playmap_18", - "w_next": "playmap_21", + "w_next": "playmap_21" }, "add": { "x": 18, @@ -213,14 +225,19 @@ }, "playmap_21": { "gen": { - "additionals": ["playmap_22", "playmap_23", "playmap_24", - "playmap_25", "playmap_26", "playmap_27", - "playmap_29", "playmap_50"], + "additionals": [ + "playmap_22", + "playmap_23", + "playmap_24", + "playmap_25", + "playmap_26", + "playmap_27", + "playmap_29", + "playmap_50" + ], "width": 3, "height": 1, - "desc": "The great Rock-ville is the biggest city in the region \ -around the Big mountain. With the Rocky hotel it's also a tourist \ -hotspot.", + "desc": "mapstation.playmap_21.description", "s_next": "playmap_19", "d_next": "playmap_33", "w_next": "playmap_40" @@ -235,9 +252,9 @@ "additionals": [], "width": 2, "height": 1, - "desc": "A foggy place full of ghosts and plants.", + "desc": "mapstation.playmap_28.description", "a_next": "playmap_4", - "d_next": "playmap_30", + "d_next": "playmap_30" }, "add": { "x": 11, @@ -246,13 +263,14 @@ }, "playmap_30": { "gen": { - "additionals": ["playmap_31", "playmap_32"], + "additionals": [ + "playmap_31", + "playmap_32" + ], "width": 1, "height": 1, - "desc": "With its plant Poketes, Flowy Town may be the greenest \ -spot in the Pokete world and with the great git-tree it may also be one \ -of the most spectacular.", - "a_next": "playmap_28", + "desc": "mapstation.playmap_30.description", + "a_next": "playmap_28" }, "add": { "x": 13, @@ -261,12 +279,14 @@ }, "playmap_33": { "gen": { - "additionals": ["playmap_34"], + "additionals": [ + "playmap_34" + ], "width": 1, "height": 1, - "desc": "Part of the great agracultural landscape near Agrawos.", + "desc": "mapstation.playmap_33.description", "a_next": "playmap_21", - "d_next": "playmap_35", + "d_next": "playmap_35" }, "add": { "x": 21, @@ -275,12 +295,16 @@ }, "playmap_35": { "gen": { - "additionals": ["playmap_36", "playmap_37", "playmap_38"], + "additionals": [ + "playmap_36", + "playmap_37", + "playmap_38" + ], "width": 1, "height": 2, - "desc": "Part of the great agracultural landscape near Agrawos.", + "desc": "mapstation.playmap_35.description", "a_next": "playmap_33", - "s_next": "playmap_39", + "s_next": "playmap_39" }, "add": { "x": 22, @@ -292,8 +316,8 @@ "additionals": [], "width": 2, "height": 1, - "desc": "A Great beach, with great weather, always.", - "s_next": "playmap_21", + "desc": "mapstation.playmap_40.description", + "s_next": "playmap_21" }, "add": { "x": 18, @@ -302,24 +326,26 @@ }, "playmap_39": { "gen": { - "additionals": ["playmap_41", "playmap_42", "playmap_43", - "playmap_44", "playmap_45", "playmap_46", - "playmap_47", "playmap_48"], + "additionals": [ + "playmap_41", + "playmap_42", + "playmap_43", + "playmap_44", + "playmap_45", + "playmap_46", + "playmap_47", + "playmap_48" + ], "width": 2, "height": 2, - "desc": "The great city of Agrawos, agricultural and cultural " - "center of the whole region. It's famous for its great " - "Pokete-Arena and its master trainer. Check out the " - "MowCow-Burger restaurant, which offers the best, " - "juiciest and most delicious Mowcow-burgers, cut from the " - "happiest and most delicious Mowcows anywhere to find!", - "w_next": "playmap_35", + "desc": "mapstation.playmap_39.description", + "w_next": "playmap_35" }, "add": { "x": 21, "y": 4 } - }, + } } if __name__ == "__main__": diff --git a/pokete_data/poketes.py b/pokete_data/poketes.py index c13d32b8..664e8b6b 100644 --- a/pokete_data/poketes.py +++ b/pokete_data/poketes.py @@ -15,7 +15,7 @@ "attacks": [], "pool": [], "miss_chance": 0, - "desc": "", + "desc": "pokete.__fallback__.description", "lose_xp": 0, "rarity": 0, "types": ["normal"], @@ -34,7 +34,7 @@ "attacks": ["tackle", "politure", "brick_throw"], "pool": [], "miss_chance": 0, - "desc": "A squared stone that can be readily found just lying around.", + "desc": "pokete.steini.description", "lose_xp": 3, "rarity": 1, "types": ["stone", "normal"], @@ -56,7 +56,7 @@ "attacks": ["tackle"], "pool": ["supercow_power", "meat_skewer"], "miss_chance": 0, - "desc": "A cow-like creature found in meadows.", + "desc": "pokete.mowcow.description", "lose_xp": 2, "rarity": 1, "types": ["normal"], @@ -77,7 +77,7 @@ "attacks": ["snooze", "politure", "brick_throw"], "pool": [], "miss_chance": 0, - "desc": "A big and heavy stone made from one of the hardest materials.", + "desc": "pokete.bigstone.description", "lose_xp": 5, "rarity": 0.3, "types": ["stone", "normal"], @@ -99,7 +99,7 @@ "attacks": ["tackle", "politure", "earch_quake"], "pool": [], "miss_chance": 0, - "desc": "A powerful and heavy stone Pokete that lives in mountain caves.", + "desc": "pokete.poundi.description", "lose_xp": 4, "rarity": 0.7, "types": ["stone", "normal"], @@ -121,7 +121,7 @@ "attacks": ["tackle", "politure", "pepple_fire"], "pool": [], "miss_chance": 0, - "desc": "A small but powerful stone Pokete that lives in the mountains.", + "desc": "pokete.lilstone.description", "lose_xp": 2, "rarity": 1, "types": ["stone", "normal"], @@ -143,7 +143,7 @@ "attacks": ["sucker", "super_sucker"], "pool": [], "miss_chance": 0, - "desc": "A plant Pokete that's often mistaken for a normal flower.", + "desc": "pokete.rosi.description", "lose_xp": 2, "rarity": 0.8, "types": ["plant"], @@ -165,7 +165,7 @@ "attacks": ["root_slap", "special_smell"], "pool": [], "miss_chance": 0.1, - "desc": "A plant Pokete found in Agrawos; it has special 'Powers'.", + "desc": "pokete.wheeto.description", "lose_xp": 2, "rarity": 1, "types": ["plant"], @@ -187,7 +187,7 @@ "attacks": ["mind_blow", "fire_ball", "sand_throw"], "pool": ["hiding"], "miss_chance": 1, - "desc": "The dark and fiery souls of those who got burned to death by the hot sun!", + "desc": "pokete.saugh.description", "lose_xp": 4, "rarity": 0.5, "types": ["undead", "fire"], @@ -215,7 +215,7 @@ "attacks": ["tackle", "mind_blow", "heart_touch"], "pool": ["cry"], "miss_chance": 0, - "desc": "A scary ghost Pokete that lives in caves and old houses.", + "desc": "pokete.gobost.description", "lose_xp": 3, "rarity": 1, "types": ["undead", "normal"], @@ -237,7 +237,7 @@ "attacks": ["tackle", "mind_blow", "wet_slap", "heart_touch"], "pool": ["cry"], "miss_chance": 0, - "desc": "A ghost Pokete that will scare your pants off.", + "desc": "pokete.angrilo.description", "lose_xp": 4, "rarity": 0.6, "types": ["undead", "normal", "water"], @@ -259,7 +259,7 @@ "attacks": ["tackle", "power_pick"], "pool": ["cry"], "miss_chance": 0, - "desc": "A very common bird Pokete; it lives everywhere.", + "desc": "pokete.vogli.description", "lose_xp": 2, "rarity": 1, "types": ["flying", "normal", "bird"], @@ -281,7 +281,7 @@ "attacks": ["tackle", "power_pick", "wing_hit", "brooding"], "pool": ["cry"], "miss_chance": 0, - "desc": "A very aggressive bird Pokete that can only be found in the woods.", + "desc": "pokete.voglo.description", "lose_xp": 3, "rarity": 0.8, "types": ["flying", "normal", "bird"], @@ -303,7 +303,7 @@ "attacks": ["tackle", "power_pick", "storm_gust", "brooding"], "pool": ["cry"], "miss_chance": 0, - "desc": "A very aggressive and hard to find bird Pokete.", + "desc": "pokete.voglus.description", "lose_xp": 5, "rarity": 0.2, "types": ["flying", "normal", "bird"], @@ -328,8 +328,7 @@ "attacks": ["tackle", "eye_pick", "brooding"], "pool": ["cry"], "miss_chance": 0, - "desc": "A very aggressive bird Pokete that lives near deserts; \ -it will try to peck out your eyes.", + "desc": "pokete.ostri.description", "rarity": 0.6, "lose_xp": 4, "types": ["flying", "normal", "bird"], @@ -351,7 +350,7 @@ "attacks": ["tackle"], "pool": [], "miss_chance": 0, - "desc": "A harmless water Pokete that can be found everywhere.", + "desc": "pokete.karpi.description", "lose_xp": 1, "rarity": 3, "types": ["water", "normal"], @@ -373,7 +372,7 @@ "attacks": ["chocer", "bite", "poison_bite"], "pool": [], "miss_chance": 0, - "desc": "A dangerous snake Pokete.", + "desc": "pokete.würgos.description", "lose_xp": 2, "rarity": 1, "types": ["poison", "normal", "snake"], @@ -395,7 +394,7 @@ "attacks": ["chocer", "bite", "poison_bite", "power_bite"], "pool": [], "miss_chance": 0, - "desc": "A fucking dangerous and enormous snake Pokete.", + "desc": "pokete.choka.description", "lose_xp": 4, "rarity": 0.5, "types": ["poison", "normal", "snake"], @@ -417,7 +416,7 @@ "attacks": ["apple_drop", "bark_hardening", "branch_stab", "root_strangler"], "pool": [], "miss_chance": 0, - "desc": "A scary and dangerous apple tree.", + "desc": "pokete.treenator.description", "lose_xp": 2, "rarity": 1, "types": ["plant"], @@ -439,7 +438,7 @@ "attacks": ["bite", "cry"], "pool": [], "miss_chance": 0, - "desc": "An annoying flying rat.", + "desc": "pokete.bato.description", "lose_xp": 3, "rarity": 1.3, "types": ["flying", "flying"], @@ -460,7 +459,7 @@ "attacks": ["bite", "cry", "poison_bite", "wing_hit"], "pool": [], "miss_chance": 0, - "desc": "A chongus flying rat.", + "desc": "pokete.bator.description", "lose_xp": 4, "rarity": 0.2, "types": ["flying", "normal"], @@ -482,7 +481,7 @@ "attacks": ["tackle", "bubble_bomb", "bubble_shield"], "pool": [], "miss_chance": 0, - "desc": "Very delicious and low fat water Pokete.", + "desc": "pokete.blub.description", "lose_xp": 5, "rarity": 1, "types": ["water", "normal"], @@ -504,7 +503,7 @@ "attacks": ["pick", "wing_hit", "cry"], "pool": ["cry"], "miss_chance": 0, - "desc": "A nocturnal Pokete that is looking for small children to eat as a midnight snack.", + "desc": "pokete.owol.description", "lose_xp": 2, "rarity": 0.5, "types": ["flying", "normal", "bird"], @@ -528,7 +527,7 @@ "attacks": ["tackle", "tail_wipe"], "pool": ["bite", "power_bite"], "miss_chance": 0, - "desc": "An annoying rat.", + "desc": "pokete.rato.description", "lose_xp": 2, "rarity": 1.3, "types": ["normal"], @@ -549,7 +548,7 @@ "attacks": ["tackle", "tail_wipe", "power_bite"], "pool": ["bite"], "miss_chance": 0, - "desc": "A damn dangerous and enourmous rat; it will bite of your leg.", + "desc": "pokete.ratatat.description", "lose_xp": 2, "rarity": 0.7, "types": ["normal"], @@ -574,7 +573,7 @@ "attacks": ["tackle", "meat_skewer", "tail_wipe"], "pool": [], "miss_chance": 0, - "desc": "A majestic horse that is always looking for something to pick with its horn.", + "desc": "pokete.hornita.description", "lose_xp": 3, "rarity": 1, "types": ["normal"], @@ -596,7 +595,7 @@ "attacks": ["tackle", "meat_skewer"], "pool": ["tail_wipe"], "miss_chance": 0.2, - "desc": "A teenage unicorn in the middle of puberty.", + "desc": "pokete.horny.description", "rarity": 1, "lose_xp": 2, "types": ["normal"], @@ -618,7 +617,7 @@ "attacks": ["tackle", "bark_hardening"], "pool": ["apple_drop"], "miss_chance": 0, - "desc": "A bush, and just a bush. But watch out!", + "desc": "pokete.bushy.description", "lose_xp": 1, "rarity": 1, "types": ["plant", "normal"], @@ -639,7 +638,7 @@ "attacks": ["tackle", "fire_bite", "ash_throw"], "pool": ["cry", "bite", "power_bite"], "miss_chance": 0, - "desc": "A fiery wolf straight from hell that likes to burn 11 years old butts off.", + "desc": "pokete.wolfior.description", "lose_xp": 2, "rarity": 1, "types": ["fire", "normal"], @@ -664,7 +663,7 @@ "attacks": ["tackle", "fire_bite", "ash_throw", "fire_ball"], "pool": ["cry", "bite", "power_bite"], "miss_chance": 0, - "desc": "A fiery wolf from hell on steroids.", + "desc": "pokete.wolfiro.description", "lose_xp": 4, "rarity": 1, "types": ["fire", "normal"], @@ -689,7 +688,7 @@ "attacks": ["tackle", "power_roll"], "pool": ["hiding"], "miss_chance": 0, - "desc": "A big chunk of stone and dirt that rolls around.", + "desc": "pokete.rollator.description", "lose_xp": 3, "rarity": 0.5, "types": ["ground", "normal"], @@ -711,7 +710,7 @@ "attacks": ["tackle", "bubble_bomb", "shell_pinch"], "pool": [], "miss_chance": 0, - "desc": "A shell that lives deep in the sea or near bays; it's pretty hard to crack.", + "desc": "pokete.clampi.description", "lose_xp": 5, "rarity": 0.8, "types": ["water", "normal"], @@ -735,7 +734,7 @@ "attacks": ["tackle", "bubble_gun", "earch_quake", "shell_pinch"], "pool": [], "miss_chance": 0, - "desc": "A crusty Pokete that loves to pinch big toes.", + "desc": "pokete.crabbat.description", "lose_xp": 5, "rarity": 0.8, "types": ["water", "ground", "normal"], @@ -759,8 +758,7 @@ "attacks": ["toe_breaker", "bubble_gun", "earch_quake", "shell_pinch"], "pool": [], "miss_chance": 0, - "desc": "A crusty Pokete that will pinch your toes and check whether \ -or not you borrowed something.", + "desc": "pokete.rustacean.description", "lose_xp": 5, "rarity": 0.5, "types": ["water", "ground", "normal"], @@ -784,7 +782,7 @@ "attacks": ["shock", "charging", "mega_arch"], "pool": [], "miss_chance": 0, - "desc": "A small floating ball that will give you a shock.", + "desc": "pokete.electrode.description", "lose_xp": 3, "rarity": 0.8, "types": ["electro"], @@ -807,7 +805,7 @@ "attacks": ["tackle", "freeze", "snow_storm"], "pool": [], "miss_chance": 0.1, - "desc": "A small ice cube.", + "desc": "pokete.cubl.description", "lose_xp": 2, "rarity": 1.2, "types": ["ice", "normal"], @@ -837,7 +835,7 @@ "attacks": ["tackle", "freeze", "snow_storm", "sword_of_ice"], "pool": [], "miss_chance": 0.1, - "desc": "A block of ice.", + "desc": "pokete.spikl.description", "lose_xp": 4, "rarity": 0.9, "types": ["ice", "normal", "water"], @@ -869,8 +867,7 @@ "attacks": ["confusion"], "pool": [], "miss_chance": 0.1, - "desc": "A ball floating around in dark woods and caves, \ -that will confuse the shit out of you.", + "desc": "pokete.confuso.description", "lose_xp": 6, "rarity": 0.5, "types": ["undead"], @@ -899,7 +896,7 @@ "attacks": ["root_slap", "poison_spores", "leaf_storm"], "pool": ["poison_thorn"], "miss_chance": 0.1, - "desc": "A unsuspicious plant.", + "desc": "pokete.poisopla.description", "lose_xp": 6, "rarity": 0.9, "types": ["plant", "poison"], @@ -925,7 +922,7 @@ "attacks": ["root_slap", "poison_spores", "leaf_storm", "poison_thorn"], "pool": [], "miss_chance": 0.1, - "desc": "A not at all suspicious plant.", + "desc": "pokete.megapois.description", "lose_xp": 6, "rarity": 0.9, "types": ["plant", "poison"], @@ -951,7 +948,7 @@ "attacks": ["tackle", "hiding"], "pool": [], "miss_chance": 0, - "desc": "A small heavy thing that can be found on the ground; it may reveal something wonderful later.", + "desc": "pokete.corcos_day.description", "lose_xp": 1, "rarity": 1, "night_active": False, @@ -975,7 +972,7 @@ "attacks": ["tackle", "hiding"], "pool": [], "miss_chance": 0, - "desc": "A small heavy thing that can be found on the ground; it may reveal something wonderful later.", + "desc": "pokete.corcos_night.description", "lose_xp": 1, "rarity": 1, "night_active": True, @@ -999,7 +996,7 @@ "attacks": ["tackle", "hiding"], "pool": [], "miss_chance": 0.1, - "desc": "A small caterpillar found on leaves.", + "desc": "pokete.raupathor_day.description", "lose_xp": 2, "rarity": 1, "night_active": False, @@ -1024,7 +1021,7 @@ "attacks": ["tackle", "hiding"], "pool": [], "miss_chance": 0.1, - "desc": "A small caterpillar found on leaves.", + "desc": "pokete.raupathor_night.description", "lose_xp": 2, "rarity": 1, "night_active": True, @@ -1052,7 +1049,7 @@ "attacks": ["schmetter", "wing_hit"], "pool": [], "miss_chance": 0.1, - "desc": "A butterfly that will schmetter you away.", + "desc": "pokete.schmetterling.description", "lose_xp": 3, "rarity": 1, "night_active": False, @@ -1075,7 +1072,7 @@ "attacks": ["schmetter", "wing_hit"], "pool": [], "miss_chance": 0.1, - "desc": "A dark butterfly that will schmetter you away.", + "desc": "pokete.mothor.description", "lose_xp": 4, "rarity": 1, "night_active": True, @@ -1103,7 +1100,7 @@ "attacks": ["tackle", "ground_hit"], "pool": ["dick_energy", "hiding"], "miss_chance": 0.1, - "desc": "A very small whatever that sticks out of the ground.", + "desc": "pokete.lil_nut.description", "lose_xp": 2, "rarity": 1, "types": ["ground", "normal"], @@ -1126,7 +1123,7 @@ "attacks": ["tackle", "dick_energy", "hiding", "ground_hit"], "pool": [], "miss_chance": 0.1, - "desc": "A little whatever that sticks out of the ground.", + "desc": "pokete.dicki.description", "lose_xp": 2, "rarity": 1, "types": ["ground", "normal"], @@ -1149,7 +1146,7 @@ "attacks": ["tackle", "dick_energy", "hiding", "ground_hit"], "pool": [], "miss_chance": 0.1, - "desc": "An even bigger whatever that sticks out of the ground.", + "desc": "pokete.dicko.description", "lose_xp": 2, "rarity": 1, "types": ["ground", "normal"], @@ -1172,7 +1169,7 @@ "attacks": ["tackle", "politure", "dazzle"], "pool": ["dia_stab", "dia_spikes"], "miss_chance": 0.1, - "desc": "A precious diamond that can only be found in the darkest caves.", + "desc": "pokete.diamondos.description", "lose_xp": 2, "rarity": 1, "types": ["stone"], diff --git a/pokete_data/weather.py b/pokete_data/weather.py index 4900a204..a7bf8523 100644 --- a/pokete_data/weather.py +++ b/pokete_data/weather.py @@ -1,6 +1,6 @@ weathers = { "rain": { - "info": "It's raining!", + "info": "weather.rain.info", "effected": { "fire": 0.5, "plant": 1.5, @@ -8,7 +8,7 @@ } }, "thunderstorm": { - "info": "There is a thunderstorm going on!", + "info": "weather.thunderstorm.info", "effected": { "fire": 0.5, "plant": 1.5, @@ -17,14 +17,14 @@ } }, "foggy": { - "info": "It's foggy!", + "info": "weather.foggy.info", "effected": { "undead": 1.5, "normal": 0.75, } }, "sunny": { - "info": "It's a hot sunny day!", + "info": "weather.sunny.info", "effected": { "fire": 1.5, "water": 0.75, From 6602a6063d2974c147946a21fe90d16f59af05aa Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Fri, 5 Aug 2022 15:35:35 +0200 Subject: [PATCH 08/10] Added trainers.py translations, may have added too much whitespace --- pokete_data/trainers.py | 1525 ++++++++++++++++++++++++++++++--------- 1 file changed, 1198 insertions(+), 327 deletions(-) diff --git a/pokete_data/trainers.py b/pokete_data/trainers.py index cb765582..f6286978 100644 --- a/pokete_data/trainers.py +++ b/pokete_data/trainers.py @@ -1,371 +1,1242 @@ trainers = { - "playmap_1": [{ - "pokes": [("poundi", 60)], - "args": ("Franz", "He", - ["trainer.playmap1.franz.fight"], [ - "trainer.playmap1.franz.lose1", - "trainer.playmap1.franz.lose2" - ], - ["trainer.playmap1.franz.win"], 30, 10) - }, + "playmap_1": [ + { + "pokes": [ + [ + "poundi", + 60 + ] + ], + "args": ( + "Franz", + "He", + [ + "trainer.playmap_1.franz.dialog1" + ], + [ + "trainer.playmap_1.franz.lose1", + "trainer.playmap_1.franz.lose2" + ], + [ + "trainer.playmap_1.franz.win1" + ], + 30, + 10 + ) + } ], - "cave_1": [{ - "pokes": [("hornita", 128)], - "args": ("Monica", "She", - ["Hello, noble traveler", "Are you willing to fight me?"], - ["Hahaha!", "Looooser!"], - ["Congratulations!", "Have a great day!"], 23, 10) - }, + "cave_1": [ + { + "pokes": [ + [ + "hornita", + 128 + ] + ], + "args": ( + "Monica", + "She", + [ + "trainer.cave_1.monica.dialog1", + "trainer.cave_1.monica.dialog2" + ], + [ + "trainer.cave_1.monica.lose1", + "trainer.cave_1.monica.lose2" + ], + [ + "trainer.cave_1.monica.win1", + "trainer.cave_1.monica.win2" + ], + 23, + 10 + ) + } ], - "playmap_2": [{ - "pokes": [("ostri", 160)], - "args": ("Wanderer Murrad", "He", - ["Isn't it a great day?", "I traveled here from a distant country", - "Do you want to fight against my rare Pokete?"], - ["It is stronger than you might have expected"], - ["Oh, I didn't think you could defeat my Pokete!", "You are a very good trainer!"], 32, 12) - }, + "playmap_2": [ + { + "pokes": [ + [ + "ostri", + 160 + ] + ], + "args": ( + "Wanderer Murrad", + "He", + [ + "trainer.playmap_2.wanderer_murrad.dialog1", + "trainer.playmap_2.wanderer_murrad.dialog2", + "trainer.playmap_2.wanderer_murrad.dialog3" + ], + [ + "trainer.playmap_2.wanderer_murrad.lose1" + ], + [ + "trainer.playmap_2.wanderer_murrad.win1", + "trainer.playmap_2.wanderer_murrad.win2" + ], + 32, + 12 + ) + } ], - "playmap_3": [{ - "pokes": [("hornita", 200)], - "args": ("Markus", "He", - ["Hey!", "Welcome to Sunnydale!", "But first, we must fight!"], - ["Hahaha!", "Hahaha!", "You're a loser!"], - ["Damn, I lost!"], 11, 5) - }, + "playmap_3": [ + { + "pokes": [ + [ + "hornita", + 200 + ] + ], + "args": ( + "Markus", + "He", + [ + "trainer.playmap_3.markus.dialog1", + "trainer.playmap_3.markus.dialog2", + "trainer.playmap_3.markus.dialog3" + ], + [ + "trainer.playmap_3.markus.lose1", + "trainer.playmap_3.markus.lose2", + "trainer.playmap_3.markus.lose3" + ], + [ + "trainer.playmap_3.markus.win1" + ], + 11, + 5 + ) + } ], - "playmap_4": [{ - "pokes": [("karpi", 340)], - "args": ("Kevin", "He", - ["Yo!", "Whaddup?", "Wanna see my sick-ass Pokete?"], - ["Yeaaah!", "My Pokete is sooo sick!"], - ["Daaaamn", "Your Pokete is nooot from this planet!"], 32, 31) - }, + "playmap_4": [ + { + "pokes": [ + [ + "karpi", + 340 + ] + ], + "args": ( + "Kevin", + "He", + [ + "trainer.playmap_4.kevin.dialog1", + "trainer.playmap_4.kevin.dialog2", + "trainer.playmap_4.kevin.dialog3" + ], + [ + "trainer.playmap_4.kevin.lose1", + "trainer.playmap_4.kevin.lose2" + ], + [ + "trainer.playmap_4.kevin.win1", + "trainer.playmap_4.kevin.win2" + ], + 32, + 31 + ) + } ], - "playmap_5": [{ - "pokes": [("bator", 350)], - "args": ("Caveman Marc", "He", - ["Oh!", "I haven't seen anyone down here for a while", - "Can I show you my rare Pokete which can only be found in this cave?"], - ["Oh!", "My Pokete is not just rare", "It's also strong"], - ["Congratulations!", "I hope you can also catch one!"], 23, 12) - }, + "playmap_5": [ + { + "pokes": [ + [ + "bator", + 350 + ] + ], + "args": ( + "Caveman Marc", + "He", + [ + "trainer.playmap_5.caveman_marc.dialog1", + "trainer.playmap_5.caveman_marc.dialog2", + "trainer.playmap_5.caveman_marc.dialog3" + ], + [ + "trainer.playmap_5.caveman_marc.lose1", + "trainer.playmap_5.caveman_marc.lose2", + "trainer.playmap_5.caveman_marc.lose3" + ], + [ + "trainer.playmap_5.caveman_marc.win1", + "trainer.playmap_5.caveman_marc.win2" + ], + 23, + 12 + ) + } ], - "playmap_6": [{ - "pokes": [("treenator", 400)], - "args": ("Eva", "She", - ["Hi!", "Fight?"], - ["Loser"], - ["I lost!"], 47, 43) - }, + "playmap_6": [ + { + "pokes": [ + [ + "treenator", + 400 + ] + ], + "args": ( + "Eva", + "She", + [ + "trainer.playmap_6.eva.dialog1", + "trainer.playmap_6.eva.dialog2" + ], + [ + "trainer.playmap_6.eva.lose1" + ], + [ + "trainer.playmap_6.eva.win1" + ], + 47, + 43 + ) + } ], - "playmap_7": [{ - "pokes": [("steini", 400)], - "args": ("Caveman Dieter", "He", - ["Oh!", "I didn't see you coming"], - ["My Steini is old but classy"], - ["You're a great trainer!"], 18, 7) - }, + "playmap_7": [ + { + "pokes": [ + [ + "steini", + 400 + ] + ], + "args": ( + "Caveman Dieter", + "He", + [ + "trainer.playmap_7.caveman_dieter.dialog1", + "trainer.playmap_7.caveman_dieter.dialog2" + ], + [ + "trainer.playmap_7.caveman_dieter.lose1" + ], + [ + "trainer.playmap_7.caveman_dieter.win1" + ], + 18, + 7 + ) + } ], - "playmap_8": [{ - "pokes": [("gobost", 400)], - "args": ("Woodsman Bert", "He", - ["Do you see this abandoned house?", "I caught this Pokete in there!"], - ["It's pretty cool huh?!"], - ["Oh, yours is better than mine!"], 39, 6) - }, + "playmap_8": [ + { + "pokes": [ + [ + "gobost", + 400 + ] + ], + "args": ( + "Woodsman Bert", + "He", + [ + "trainer.playmap_8.woodsman_bert.dialog1", + "trainer.playmap_8.woodsman_bert.dialog2" + ], + [ + "trainer.playmap_8.woodsman_bert.lose1" + ], + [ + "trainer.playmap_8.woodsman_bert.win1" + ], + 39, + 6 + ) + } ], - "playmap_11": [{ - "pokes": [("clampi", 450)], - "args": ("Fisherman's Friend", "He", - ["G'day, young trainer", "I've lived here for years"], - ["Those years of training were worth it"], - ["I haven't trained my Pokete in years!"], 42, 7) - }, + "playmap_11": [ + { + "pokes": [ + [ + "clampi", + 450 + ] + ], + "args": ( + "Fisherman's Friend", + "He", + [ + "trainer.playmap_11.fishermans_friend.dialog1", + "trainer.playmap_11.fishermans_friend.dialog2" + ], + [ + "trainer.playmap_11.fishermans_friend.lose1" + ], + [ + "trainer.playmap_11.fishermans_friend.win1" + ], + 42, + 7 + ) + } ], - "playmap_12": [{ - "pokes": [("blub", 600)], - "args": ("Brother Justin", "He", - ["Hey, my brother and I want to fight!"], - ["Haha, you're bad!"], - ["Damn!"], 26, 10) - }, { - "pokes": [("poundi", 600)], - "args": ("Brother Justus", "He", - ["Now it's my turn!"], - ["Haha, you're bad!"], - ["Damn!"], 27, 10) - }, + "playmap_12": [ + { + "pokes": [ + [ + "blub", + 600 + ] + ], + "args": ( + "Brother Justin", + "He", + [ + "trainer.playmap_12.brother_justin.dialog1" + ], + [ + "trainer.playmap_12.brother_justin.lose1" + ], + [ + "trainer.playmap_12.brother_justin.win1" + ], + 26, + 10 + ) + }, + { + "pokes": [ + [ + "poundi", + 600 + ] + ], + "args": ( + "Brother Justus", + "He", + [ + "trainer.playmap_12.brother_justus.dialog1" + ], + [ + "trainer.playmap_12.brother_justus.lose1" + ], + [ + "trainer.playmap_12.brother_justus.win1" + ], + 27, + 10 + ) + } ], - "playmap_13": [{ - "pokes": [("vogli", 600)], - "args": ("Citizen", "He", - ["Hello, fellow stranger!", "This town is known for its bird Poketes"], - ["Haha, you're bad!"], - ["Damn!"], 5, 31) - }, + "playmap_13": [ + { + "pokes": [ + [ + "vogli", + 600 + ] + ], + "args": ( + "Citizen", + "He", + [ + "trainer.playmap_13.citizen.dialog1", + "trainer.playmap_13.citizen.dialog2" + ], + [ + "trainer.playmap_13.citizen.lose1" + ], + [ + "trainer.playmap_13.citizen.win1" + ], + 5, + 31 + ) + } ], - "playmap_14": [{ - "pokes": [("owol", 650)], - "args": ("First Trainer", "He", - ["Welcome to the Deepest Forest Pokete Arena", "I'm your first enemy!"], - ["Haha, you're bad!"], - ["Good luck!"], 17, 10) - }, { - "pokes": [("voglo", 700)], - "args": ("Second Trainer", "She", - ["Now it's my turn!"], - ["Haha, you're bad!"], - ["Good luck with the next trainer!"], 22, 10) - }, { - "pokes": [("treenator", 750)], - "args": ("Third Trainer", "She", - ["Let's see what other Poketes you have!"], - ["Haha, you're bad!"], - ["Good luck with the last trainer!"], 22, 5) - }, - { - "pokes": [("ostri", 780)], - "args": ("Last Trainer", "He", - ["I'm your last enemy!"], - ["Haha, you're bad!"], - ["Oh!", "You were able to defeat me?", "You can now leave Deepest Forest"], 17, 5) + "playmap_14": [ + { + "pokes": [ + [ + "owol", + 650 + ] + ], + "args": ( + "First Trainer", + "He", + [ + "trainer.playmap_14.first_trainer.dialog1", + "trainer.playmap_14.first_trainer.dialog2" + ], + [ + "trainer.playmap_14.first_trainer.lose1" + ], + [ + "trainer.playmap_14.first_trainer.win1" + ], + 17, + 10 + ) + }, + { + "pokes": [ + [ + "voglo", + 700 + ] + ], + "args": ( + "Second Trainer", + "She", + [ + "trainer.playmap_14.second_trainer.dialog1" + ], + [ + "trainer.playmap_14.second_trainer.lose1" + ], + [ + "trainer.playmap_14.second_trainer.win1" + ], + 22, + 10 + ) + }, + { + "pokes": [ + [ + "treenator", + 750 + ] + ], + "args": ( + "Third Trainer", + "She", + [ + "trainer.playmap_14.third_trainer.dialog1" + ], + [ + "trainer.playmap_14.third_trainer.lose1" + ], + [ + "trainer.playmap_14.third_trainer.win1" + ], + 22, + 5 + ) }, + { + "pokes": [ + [ + "ostri", + 780 + ] + ], + "args": ( + "Last Trainer", + "He", + [ + "trainer.playmap_14.last_trainer.dialog1" + ], + [ + "trainer.playmap_14.last_trainer.lose1" + ], + [ + "trainer.playmap_14.last_trainer.win1", + "trainer.playmap_14.last_trainer.win2", + "trainer.playmap_14.last_trainer.win3" + ], + 17, + 5 + ) + } ], - "playmap_15": [{ - "pokes": [("clampi", 650)], - "args": ("Samantha", "She", - ["Hey, you!", "My Pokete is very effective against bird Poketes"], - ["You see, it's effective"], - ["Oh no", "I guess yours is even more effective than mine!"], 43, 17) - }, { - "pokes": [("angrilo", 650)], - "args": ("Jessica", "She", - ["Hey you!"], - ["Haha, you're a loser!"], - ["Oh no"], 31, 6) - }, + "playmap_15": [ + { + "pokes": [ + [ + "clampi", + 650 + ] + ], + "args": ( + "Samantha", + "She", + [ + "trainer.playmap_15.samantha.dialog1", + "trainer.playmap_15.samantha.dialog2" + ], + [ + "trainer.playmap_15.samantha.lose1" + ], + [ + "trainer.playmap_15.samantha.win1", + "trainer.playmap_15.samantha.win2" + ], + 43, + 17 + ) + }, + { + "pokes": [ + [ + "angrilo", + 650 + ] + ], + "args": ( + "Jessica", + "She", + [ + "trainer.playmap_15.jessica.dialog1" + ], + [ + "trainer.playmap_15.jessica.lose1" + ], + [ + "trainer.playmap_15.jessica.win1" + ], + 31, + 6 + ) + } ], - "playmap_18": [{ - "pokes": [("poundi", 700)], - "args": ("Bert", "He", - ["Hey!", "This region is full of stone and ground Poketes"], - ["Haha, you're bad!"], - ["Oh, I lost!"], 6, 4) - }, { - "pokes": [("clampi", 700)], - "args": ("Karen", "She", - ["I don't think you can walk here", "I demand a fight with you!"], - ["Go home, little zoomer."], - ["I want to talk to your manager!"], 56, 11) - }, + "playmap_18": [ + { + "pokes": [ + [ + "poundi", + 700 + ] + ], + "args": ( + "Bert", + "He", + [ + "trainer.playmap_18.bert.dialog1", + "trainer.playmap_18.bert.dialog2" + ], + [ + "trainer.playmap_18.bert.lose1" + ], + [ + "trainer.playmap_18.bert.win1" + ], + 6, + 4 + ) + }, + { + "pokes": [ + [ + "clampi", + 700 + ] + ], + "args": ( + "Karen", + "She", + [ + "trainer.playmap_18.karen.dialog1", + "trainer.playmap_18.karen.dialog2" + ], + [ + "trainer.playmap_18.karen.lose1" + ], + [ + "trainer.playmap_18.karen.win1" + ], + 56, + 11 + ) + } ], - "playmap_19": [{ - "pokes": [("choka", 850)], - "args": ("Brian", "He", - ["Hello fellow cave diver!"], - ["Oooooh!", "You're a loooser!"], - ["Oh!", "You were lucky!"], 16, 15) - }, { - "pokes": [("wolfiro", 850)], - "args": ("Simon", "He", - ["Yoooo!", "What's up?"], - ["You're a loooser!"], - ["Duck!"], 15, 7) - }, + "playmap_19": [ + { + "pokes": [ + [ + "choka", + 850 + ] + ], + "args": ( + "Brian", + "He", + [ + "trainer.playmap_19.brian.dialog1" + ], + [ + "trainer.playmap_19.brian.lose1", + "trainer.playmap_19.brian.lose2" + ], + [ + "trainer.playmap_19.brian.win1", + "trainer.playmap_19.brian.win2" + ], + 16, + 15 + ) + }, + { + "pokes": [ + [ + "wolfiro", + 850 + ] + ], + "args": ( + "Simon", + "He", + [ + "trainer.playmap_19.simon.dialog1", + "trainer.playmap_19.simon.dialog2" + ], + [ + "trainer.playmap_19.simon.lose1" + ], + [ + "trainer.playmap_19.simon.win1" + ], + 15, + 7 + ) + } ], - "playmap_21": [{ - "pokes": [("bigstone", 900)], - "args": ("Rock-hard Rick", "He", - ["Hello trainer!", - "Welcome to Rock-ville, the highest place in the Pokete world and home of all stone Poketes.", - "When leaving this town through the 'Cave of Doom' you have to fight against the best trainers of " - "this town.", - "But first, you have to fight me!"], - ["If I'm a problem for you, you might not be able to fight the other trainers."], - ["Oh", "I guess you will be a challenge for our trainers!"], 12, 23) - }, + "playmap_21": [ + { + "pokes": [ + [ + "bigstone", + 900 + ] + ], + "args": ( + "Rock-hard Rick", + "He", + [ + "trainer.playmap_21.rock_hard_rick.dialog1", + "trainer.playmap_21.rock_hard_rick.dialog2", + "trainer.playmap_21.rock_hard_rick.dialog3", + "trainer.playmap_21.rock_hard_rick.dialog4" + ], + [ + "trainer.playmap_21.rock_hard_rick.lose1" + ], + [ + "trainer.playmap_21.rock_hard_rick.win1", + "trainer.playmap_21.rock_hard_rick.win2" + ], + 12, + 23 + ) + } ], - "playmap_27": [{ - "pokes": [("bigstone", 900)], - "args": ("Bertold", "He", - ["We are the elite of Rock-ville!"], - ["You're a loooser!"], - ["You were lucky!"], 6, 6) - }, { - "pokes": [("steini", 900)], - "args": ("Gerard", "He", - ["My Steini will rip out your Pokete's heart!"], - ["You're a loooser!"], - ["The other trainers wont be as easy!"], 11, 10) - }, { - "pokes": [("treenator", 950), ("lilstone", 950)], - "args": ("Jessica", "She", - ["You wont be ready for my Treenator!"], - ["You're a loooser!"], - ["Our best trainer will defeat you though!"], 16, 6) - }, - { - "pokes": [("poundi", 1000), ("steini", 1000), ("diamondos", 1000)], - "args": ("First Trainer", "He", - ["Let's have a fair fight!"], - ["You're a loooser!"], - ["I wish you the best luck on your journey!"], 22, 10) + "playmap_27": [ + { + "pokes": [ + [ + "bigstone", + 900 + ] + ], + "args": ( + "Bertold", + "He", + [ + "trainer.playmap_27.bertold.dialog1" + ], + [ + "trainer.playmap_27.bertold.lose1" + ], + [ + "trainer.playmap_27.bertold.win1" + ], + 6, + 6 + ) + }, + { + "pokes": [ + [ + "steini", + 900 + ] + ], + "args": ( + "Gerard", + "He", + [ + "trainer.playmap_27.gerard.dialog1" + ], + [ + "trainer.playmap_27.gerard.lose1" + ], + [ + "trainer.playmap_27.gerard.win1" + ], + 11, + 10 + ) + }, + { + "pokes": [ + [ + "treenator", + 950 + ], + [ + "lilstone", + 950 + ] + ], + "args": ( + "Jessica", + "She", + [ + "trainer.playmap_27.jessica.dialog1" + ], + [ + "trainer.playmap_27.jessica.lose1" + ], + [ + "trainer.playmap_27.jessica.win1" + ], + 16, + 6 + ) }, + { + "pokes": [ + [ + "poundi", + 1000 + ], + [ + "steini", + 1000 + ], + [ + "diamondos", + 1000 + ] + ], + "args": ( + "First Trainer", + "He", + [ + "trainer.playmap_27.first_trainer.dialog1" + ], + [ + "trainer.playmap_27.first_trainer.lose1" + ], + [ + "trainer.playmap_27.first_trainer.win1" + ], + 22, + 10 + ) + } ], - "playmap_28": [{ - "pokes": [("electrode", 950)], - "args": ("Steven the Big", "He", - ["I don't think you ever met an Electrode!"], - ["You're a loooser!"], - ["Hmph!", "It's not as great as I thought!"], 36, 47) - }, { - "pokes": [("steini", 850)], - "args": ("Laurena", "She", - ["I trained my Steini for years to get to this level", "I will win!"], - ["You're a loooser!"], - ["Ohhh nooo!", "NOT MY STEINI!!!1!!1"], 114, 37) - }, { - "pokes": [("poisopla", 950)], - "args": ("Laurin", "They", - ["Poisopla is one of the strongest local Poketes!", "And it will kill your lame Pokete!"], - ["You're a loooser!"], - ["It won't be as easy in 'Flowy Town'!"], 141, 23) - }, - { - "pokes": [("confuso", 900)], - "args": ("Fucking badass looking dude in the woods", "He", - ["You have to beat my Pokete to enter 'Flowy Town'", "I guess it'll confuse you!"], - ["You're a loooser!"], - ["I wish you the best of luck in 'Flowy Town'!"], 190, 8) + "playmap_28": [ + { + "pokes": [ + [ + "electrode", + 950 + ] + ], + "args": ( + "Steven the Big", + "He", + [ + "trainer.playmap_28.steven_the_big.dialog1" + ], + [ + "trainer.playmap_28.steven_the_big.lose1" + ], + [ + "trainer.playmap_28.steven_the_big.win1", + "trainer.playmap_28.steven_the_big.win2" + ], + 36, + 47 + ) + }, + { + "pokes": [ + [ + "steini", + 850 + ] + ], + "args": ( + "Laurena", + "She", + [ + "trainer.playmap_28.laurena.dialog1", + "trainer.playmap_28.laurena.dialog2" + ], + [ + "trainer.playmap_28.laurena.lose1" + ], + [ + "trainer.playmap_28.laurena.win1", + "trainer.playmap_28.laurena.win2" + ], + 114, + 37 + ) + }, + { + "pokes": [ + [ + "poisopla", + 950 + ] + ], + "args": ( + "Laurin", + "They", + [ + "trainer.playmap_28.laurin.dialog1", + "trainer.playmap_28.laurin.dialog2" + ], + [ + "trainer.playmap_28.laurin.lose1" + ], + [ + "trainer.playmap_28.laurin.win1" + ], + 141, + 23 + ) }, + { + "pokes": [ + [ + "confuso", + 900 + ] + ], + "args": ( + "Fucking badass looking dude in the woods", + "He", + [ + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.dialog1", + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.dialog2" + ], + [ + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.lose1" + ], + [ + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.win1" + ], + 190, + 8 + ) + } ], - "playmap_30": [{ - "pokes": [("poisopla", 950)], - "args": ("Guy at the Entrance", "He", - ["Welcome to 'Flowy Town', home of the flowers."], - ["You're a loooser!"], - ["I wish you the best of luck fighting against our best trainers!"], 5, 18) - }, + "playmap_30": [ + { + "pokes": [ + [ + "poisopla", + 950 + ] + ], + "args": ( + "Guy at the Entrance", + "He", + [ + "trainer.playmap_30.guy_at_the_entrance.dialog1" + ], + [ + "trainer.playmap_30.guy_at_the_entrance.lose1" + ], + [ + "trainer.playmap_30.guy_at_the_entrance.win1" + ], + 5, + 18 + ) + } ], - "playmap_31": [{ - "pokes": [("diamondos", 1000)], - "args": ("Luther", "He", - ["Welcome to the 'Flowy Town' Arena!"], - ["You're a loooser!"], - ["You were lucky!"], 22, 10) - }, { - "pokes": [("poisopla", 1000)], - "args": ("Heavy Hans", "He", - ["I don't think your Pokete is better than mine!"], - ["Your journey came to a fast end!"], - ["The other trainers wont be as easy!"], 25, 8) - }, { - "pokes": [("treenator", 1000)], - "args": ("Aurelia", "She", - ["You wont be ready for my Treenator!"], - ["You're a loooser!"], - ["Our best trainer will defeat you though!"], 28, 6) - }, - { - "pokes": [("rosi", 1200)], - "args": ("Master of the Flowers", "He", - ["I'm the Master of the plants and I have one of the rarest plant Poketes!"], - ["You're a loooser!"], - ["This was unfortunate!"], 31, 4) + "playmap_31": [ + { + "pokes": [ + [ + "diamondos", + 1000 + ] + ], + "args": ( + "Luther", + "He", + [ + "trainer.playmap_31.luther.dialog1" + ], + [ + "trainer.playmap_31.luther.lose1" + ], + [ + "trainer.playmap_31.luther.win1" + ], + 22, + 10 + ) }, - ], - "playmap_33": [{ - "pokes": [("mowcow", 1200)], - "args": ("Cowsay", "They", - ["This apt has supercow-powers!"], - ["You're a loooser!"], - ["I hope you'll also catch one!!"], 59, 23) + { + "pokes": [ + [ + "poisopla", + 1000 + ] + ], + "args": ( + "Heavy Hans", + "He", + [ + "trainer.playmap_31.heavy_hans.dialog1" + ], + [ + "trainer.playmap_31.heavy_hans.lose1" + ], + [ + "trainer.playmap_31.heavy_hans.win1" + ], + 25, + 8 + ) }, - ], - "playmap_35": [{ - "pokes": [("mowcow", 1200)], - "args": ("Farmer Gert", "He", - ["Welcome to the fields of Agrawos!", - "This is the farming part of the city of Agrawos!", - "You have to pass my field to reach Agrawos!"], - ["I don't think you'll ever get there!"], - ["Have fun in Agrawos!"], 6, 17) - }, { - "pokes": [("dicki", 1250)], - "args": ("Farmer Doora", "She", - ["This is a cool Pokete I found on my field!"], - ["It's cool, innit?!"], - ["I guess have still have to train it. :("], 74, 33) - }, { - "pokes": [("wolfiro", 1300)], - "args": ("Farmer Ralf", "He", - ["DIE!"], - ["HAHAHA, IM BETTER THAN YOU!"], - ["NOOOOOO; WHYYY ARE YOU BETTER ??!!!1!!!111"], 69, 61) + { + "pokes": [ + [ + "treenator", + 1000 + ] + ], + "args": ( + "Aurelia", + "She", + [ + "trainer.playmap_31.aurelia.dialog1" + ], + [ + "trainer.playmap_31.aurelia.lose1" + ], + [ + "trainer.playmap_31.aurelia.win1" + ], + 28, + 6 + ) }, + { + "pokes": [ + [ + "rosi", + 1200 + ] + ], + "args": ( + "Master of the Flowers", + "He", + [ + "trainer.playmap_31.master_of_the_flowers.dialog1" + ], + [ + "trainer.playmap_31.master_of_the_flowers.lose1" + ], + [ + "trainer.playmap_31.master_of_the_flowers.win1" + ], + 31, + 4 + ) + } ], - "playmap_39": [{ - "pokes": [("megapois", 2000)], - "args": ("Gardener Angela", "She", - ["Have you already fought our lead trainer?", - "If so, look at this cool Pokete!"], - ["You're a loooser!"], - ["Cool, huh?"], 8, 37) - }, + "playmap_33": [ + { + "pokes": [ + [ + "mowcow", + 1200 + ] + ], + "args": ( + "Cowsay", + "They", + [ + "trainer.playmap_33.cowsay.dialog1" + ], + [ + "trainer.playmap_33.cowsay.lose1" + ], + [ + "trainer.playmap_33.cowsay.win1" + ], + 59, + 23 + ) + } ], - "playmap_40": [{ - "pokes": [("rustacean", 1800)], - "args": ("Angler Gustav", "He", - ["My Pokete will blow you away!"], - ["You're a loooser!"], - ["Cool, huh?"], 58, 12) + "playmap_35": [ + { + "pokes": [ + [ + "mowcow", + 1200 + ] + ], + "args": ( + "Farmer Gert", + "He", + [ + "trainer.playmap_35.farmer_gert.dialog1", + "trainer.playmap_35.farmer_gert.dialog2", + "trainer.playmap_35.farmer_gert.dialog3" + ], + [ + "trainer.playmap_35.farmer_gert.lose1" + ], + [ + "trainer.playmap_35.farmer_gert.win1" + ], + 6, + 17 + ) }, - ], - "playmap_41": [{ - "pokes": [("wheeto", 2000)], - "args": ("Farmer Daniel", "He", - ["Howdy, partner!", "How ya doin?", - "My Pokete is one of a kind", - "The good stuff!"], - ["Uhhh yeah!", "The good stuff...!"], - ["I guess it's not the good stuff"], 17, 4) + { + "pokes": [ + [ + "dicki", + 1250 + ] + ], + "args": ( + "Farmer Doora", + "She", + [ + "trainer.playmap_35.farmer_doora.dialog1" + ], + [ + "trainer.playmap_35.farmer_doora.lose1" + ], + [ + "trainer.playmap_35.farmer_doora.win1" + ], + 74, + 33 + ) }, + { + "pokes": [ + [ + "wolfiro", + 1300 + ] + ], + "args": ( + "Farmer Ralf", + "He", + [ + "trainer.playmap_35.farmer_ralf.dialog1" + ], + [ + "trainer.playmap_35.farmer_ralf.lose1" + ], + [ + "trainer.playmap_35.farmer_ralf.win1" + ], + 69, + 61 + ) + } + ], + "playmap_39": [ + { + "pokes": [ + [ + "megapois", + 2000 + ] + ], + "args": ( + "Gardener Angela", + "She", + [ + "trainer.playmap_39.gardener_angela.dialog1", + "trainer.playmap_39.gardener_angela.dialog2" + ], + [ + "trainer.playmap_39.gardener_angela.lose1" + ], + [ + "trainer.playmap_39.gardener_angela.win1" + ], + 8, + 37 + ) + } + ], + "playmap_40": [ + { + "pokes": [ + [ + "rustacean", + 1800 + ] + ], + "args": ( + "Angler Gustav", + "He", + [ + "trainer.playmap_40.angler_gustav.dialog1" + ], + [ + "trainer.playmap_40.angler_gustav.lose1" + ], + [ + "trainer.playmap_40.angler_gustav.win1" + ], + 58, + 12 + ) + } + ], + "playmap_41": [ + { + "pokes": [ + [ + "wheeto", + 2000 + ] + ], + "args": ( + "Farmer Daniel", + "He", + [ + "trainer.playmap_41.farmer_daniel.dialog1", + "trainer.playmap_41.farmer_daniel.dialog2", + "trainer.playmap_41.farmer_daniel.dialog3", + "trainer.playmap_41.farmer_daniel.dialog4" + ], + [ + "trainer.playmap_41.farmer_daniel.lose1", + "trainer.playmap_41.farmer_daniel.lose2" + ], + [ + "trainer.playmap_41.farmer_daniel.win1" + ], + 17, + 4 + ) + } ], "playmap_46": [ { - "pokes": [("wheeto", 2000)], - "args": ("Farmer Martin", "He", - ["Howdy, partner!", "I will be your first challenger!"], - ["You'll do better next time."], - ["I wish you the best of luck"], 19, 7) + "pokes": [ + [ + "wheeto", + 2000 + ] + ], + "args": ( + "Farmer Martin", + "He", + [ + "trainer.playmap_46.farmer_martin.dialog1", + "trainer.playmap_46.farmer_martin.dialog2" + ], + [ + "trainer.playmap_46.farmer_martin.lose1" + ], + [ + "trainer.playmap_46.farmer_martin.win1" + ], + 19, + 7 + ) }, { - "pokes": [("dicko", 2100)], - "args": ("The Undetermined", "They", - ["I see you're not as bad as we thought!"], - ["You'll do better next time."], - ["I wish you the best of luck"], 16, 7) + "pokes": [ + [ + "dicko", + 2100 + ] + ], + "args": ( + "The Undetermined", + "They", + [ + "trainer.playmap_46.the_undetermined.dialog1" + ], + [ + "trainer.playmap_46.the_undetermined.lose1" + ], + [ + "trainer.playmap_46.the_undetermined.win1" + ], + 16, + 7 + ) }, { - "pokes": [("megapois", 2200), ("bushy", 2200)], - "args": ("Gardener Daniela", "She", - ["Look at my newest creation!"], - ["You'll do better next time."], - ["I wish you the best of luck"], 13, 7) + "pokes": [ + [ + "megapois", + 2200 + ], + [ + "bushy", + 2200 + ] + ], + "args": ( + "Gardener Daniela", + "She", + [ + "trainer.playmap_46.gardener_daniela.dialog1" + ], + [ + "trainer.playmap_46.gardener_daniela.lose1" + ], + [ + "trainer.playmap_46.gardener_daniela.win1" + ], + 13, + 7 + ) }, { - "pokes": [("mowcow", 2300), ("treenator", 2300), ("wheeto", 2300)], - "args": ("Leader Sebastian", "He", - ["So, I'll be your last opponent.", - "Let's have a fair fight!"], - ["You'll do better next time."], - ["You're quite a good trainer.", - "Hopefully you can beat all other trainers with whom " - "you may cross paths!"], 10, 7) - }, - ], + "pokes": [ + [ + "mowcow", + 2300 + ], + [ + "treenator", + 2300 + ], + [ + "wheeto", + 2300 + ] + ], + "args": ( + "Leader Sebastian", + "He", + [ + "trainer.playmap_46.leader_sebastian.dialog1", + "trainer.playmap_46.leader_sebastian.dialog2" + ], + [ + "trainer.playmap_46.leader_sebastian.lose1" + ], + [ + "trainer.playmap_46.leader_sebastian.win1", + "trainer.playmap_46.leader_sebastian.win2" + ], + 10, + 7 + ) + } + ] } + if __name__ == "__main__": print("\033[31;1mDo not execute this!\033[0m") From 6006fb7a18c10218d7c6cdcee5fdcbd903ea3280 Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Fri, 5 Aug 2022 15:35:59 +0200 Subject: [PATCH 09/10] Made Pokete names translateable --- pokete_data/poketes.py | 100 ++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/pokete_data/poketes.py b/pokete_data/poketes.py index 664e8b6b..421a272e 100644 --- a/pokete_data/poketes.py +++ b/pokete_data/poketes.py @@ -8,7 +8,7 @@ pokes = { "__fallback__": { - "name": "", + "name": "pokete.__fallback__.name", "hp": 20, "atc": 0, "defense": 0, @@ -27,7 +27,7 @@ "esc": None}], }, "steini": { - "name": "Steini", + "name": "pokete.steini.name", "hp": 25, "atc": 2, "defense": 4, @@ -49,7 +49,7 @@ "esc": None}], }, "mowcow": { - "name": "Mowcow", + "name": "pokete.mowcow.name", "hp": 20, "atc": 2, "defense": 3, @@ -70,7 +70,7 @@ "esc": None}], }, "bigstone": { - "name": "Bigstone", + "name": "pokete.bigstone.name", "hp": 30, "atc": 2, "defense": 13, @@ -92,7 +92,7 @@ "esc": None}], }, "poundi": { - "name": "Poundi", + "name": "pokete.poundi.name", "hp": 25, "atc": 2, "defense": 3, @@ -114,7 +114,7 @@ "esc": None}], }, "lilstone": { - "name": "Lilstone", + "name": "pokete.lilstone.name", "hp": 20, "atc": 1, "defense": 2, @@ -136,7 +136,7 @@ "esc": None}], }, "rosi": { - "name": "Rosi", + "name": "pokete.rosi.name", "hp": 20, "atc": 0, "defense": 1, @@ -158,7 +158,7 @@ "esc": None}], }, "wheeto": { - "name": "Wheeto", + "name": "pokete.wheeto.name", "hp": 20, "atc": 3, "defense": 2, @@ -180,7 +180,7 @@ "esc": None}], }, "saugh": { - "name": "Saugh", + "name": "pokete.saugh.name", "hp": 20, "atc": 4, "defense": 2, @@ -208,7 +208,7 @@ }], }, "gobost": { - "name": "Gobost", + "name": "pokete.gobost.name", "hp": 20, "atc": 2, "defense": 1, @@ -230,7 +230,7 @@ "esc": None}], }, "angrilo": { - "name": "Angrilo", + "name": "pokete.angrilo.name", "hp": 25, "atc": 3, "defense": 2, @@ -252,7 +252,7 @@ "esc": None}], }, "vogli": { - "name": "Vogli", + "name": "pokete.vogli.name", "hp": 20, "atc": 6, "defense": 1, @@ -274,7 +274,7 @@ "esc": None}] }, "voglo": { - "name": "Voglo", + "name": "pokete.voglo.name", "hp": 20, "atc": 7, "defense": 1, @@ -296,7 +296,7 @@ "esc": None}] }, "voglus": { - "name": "Voglus", + "name": "pokete.voglus.name", "hp": 25, "atc": 9, "defense": 3, @@ -321,7 +321,7 @@ "esc": ["thicc", "red"]}] }, "ostri": { - "name": "Ostri", + "name": "pokete.ostri.name", "hp": 20, "atc": 8, "defense": 0, @@ -343,7 +343,7 @@ "esc": None}] }, "karpi": { - "name": "Karpi", + "name": "pokete.karpi.name", "hp": 15, "atc": 0, "defense": 0, @@ -365,7 +365,7 @@ "esc": None}] }, "würgos": { - "name": "Würgos", + "name": "pokete.würgos.name", "hp": 20, "atc": 3, "defense": 0, @@ -387,7 +387,7 @@ "esc": None}] }, "choka": { - "name": "Choka", + "name": "pokete.choka.name", "hp": 25, "atc": 5, "defense": 1, @@ -409,7 +409,7 @@ "esc": None}] }, "treenator": { - "name": "Treenator", + "name": "pokete.treenator.name", "hp": 25, "atc": 2, "defense": 2, @@ -431,7 +431,7 @@ "esc": None}] }, "bato": { - "name": "Bato", + "name": "pokete.bato.name", "hp": 20, "atc": 3, "defense": 1, @@ -452,7 +452,7 @@ "esc": None}] }, "bator": { - "name": "Bator", + "name": "pokete.bator.name", "hp": 25, "atc": 4, "defense": 2, @@ -474,7 +474,7 @@ "esc": None}] }, "blub": { - "name": "Blub", + "name": "pokete.blub.name", "hp": 20, "atc": 2, "defense": 1, @@ -496,7 +496,7 @@ "esc": None}] }, "owol": { - "name": "Owol", + "name": "pokete.owol.name", "hp": 20, "atc": 7, "defense": 2, @@ -520,7 +520,7 @@ "esc": None}] }, "rato": { - "name": "Rato", + "name": "pokete.rato.name", "hp": 20, "atc": 4, "defense": 2, @@ -541,7 +541,7 @@ "esc": None}] }, "ratatat": { - "name": "Ratatat", + "name": "pokete.ratatat.name", "hp": 25, "atc": 7, "defense": 3, @@ -566,7 +566,7 @@ "esc": ["thicc", "green"]}] }, "hornita": { - "name": "Hornita", + "name": "pokete.hornita.name", "hp": 20, "atc": 6, "defense": 2, @@ -588,7 +588,7 @@ "esc": None}] }, "horny": { - "name": "Horny", + "name": "pokete.horny.name", "hp": 20, "atc": 5, "defense": 1, @@ -610,7 +610,7 @@ "esc": None}] }, "bushy": { - "name": "Bushy", + "name": "pokete.bushy.name", "hp": 25, "atc": 2, "defense": 1, @@ -631,7 +631,7 @@ "esc": None}] }, "wolfior": { - "name": "Wolfior", + "name": "pokete.wolfior.name", "hp": 20, "atc": 6, "defense": 3, @@ -656,7 +656,7 @@ "esc": ["thicc", "red"]}] }, "wolfiro": { - "name": "Wolfiro", + "name": "pokete.wolfiro.name", "hp": 25, "atc": 7, "defense": 4, @@ -681,7 +681,7 @@ "esc": ["thicc", "red"]}] }, "rollator": { - "name": "Rollator", + "name": "pokete.rollator.name", "hp": 25, "atc": 2, "defense": 5, @@ -703,7 +703,7 @@ "esc": None}] }, "clampi": { - "name": "Clampi", + "name": "pokete.clampi.name", "hp": 25, "atc": 2, "defense": 7, @@ -727,7 +727,7 @@ "esc": ["lightblue"]}] }, "crabbat": { - "name": "Crabbat", + "name": "pokete.crabbat.name", "hp": 30, "atc": 3, "defense": 8, @@ -751,7 +751,7 @@ "esc": ["lightblue"]}] }, "rustacean": { - "name": "Rustacean", + "name": "pokete.rustacean.name", "hp": 35, "atc": 4, "defense": 9, @@ -775,7 +775,7 @@ "esc": ["lightblue"]}] }, "electrode": { - "name": "Electrode", + "name": "pokete.electrode.name", "hp": 20, "atc": 5, "defense": 2, @@ -798,7 +798,7 @@ "esc": ["lightblue"]}] }, "cubl": { - "name": "Cubl", + "name": "pokete.cubl.name", "hp": 20, "atc": 3, "defense": 3, @@ -828,7 +828,7 @@ ] }, "spikl": { - "name": "Spikl", + "name": "pokete.spikl.name", "hp": 25, "atc": 4, "defense": 4, @@ -860,7 +860,7 @@ ] }, "confuso": { - "name": "Confuso", + "name": "pokete.confuso.name", "hp": 20, "atc": 1, "defense": 1, @@ -889,7 +889,7 @@ ] }, "poisopla": { - "name": "Poisopla", + "name": "pokete.poisopla.name", "hp": 20, "atc": 3, "defense": 3, @@ -915,7 +915,7 @@ ] }, "megapois": { - "name": "Megapois", + "name": "pokete.megapois.name", "hp": 25, "atc": 3, "defense": 5, @@ -941,7 +941,7 @@ ] }, "corcos_day": { - "name": "Corcos", + "name": "pokete.corcos_day.name", "hp": 15, "atc": 2, "defense": 5, @@ -965,7 +965,7 @@ ] }, "corcos_night": { - "name": "Corcos", + "name": "pokete.corcos_night.name", "hp": 15, "atc": 2, "defense": 5, @@ -989,7 +989,7 @@ ] }, "raupathor_day": { - "name": "Raupathor", + "name": "pokete.raupathor_day.name", "hp": 20, "atc": 3, "defense": 4, @@ -1014,7 +1014,7 @@ ] }, "raupathor_night": { - "name": "Raupathor", + "name": "pokete.raupathor_night.name", "hp": 20, "atc": 3, "defense": 4, @@ -1042,7 +1042,7 @@ ] }, "schmetterling": { - "name": "Schmetterling", + "name": "pokete.schmetterling.name", "hp": 20, "atc": 5, "defense": 2, @@ -1065,7 +1065,7 @@ ] }, "mothor": { - "name": "Mothor", + "name": "pokete.mothor.name", "hp": 20, "atc": 6, "defense": 2, @@ -1093,7 +1093,7 @@ ] }, "lil_nut": { - "name": "Lil Nut", + "name": "pokete.lil_nut.name", "hp": 20, "atc": 1, "defense": 3, @@ -1116,7 +1116,7 @@ ] }, "dicki": { - "name": "Dicki", + "name": "pokete.dicki.name", "hp": 20, "atc": 2, "defense": 4, @@ -1139,7 +1139,7 @@ ] }, "dicko": { - "name": "Dicko", + "name": "pokete.dicko.name", "hp": 25, "atc": 3, "defense": 5, @@ -1162,7 +1162,7 @@ ] }, "diamondos": { - "name": "Diamondos", + "name": "pokete.diamondos.name", "hp": 20, "atc": 2, "defense": 15, From 487a17ea9a2411c5c6004e6a6b14c47e77b9c3cf Mon Sep 17 00:00:00 2001 From: Maik Steiger Date: Fri, 5 Aug 2022 15:56:39 +0200 Subject: [PATCH 10/10] Automatic schema generator, useful for adding new languages --- assets/gen_schema.py | 35 + assets/lang/schema.json | 1961 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 1995 insertions(+), 1 deletion(-) create mode 100644 assets/gen_schema.py diff --git a/assets/gen_schema.py b/assets/gen_schema.py new file mode 100644 index 00000000..8f0d52b9 --- /dev/null +++ b/assets/gen_schema.py @@ -0,0 +1,35 @@ +from pathlib import Path +import json + +def main(): + lang_path = Path(__file__).parent / "lang" + lang_file = lang_path / "en_US.json" + schema_file = lang_path / "schema.json" + + schema = { + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Pokete Translation File Schema", + "properties": {} + } + + if not lang_file.is_file(): + print(f"en_US.json file not found in directory {lang_file} Abort.") + return + + with open(lang_file) as en_US: + data = json.load(en_US) + + for key in data: + if key == "$schema": + continue + + schema["properties"][key] = { + "type": "string" + } + + with open(schema_file, "w") as schema_file: + json.dump(schema, schema_file, indent=2) + + +if __name__ == '__main__': + main() diff --git a/assets/lang/schema.json b/assets/lang/schema.json index de69d4fd..130015ed 100644 --- a/assets/lang/schema.json +++ b/assets/lang/schema.json @@ -2,18 +2,282 @@ "$schema": "http://json-schema.org/draft-07/schema", "title": "Pokete Translation File Schema", "properties": { + "assert.input.text_length": { + "type": "string" + }, + "assert.pokete.attack_length": { + "type": "string" + }, + "error.input.single_space_character": { + "type": "string" + }, "error.import.scrap_engine": { "type": "string" }, + "error.exception.road_map_exception": { + "type": "string" + }, + "error.mod.attributes": { + "type": "string" + }, + "ui.pokete.title": { + "type": "string" + }, + "ui.dialog.yes": { + "type": "string" + }, + "ui.dialog.no": { + "type": "string" + }, + "ui.dialog.select_yes": { + "type": "string" + }, + "ui.dialog.select_no": { + "type": "string" + }, + "ui.dialog.select_ok": { + "type": "string" + }, + "ui.dialog.min_window_size": { + "type": "string" + }, + "ui.dialog.on": { + "type": "string" + }, + "ui.dialog.off": { + "type": "string" + }, + "ui.dialog.nothing": { + "type": "string" + }, + "ui.dialog.succeeded": { + "type": "string" + }, + "ui.dialog.failed": { + "type": "string" + }, + "ui.dialog.answer": { + "type": "string" + }, + "ui.dialog.lost": { + "type": "string" + }, + "ui.dialog.won": { + "type": "string" + }, + "ui.dialog.close": { + "type": "string" + }, + "ui.dialog.at": { + "type": "string" + }, + "ui.dialog.exit": { + "type": "string" + }, + "ui.dialog.active": { + "type": "string" + }, + "ui.dialog.move": { + "type": "string" + }, + "ui.dialog.move_to": { + "type": "string" + }, + "ui.dialog.cant_free_all": { + "type": "string" + }, + "ui.dialog.free": { + "type": "string" + }, + "ui.dialog.free_pokete": { + "type": "string" + }, + "ui.details.title": { + "type": "string" + }, + "ui.details.attacks": { + "type": "string" + }, + "ui.details.attack": { + "type": "string" + }, + "ui.details.defense": { + "type": "string" + }, + "ui.details.abilities": { + "type": "string" + }, + "ui.details.initiative": { + "type": "string" + }, + "ui.details.nature": { + "type": "string" + }, + "ui.details.nature.very": { + "type": "string" + }, + "ui.details.nature.description": { + "type": "string" + }, + "ui.details.use_ability": { + "type": "string" + }, + "ui.details.denominator.equal": { + "type": "string" + }, + "ui.details.denominator.less_than": { + "type": "string" + }, + "ui.details.denominator.greater_than": { + "type": "string" + }, + "ui.movemap.deck": { + "type": "string" + }, + "ui.movemap.map": { + "type": "string" + }, + "ui.movemap.inventory_abbr": { + "type": "string" + }, + "ui.movemap.clock": { + "type": "string" + }, + "ui.movemap.help": { + "type": "string" + }, + "ui.hotkeys.not_set": { + "type": "string" + }, + "ui.menu.title": { + "type": "string" + }, + "ui.menu.playername": { + "type": "string" + }, + "ui.menu.playername_char": { + "type": "string" + }, + "ui.menu.save": { + "type": "string" + }, + "ui.menu.quit_game": { + "type": "string" + }, + "ui.menu.autosave": { + "type": "string" + }, + "ui.menu.animations": { + "type": "string" + }, + "ui.menu.save_trainers": { + "type": "string" + }, + "ui.menu.audio": { + "type": "string" + }, + "ui.menu.language": { + "type": "string" + }, + "ui.menu.saving": { + "type": "string" + }, + "ui.about.title": { + "type": "string" + }, + "ui.mods.title": { + "type": "string" + }, + "ui.mods.load": { + "type": "string" + }, + "ui.mods.description": { + "type": "string" + }, + "ui.mods.currently.singular": { + "type": "string" + }, + "ui.mods.currently.plural": { + "type": "string" + }, + "ui.mods.enabled": { + "type": "string" + }, + "ui.mods.disabled": { + "type": "string" + }, + "ui.dex.title": { + "type": "string" + }, "ui.inventory.title": { "type": "string" }, + "ui.achievements.title": { + "type": "string" + }, + "ui.achievements.achieved": { + "type": "string" + }, + "ui.achievements.unlocked": { + "type": "string" + }, + "ui.shop.title": { + "type": "string" + }, + "ui.roadmap.title": { + "type": "string" + }, + "ui.roadmap.find": { + "type": "string" + }, + "ui.controls.title": { + "type": "string" + }, + "ui.help.controls.up": { + "type": "string" + }, + "ui.help.controls.down": { + "type": "string" + }, + "ui.help.controls.left": { + "type": "string" + }, + "ui.help.controls.right": { + "type": "string" + }, + "ui.help.controls.menu": { + "type": "string" + }, + "ui.help.text": { + "type": "string" + }, "ui.lang.en_us": { "type": "string" }, "ui.lang.de_de": { "type": "string" }, + "dialog.time.day": { + "type": "string" + }, + "dialog.time.night": { + "type": "string" + }, + "dialog.time.always": { + "type": "string" + }, + "dialog.evolution.look": { + "type": "string" + }, + "dialog.evolution.evolving": { + "type": "string" + }, + "dialog.evolution.evolved": { + "type": "string" + }, + "dialog.evolution.evolve": { + "type": "string" + }, "dialog.center.welcome": { "type": "string" }, @@ -25,6 +289,1701 @@ }, "dialog.center.healed": { "type": "string" + }, + "dialog.shop.welcome": { + "type": "string" + }, + "dialog.shop.action": { + "type": "string" + }, + "dialog.shop.leave": { + "type": "string" + }, + "dialog.trader.welcome": { + "type": "string" + }, + "dialog.trader.action": { + "type": "string" + }, + "dialog.attack.what_to_do": { + "type": "string" + }, + "dialog.attack.no_items": { + "type": "string" + }, + "dialog.attack.run_question": { + "type": "string" + }, + "dialog.attack.failed_run": { + "type": "string" + }, + "dialog.attack.success_run": { + "type": "string" + }, + "dialog.attack.encounter": { + "type": "string" + }, + "dialog.attack.start_fight": { + "type": "string" + }, + "dialog.attack.opponent.attack": { + "type": "string" + }, + "dialog.attack.opponent.used": { + "type": "string" + }, + "dialog.attack.player.attack": { + "type": "string" + }, + "dialog.attack.player.swap_pokete": { + "type": "string" + }, + "dialog.attack.player.swap_pokete.confirm": { + "type": "string" + }, + "dialog.attack.player.throw": { + "type": "string" + }, + "dialog.attack.pokete.defeat": { + "type": "string" + }, + "dialog.attack.pokete.no_ap": { + "type": "string" + }, + "dialog.attack.pokete.won": { + "type": "string" + }, + "dialog.attack.pokete.levelup": { + "type": "string" + }, + "dialog.attack.pokete.caught": { + "type": "string" + }, + "dialog.attack.pokete.missed": { + "type": "string" + }, + "dialog.attack.pokete.learn_attack": { + "type": "string" + }, + "dialog.attack.pokete.learned_attack": { + "type": "string" + }, + "dialog.attack.noop": { + "type": "string" + }, + "dialog.attack.blackout": { + "type": "string" + }, + "dialog.attack.deck": { + "type": "string" + }, + "dialog.attack.won": { + "type": "string" + }, + "dialog.attack.lvl": { + "type": "string" + }, + "dialog.attack.hp": { + "type": "string" + }, + "dialog.attack.xp": { + "type": "string" + }, + "dialog.attack.ap": { + "type": "string" + }, + "dialog.attack.attacks": { + "type": "string" + }, + "dialog.attack.attack": { + "type": "string" + }, + "dialog.attack.attack_info": { + "type": "string" + }, + "dialog.attack.run": { + "type": "string" + }, + "dialog.attack.type": { + "type": "string" + }, + "dialog.attack.info": { + "type": "string" + }, + "dialog.attack.effective": { + "type": "string" + }, + "dialog.attack.not_effective": { + "type": "string" + }, + "dialog.attack.missed": { + "type": "string" + }, + "dialog.attack.attack_used": { + "type": "string" + }, + "dialog.attack.hurt_itself": { + "type": "string" + }, + "dialog.inventory.prefix_ld_disk": { + "type": "string" + }, + "dialog.inventory.teach_disc": { + "type": "string" + }, + "dialog.effect.not_affected": { + "type": "string" + }, + "dialog.effect.now": { + "type": "string" + }, + "dialog.effect.already": { + "type": "string" + }, + "dialog.effect.still": { + "type": "string" + }, + "dialog.effect.isnt": { + "type": "string" + }, + "dialog.effect.anymore": { + "type": "string" + }, + "dialog.effect.cant_attack": { + "type": "string" + }, + "dialog.effect.paralysis.description": { + "type": "string" + }, + "dialog.effect.sleep.description": { + "type": "string" + }, + "dialog.effect.burn.description": { + "type": "string" + }, + "dialog.effect.poison.description": { + "type": "string" + }, + "dialog.effect.confusion.description": { + "type": "string" + }, + "dialog.effect.freeze.description": { + "type": "string" + }, + "dialog.walk.collected_item.singular": { + "type": "string" + }, + "dialog.walk.collected_item.plural": { + "type": "string" + }, + "npc.interaction.give": { + "type": "string" + }, + "npc.interaction.twenty_dollars": { + "type": "string" + }, + "npc.test_npc.hey": { + "type": "string" + }, + "npc.old_man.greet": { + "type": "string" + }, + "npc.old_man.talk": { + "type": "string" + }, + "npc.old_man.found_hyperball": { + "type": "string" + }, + "npc.old_man.hyperball": { + "type": "string" + }, + "npc.old_man.rarest": { + "type": "string" + }, + "npc.old_man.keep": { + "type": "string" + }, + "achievement.first_poke.title": { + "type": "string" + }, + "achievement.first_poke.description": { + "type": "string" + }, + "achievement.first_duel.title": { + "type": "string" + }, + "achievement.first_duel.description": { + "type": "string" + }, + "achievement.catch_em_all.title": { + "type": "string" + }, + "achievement.catch_em_all.description": { + "type": "string" + }, + "attack.tackle.title": { + "type": "string" + }, + "attack.tackle.description": { + "type": "string" + }, + "attack.cry.title": { + "type": "string" + }, + "attack.cry.description": { + "type": "string" + }, + "attack.bite.title": { + "type": "string" + }, + "attack.bite.description": { + "type": "string" + }, + "attack.power_bite.title": { + "type": "string" + }, + "attack.power_bite.description": { + "type": "string" + }, + "attack.chocer.title": { + "type": "string" + }, + "attack.chocer.description": { + "type": "string" + }, + "attack.tail_wipe.title": { + "type": "string" + }, + "attack.tail_wipe.description": { + "type": "string" + }, + "attack.meat_skewer.title": { + "type": "string" + }, + "attack.meat_skewer.description": { + "type": "string" + }, + "attack.snooze.title": { + "type": "string" + }, + "attack.snooze.description": { + "type": "string" + }, + "attack.supercow_power.title": { + "type": "string" + }, + "attack.supercow_power.description": { + "type": "string" + }, + "attack.poison_bite.title": { + "type": "string" + }, + "attack.poison_bite.description": { + "type": "string" + }, + "attack.poison_thorn.title": { + "type": "string" + }, + "attack.poison_thorn.description": { + "type": "string" + }, + "attack.pepple_fire.title": { + "type": "string" + }, + "attack.pepple_fire.description": { + "type": "string" + }, + "attack.sand_throw.title": { + "type": "string" + }, + "attack.sand_throw.description": { + "type": "string" + }, + "attack.politure.title": { + "type": "string" + }, + "attack.politure.description": { + "type": "string" + }, + "attack.brick_throw.title": { + "type": "string" + }, + "attack.brick_throw.description": { + "type": "string" + }, + "attack.rock_smash.title": { + "type": "string" + }, + "attack.rock_smash.description": { + "type": "string" + }, + "attack.dia_stab.title": { + "type": "string" + }, + "attack.dia_stab.description": { + "type": "string" + }, + "attack.dazzle.title": { + "type": "string" + }, + "attack.dazzle.description": { + "type": "string" + }, + "attack.dia_spikes.title": { + "type": "string" + }, + "attack.dia_spikes.description": { + "type": "string" + }, + "attack.earch_quake.title": { + "type": "string" + }, + "attack.earch_quake.description": { + "type": "string" + }, + "attack.power_roll.title": { + "type": "string" + }, + "attack.power_roll.description": { + "type": "string" + }, + "attack.toe_breaker.title": { + "type": "string" + }, + "attack.toe_breaker.description": { + "type": "string" + }, + "attack.ground_hit.title": { + "type": "string" + }, + "attack.ground_hit.description": { + "type": "string" + }, + "attack.dick_energy.title": { + "type": "string" + }, + "attack.dick_energy.description": { + "type": "string" + }, + "attack.hiding.title": { + "type": "string" + }, + "attack.hiding.description": { + "type": "string" + }, + "attack.fire_bite.title": { + "type": "string" + }, + "attack.fire_bite.description": { + "type": "string" + }, + "attack.ash_throw.title": { + "type": "string" + }, + "attack.ash_throw.description": { + "type": "string" + }, + "attack.flame_throw.title": { + "type": "string" + }, + "attack.flame_throw.description": { + "type": "string" + }, + "attack.fire_ball.title": { + "type": "string" + }, + "attack.fire_ball.description": { + "type": "string" + }, + "attack.flying.title": { + "type": "string" + }, + "attack.flying.description": { + "type": "string" + }, + "attack.pick.title": { + "type": "string" + }, + "attack.pick.description": { + "type": "string" + }, + "attack.wind_blow.title": { + "type": "string" + }, + "attack.wind_blow.description": { + "type": "string" + }, + "attack.storm_gust.title": { + "type": "string" + }, + "attack.storm_gust.description": { + "type": "string" + }, + "attack.schmetter.title": { + "type": "string" + }, + "attack.schmetter.description": { + "type": "string" + }, + "attack.eye_pick.title": { + "type": "string" + }, + "attack.eye_pick.description": { + "type": "string" + }, + "attack.wing_hit.title": { + "type": "string" + }, + "attack.wing_hit.description": { + "type": "string" + }, + "attack.brooding.title": { + "type": "string" + }, + "attack.brooding.description": { + "type": "string" + }, + "attack.power_pick.title": { + "type": "string" + }, + "attack.power_pick.description": { + "type": "string" + }, + "attack.bubble_gun.title": { + "type": "string" + }, + "attack.bubble_gun.description": { + "type": "string" + }, + "attack.bubble_bomb.title": { + "type": "string" + }, + "attack.bubble_bomb.description": { + "type": "string" + }, + "attack.bubble_shield.title": { + "type": "string" + }, + "attack.bubble_shield.description": { + "type": "string" + }, + "attack.wet_slap.title": { + "type": "string" + }, + "attack.wet_slap.description": { + "type": "string" + }, + "attack.shell_pinch.title": { + "type": "string" + }, + "attack.shell_pinch.description": { + "type": "string" + }, + "attack.heart_touch.title": { + "type": "string" + }, + "attack.heart_touch.description": { + "type": "string" + }, + "attack.confusion.title": { + "type": "string" + }, + "attack.confusion.description": { + "type": "string" + }, + "attack.mind_blow.title": { + "type": "string" + }, + "attack.mind_blow.description": { + "type": "string" + }, + "attack.shock.title": { + "type": "string" + }, + "attack.shock.description": { + "type": "string" + }, + "attack.charging.title": { + "type": "string" + }, + "attack.charging.description": { + "type": "string" + }, + "attack.mega_arch.title": { + "type": "string" + }, + "attack.mega_arch.description": { + "type": "string" + }, + "attack.special_smell.title": { + "type": "string" + }, + "attack.special_smell.description": { + "type": "string" + }, + "attack.apple_drop.title": { + "type": "string" + }, + "attack.apple_drop.description": { + "type": "string" + }, + "attack.super_sucker.title": { + "type": "string" + }, + "attack.super_sucker.description": { + "type": "string" + }, + "attack.sucker.title": { + "type": "string" + }, + "attack.sucker.description": { + "type": "string" + }, + "attack.root_strangler.title": { + "type": "string" + }, + "attack.root_strangler.description": { + "type": "string" + }, + "attack.root_slap.title": { + "type": "string" + }, + "attack.root_slap.description": { + "type": "string" + }, + "attack.the_old_roots_hit.title": { + "type": "string" + }, + "attack.the_old_roots_hit.description": { + "type": "string" + }, + "attack.leaf_storm.title": { + "type": "string" + }, + "attack.leaf_storm.description": { + "type": "string" + }, + "attack.bark_hardening.title": { + "type": "string" + }, + "attack.bark_hardening.description": { + "type": "string" + }, + "attack.poison_spores.title": { + "type": "string" + }, + "attack.poison_spores.description": { + "type": "string" + }, + "attack.branch_stab.title": { + "type": "string" + }, + "attack.branch_stab.description": { + "type": "string" + }, + "attack.freeze.title": { + "type": "string" + }, + "attack.freeze.description": { + "type": "string" + }, + "attack.snow_storm.title": { + "type": "string" + }, + "attack.snow_storm.description": { + "type": "string" + }, + "attack.sword_of_ice.title": { + "type": "string" + }, + "attack.sword_of_ice.description": { + "type": "string" + }, + "attack.spikes.title": { + "type": "string" + }, + "attack.spikes.description": { + "type": "string" + }, + "item.poketeball.title": { + "type": "string" + }, + "item.poketeball.description": { + "type": "string" + }, + "item.superball.title": { + "type": "string" + }, + "item.superball.description": { + "type": "string" + }, + "item.hyperball.title": { + "type": "string" + }, + "item.hyperball.description": { + "type": "string" + }, + "item.healing_potion.title": { + "type": "string" + }, + "item.healing_potion.description": { + "type": "string" + }, + "item.super_potion.title": { + "type": "string" + }, + "item.super_potion.description": { + "type": "string" + }, + "item.ap_potion.title": { + "type": "string" + }, + "item.ap_potion.description": { + "type": "string" + }, + "item.treat.title": { + "type": "string" + }, + "item.treat.description": { + "type": "string" + }, + "item.shut_the_fuck_up_stone.title": { + "type": "string" + }, + "item.shut_the_fuck_up_stone.description": { + "type": "string" + }, + "mapstation.playmap_1.description": { + "type": "string" + }, + "mapstation.cave_1.description": { + "type": "string" + }, + "mapstation.playmap_2.description": { + "type": "string" + }, + "mapstation.playmap_3.description": { + "type": "string" + }, + "mapstation.playmap_4.description": { + "type": "string" + }, + "mapstation.playmap_6.description": { + "type": "string" + }, + "mapstation.playmap_7.description": { + "type": "string" + }, + "mapstation.playmap_8.description": { + "type": "string" + }, + "mapstation.playmap_11.description": { + "type": "string" + }, + "mapstation.playmap_12.description": { + "type": "string" + }, + "mapstation.playmap_13.description": { + "type": "string" + }, + "mapstation.playmap_15.description": { + "type": "string" + }, + "mapstation.playmap_16.description": { + "type": "string" + }, + "mapstation.playmap_18.description": { + "type": "string" + }, + "mapstation.playmap_19.description": { + "type": "string" + }, + "mapstation.playmap_21.description": { + "type": "string" + }, + "mapstation.playmap_28.description": { + "type": "string" + }, + "mapstation.playmap_30.description": { + "type": "string" + }, + "mapstation.playmap_33.description": { + "type": "string" + }, + "mapstation.playmap_35.description": { + "type": "string" + }, + "mapstation.playmap_40.description": { + "type": "string" + }, + "mapstation.playmap_39.description": { + "type": "string" + }, + "pokete.__fallback__.name": { + "type": "string" + }, + "pokete.__fallback__.description": { + "type": "string" + }, + "pokete.steini.name": { + "type": "string" + }, + "pokete.steini.description": { + "type": "string" + }, + "pokete.mowcow.name": { + "type": "string" + }, + "pokete.mowcow.description": { + "type": "string" + }, + "pokete.bigstone.name": { + "type": "string" + }, + "pokete.bigstone.description": { + "type": "string" + }, + "pokete.poundi.name": { + "type": "string" + }, + "pokete.poundi.description": { + "type": "string" + }, + "pokete.lilstone.name": { + "type": "string" + }, + "pokete.lilstone.description": { + "type": "string" + }, + "pokete.rosi.name": { + "type": "string" + }, + "pokete.rosi.description": { + "type": "string" + }, + "pokete.wheeto.name": { + "type": "string" + }, + "pokete.wheeto.description": { + "type": "string" + }, + "pokete.saugh.name": { + "type": "string" + }, + "pokete.saugh.description": { + "type": "string" + }, + "pokete.gobost.name": { + "type": "string" + }, + "pokete.gobost.description": { + "type": "string" + }, + "pokete.angrilo.name": { + "type": "string" + }, + "pokete.angrilo.description": { + "type": "string" + }, + "pokete.vogli.name": { + "type": "string" + }, + "pokete.vogli.description": { + "type": "string" + }, + "pokete.voglo.name": { + "type": "string" + }, + "pokete.voglo.description": { + "type": "string" + }, + "pokete.voglus.name": { + "type": "string" + }, + "pokete.voglus.description": { + "type": "string" + }, + "pokete.ostri.name": { + "type": "string" + }, + "pokete.ostri.description": { + "type": "string" + }, + "pokete.karpi.name": { + "type": "string" + }, + "pokete.karpi.description": { + "type": "string" + }, + "pokete.w\u00c3\u00bcrgos.name": { + "type": "string" + }, + "pokete.w\u00c3\u00bcrgos.description": { + "type": "string" + }, + "pokete.choka.name": { + "type": "string" + }, + "pokete.choka.description": { + "type": "string" + }, + "pokete.treenator.name": { + "type": "string" + }, + "pokete.treenator.description": { + "type": "string" + }, + "pokete.bato.name": { + "type": "string" + }, + "pokete.bato.description": { + "type": "string" + }, + "pokete.bator.name": { + "type": "string" + }, + "pokete.bator.description": { + "type": "string" + }, + "pokete.blub.name": { + "type": "string" + }, + "pokete.blub.description": { + "type": "string" + }, + "pokete.owol.name": { + "type": "string" + }, + "pokete.owol.description": { + "type": "string" + }, + "pokete.rato.name": { + "type": "string" + }, + "pokete.rato.description": { + "type": "string" + }, + "pokete.ratatat.name": { + "type": "string" + }, + "pokete.ratatat.description": { + "type": "string" + }, + "pokete.hornita.name": { + "type": "string" + }, + "pokete.hornita.description": { + "type": "string" + }, + "pokete.horny.name": { + "type": "string" + }, + "pokete.horny.description": { + "type": "string" + }, + "pokete.bushy.name": { + "type": "string" + }, + "pokete.bushy.description": { + "type": "string" + }, + "pokete.wolfior.name": { + "type": "string" + }, + "pokete.wolfior.description": { + "type": "string" + }, + "pokete.wolfiro.name": { + "type": "string" + }, + "pokete.wolfiro.description": { + "type": "string" + }, + "pokete.rollator.name": { + "type": "string" + }, + "pokete.rollator.description": { + "type": "string" + }, + "pokete.clampi.name": { + "type": "string" + }, + "pokete.clampi.description": { + "type": "string" + }, + "pokete.crabbat.name": { + "type": "string" + }, + "pokete.crabbat.description": { + "type": "string" + }, + "pokete.rustacean.name": { + "type": "string" + }, + "pokete.rustacean.description": { + "type": "string" + }, + "pokete.electrode.name": { + "type": "string" + }, + "pokete.electrode.description": { + "type": "string" + }, + "pokete.cubl.name": { + "type": "string" + }, + "pokete.cubl.description": { + "type": "string" + }, + "pokete.spikl.name": { + "type": "string" + }, + "pokete.spikl.description": { + "type": "string" + }, + "pokete.confuso.name": { + "type": "string" + }, + "pokete.confuso.description": { + "type": "string" + }, + "pokete.poisopla.name": { + "type": "string" + }, + "pokete.poisopla.description": { + "type": "string" + }, + "pokete.megapois.name": { + "type": "string" + }, + "pokete.megapois.description": { + "type": "string" + }, + "pokete.corcos_day.name": { + "type": "string" + }, + "pokete.corcos_day.description": { + "type": "string" + }, + "pokete.corcos_night.name": { + "type": "string" + }, + "pokete.corcos_night.description": { + "type": "string" + }, + "pokete.raupathor_day.name": { + "type": "string" + }, + "pokete.raupathor_day.description": { + "type": "string" + }, + "pokete.raupathor_night.name": { + "type": "string" + }, + "pokete.raupathor_night.description": { + "type": "string" + }, + "pokete.schmetterling.name": { + "type": "string" + }, + "pokete.schmetterling.description": { + "type": "string" + }, + "pokete.mothor.name": { + "type": "string" + }, + "pokete.mothor.description": { + "type": "string" + }, + "pokete.lil_nut.name": { + "type": "string" + }, + "pokete.lil_nut.description": { + "type": "string" + }, + "pokete.dicki.name": { + "type": "string" + }, + "pokete.dicki.description": { + "type": "string" + }, + "pokete.dicko.name": { + "type": "string" + }, + "pokete.dicko.description": { + "type": "string" + }, + "pokete.diamondos.name": { + "type": "string" + }, + "pokete.diamondos.description": { + "type": "string" + }, + "trainer.playmap_1.franz.dialog1": { + "type": "string" + }, + "trainer.playmap_1.franz.lose1": { + "type": "string" + }, + "trainer.playmap_1.franz.lose2": { + "type": "string" + }, + "trainer.playmap_1.franz.win1": { + "type": "string" + }, + "trainer.cave_1.monica.dialog1": { + "type": "string" + }, + "trainer.cave_1.monica.dialog2": { + "type": "string" + }, + "trainer.cave_1.monica.lose1": { + "type": "string" + }, + "trainer.cave_1.monica.lose2": { + "type": "string" + }, + "trainer.cave_1.monica.win1": { + "type": "string" + }, + "trainer.cave_1.monica.win2": { + "type": "string" + }, + "trainer.playmap_2.wanderer_murrad.dialog1": { + "type": "string" + }, + "trainer.playmap_2.wanderer_murrad.dialog2": { + "type": "string" + }, + "trainer.playmap_2.wanderer_murrad.dialog3": { + "type": "string" + }, + "trainer.playmap_2.wanderer_murrad.lose": { + "type": "string" + }, + "trainer.playmap_2.wanderer_murrad.win1": { + "type": "string" + }, + "trainer.playmap_2.wanderer_murrad.win2": { + "type": "string" + }, + "trainer.playmap_3.markus.dialog1": { + "type": "string" + }, + "trainer.playmap_3.markus.dialog2": { + "type": "string" + }, + "trainer.playmap_3.markus.dialog3": { + "type": "string" + }, + "trainer.playmap_3.markus.lose1": { + "type": "string" + }, + "trainer.playmap_3.markus.lose2": { + "type": "string" + }, + "trainer.playmap_3.markus.lose3": { + "type": "string" + }, + "trainer.playmap_3.markus.win1": { + "type": "string" + }, + "trainer.playmap_4.kevin.dialog1": { + "type": "string" + }, + "trainer.playmap_4.kevin.dialog2": { + "type": "string" + }, + "trainer.playmap_4.kevin.dialog3": { + "type": "string" + }, + "trainer.playmap_4.kevin.lose1": { + "type": "string" + }, + "trainer.playmap_4.kevin.lose2": { + "type": "string" + }, + "trainer.playmap_4.kevin.win1": { + "type": "string" + }, + "trainer.playmap_4.kevin.win2": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.dialog1": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.dialog2": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.dialog3": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.lose1": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.lose2": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.lose3": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.win1": { + "type": "string" + }, + "trainer.playmap_5.caveman_marc.win2": { + "type": "string" + }, + "trainer.playmap_6.eva.dialog1": { + "type": "string" + }, + "trainer.playmap_6.eva.dialog2": { + "type": "string" + }, + "trainer.playmap_6.eva.lose1": { + "type": "string" + }, + "trainer.playmap_6.eva.win1": { + "type": "string" + }, + "trainer.playmap_7.caveman_dieter.dialog1": { + "type": "string" + }, + "trainer.playmap_7.caveman_dieter.dialog2": { + "type": "string" + }, + "trainer.playmap_7.caveman_dieter.lose1": { + "type": "string" + }, + "trainer.playmap_7.caveman_dieter.win1": { + "type": "string" + }, + "trainer.playmap_8.woodsman_bert.dialog1": { + "type": "string" + }, + "trainer.playmap_8.woodsman_bert.dialog2": { + "type": "string" + }, + "trainer.playmap_8.woodsman_bert.lose1": { + "type": "string" + }, + "trainer.playmap_8.woodsman_bert.win1": { + "type": "string" + }, + "trainer.playmap_11.fishermans_friend.dialog1": { + "type": "string" + }, + "trainer.playmap_11.fishermans_friend.dialog2": { + "type": "string" + }, + "trainer.playmap_11.fishermans_friend.lose1": { + "type": "string" + }, + "trainer.playmap_11.fishermans_friend.win1": { + "type": "string" + }, + "trainer.playmap_12.brother_justin.dialog1": { + "type": "string" + }, + "trainer.playmap_12.brother_justin.lose1": { + "type": "string" + }, + "trainer.playmap_12.brother_justin.win1": { + "type": "string" + }, + "trainer.playmap_12.brother_justus.dialog1": { + "type": "string" + }, + "trainer.playmap_12.brother_justus.lose1": { + "type": "string" + }, + "trainer.playmap_12.brother_justus.win1": { + "type": "string" + }, + "trainer.playmap_13.citizen.dialog1": { + "type": "string" + }, + "trainer.playmap_13.citizen.dialog2": { + "type": "string" + }, + "trainer.playmap_13.citizen.lose1": { + "type": "string" + }, + "trainer.playmap_13.citizen.win1": { + "type": "string" + }, + "trainer.playmap_14.first_trainer.dialog1": { + "type": "string" + }, + "trainer.playmap_14.first_trainer.dialog2": { + "type": "string" + }, + "trainer.playmap_14.first_trainer.lose1": { + "type": "string" + }, + "trainer.playmap_14.first_trainer.win1": { + "type": "string" + }, + "trainer.playmap_14.second_trainer.dialog1": { + "type": "string" + }, + "trainer.playmap_14.second_trainer.lose1": { + "type": "string" + }, + "trainer.playmap_14.second_trainer.win1": { + "type": "string" + }, + "trainer.playmap_14.third_trainer.dialog1": { + "type": "string" + }, + "trainer.playmap_14.third_trainer.lose1": { + "type": "string" + }, + "trainer.playmap_14.third_trainer.win1": { + "type": "string" + }, + "trainer.playmap_14.last_trainer.dialog1": { + "type": "string" + }, + "trainer.playmap_14.last_trainer.lose1": { + "type": "string" + }, + "trainer.playmap_14.last_trainer.win1": { + "type": "string" + }, + "trainer.playmap_14.last_trainer.win2": { + "type": "string" + }, + "trainer.playmap_14.last_trainer.win3": { + "type": "string" + }, + "trainer.playmap_15.samantha.dialog1": { + "type": "string" + }, + "trainer.playmap_15.samantha.dialog2": { + "type": "string" + }, + "trainer.playmap_15.samantha.lose1": { + "type": "string" + }, + "trainer.playmap_15.samantha.win1": { + "type": "string" + }, + "trainer.playmap_15.samantha.win2": { + "type": "string" + }, + "trainer.playmap_15.jessica.dialog1": { + "type": "string" + }, + "trainer.playmap_15.jessica.lose1": { + "type": "string" + }, + "trainer.playmap_15.jessica.win1": { + "type": "string" + }, + "trainer.playmap_18.bert.dialog1": { + "type": "string" + }, + "trainer.playmap_18.bert.dialog2": { + "type": "string" + }, + "trainer.playmap_18.bert.lose1": { + "type": "string" + }, + "trainer.playmap_18.bert.win1": { + "type": "string" + }, + "trainer.playmap_18.karen.dialog1": { + "type": "string" + }, + "trainer.playmap_18.karen.dialog2": { + "type": "string" + }, + "trainer.playmap_18.karen.lose1": { + "type": "string" + }, + "trainer.playmap_18.karen.win1": { + "type": "string" + }, + "trainer.playmap_19.brian.dialog1": { + "type": "string" + }, + "trainer.playmap_19.brian.lose1": { + "type": "string" + }, + "trainer.playmap_19.brian.lose2": { + "type": "string" + }, + "trainer.playmap_19.brian.win1": { + "type": "string" + }, + "trainer.playmap_19.brian.win2": { + "type": "string" + }, + "trainer.playmap_19.simon.dialog1": { + "type": "string" + }, + "trainer.playmap_19.simon.dialog2": { + "type": "string" + }, + "trainer.playmap_19.simon.lose1": { + "type": "string" + }, + "trainer.playmap_19.simon.win1": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.dialog1": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.dialog2": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.dialog3": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.dialog4": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.lose1": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.win1": { + "type": "string" + }, + "trainer.playmap_21.rock_hard_rick.win2": { + "type": "string" + }, + "trainer.playmap_27.bertold.dialog1": { + "type": "string" + }, + "trainer.playmap_27.bertold.lose1": { + "type": "string" + }, + "trainer.playmap_27.bertold.win1": { + "type": "string" + }, + "trainer.playmap_27.gerard.dialog1": { + "type": "string" + }, + "trainer.playmap_27.gerard.lose1": { + "type": "string" + }, + "trainer.playmap_27.gerard.win1": { + "type": "string" + }, + "trainer.playmap_27.jessica.dialog1": { + "type": "string" + }, + "trainer.playmap_27.jessica.lose1": { + "type": "string" + }, + "trainer.playmap_27.jessica.win1": { + "type": "string" + }, + "trainer.playmap_27.first_trainer.dialog1": { + "type": "string" + }, + "trainer.playmap_27.first_trainer.lose1": { + "type": "string" + }, + "trainer.playmap_27.first_trainer.win1": { + "type": "string" + }, + "trainer.playmap_28.steven_the_big.dialog1": { + "type": "string" + }, + "trainer.playmap_28.steven_the_big.lose1": { + "type": "string" + }, + "trainer.playmap_28.steven_the_big.win1": { + "type": "string" + }, + "trainer.playmap_28.steven_the_big.win2": { + "type": "string" + }, + "trainer.playmap_28.laurena.dialog1": { + "type": "string" + }, + "trainer.playmap_28.laurena.dialog2": { + "type": "string" + }, + "trainer.playmap_28.laurena.lose1": { + "type": "string" + }, + "trainer.playmap_28.laurena.win1": { + "type": "string" + }, + "trainer.playmap_28.laurena.win2": { + "type": "string" + }, + "trainer.playmap_28.laurin.dialog1": { + "type": "string" + }, + "trainer.playmap_28.laurin.dialog2": { + "type": "string" + }, + "trainer.playmap_28.laurin.lose1": { + "type": "string" + }, + "trainer.playmap_28.laurin.win1": { + "type": "string" + }, + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.dialog1": { + "type": "string" + }, + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.dialog2": { + "type": "string" + }, + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.lose1": { + "type": "string" + }, + "trainer.playmap_28.fucking_badass_looking_dude_in_the_woods.win1": { + "type": "string" + }, + "trainer.playmap_30.guy_at_the_entrance.dialog1": { + "type": "string" + }, + "trainer.playmap_30.guy_at_the_entrance.lose1": { + "type": "string" + }, + "trainer.playmap_30.guy_at_the_entrance.win1": { + "type": "string" + }, + "trainer.playmap_31.luther.dialog1": { + "type": "string" + }, + "trainer.playmap_31.luther.lose1": { + "type": "string" + }, + "trainer.playmap_31.luther.win1": { + "type": "string" + }, + "trainer.playmap_31.heavy_hans.dialog1": { + "type": "string" + }, + "trainer.playmap_31.heavy_hans.lose1": { + "type": "string" + }, + "trainer.playmap_31.heavy_hans.win1": { + "type": "string" + }, + "trainer.playmap_31.aurelia.dialog1": { + "type": "string" + }, + "trainer.playmap_31.aurelia.lose1": { + "type": "string" + }, + "trainer.playmap_31.aurelia.win1": { + "type": "string" + }, + "trainer.playmap_31.master_of_the_flowers.dialog1": { + "type": "string" + }, + "trainer.playmap_31.master_of_the_flowers.lose1": { + "type": "string" + }, + "trainer.playmap_31.master_of_the_flowers.win1": { + "type": "string" + }, + "trainer.playmap_33.cowsay.dialog1": { + "type": "string" + }, + "trainer.playmap_33.cowsay.lose1": { + "type": "string" + }, + "trainer.playmap_33.cowsay.win1": { + "type": "string" + }, + "trainer.playmap_35.farmer_gert.dialog1": { + "type": "string" + }, + "trainer.playmap_35.farmer_gert.dialog2": { + "type": "string" + }, + "trainer.playmap_35.farmer_gert.dialog3": { + "type": "string" + }, + "trainer.playmap_35.farmer_gert.lose1": { + "type": "string" + }, + "trainer.playmap_35.farmer_gert.win1": { + "type": "string" + }, + "trainer.playmap_35.farmer_doora.dialog1": { + "type": "string" + }, + "trainer.playmap_35.farmer_doora.lose1": { + "type": "string" + }, + "trainer.playmap_35.farmer_doora.win1": { + "type": "string" + }, + "trainer.playmap_35.farmer_ralf.dialog1": { + "type": "string" + }, + "trainer.playmap_35.farmer_ralf.lose1": { + "type": "string" + }, + "trainer.playmap_35.farmer_ralf.win1": { + "type": "string" + }, + "trainer.playmap_39.gardener_angela.dialog1": { + "type": "string" + }, + "trainer.playmap_39.gardener_angela.dialog2": { + "type": "string" + }, + "trainer.playmap_39.gardener_angela.lose1": { + "type": "string" + }, + "trainer.playmap_39.gardener_angela.win1": { + "type": "string" + }, + "trainer.playmap_40.angler_gustav.dialog1": { + "type": "string" + }, + "trainer.playmap_40.angler_gustav.lose1": { + "type": "string" + }, + "trainer.playmap_40.angler_gustav.win1": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.dialog1": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.dialog2": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.dialog3": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.dialog4": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.lose1": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.lose2": { + "type": "string" + }, + "trainer.playmap_41.farmer_daniel.win1": { + "type": "string" + }, + "trainer.playmap_46.farmer_martin.dialog1": { + "type": "string" + }, + "trainer.playmap_46.farmer_martin.dialog2": { + "type": "string" + }, + "trainer.playmap_46.farmer_martin.lose1": { + "type": "string" + }, + "trainer.playmap_46.farmer_martin.win1": { + "type": "string" + }, + "trainer.playmap_46.the_undetermined.dialog1": { + "type": "string" + }, + "trainer.playmap_46.the_undetermined.lose1": { + "type": "string" + }, + "trainer.playmap_46.the_undetermined.win1": { + "type": "string" + }, + "trainer.playmap_46.gardener_daniela.dialog1": { + "type": "string" + }, + "trainer.playmap_46.gardener_daniela.lose1": { + "type": "string" + }, + "trainer.playmap_46.gardener_daniela.win1": { + "type": "string" + }, + "trainer.playmap_46.leader_sebastian.dialog1": { + "type": "string" + }, + "trainer.playmap_46.leader_sebastian.dialog2": { + "type": "string" + }, + "trainer.playmap_46.leader_sebastian.lose1": { + "type": "string" + }, + "trainer.playmap_46.leader_sebastian.win1": { + "type": "string" + }, + "trainer.playmap_46.leader_sebastian.win2": { + "type": "string" + }, + "weather.rain.info": { + "type": "string" + }, + "weather.thunderstorm.info": { + "type": "string" + }, + "weather.foggy.info": { + "type": "string" + }, + "weather.sunny.info": { + "type": "string" + }, + "log.achievements.unlocked": { + "type": "string" + }, + "log.general.player": { + "type": "string" + }, + "log.general.enemy": { + "type": "string" + }, + "log.effects.add": { + "type": "string" + }, + "log.effects.remove": { + "type": "string" + }, + "log.fight.ran_away": { + "type": "string" + }, + "log.fight.end_fight": { + "type": "string" + }, + "log.fight.start_fight": { + "type": "string" + }, + "log.fight.end_fight_won": { + "type": "string" + }, + "log.fight.pokete_caught": { + "type": "string" + }, + "log.fight.pokete_missed": { + "type": "string" + }, + "log.fight.ap_potion_used": { + "type": "string" + }, + "log.fight.blackout": { + "type": "string" + }, + "log.npc.interaction": { + "type": "string" + }, + "log.npc.walk_check": { + "type": "string" + }, + "log.npc.match_info": { + "type": "string" + }, + "log.pokete.gained_xp": { + "type": "string" + }, + "log.pokete.level_up": { + "type": "string" + }, + "log.pokete.used_attack": { + "type": "string" + }, + "log.pokete.evolved": { + "type": "string" } } -} +} \ No newline at end of file