去掉skillcom处理 buff skill只负责动画运行和碰撞伤害
This commit is contained in:
@@ -2,7 +2,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HType } from "../common/config/heroSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { BuffAttr, SkillSet } from "../common/config/SkillSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { SkillCom } from "./SkillCom";
|
||||
@@ -86,79 +86,34 @@ export class Skill extends ecs.Entity {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取计算后的属性数据
|
||||
let ap_data = this.get_ap(caster,dmg,uuid)
|
||||
|
||||
|
||||
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
|
||||
Object.assign(SComp, {
|
||||
// 核心标识
|
||||
s_uuid: uuid,
|
||||
|
||||
// 位置和施法者信息
|
||||
startPos: startPos,
|
||||
targetPos: targetPos,
|
||||
caster: caster,
|
||||
group: caster.box_group,
|
||||
fac: caster.fac,
|
||||
|
||||
// 计算后的战斗数据
|
||||
ap: ap_data.ap,
|
||||
caster_crit: ap_data.crit,
|
||||
caster_crit_d: ap_data.crit_d,
|
||||
puncture: ap_data.puncture,
|
||||
puncture_damage: ap_data.puncture_damage,
|
||||
burn_count: ap_data.burn_count,
|
||||
burn_value: ap_data.burn_value,
|
||||
stun_time: ap_data.stun_time,
|
||||
stun_ratto: ap_data.stun_ratto,
|
||||
frost_time: ap_data.frost_time,
|
||||
frost_ratto: ap_data.frost_ratto,
|
||||
// 技能数值
|
||||
ap: caster.Attrs[BuffAttr.AP],
|
||||
caster_crit: caster.Attrs[BuffAttr.CRITICAL],
|
||||
caster_crit_d: caster.Attrs[BuffAttr.CRITICAL_DMG],
|
||||
puncture: caster.Attrs[BuffAttr.PUNCTURE],
|
||||
puncture_damage: caster.Attrs[BuffAttr.PUNCTURE_DMG],
|
||||
burn_count: caster.Attrs[BuffAttr.BURN_COUNT],
|
||||
burn_value: caster.Attrs[BuffAttr.BURN_VALUE],
|
||||
stun_time: caster.Attrs[BuffAttr.STUN_TIME],
|
||||
stun_ratio: caster.Attrs[BuffAttr.STUN_RATIO],
|
||||
frost_time: caster.Attrs[BuffAttr.FROST_TIME],
|
||||
frost_ratio: caster.Attrs[BuffAttr.FROST_RATIO],
|
||||
debuff_up: caster.Attrs[BuffAttr.DEBUFF_UP],
|
||||
debuff_value: caster.Attrs[BuffAttr.DEBUFF_VALUE],
|
||||
debuff_count: caster.Attrs[BuffAttr.DEBUFF_COUNT],
|
||||
});
|
||||
|
||||
this.add(SComp);
|
||||
}
|
||||
|
||||
get_ap(view:HeroViewComp,dmg:number=0,uuid:number=0){
|
||||
let ap=0
|
||||
let crit=0
|
||||
let crit_d=0
|
||||
let buffap=1
|
||||
let puncture=0
|
||||
let puncture_damage=0
|
||||
let burn_count=0
|
||||
let burn_value=0
|
||||
let stun_time=0
|
||||
let stun_ratto=0
|
||||
let frost_time=0
|
||||
let frost_ratto=0
|
||||
// 汇总DEBUFF_DECD并处理count值
|
||||
let BUFF_ATK = 0
|
||||
let DEBUFF_DEATK = 0
|
||||
if(view.BUFF_ATKS.length>0){
|
||||
for (let i = view.BUFF_ATKS.length - 1; i >= 0; i--) {
|
||||
BUFF_ATK += view.BUFF_ATKS[i].value;
|
||||
// 不再在这里减少duration,改为在update中按时间减少
|
||||
}
|
||||
}
|
||||
if(view.DEBUFF_DEATKS.length>0) {
|
||||
for (let i = view.DEBUFF_DEATKS.length - 1; i >= 0; i--) {
|
||||
DEBUFF_DEATK += view.DEBUFF_DEATKS[i].value;
|
||||
// 不再在这里减少duration,改为在update中按时间减少
|
||||
}
|
||||
}
|
||||
|
||||
let BUFF_AP=(100-DEBUFF_DEATK+BUFF_ATK+dmg)/100 //buff区 总加成
|
||||
puncture =view.puncture
|
||||
puncture_damage=view.puncture_damage
|
||||
ap=view.ap*buffap*BUFF_AP*SkillSet[uuid].ap/100
|
||||
crit=view.crit
|
||||
crit_d=view.crit_d
|
||||
burn_count=view.burn_count
|
||||
burn_value=view.burn_value
|
||||
stun_time=view.stun_time
|
||||
stun_ratto=view.stun_ratto
|
||||
frost_time=view.frost_time
|
||||
frost_ratto=view.frost_ratto
|
||||
return {ap,crit,crit_d,puncture,puncture_damage,burn_count,burn_value,stun_time,stun_ratto,frost_time,frost_ratto}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ export class SkillCom extends CCComp {
|
||||
burn_count:number=0;
|
||||
burn_value:number=0;
|
||||
stun_time:number=0;
|
||||
stun_ratto:number=0;
|
||||
frost_ratto:number=0;
|
||||
stun_ratio:number=0;
|
||||
frost_ratio:number=0;
|
||||
frost_time:number=0;
|
||||
run_time:number=0;
|
||||
hited_time:number=0;
|
||||
@@ -46,7 +46,9 @@ export class SkillCom extends CCComp {
|
||||
caster_crit_d:number=0;
|
||||
puncture:number=0;
|
||||
puncture_damage:number=0;
|
||||
|
||||
debuff_up:number=0;
|
||||
debuff_value:number=0;
|
||||
debuff_count:number=0;
|
||||
// 组件引用
|
||||
spine:sp.Skeleton=null;
|
||||
anim:Animation=null;
|
||||
@@ -159,23 +161,10 @@ export class SkillCom extends CCComp {
|
||||
onAnimationFinished(){
|
||||
// console.log("[SkillCom]:onAnimationFinished",this.s_uuid)
|
||||
if (!this.skillConfig) return;
|
||||
|
||||
if(this.skillConfig.EType==EType.timeEnd) return
|
||||
if(this.skillConfig.SType!=SType.damage){
|
||||
this.to_do_buff()
|
||||
}
|
||||
|
||||
this.is_destroy=true
|
||||
}
|
||||
to_do_buff(){
|
||||
if (!this.skillConfig) return;
|
||||
|
||||
switch(this.skillConfig.SType){
|
||||
case SType.shield:
|
||||
this.caster.add_shield(this.skillConfig.buV)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//单体伤害
|
||||
single_damage(target:HeroViewComp,is_range:boolean=false){
|
||||
// //console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit)
|
||||
@@ -188,17 +177,17 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
target.do_atked(ap,this.caster_crit,this.caster_crit_d,
|
||||
this.burn_count,this.burn_value,
|
||||
this.stun_time,this.stun_ratto,
|
||||
this.frost_time,this.frost_ratto,
|
||||
this.stun_time,this.stun_ratio,
|
||||
this.frost_time,this.frost_ratio,
|
||||
this.skillConfig.AtkedType
|
||||
) // ap 及暴击 属性已经在skill.ts 处理
|
||||
// console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
|
||||
if(this.skillConfig.debuff>0){
|
||||
let debuff=this.skillConfig
|
||||
let dev=debuff.deV*(100+this.caster.DEBUFF_VALUE)/100
|
||||
let deR=debuff.deR+this.caster.DEBUFF_UP
|
||||
let dev=debuff.deV*(100+this.debuff_value)/100
|
||||
let deR=debuff.deR+this.debuff_up
|
||||
dev=Math.round(dev*100)/100
|
||||
let deC=debuff.deC+this.caster.DEBUFF_COUNT //dec只作为次数叠加
|
||||
let deC=debuff.deC+this.debuff_count //dec只作为次数叠加
|
||||
// //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC)
|
||||
target.add_debuff(debuff.debuff,dev,deC,deR)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user