From ce1019efc559eaf7d8d7809b119603c0f03b320b Mon Sep 17 00:00:00 2001 From: lxgr-linux Date: Thu, 8 Aug 2024 10:49:56 +0200 Subject: [PATCH] feat(#296): Added AssetService --- pkg/server/pokete/msg/map_info/info.go | 36 ++++++++------ pokete_classes/asset_service/__init__.py | 0 .../asset_service/asset_types/__init__.py | 7 +++ .../asset_service/asset_types/assets.py | 26 ++++++++++ .../asset_types/base/__init__.py | 7 +++ .../asset_types/base/achievements.py | 9 ++++ .../asset_service/asset_types/base/attacks.py | 19 ++++++++ .../asset_service/asset_types/base/items.py | 11 +++++ .../asset_service/asset_types/base/natures.py | 10 ++++ .../asset_service/asset_types/base/poke.py | 27 +++++++++++ .../asset_service/asset_types/base/types.py | 10 ++++ .../asset_service/asset_types/base/weather.py | 9 ++++ .../asset_types}/coords.py | 0 .../asset_types}/maps.py | 0 .../asset_types}/npcs.py | 0 .../asset_types}/obmaps.py | 0 .../asset_types}/stations.py | 0 .../asset_types}/trainers.py | 0 pokete_classes/asset_service/service.py | 48 +++++++++++++++++++ pokete_classes/generate.py | 39 ++++++++------- pokete_classes/maps/__init__.py | 6 --- pokete_classes/multiplayer/communication.py | 12 ++--- .../multiplayer/msg/map_info/info.py | 10 +--- pokete_classes/roadmap.py | 2 +- pokete_data/achievements.py | 3 +- pokete_data/attacks.py | 6 ++- pokete_data/items.py | 5 +- pokete_data/map_data.py | 2 +- pokete_data/maps.py | 2 +- pokete_data/mapstations.py | 4 +- pokete_data/natures.py | 3 +- pokete_data/npcs.py | 32 +++++++------ pokete_data/poketes.py | 3 +- pokete_data/trainers.py | 2 +- pokete_data/types.py | 6 +-- pokete_data/weather.py | 4 +- 36 files changed, 275 insertions(+), 85 deletions(-) create mode 100644 pokete_classes/asset_service/__init__.py create mode 100644 pokete_classes/asset_service/asset_types/__init__.py create mode 100644 pokete_classes/asset_service/asset_types/assets.py create mode 100644 pokete_classes/asset_service/asset_types/base/__init__.py create mode 100644 pokete_classes/asset_service/asset_types/base/achievements.py create mode 100644 pokete_classes/asset_service/asset_types/base/attacks.py create mode 100644 pokete_classes/asset_service/asset_types/base/items.py create mode 100644 pokete_classes/asset_service/asset_types/base/natures.py create mode 100644 pokete_classes/asset_service/asset_types/base/poke.py create mode 100644 pokete_classes/asset_service/asset_types/base/types.py create mode 100644 pokete_classes/asset_service/asset_types/base/weather.py rename pokete_classes/{maps => asset_service/asset_types}/coords.py (100%) rename pokete_classes/{maps => asset_service/asset_types}/maps.py (100%) rename pokete_classes/{maps => asset_service/asset_types}/npcs.py (100%) rename pokete_classes/{maps => asset_service/asset_types}/obmaps.py (100%) rename pokete_classes/{maps => asset_service/asset_types}/stations.py (100%) rename pokete_classes/{maps => asset_service/asset_types}/trainers.py (100%) create mode 100644 pokete_classes/asset_service/service.py delete mode 100644 pokete_classes/maps/__init__.py diff --git a/pkg/server/pokete/msg/map_info/info.go b/pkg/server/pokete/msg/map_info/info.go index 1d4363e9..c6477953 100644 --- a/pkg/server/pokete/msg/map_info/info.go +++ b/pkg/server/pokete/msg/map_info/info.go @@ -11,15 +11,19 @@ const InfoType msg.Type = "pokete.map.info" type Info struct { msg.BaseMsg - Obmaps resources.Obmaps `json:"obmaps"` - Maps resources.Maps `json:"maps"` - NPCs resources.NPCs `json:"npcs"` - Trainers resources.Trainers `json:"trainers"` - MapStations resources.MapStations `json:"map_stations"` - MapDecorations resources.MapDecorations `json:"map_decorations"` - Position user.Position `json:"position"` - Users []user.User `json:"users"` - GreetingText string `json:"greeting_text"` + Assets Assets `json:"assets"` + Position user.Position `json:"position"` + Users []user.User `json:"users"` + GreetingText string `json:"greeting_text"` +} + +type Assets struct { + Obmaps resources.Obmaps `json:"obmaps"` + Maps resources.Maps `json:"maps"` + NPCs resources.NPCs `json:"npcs"` + Trainers resources.Trainers `json:"trainers"` + Stations resources.MapStations `json:"stations"` + Decorations resources.MapDecorations `json:"decorations"` } func (i Info) GetType() msg.Type { @@ -34,12 +38,14 @@ func NewInfo( ) Info { return Info{ msg.BaseMsg{}, - resources2.GetObmaps(), - resources2.GetMaps(), - resources2.GetNPCs(), - resources2.GetTrainers(), - resources2.GetMapStations(), - resources2.GetMapDecorations(), + Assets{ + resources2.GetObmaps(), + resources2.GetMaps(), + resources2.GetNPCs(), + resources2.GetTrainers(), + resources2.GetMapStations(), + resources2.GetMapDecorations(), + }, position, users.GetAllUsers(), greetingtext, diff --git a/pokete_classes/asset_service/__init__.py b/pokete_classes/asset_service/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pokete_classes/asset_service/asset_types/__init__.py b/pokete_classes/asset_service/asset_types/__init__.py new file mode 100644 index 00000000..f81b1fc2 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/__init__.py @@ -0,0 +1,7 @@ +from .assets import Assets, BaseAssets +from .maps import Map, Maps +from .npcs import NPCs, NPC +from .obmaps import Obmap, Obmaps +from .stations import Station, Stations, Decorations, Decoration +from .trainers import Trainer, Trainers +from .base import * diff --git a/pokete_classes/asset_service/asset_types/assets.py b/pokete_classes/asset_service/asset_types/assets.py new file mode 100644 index 00000000..40b97634 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/assets.py @@ -0,0 +1,26 @@ +from typing import TypedDict + +from .base import Items, Pokes, Natures, Weathers, Types, Achievements +from .maps import Maps +from .npcs import NPCs +from .stations import Stations, Decorations +from .trainers import Trainers +from .obmaps import Obmaps + + +class BaseAssets(TypedDict): + items: Items + pokes: Pokes + natures: Natures + weathers: Weathers + types: Types + achievements: Achievements + + +class Assets(TypedDict): + trainers: Trainers + npcs: NPCs + obmaps: Obmaps + stations: Stations + decorations: Decorations + maps: Maps diff --git a/pokete_classes/asset_service/asset_types/base/__init__.py b/pokete_classes/asset_service/asset_types/base/__init__.py new file mode 100644 index 00000000..62fa543f --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/__init__.py @@ -0,0 +1,7 @@ +from .items import Items, Item +from .poke import Pokes, Poke +from .natures import Natures, Nature +from .weather import Weather, Weathers +from .attacks import Attack, Attacks +from .types import Type, Types +from .achievements import Achievement, Achievements diff --git a/pokete_classes/asset_service/asset_types/base/achievements.py b/pokete_classes/asset_service/asset_types/base/achievements.py new file mode 100644 index 00000000..607b9710 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/achievements.py @@ -0,0 +1,9 @@ +from typing import TypedDict + + +class Achievement(TypedDict): + title: str + desc: str + + +Achievements = dict[str, Achievement] diff --git a/pokete_classes/asset_service/asset_types/base/attacks.py b/pokete_classes/asset_service/asset_types/base/attacks.py new file mode 100644 index 00000000..639e0de2 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/attacks.py @@ -0,0 +1,19 @@ +from typing import TypedDict + + +class Attack(TypedDict): + name: str + factor: float + action: str | None + world_action: str + move: list[str] + miss_chance: float + min_lvl: int + desc: str + types: list[str] + effect: str | None + is_generic: bool + ap: int + + +Attacks = dict[str, Attack] diff --git a/pokete_classes/asset_service/asset_types/base/items.py b/pokete_classes/asset_service/asset_types/base/items.py new file mode 100644 index 00000000..20ea95ab --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/items.py @@ -0,0 +1,11 @@ +from typing import TypedDict + + +class Item(TypedDict): + pretty_name: str + desc: str + price: int + fn: str | None + + +Items = dict[str, Item] diff --git a/pokete_classes/asset_service/asset_types/base/natures.py b/pokete_classes/asset_service/asset_types/base/natures.py new file mode 100644 index 00000000..619aef69 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/natures.py @@ -0,0 +1,10 @@ +from typing import TypedDict + + +class Nature(TypedDict): + esc: str + atc: float + _def: float + + +Natures = dict[str, Nature] diff --git a/pokete_classes/asset_service/asset_types/base/poke.py b/pokete_classes/asset_service/asset_types/base/poke.py new file mode 100644 index 00000000..0b1a6ad9 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/poke.py @@ -0,0 +1,27 @@ +from typing import TypedDict + + +class BaseIco(TypedDict): + txt: str + esc: str | None + + +class Poke(TypedDict): + name: str + hp: int + atc: int + defense: int + attacks: list[str] + pool: list[str] + miss_chance: int + desc: str + lose_xp: int + rarity: int + types: list[str] + evolve_poke: str + evolve_lvl: int + initiative: int + ico: list[BaseIco] + + +Pokes = dict[str, Poke] diff --git a/pokete_classes/asset_service/asset_types/base/types.py b/pokete_classes/asset_service/asset_types/base/types.py new file mode 100644 index 00000000..8d337f40 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/types.py @@ -0,0 +1,10 @@ +from typing import TypedDict + + +class Type(TypedDict): + effective: list[str] + ineffective: list[str] + color: list[str] + + +Types = dict[str, Type] diff --git a/pokete_classes/asset_service/asset_types/base/weather.py b/pokete_classes/asset_service/asset_types/base/weather.py new file mode 100644 index 00000000..829408a2 --- /dev/null +++ b/pokete_classes/asset_service/asset_types/base/weather.py @@ -0,0 +1,9 @@ +from typing import TypedDict + + +class Weather(TypedDict): + info: str + effected: dict[str, float] + + +Weathers = dict[str, Weather] diff --git a/pokete_classes/maps/coords.py b/pokete_classes/asset_service/asset_types/coords.py similarity index 100% rename from pokete_classes/maps/coords.py rename to pokete_classes/asset_service/asset_types/coords.py diff --git a/pokete_classes/maps/maps.py b/pokete_classes/asset_service/asset_types/maps.py similarity index 100% rename from pokete_classes/maps/maps.py rename to pokete_classes/asset_service/asset_types/maps.py diff --git a/pokete_classes/maps/npcs.py b/pokete_classes/asset_service/asset_types/npcs.py similarity index 100% rename from pokete_classes/maps/npcs.py rename to pokete_classes/asset_service/asset_types/npcs.py diff --git a/pokete_classes/maps/obmaps.py b/pokete_classes/asset_service/asset_types/obmaps.py similarity index 100% rename from pokete_classes/maps/obmaps.py rename to pokete_classes/asset_service/asset_types/obmaps.py diff --git a/pokete_classes/maps/stations.py b/pokete_classes/asset_service/asset_types/stations.py similarity index 100% rename from pokete_classes/maps/stations.py rename to pokete_classes/asset_service/asset_types/stations.py diff --git a/pokete_classes/maps/trainers.py b/pokete_classes/asset_service/asset_types/trainers.py similarity index 100% rename from pokete_classes/maps/trainers.py rename to pokete_classes/asset_service/asset_types/trainers.py diff --git a/pokete_classes/asset_service/service.py b/pokete_classes/asset_service/service.py new file mode 100644 index 00000000..c966d850 --- /dev/null +++ b/pokete_classes/asset_service/service.py @@ -0,0 +1,48 @@ +import logging + +import pokete_data as p_data +from .asset_types.assets import Assets, BaseAssets + + +class AssetSerice: + def __init__(self): + self.__assets: Assets | None = None + self.__base_assets: BaseAssets | None = None + self.load_base_assets_from_p_data() + + def load_assets(self, assets: Assets): + self.__assets = assets + + def __load_base_assets(self, base_assets: BaseAssets): + self.__base_assets = base_assets + + def load_assets_from_p_data(self): + if self.__assets is not None: + logging.warning("[AssetService]: Assets already loaded") + self.load_assets({ + "trainers": p_data.trainers, + "npcs": p_data.npcs, + "obmaps": p_data.map_data, + "stations": p_data.stations, + "decorations": p_data.decorations, + "maps": p_data.maps, + }) + + def load_base_assets_from_p_data(self): + self.__load_base_assets({ + "items": p_data.items, + "pokes": p_data.pokes, + "natures": p_data.natures, + "weathers": p_data.weathers, + "types": p_data.types, + "achievements": p_data.achievements + }) + + def get_assets(self) -> Assets | None: + return self.__assets + + def get_base_assets(self) -> BaseAssets: + return self.__base_assets + + +asset_service: AssetSerice = AssetSerice() diff --git a/pokete_classes/generate.py b/pokete_classes/generate.py index 0118d4d5..b736372e 100644 --- a/pokete_classes/generate.py +++ b/pokete_classes/generate.py @@ -1,8 +1,11 @@ """Generating maps""" import scrap_engine as se +from .asset_service.asset_types import Maps, NPCs +from pokete_classes.asset_service.asset_types.npcs import NPCs +from pokete_classes.asset_service.asset_types.obmaps import Obmaps +from pokete_classes.asset_service.asset_types.trainers import Trainers from pokete_classes.map_additions.center import CenterMap, ShopMap -from pokete_classes.maps import Maps, Obmaps, NPCs, Trainers from pokete_classes.tss import tss from .landscape import Meadow, Water, Sand, Poketeball from .classes import PlayMap @@ -14,7 +17,7 @@ from . import ob_maps as obmp -def parse_obj(_map, name, obj, _dict): +def __parse_obj(_map, name, obj, _dict): """Parses an object to a maps attribute and adds it ARGS: _map: The given PlayMap @@ -80,32 +83,32 @@ def gen_obs(map_data: Obmaps, npcs: NPCs, trainers: Trainers, figure): for ob_map, single_map in map_data.items(): _map = obmp.ob_maps[ob_map] for hard_ob, single_hard_ob in single_map["hard_obs"].items(): - parse_obj(_map, hard_ob, - se.Text(single_hard_ob["txt"], - ignore=" "), - single_hard_ob) + __parse_obj(_map, hard_ob, + se.Text(single_hard_ob["txt"], + ignore=" "), + single_hard_ob) for soft_ob, single_soft_ob in single_map["soft_obs"].items(): cls = { "sand": Sand, "meadow": Meadow, "water": Water, }[single_soft_ob.get("cls", "meadow")] - parse_obj(_map, soft_ob, - cls(single_soft_ob["txt"], - _map.poke_args - if cls != Water else _map.w_poke_args), - single_soft_ob) + __parse_obj(_map, soft_ob, + cls(single_soft_ob["txt"], + _map.poke_args + if cls != Water else _map.w_poke_args), + single_soft_ob) for door, single_door in single_map["dors"].items(): - parse_obj(_map, door, - Door(" ", state="float", - arg_proto=single_door["args"]), - single_door) + __parse_obj(_map, door, + Door(" ", state="float", + arg_proto=single_door["args"]), + single_door) for ball, single_ball in single_map["balls"].items(): if f'{ob_map}.{ball}' not in figure.used_npcs or not \ settings("save_trainers").val: - parse_obj(_map, ball, - Poketeball(f"{ob_map}.{ball}"), - single_ball) + __parse_obj(_map, ball, + Poketeball(f"{ob_map}.{ball}"), + single_ball) if "special_dors" in single_map: for name, cls in [("dor", DoorToCenter), ("shopdor", DoorToShop)]: if name in single_map["special_dors"]: diff --git a/pokete_classes/maps/__init__.py b/pokete_classes/maps/__init__.py deleted file mode 100644 index 0280e915..00000000 --- a/pokete_classes/maps/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .obmaps import Obmaps -from .maps import Maps -from .npcs import NPCs -from .trainers import Trainers -from .coords import Coords -from .stations import Stations, Decorations diff --git a/pokete_classes/multiplayer/communication.py b/pokete_classes/multiplayer/communication.py index 68a3747e..1f6493db 100644 --- a/pokete_classes/multiplayer/communication.py +++ b/pokete_classes/multiplayer/communication.py @@ -83,16 +83,16 @@ def handshake( raise InvalidPokeException(data["error"]) case map_info.INFO_TYPE: data: map_info.InfoData = resp.data - obmp.ob_maps = gen_maps(data["maps"], fix_center=True) + obmp.ob_maps = gen_maps(data["assets"]["maps"], fix_center=True) gen_obs( - data["obmaps"], - data["npcs"], - data["trainers"], + data["assets"]["obmaps"], + data["assets"]["npcs"], + data["assets"]["trainers"], ctx.figure, ) roadmap.roadmap = roadmap.RoadMap( - data["map_stations"], - data["map_decorations"] + data["assets"]["stations"], + data["assets"]["decorations"] ) pos = data["position"] self.saved_pos = ( diff --git a/pokete_classes/multiplayer/msg/map_info/info.py b/pokete_classes/multiplayer/msg/map_info/info.py index 42d3a51f..0d4b1c18 100644 --- a/pokete_classes/multiplayer/msg/map_info/info.py +++ b/pokete_classes/multiplayer/msg/map_info/info.py @@ -1,8 +1,7 @@ from typing import TypedDict import bs_rpc -from pokete_classes.maps import Obmaps, Maps, NPCs, Trainers, Stations, \ - Decorations +from pokete_classes.asset_service.asset_types import Assets from pokete_classes.multiplayer.msg.position import Position from pokete_classes.multiplayer.msg.position.update import User @@ -10,12 +9,7 @@ class InfoData(TypedDict): - obmaps: Obmaps - maps: Maps - npcs: NPCs - trainers: Trainers - map_stations: Stations - map_decorations: Decorations + assets: Assets position: Position users: list[User] greeting_text: str diff --git a/pokete_classes/roadmap.py b/pokete_classes/roadmap.py index cf931882..78c360f0 100644 --- a/pokete_classes/roadmap.py +++ b/pokete_classes/roadmap.py @@ -2,9 +2,9 @@ import scrap_engine as se import pokete_data as p_data import pokete_classes.ob_maps as obmp +from pokete_classes.asset_service.asset_types import Stations, Decorations from pokete_classes.context import Context from pokete_classes.game import PeriodicEvent -from pokete_classes.maps import Stations, Decorations from util import liner from .input import ACTION_DIRECTIONS, Action, ActionList, get_action from .color import Color diff --git a/pokete_data/achievements.py b/pokete_data/achievements.py index df0494ec..2de6e744 100644 --- a/pokete_data/achievements.py +++ b/pokete_data/achievements.py @@ -1,6 +1,7 @@ """Contains raw achievement data""" +from pokete_classes.asset_service.asset_types import Achievements -achievements = { +achievements: Achievements = { "first_poke": { "title": "First Pokete", "desc": "Catch your first Pokete!" diff --git a/pokete_data/attacks.py b/pokete_data/attacks.py index 6dbdd317..25319a53 100644 --- a/pokete_data/attacks.py +++ b/pokete_data/attacks.py @@ -1,4 +1,6 @@ -attacks = { +from pokete_classes.asset_service.asset_types import Attacks + +attacks: Attacks = { # normal attacks "tackle": { "name": "Tackle", @@ -367,7 +369,7 @@ "is_generic": False, "ap": 15, }, - "webattack": { + "webattack": { "name": "Web attack", "factor": 1, "action": None, diff --git a/pokete_data/items.py b/pokete_data/items.py index 8cb7f399..70e55ab9 100644 --- a/pokete_data/items.py +++ b/pokete_data/items.py @@ -1,4 +1,6 @@ -items = { +from pokete_classes.asset_service.asset_types import Items + +items: Items = { "poketeball": { "pretty_name": "Poketeball", "desc": "A ball you can use to catch Poketes", @@ -49,6 +51,5 @@ }, } - if __name__ == "__main__": print("\033[31;1mDo not execute this!\033[0m") diff --git a/pokete_data/map_data.py b/pokete_data/map_data.py index aa6f6a92..c48d0ba0 100644 --- a/pokete_data/map_data.py +++ b/pokete_data/map_data.py @@ -1,6 +1,6 @@ """This file contains a dict with all Strings that will be added to the maps""" -from pokete_classes.maps import Obmaps +from pokete_classes.asset_service.asset_types import Obmaps # Those are some vars used in map_data CENTER = r""" __________ diff --git a/pokete_data/maps.py b/pokete_data/maps.py index 65006abc..2e9b4096 100644 --- a/pokete_data/maps.py +++ b/pokete_data/maps.py @@ -1,4 +1,4 @@ -from pokete_classes.maps import Maps +from pokete_classes.asset_service.asset_types import Maps maps: Maps = { "intromap": { diff --git a/pokete_data/mapstations.py b/pokete_data/mapstations.py index 93ebd16c..01e317cc 100644 --- a/pokete_data/mapstations.py +++ b/pokete_data/mapstations.py @@ -1,4 +1,4 @@ -from pokete_classes.maps import Stations +from pokete_classes.asset_service.asset_types import Stations, Decorations stations: Stations = { "playmap_1": { @@ -368,7 +368,7 @@ } -decorations = { +decorations: Decorations = { "cave3": { "gen": { "text": """██ diff --git a/pokete_data/natures.py b/pokete_data/natures.py index 77efb7ee..bda38154 100644 --- a/pokete_data/natures.py +++ b/pokete_data/natures.py @@ -1,6 +1,7 @@ """Contains data about the different natures""" +from pokete_classes.asset_service.asset_types import Natures -natures = { +natures: Natures = { "brave": { "esc": "blue", "atc": 1.1, diff --git a/pokete_data/npcs.py b/pokete_data/npcs.py index 21cf0c85..3a9f99cd 100644 --- a/pokete_data/npcs.py +++ b/pokete_data/npcs.py @@ -1,4 +1,6 @@ -npcs = { +from pokete_classes.asset_service.asset_types import NPCs + +npcs: NPCs = { "test_npc": { "texts": ["Hey."], "fn": None, @@ -199,18 +201,18 @@ "Hello": { "q": ["Hi."], "a": {} - }, + }, "How are you?": { "q": ["I'm fine, thanks.", "Where are you from?"], "a": { "Home.": { "q": ["Wow."], "a": {} - } } } } - }, + } + }, "map": "playmap_8", "x": 74, "y": 15 @@ -224,7 +226,7 @@ "Just chilling.": { "q": ["Nice.", "This beach is the most beautiful in the region!", "Isn't the weather great today?"], "a": {} - }, + }, "Searching for Poketes": { "q": ["Oh cool, you're a Pokete trainer!", "Did you already find some?"], "a": { @@ -237,40 +239,40 @@ "Yes": { "q": ["Those are fucking beasts!"], "a": {} - }, + }, "Hell, what are those?": { "q": ["They're the dark and fiery souls of those who got burned to death by the hot sun!"], "a": {} - } } - }, - "Yes, of course" : { + } + }, + "Yes, of course": { "q": ["You're a good trainer, huh?", "I want to see you fight a Rustacean.", "They're very tough!"], "a": {} - }, + }, "No": { "q": ["That's too bad.", "But they're very tough!"], "a": {} - } } - }, + } + }, "No": { "q": ["That's too bad.", "You can find some in the sand fields."], "a": { "Thanks a lot!": { "q": ["No problem!"], "a": {} - }, + }, "Are you a trainer yourself?": { "q": ["No, but the guy over there is."], "a": {} - } } } } } } - }, + } + }, "map": "playmap_40", "x": 107, "y": 25 diff --git a/pokete_data/poketes.py b/pokete_data/poketes.py index a755eff3..68e97c04 100644 --- a/pokete_data/poketes.py +++ b/pokete_data/poketes.py @@ -5,8 +5,9 @@ All attributes have to be present make a Pokete work A type has to be present Hornita was inspired and partly designed by Pia """ +from pokete_classes.asset_service.asset_types import Pokes -pokes = { +pokes: Pokes = { "__fallback__": { "name": "", "hp": 20, diff --git a/pokete_data/trainers.py b/pokete_data/trainers.py index 9972950b..3e5f2c1f 100644 --- a/pokete_data/trainers.py +++ b/pokete_data/trainers.py @@ -1,4 +1,4 @@ -from pokete_classes.maps import Trainers +from pokete_classes.asset_service.asset_types import Trainers trainers: Trainers = { "playmap_1": [ diff --git a/pokete_data/types.py b/pokete_data/types.py index 7483c6cb..aee700dc 100644 --- a/pokete_data/types.py +++ b/pokete_data/types.py @@ -1,4 +1,6 @@ -types = { +from pokete_classes.asset_service.asset_types import Types + +types: Types = { "normal": { "effective": [], "ineffective": [], @@ -56,9 +58,7 @@ }, } - sub_types = ["bird", "snake"] - if __name__ == "__main__": print("\033[31;1mDo not execute this!\033[0m") diff --git a/pokete_data/weather.py b/pokete_data/weather.py index 4900a204..2b596140 100644 --- a/pokete_data/weather.py +++ b/pokete_data/weather.py @@ -1,4 +1,6 @@ -weathers = { +from pokete_classes.asset_service.asset_types import Weathers + +weathers: Weathers = { "rain": { "info": "It's raining!", "effected": {