技能有bug 需要处理
This commit is contained in:
@@ -68,25 +68,7 @@ export class Skill extends ecs.Entity {
|
||||
node.angle+=angle
|
||||
// 添加技能组件
|
||||
const SComp = node.getComponent(SkillCom); // 初始化技能参数
|
||||
if (!SComp) {
|
||||
console.error("[Skill] 技能组件获取失败");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 确保caster有必要的属性
|
||||
if (typeof caster.ap === 'undefined') {
|
||||
console.error("[Skill] caster.ap 未定义");
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof caster.box_group === 'undefined') {
|
||||
console.error("[Skill] caster.box_group 未定义");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 只设置必要的运行时属性,配置信息通过 SkillSet[uuid] 访问
|
||||
Object.assign(SComp, {
|
||||
// 核心标识
|
||||
@@ -94,7 +76,6 @@ export class Skill extends ecs.Entity {
|
||||
// 位置和施法者信息
|
||||
startPos: startPos,
|
||||
targetPos: targetPos,
|
||||
caster: caster,
|
||||
group: caster.box_group,
|
||||
fac: caster.fac,
|
||||
// 技能数值
|
||||
|
||||
@@ -161,10 +161,23 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user