feat(技能系统): 添加额外伤害和溅射伤害功能

在技能组件中新增ext_dmg和splash字段用于处理额外伤害和溅射伤害
修改技能创建和伤害计算逻辑以支持新功能
This commit is contained in:
2025-11-24 16:58:04 +08:00
parent 6df4abadd1
commit 91c18004eb
4 changed files with 21 additions and 12 deletions

View File

@@ -161,17 +161,19 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
if (hset === HSSet.atk){
let delay = 0.3
let ext_dmg = heroAttrs.useCountValTal(TalEffet.ATK_DMG);
let splash = heroAttrs.useCountValTal(TalEffet.SPLASH);
heroView.scheduleOnce(() => {
this.createSkill(s_uuid, heroView,targets,ext_dmg);
this.createSkill(s_uuid, heroView,targets,ext_dmg,splash);
}, delay);
//风怒wfuny 只针对 普通攻击起效
if (heroAttrs.useCountTal(TalEffet.WFUNY)){
let ext2_dmg = heroAttrs.useCountValTal(TalEffet.ATK_DMG);
let splash2 = heroAttrs.useCountValTal(TalEffet.SPLASH);
let delay = 0.3
heroView.playSkillEffect(s_uuid);
//需要再添加 风怒动画
heroView.scheduleOnce(() => {
this.createSkill(s_uuid, heroView,targets,ext2_dmg);
this.createSkill(s_uuid, heroView,targets,ext2_dmg,splash2);
},delay);
}
}
@@ -212,7 +214,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
/**
* 创建技能实体
*/
private createSkill(s_uuid: number, caster: HeroViewComp,targets:Vec3[]=[],ext_dmg:number=0) {
private createSkill(s_uuid: number, caster: HeroViewComp,targets:Vec3[]=[],ext_dmg:number=0,splash:number=0) {
// 检查节点有效性
if (!caster.node || !caster.node.isValid) {
console.warn("[SACastSystem] 施法者节点无效");
@@ -237,7 +239,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
const targetPos = targets[0]; // 使用第一个目标位置
// console.log(`[SACastSystem]: ${s_uuid}, 起始位置: ${startPos}, 目标位置: ${targetPos}`);
// 加载技能实体(包括预制体、组件初始化等)
skill.load(startPos, parent, s_uuid, targetPos, caster,ext_dmg);
skill.load(startPos, parent, s_uuid, targetPos, caster,ext_dmg,splash);
}
/**