diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 10ede595..52a29bf9 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -126,7 +126,7 @@ ap:施法者攻击 mhp:增加最大生命比例 hp:增加当前生命比例 cd:buff/debuff持续时间 -buff_cd:buff/debuff触发时间 +/debuff触发时间 hited:伤害时间 shield:增加护盾占最大生命比例 @@ -140,134 +140,134 @@ export const HeroSkillList = [6001,6001,6001,6001,6001,6001] export const SkillSet = { 6001:{uuid:6001,name:"凛冬之触",sp_name:"greenball",path:"6001",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"}, 6002:{uuid:6002,name:"烈焰之怒",sp_name:"greenball",path:"6002",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"}, 6003:{uuid:6003,name:"奥术冲击",sp_name:"greenball",path:"6003",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"}, 6004:{uuid:6004,name:"神圣裁决",sp_name:"greenball",path:"6004",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"}, 6005:{uuid:6005,name:"破空斩击",sp_name:"patk",path:"6005",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:50,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"攻击前方直线100码内的敌人造成50%伤害"}, 6006:{uuid:6006,name:"穿心箭矢",sp_name:"arrow",path:"6006",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.linear,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放箭矢,造成100%攻击的伤害"}, 6007:{uuid:6007,name:"铁斧打击",sp_name:"mon_ft",path:"6007",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"}, 6008:{uuid:6008,name:"木棍打击",sp_name:"mon_ly",path:"6008",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出木棍,造成100%攻击的伤害"}, 6009:{uuid:6009,name:"飞刀打击",sp_name:"mon_xd",path:"6009",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"}, 6010:{uuid:6010,name:"石斧打击",sp_name:"mon_sf",path:"6010",TargetType:TargetType.Frontline, TargetGroup:3,act:"atk",CdType:1,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:3,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出石斧,造成100%攻击的伤害"}, 6011:{uuid:6011,name:"烈火呼吸",sp_name:"firequan",path:"6011",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:0.5, + debuff:0,in:3,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, 6012:{uuid:6012,name:"大火球" ,sp_name:"fire",path:"6012",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.linear,endType:1,fname:"max",flash:false,with:50, - debuff:2,depb:20,debtime:2,derate:100,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:2,in:1,ap:300,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"}, 6013:{uuid:6013,name:"火墙", sp_name:"firewall",path:"6013",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.fixedEnd,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:10,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:10,ap:50,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤一堵火墙,持续10秒,每秒造成50%攻击伤害"}, 6014:{uuid:6014,name:"寒冰箭", sp_name:"arrow_blue",path:"6014",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:1,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:1,in:1,ap:200,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率冰冻敌人"}, 6015:{uuid:6015,name:"烈焰射击",sp_name:"arrow_yellow",path:"6015",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:3,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:3,in:1,ap:200,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率眩晕敌人"}, 6016:{uuid:6016,name:"龙卷风", sp_name:"bwind",path:"6016",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:8,depb:50,debtime:1,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:8,in:1,ap:200,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,50%几率击退敌人"}, 6017:{uuid:6017,name:"生命之泉",sp_name:"heath",path:"6017",TargetType:TargetType.Frontline, TargetGroup:2,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max_blue",flash:true,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:5,count:1,def:0,apup:0,ap:100,mhp:0,hp:3,cd:5,buff_cd:1, + debuff:0,in:5,ap:100,hp:3,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"5秒持续为全体友方恢复施法者最大生命值15%的生命"}, 6018:{uuid:6018,name:"神圣护盾",sp_name:"shield",path:"6018",TargetType:TargetType.Frontline, TargetGroup:0,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:0.8,ap:100,cd:5, hited:0.3,shield:30,speed:720,sonsk:0,hero:0,info:"召唤圣盾保护自己,可以抵御3次攻击"}, 6019:{uuid:6019,name:"战争咆哮",sp_name:"apup",path:"6019",TargetType:TargetType.Frontline, TargetGroup:2,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max_red",flash:true,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:1,count:1,def:0,apup:20,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:1,def:0,apup:20,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"为全体友方增加施法者攻击力20%的攻击"}, 6021:{uuid:6021,name:"死亡射击",sp_name:"shoot2",path:"6021",TargetType:2, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.fixedEnd,RunType:RunType.bezier,endType:0,fname:"max_blue",flash:true,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:1,count:1,def:0,apup:0,ap:600,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:0,in:1,ap:600,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"攻击最后方的敌人,造成600%攻击的伤害"}, 6022:{uuid:6022,name:"寒霜之矛",sp_name:"icez",path:"6022",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:1,depb:50,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:1,in:1,ap:300,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤冰刺攻击敌人,造成200%攻击的伤害,20%几率冰冻敌人"}, 6023:{uuid:6023,name:"冰墙", sp_name:"icet",path:"6023",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:8,depb:50,debtime:1,derate:0,in:1,count:1,def:0,apup:0,ap:400,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:8,in:1,ap:400,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤冰墙攻击敌人,造成200%攻击的伤害,50%几率击退敌人"}, 6024:{uuid:6024,name:"旋风斩", sp_name:"fwind",path:"6024",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.fixedStart,RunType:RunType.bezier,endType:1,fname:"max_red",flash:false,with:50, - debuff:8,depb:50,debtime:1,derate:0,in:2,count:1,def:0,apup:0,ap:80,mhp:0,hp:0,cd:5,buff_cd:0.5, + debuff:8,in:2,ap:80,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"旋转武器对周围的敌人造成80%攻击,2秒内旋转4次"}, 6025:{uuid:6025,name:"火焰漩涡",sp_name:"fireball",path:"6025",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:8,depb:50,debtime:1,derate:0,in:3,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:8,in:3,ap:500,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤一个能量球射向前方敌人,对遇到的第一个敌人造成500%攻击的伤害,并击退"}, 6026:{uuid:6026,name:"潮汐", sp_name:"watert",path:"6026",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:8,depb:50,debtime:2,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:8,in:3,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤水柱攻击敌人,每秒造成100%攻击的伤害,50%几率击退敌人"}, 6027:{uuid:6027,name:"国王霸气",sp_name:"kingba",path:"6027",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.fixedStart,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:8,depb:100,debtime:2,derate:0,in:3,count:1,def:0,apup:2,ap:400,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:8,in:3,ap:400,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"释放霸气攻击周围敌人,造成400%伤害,并100%几率击退敌人"}, 6028:{uuid:6028,name:"自然庇佑",sp_name:"heath2",path:"6028",TargetType:TargetType.Frontline, TargetGroup:2,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max_blue",flash:true,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:2,count:1,def:0,apup:0,ap:100,mhp:0,hp:10,cd:5,buff_cd:1, + debuff:0,in:2,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"为全体友方恢复施法者最大生命值10%的生命,和抵御1次攻击的护盾"}, 6029:{uuid:6029,name:"陨石术", sp_name:"fireys",path:"6029",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.fixedEnd,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:8,depb:50,debtime:2,derate:0,in:3,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:8,in:3,ap:500,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤陨石攻击敌人,造成500%攻击的伤害"}, 6030:{uuid:6030,name:"闪电呼吸",sp_name:"dianquan",path:"6030",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:0.5, + debuff:0,in:3,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤闪电攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, 6031:{uuid:6031,name:"召唤仆从",sp_name:"zhaohuan",path:"6031",TargetType:TargetType.Frontline, TargetGroup:0,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max_blue",flash:true,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:2,count:1,def:20,apup:0,ap:70,mhp:0,hp:70,cd:5,buff_cd:1, + debuff:0,in:2,ap:70,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:5211,info:"召唤一个与施法者等级相同的骷髅战士为我方而战"}, 6032:{uuid:6032,name:"自愈", sp_name:"heath_small",path:"6032",TargetType:TargetType.Frontline, TargetGroup:0,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:0,depb:0,debtime:0,derate:0,in:2,count:1,def:0,apup:0,ap:100,mhp:0,hp:5,cd:5,buff_cd:1, + debuff:0,in:2,ap:100,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"主动:自己回复自身5%最大生命值的生命"}, 6033:{uuid:6033,name:"震地裂击",sp_name:"cuida",path:"6033",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:4,depb:100,debtime:1,derate:20,in:1,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:4,in:1,ap:500,cd:5, hited:0.3,shield:0,speed:720,sonsk:6035,hero:0,info:"捶爆前方目标,造成300%攻击的伤害,震慑敌人,本局内全部敌方降低对方10%攻击力"}, 6034:{uuid:6034,name:"风暴之矢",sp_name:"bingyu",path:"6034",TargetType:TargetType.Frontline, TargetGroup:3,act:"max",CdType:2,AnimType:AnimType.parabolic,RunType:RunType.bezier,endType:1,fname:"max",flash:false,with:50, - debuff:4,depb:100,debtime:1,derate:20,in:1,count:1,def:0,apup:0,ap:80,mhp:0,hp:0,cd:5,buff_cd:1, + debuff:4,in:1,ap:80,cd:5, hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"射出能量暴风箭攻击最前方范围敌人,每波造成80%攻击的伤害"} }; \ No newline at end of file diff --git a/assets/script/game/map/FightConComp.ts b/assets/script/game/map/FightConComp.ts index 5e39ff7c..f3e5544a 100644 --- a/assets/script/game/map/FightConComp.ts +++ b/assets/script/game/map/FightConComp.ts @@ -176,14 +176,14 @@ export class FightConComp extends Component { console.error("[FightConComp] 主角视图组件获取失败"); return; } - + let angle=0 let targets = this.pickRandomTarget(data.count) let target_pos= new Vec3(0,0,0) if(targets.length==0){ target_pos=this.aoe_target_pos }else{ - target_pos= new Vec3(targets[0].get(HeroViewComp).node.position.x,targets[0].get(HeroViewComp).node.position.y,0) + target_pos= new Vec3(targets[0].get(HeroViewComp).node.position.x,0,0) } skill.load( diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index 50bda294..8e41b083 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -41,6 +41,8 @@ export class SkillCom extends CCComp { distance_y:number=0; ap:number=0; FIGHTCON:FightConComp=null; + hited_time:number=0; + hit_count:number=0; private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向 protected onLoad(): void { @@ -88,14 +90,14 @@ export class SkillCom extends CCComp { if(this.node.getComponent(Animation)){ let anim = this.node.getComponent(Animation); console.log("has anim",anim) - anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this); + anim.on(Animation.EventType.FINISHED, this.onAnimationFinishedToDestroy, this); } if(this.node.getChildByName('anm')){ if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){ var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton; console.log("has spine",spine) spine.setCompleteListener((trackEntry) => { - this.onAnimationFinished() + this.onAnimationFinishedToDestroy() console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex); }); } @@ -103,47 +105,13 @@ export class SkillCom extends CCComp { break; } - // let dir_x = this.targetPos.x > this.node.position.x ? 1 : -1 - // this.node.scale = v3(dir_x,1,1) - // 根据目标位置设置节点朝向 - // if ( this.targetPos) { - // // 计算朝向 - // let direction = this.targetPos.x > this.node.position.x ? 1 : -1; - // // 设置节点缩放来改变朝向 - // this.node.scale = v3(direction * Math.abs(this.scale), this.scale, 1); - // } - // let dir_y = ( this.targetPos.y+BoxSet.ATK_Y) > this.node.position.y ? 1 : -1 - // if( this.targetPos.y+BoxSet.ATK_Y==this.node.position.y){ - // dir_y=0 - // } - // // 计算这一帧的移动距离 - // this.distance_x = SkillSet[this.s_uuid].speed*dir_x; - // this.distance_y = this.distance_x*Math.abs(this.targetPos.y-this.node.position.y)/Math.abs(this.targetPos.x-this.node.position.x)*dir_y; - // this.startMovement(); - - // // 计算目标角度 - // if (this.targetPos) { - // const currentPos = this.node.position; - - // // 计算角度(弧度) - // const dx = this.targetPos.x - currentPos.x; - // const dy = (this.targetPos.y + BoxSet.ATK_Y) - currentPos.y; - // const angle = Math.atan2(dy, dx); - - // // 将弧度转换为角度并设置节点旋转 - // this.angle = angle * 180 / Math.PI; - // this.node.angle = this.angle; // 移除负号,修正角度方向 - // } - - // // 计算速度分量 - // const radians = this.angle * Math.PI / 180; // 移除负号,使用正确的角度 - // this.distance_x = this.speed * Math.cos(radians); - // this.distance_y = this.speed * Math.sin(radians); - - // this.startMovement(); - // console.log("skill start",this.node.parent) + + } + onAnimationFinishedToDestroy(){ + this.is_destroy=true } onAnimationFinished(){ + this.hit_count++ let remainingDamage = this.ap; remainingDamage=remainingDamage*(100-this.FIGHTCON.enemy_buff.DEF+this.FIGHTCON.enemy_debuff.BURN)/100 let enemys=ecs.query(ecs.allOf(MonModelComp)) @@ -155,8 +123,7 @@ export class SkillCom extends CCComp { view.do_atked(remainingDamage) } }); - - this.is_destroy=true + } onBeginContact (seCol: Collider2D, oCol: Collider2D) { // console.log(this.scale+"碰撞开始 ",seCol,oCol); @@ -194,42 +161,6 @@ export class SkillCom extends CCComp { } } - private startBezierMove() { - - // let s_pos = v3(this.startPos.x,this.startPos.y) - // let c_pos = v3((this.targetPos.x+this.startPos.x)/2,this.startPos.y+150) - // let e_pos = v3(this.targetPos.x,this.targetPos.y) - // let time =Math.abs(Math.abs(this.targetPos.x-this.startPos.x)/this.speed) - - // // console.log("开始贝塞尔运动=>time:"+time,"s_pos:"+s_pos,"c_pos:"+c_pos,"e_pos:"+e_pos) - // SkillCom.bezierTo(this.node,time,s_pos,c_pos,e_pos,{ - // onComplete: (target?: object) => { - // this.is_destroy=true - // }, - // }).start(); - } - - - public static bezierTo(target: any, duration: number, c1: Vec3, c2: Vec3, to: Vec3, opts: any) { - opts = opts || Object.create(null); - /* - * @desc 二阶贝塞尔 - * @param {number} t 当前百分比 - * @param {} p1 起点坐标 - * @param {} cp 控制点 - * @param {} p2 终点坐标 - * @returns {any} - */ - let twoBezier = (t:number, p1: Vec3, cp: Vec3, p2: Vec3) => { - let x = (1 - t) * (1 - t) * p1.x + 2 * t * (1 - t) * cp.x + t * t * p2.x; - let y = (1 - t) * (1 - t) * p1.y + 2 * t * (1 - t) * cp.y + t * t * p2.y; - return v3(x, y, 0); - }; - opts.onUpdate = (arg: Vec3, ratio: number) => { - target.position = twoBezier(ratio, c1, c2, to); - }; - return tween(target).to(duration, {}, opts); - } to_console(value:any,value2:any=null,value3:any=null){ console.log("["+this.s_name+this.s_uuid+"]:",value,value2,value3) @@ -238,8 +169,12 @@ export class SkillCom extends CCComp { update(deltaTime: number) { if(smc.mission.pause) return; if (!this.node || !this.node.isValid) return; - - if(this.animType == AnimType.linear) this.startLinearMove(deltaTime); + this.hited_time+=deltaTime + if(this.hited_time>SkillSet[this.s_uuid].hited&&this.animType==AnimType.fixedEnd&&this.hit_count==0){ + this.hited_time=0 + this.onAnimationFinished() + } + // if(this.animType == AnimType.linear) this.startLinearMove(deltaTime); this.toDestroy(); } toDestroy() {