add summon unit & maze buff & refactor battle

This commit is contained in:
Naruse
2025-04-16 21:31:18 +08:00
parent f0e41e3258
commit cfd9f3cb99
11 changed files with 164 additions and 42 deletions

View File

@@ -1,23 +1,30 @@
from dataclasses import dataclass, field
from dataclasses import dataclass
from game_server.resource.base_resource import BaseResource, T
from game_server.resource.decorators import GameResource
from game_server.resource.configdb.avatar_skill_tree_config import AvatarSkillTreeConfig
from game_server.resource.configdb.maze_buff_config import MazeBuffConfig
@dataclass
@GameResource("resources/ExcelOutput/AvatarConfig.json")
class AvatarConfig(BaseResource):
AvatarID: int
AvatarSkills: dict[int, int]
MazeBuffs: dict[int,int] # ID and LvMax
def on_load(self: T) -> bool:
from game_server.resource import ResourceManager
self.AvatarSkills = {}
self.MazeBuffs = {}
skill_tree_config = ResourceManager.instance().find_all_by_index(
AvatarSkillTreeConfig, self.AvatarID
)
for data in ResourceManager.instance().values(MazeBuffConfig):
if str(data.ID).startswith(str(self.AvatarID)):
self.MazeBuffs[data.ID] = data.LvMax
for skill in skill_tree_config:
skill_id = skill.PointID
skill_level = skill.MaxLevel