fix(英雄技能系统): 修复怪物释放技能时消耗蓝量的问题

修改技能释放逻辑,当单位是怪物时使用无限蓝量进行检查且不扣除蓝量
This commit is contained in:
walkpan
2026-01-02 15:23:25 +08:00
parent 7b69700f14
commit e9abbefe9d

View File

@@ -8,7 +8,7 @@ import { Skill } from "../skill/Skill";
import { smc } from "../common/SingletonModuleComp";
import { TalComp } from "./TalComp";
import { TalEffet, TriType } from "../common/config/TalSet";
import { BoxSet } from "../common/config/GameSet";
import { BoxSet, FacSet } from "../common/config/GameSet";
import { Attrs } from "../common/config/HeroAttrs";
/**
@@ -46,8 +46,9 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
// 检查是否正在攻击(只有攻击时才释放技能)
if (!heroAttrs.is_atking) return;
// 获取所有可施放的技能
const readySkills = skills.getReadySkills(heroAttrs.mp);
// 🔥 怪物不消耗蓝使用Infinity作为mp参数
const mpForCheck = heroAttrs.fac === FacSet.MON ? Infinity : heroAttrs.mp;
const readySkills = skills.getReadySkills(mpForCheck);
if (readySkills.length === 0) return;
// 选择第一个可施放的技能(支持伤害/治疗/护盾)
@@ -87,7 +88,10 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
const castSucess = this.executeCast(e, skill.s_uuid, heroView,hset);
// 5. 扣除资源和重置CD
if (castSucess) {
heroAttrs.mp -= skill.cost;
// 🔥 怪物不消耗蓝
if (heroAttrs.fac !== FacSet.MON) {
heroAttrs.mp -= skill.cost;
}
skills.resetCD(skill.s_uuid);
}
return castSucess;