feat(技能系统): 实现技能冷却时间受攻击速度和技能速度属性影响

新增技能速度(SS)属性,用于减少非基础攻击技能的冷却时间
基础攻击技能冷却时间由英雄的as属性决定
眩晕和冰冻状态下不更新技能CD
合并冗余的canCast和resetCD方法
This commit is contained in:
2025-11-03 20:53:31 +08:00
parent 04aa5f9c78
commit 914ab0e8b9
7 changed files with 71 additions and 69 deletions

View File

@@ -1,5 +1,6 @@
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { smc } from "../common/SingletonModuleComp";
import { HeroAttrsComp } from "./HeroAttrsComp";
import { HeroSkillsComp } from "./HeroSkills";
/**
@@ -27,7 +28,11 @@ export class SkillCDSystem extends ecs.ComblockSystem implements ecs.ISystemUpda
if(!smc.mission.play || smc.mission.pause) return;
const skills = e.get(HeroSkillsComp);
if (!skills) return;
const attrsCom = e.get(HeroAttrsComp);
if (!attrsCom) return;
if (attrsCom.isStun() || attrsCom.isFrost()) { // 眩晕和冰冻状态不更新CD
return;
}
// 更新所有技能CD
skills.updateCDs(this.dt);
}