refactor(hero): 移除天赋系统和相关属性,简化英雄架构

- 删除 SCDSystem、HeroAttrSystem 等独立系统,将功能整合到现有组件
- 移除 TalComp 天赋组件及相关配置(TalSet、AttrSet、CardSet)
- 清理 HeroAttrs 中未使用的属性枚举,保留核心战斗属性
- 简化 Hero 实体创建逻辑,不再为主角挂载天赋组件
- 移除 SingletonModuleComp 中与天赋、经验、收集相关的数据管理
This commit is contained in:
panw
2026-03-11 17:32:29 +08:00
parent b354c7ed9a
commit 350bbafcfb
12 changed files with 44 additions and 2520 deletions

View File

@@ -10,7 +10,6 @@ import { GameEvent } from "../common/config/GameEvent";
import { getNeAttrs, getAttrs ,Attrs, defaultAttrs} from "../common/config/HeroAttrs";
import { HeroSkillsComp } from "./HeroSkills";
import { HeroMoveComp } from "./HeroMove";
import { TalComp } from "./TalComp";
import { mLogger } from "../common/Logger";
import { HeroMasterComp } from "./HeroMasterComp";
/** 角色实体 */
@@ -21,7 +20,6 @@ export class Hero extends ecs.Entity {
HeroSkills!: HeroSkillsComp;
View!: HeroViewComp;
HeroMove!: HeroMoveComp;
TalComp!: TalComp;
debugMode: boolean = false; // 是否启用调试模式
protected init() {
this.addComponents<ecs.Comp>(
@@ -41,7 +39,6 @@ export class Hero extends ecs.Entity {
this.remove(HeroViewComp);
this.remove(HeroAttrsComp);
this.remove(HeroSkillsComp);
this.remove(TalComp);
this.remove(HeroMasterComp)
super.destroy();
}
@@ -85,16 +82,6 @@ export class Hero extends ecs.Entity {
model.is_friend = is_friend
model.rangeType = hero.rangeType;
// 只有主角才挂载天赋组件
if (is_master) {
mLogger.log(this.debugMode,`[Hero] 主角创建, uuid=${uuid},is_master=${is_master}`);
this.add(TalComp);
this.add(HeroMasterComp)
const talComp = this.get(TalComp);
if (talComp) {
talComp.init(uuid);
}
model.initEvent();
}
// ✅ 初始化技能数据(迁移到 HeroSkillsComp
skillsComp.initSkills(hero.skills, uuid);