add summon unit & maze buff & refactor battle
This commit is contained in:
@@ -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
|
||||
|
||||
13
game_server/resource/configdb/maze_buff_config.py
Normal file
13
game_server/resource/configdb/maze_buff_config.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from dataclasses import dataclass
|
||||
from game_server.resource.base_resource import BaseResource
|
||||
from game_server.resource.decorators import GameResource, LoadPriority
|
||||
from game_server.game.enums.scene.game_mode_type import GameModeTypeEnum
|
||||
|
||||
@dataclass
|
||||
@GameResource("resources/ExcelOutput/MazeBuff.json",load_priority=LoadPriority.HIGH)
|
||||
class MazeBuffConfig(BaseResource):
|
||||
ID: int
|
||||
LvMax: int
|
||||
|
||||
def get_index(self) -> str:
|
||||
return str(self.ID)
|
||||
16
game_server/resource/configdb/summon_unit_data.py
Normal file
16
game_server/resource/configdb/summon_unit_data.py
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
from dataclasses import dataclass
|
||||
from game_server.resource.base_resource import BaseResource
|
||||
from game_server.resource.decorators import GameResource
|
||||
|
||||
@dataclass
|
||||
@GameResource("resources/ExcelOutput/SummonUnitData.json")
|
||||
class SummonUnitData(BaseResource):
|
||||
ID: int
|
||||
JsonPath: str
|
||||
DestroyOnEnterBattle: bool
|
||||
RemoveMazeBuffOnDestroy: bool
|
||||
IsClient: bool
|
||||
|
||||
def get_index(self) -> str:
|
||||
return str(self.ID)
|
||||
Reference in New Issue
Block a user