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

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

View File

@@ -12,6 +12,8 @@ export class SDataCom extends ecs.Comp {
group:BoxSet=BoxSet.HERO
fac: number = 0; // 0:hero 1:monster
s_uuid:number=0
ext_dmg:number=0 //额外伤害
splash:number=0 //溅射伤害
hit_count:number=0 //击中数量
reset() {
this.Attrs=null
@@ -20,6 +22,8 @@ export class SDataCom extends ecs.Comp {
this.s_uuid=0
this.caster=null
this.hit_count=0
this.ext_dmg=0
this.splash=0
}
}

View File

@@ -29,7 +29,7 @@ export class Skill extends ecs.Entity {
this.addComponents<SMoveDataComp>(SMoveDataComp);
}
load(startPos: Vec3, parent: Node, s_uuid: number, targetPos: Vec3,
caster:HeroViewComp,ext_dmg:number=0) {
caster:HeroViewComp,ext_dmg:number=0,splash:number=0) {
const config = SkillSet[s_uuid];
if (!config) {
@@ -93,6 +93,8 @@ export class Skill extends ecs.Entity {
sDataCom.Attrs={...cAttrsComp.Attrs}
sDataCom.s_uuid=s_uuid
sDataCom.fac=cAttrsComp.fac
sDataCom.ext_dmg=ext_dmg
sDataCom.splash=splash
}
/** 模块资源释放 */