refactor(技能系统): 添加系统注册和调试日志
为SkillCastSystem、SkillCDSystem和SkillAutocastSystem添加ECS注册装饰器 在关键方法中添加console.log调试信息以便追踪系统执行流程
This commit is contained in:
@@ -45,12 +45,14 @@ export class CastSkillRequestComp extends ecs.Comp {
|
||||
* - 施法检查与执行分离
|
||||
* - 自动处理资源消耗和CD重置
|
||||
*/
|
||||
@ecs.register('SkillCastSystem')
|
||||
export class SkillCastSystem extends ecs.ComblockSystem implements ecs.IEntityEnterSystem {
|
||||
|
||||
/**
|
||||
* 过滤器:拥有技能数据 + 施法请求的实体
|
||||
*/
|
||||
filter(): ecs.IMatcher {
|
||||
console.log("[SkillCastSystem] filter");
|
||||
return ecs.allOf(HeroSkillsComp, HeroAttrsComp, CastSkillRequestComp);
|
||||
}
|
||||
|
||||
@@ -181,9 +183,11 @@ export class SkillCastSystem extends ecs.ComblockSystem implements ecs.IEntityEn
|
||||
* - 独立的CD管理系统
|
||||
* - 只负责时间递减,不处理施法逻辑
|
||||
*/
|
||||
@ecs.register('SkillCDSystem')
|
||||
export class SkillCDSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
|
||||
|
||||
filter(): ecs.IMatcher {
|
||||
console.log("[SkillCDSystem] filter");
|
||||
return ecs.allOf(HeroSkillsComp);
|
||||
}
|
||||
|
||||
@@ -210,9 +214,11 @@ export class SkillCDSystem extends ecs.ComblockSystem implements ecs.ISystemUpda
|
||||
* - 通过添加 CastSkillRequestComp 触发施法
|
||||
* - 可被玩家输入系统或AI系统复用
|
||||
*/
|
||||
@ecs.register('SkillAutocastSystem')
|
||||
export class SkillAutocastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
|
||||
|
||||
filter(): ecs.IMatcher {
|
||||
console.log("[SkillAutocastSystem] filter");
|
||||
return ecs.allOf(HeroSkillsComp, HeroAttrsComp, HeroViewComp);
|
||||
}
|
||||
|
||||
@@ -220,7 +226,7 @@ export class SkillAutocastSystem extends ecs.ComblockSystem implements ecs.ISyst
|
||||
const skillsData = e.get(HeroSkillsComp);
|
||||
const heroModel = e.get(HeroAttrsComp);
|
||||
const heroView = e.get(HeroViewComp);
|
||||
|
||||
console.log("[SkillAutocastSystem] update");
|
||||
if (!skillsData || !heroModel || !heroView) return;
|
||||
|
||||
// 检查基本条件
|
||||
|
||||
Reference in New Issue
Block a user