refactor(技能系统): 移除技能MP消耗相关逻辑

技能系统不再需要处理MP消耗,简化了技能施放和检查逻辑
This commit is contained in:
walkpan
2026-01-02 23:10:44 +08:00
parent 7d947db6b5
commit 2c7a628921
3 changed files with 25 additions and 33 deletions

View File

@@ -47,7 +47,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
if (!heroAttrs.is_atking) return;
const readySkills = skills.getReadySkills(heroAttrs.mp);
const readySkills = skills.getReadySkills();
if (readySkills.length === 0) return;
// 选择第一个可施放的技能(支持伤害/治疗/护盾)
@@ -89,9 +89,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
if (castSucess) {
// 🔥 怪物不消耗蓝
if (heroAttrs.fac !== FacSet.MON) {
// 使用 add_mp 确保 MP 不会变成负数,并触发相关更新
heroAttrs.add_mp(-skill.cost, true);
// 手动更新技能距离缓存,因为 HeroAttrSystem 无法检测到跨帧的 MP 变化
// 手动更新技能距离缓存
heroAttrs.updateSkillDistanceCache(skills);
}
skills.resetCD(skill.s_uuid);
@@ -134,8 +132,8 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
return false;
}
// 检查CD和MP
if (!skills.canCast(s_uuid, heroAttrs.mp)) {
// 检查CD
if (!skills.canCast(s_uuid)) {
return false;
}