dd
This commit is contained in:
@@ -11,6 +11,7 @@ import { BezierMove } from "../BezierMove/BezierMove";
|
||||
import { MonModelComp } from "../hero/MonModelComp";
|
||||
import { FightSet } from "../common/config/Mission";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { Skill } from "./Skill";
|
||||
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -134,12 +135,23 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AType.fixedStart: //都是buff
|
||||
this.node.setPosition(this.startPos.x,this.startPos.y,0)
|
||||
this.scheduleOnce(()=>{
|
||||
this.do_buff()
|
||||
// console.log("[SkillCom]:fixedStart",SkillSet[this.s_uuid].in-0.2)
|
||||
},SkillSet[this.s_uuid].in-0.2)
|
||||
case AType.fixedStart: //
|
||||
this.node.setPosition(this.startPos.x,this.startPos.y,0)
|
||||
|
||||
if(this.node.getComponent(Animation)){
|
||||
let anim = this.node.getComponent(Animation);
|
||||
//console.log("[SkillCom]:has anim",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
if(this.node.getChildByName('anm')){
|
||||
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
|
||||
//console.log("[SkillCom]:has spine",this.spine)
|
||||
this.spine.setCompleteListener((trackEntry) => {
|
||||
this.onAnimationFinished()
|
||||
//console.log("[SkillCom]:[track %s][animation %s] complete: %s", trackEntry.trackIndex);
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -147,6 +159,7 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
|
||||
onAnimationFinished(){
|
||||
console.log("[SkillCom]:onAnimationFinished",this.s_uuid)
|
||||
if(SkillSet[this.s_uuid].EType==EType.timeEnd) return
|
||||
this.is_destroy=true
|
||||
}
|
||||
@@ -190,7 +203,7 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
this.hit_count++
|
||||
// console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,SkillSet[this.s_uuid].hit,this.puncture)
|
||||
if(this.hit_count>=(SkillSet[this.s_uuid].hit+this.puncture)&&(SkillSet[this.s_uuid].DTType!=DTType.range)) this.is_destroy=true // 技能命中次数
|
||||
if(this.hit_count>=(SkillSet[this.s_uuid].hit+this.puncture)&&(SkillSet[this.s_uuid].DTType!=DTType.range)&&(SkillSet[this.s_uuid].EType!=EType.animationEnd)) this.is_destroy=true // 技能命中次数
|
||||
}
|
||||
|
||||
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
|
||||
@@ -200,7 +213,7 @@ export class SkillCom extends CCComp {
|
||||
if(oCol.group!=this.group){
|
||||
if(target == null) return;
|
||||
// console.log("[SkillCom]:onBeginContact oCol||seCol",oCol.node.position,seCol.node.position)
|
||||
this.single_damage(target)
|
||||
this.single_damage(target,SkillSet[this.s_uuid].DTType==DTType.range?true:false)
|
||||
// this.ent.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user