This commit is contained in:
2025-06-29 23:36:22 +08:00
parent 2ec530d881
commit 326e9bb97c
29 changed files with 2082 additions and 86 deletions

View File

@@ -139,20 +139,27 @@ export class SkillCom extends CCComp {
if(view){
let dis =Math.abs(this.node.position.x-view.node.position.x)
if(dis > SkillSet[this.s_uuid].with) return
view.do_atked(this.ap,this.caster_crit,this.caster_crit_d)
this.single_damage(view)
}
});
}
//单体伤害
single_damage(target:HeroViewComp,crit:number=0,crit_d:number=0){
single_damage(target:HeroViewComp){
this.hit_count++
console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit)
if(this.hit_count>=SkillSet[this.s_uuid].hit) this.is_destroy=true // 技能命中次数
if(target == null) return;
target.do_atked(this.ap,crit,crit_d)
target.do_atked(this.ap,this.caster_crit,this.caster_crit_d) // ap 及暴击 属性已经在skill.ts 处理
if(SkillSet[this.s_uuid].debuff>0){
let debuff =this.get_debuff()
target.add_debuff(SkillSet[this.s_uuid].debuff,debuff.deV,debuff.deC)
let deUP =this.get_debuff() // 因为不是每个技能都需要,debuff的增益在这里处理, ap 及暴击 属性已经在skill.ts 处理
let debuff=SkillSet[this.s_uuid]
let dev=debuff.deV*(100+deUP.deV)/100
let deR=debuff.deR+deUP.deR
dev=Math.round(dev*100)/100
let deC=debuff.deC+deUP.deC //dec只作为次数叠加
console.log("[SkillCom]:debuff",SkillSet[this.s_uuid].name,debuff.debuff,deUP.deV,deUP.deC)
target.add_debuff(debuff.debuff,dev,deC,deR)
}
}
@@ -161,12 +168,12 @@ export class SkillCom extends CCComp {
let target = oCol.getComponent(HeroViewComp)
if(oCol.group!=this.group){
if(target == null) return;
this.single_damage(target,this.caster_crit,this.caster_crit_d)
this.single_damage(target)
// this.ent.destroy()
}
}
get_debuff(){ //debuff 加成
let debuff = {deV:0,deC:0}
let debuff = {deV:0,deC:0,deR:0}
let buff=null
if(this.caster.is_master) buff = this.FIGHTCON.hero_buff
if(this.caster.is_friend) buff = this.FIGHTCON.friend_buff
@@ -174,6 +181,7 @@ export class SkillCom extends CCComp {
if(buff==null) return debuff
debuff.deV=buff.DEBUFF_VALUE
debuff.deC=buff.DEBUFF_COUNT
debuff.deR=buff.DEBUFF_UP
return debuff
}