修改了很多

This commit is contained in:
panfudan
2025-03-27 23:25:10 +08:00
parent 3a15541170
commit 67704725b2
40 changed files with 9140 additions and 4253 deletions

View File

@@ -37,8 +37,6 @@ export enum BoxSet {
MAX_SKILL_SY = 50,
MAX_SKILL_BY = 80,
ATK_Y = 20,
}
export enum GameSet {
ATK_TO_ATK_RATIO=0.1,

View File

@@ -78,37 +78,37 @@ info:技能描述
*/
export const SkillSet = {
6001:{uuid:6001,name:"凛冬之触",sp_name:"ball_blue",path:"6001",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"},
6002:{uuid:6002,name:"烈焰之怒",sp_name:"ball_red",path:"6002",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"},
6003:{uuid:6003,name:"奥术冲击",sp_name:"ball_green",path:"6003",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"},
6004:{uuid:6004,name:"神圣裁决",sp_name:"ball_yellow",path:"6004",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"},
6005:{uuid:6005,name:"破空斩击",sp_name:"patk",path:"6005",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"攻击前方直线100码内的敌人造成50%伤害"},
6006:{uuid:6006,name:"穿心箭矢",sp_name:"arrow",path:"6006",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放箭矢,造成100%攻击的伤害"},
6007:{uuid:6007,name:"铁斧打击",sp_name:"mon_ft",path:"6007",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"},
6008:{uuid:6008,name:"木棍打击",sp_name:"mon_ly",path:"6008",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出木棍,造成100%攻击的伤害"},
6009:{uuid:6009,name:"飞刀打击",sp_name:"mon_xd",path:"6009",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"},
6010:{uuid:6010,name:"石斧打击",sp_name:"mon_sf",path:"6010",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出石斧,造成100%攻击的伤害"},
6011:{uuid:6011,name:"烈火呼吸",sp_name:"firequan",path:"6011",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"},
6012:{uuid:6012,name:"大火球" ,sp_name:"fire",path:"6012",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"},
6013:{uuid:6013,name:"火墙", sp_name:"firewall",path:"6013",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:4,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"在最前方敌人位置,召唤一堵火墙,持续10秒,每秒造成50%攻击伤害"},
6014:{uuid:6014,name:"寒冰箭", sp_name:"arrow_blue",path:"6014",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率冰冻敌人"},
6015:{uuid:6015,name:"烈焰射击",sp_name:"arrow_yellow",path:"6015",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率眩晕敌人"},
6016:{uuid:6016,name:"龙卷风", sp_name:"bwind",path:"6016",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,50%几率击退敌人"},
6017:{uuid:6017,name:"生命之泉",sp_name:"heath",path:"6017",TargetType:1,TargetGroup:2,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"5秒持续为全体友方恢复施法者最大生命值15%的生命"},
6018:{uuid:6018,name:"神圣护盾",sp_name:"shield",path:"6018",TargetType:1,TargetGroup:0,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:30,speed:300,sonsk:0,hero:0,info:"召唤圣盾保护自己,可以抵御3次攻击"},
6019:{uuid:6019,name:"战争咆哮",sp_name:"apup",path:"6019",TargetType:1,TargetGroup:2,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"为全体友方增加施法者攻击力20%的攻击"},
6021:{uuid:6021,name:"死亡射击",sp_name:"shoot2",path:"6021",TargetType:2,TargetGroup:3,act:"max",CdType:2,AnimType:4,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"攻击最后方的敌人,造成600%攻击的伤害"},
6022:{uuid:6022,name:"寒霜之矛",sp_name:"icez",path:"6022",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"在最前方敌人位置,召唤冰刺攻击敌人,造成200%攻击的伤害,20%几率冰冻敌人"},
6023:{uuid:6023,name:"冰墙", sp_name:"icet",path:"6023",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"在最前方敌人位置,召唤冰墙攻击敌人,造成200%攻击的伤害,50%几率击退敌人"},
6024:{uuid:6024,name:"旋风斩", sp_name:"fwind",path:"6024",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:3,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"旋转武器对周围的敌人造成80%攻击,2秒内旋转4次"},
6025:{uuid:6025,name:"火焰漩涡",sp_name:"fireball",path:"6025",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:500,sonsk:0,hero:0,info:"召唤一个能量球射向前方敌人,对遇到的第一个敌人造成500%攻击的伤害,并击退"},
6026:{uuid:6026,name:"潮汐", sp_name:"watert",path:"6026",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:500,sonsk:0,hero:0,info:"在最前方敌人位置,召唤水柱攻击敌人,每秒造成100%攻击的伤害,50%几率击退敌人"},
6027:{uuid:6027,name:"国王霸气",sp_name:"kingba",path:"6027",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:3,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,hited:0.3,shield:0,speed:500,sonsk:0,hero:0,info:"释放霸气攻击周围敌人,造成400%伤害,并100%几率击退敌人"},
6028:{uuid:6028,name:"自然庇佑",sp_name:"heath2",path:"6028",TargetType:1,TargetGroup:2,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"为全体友方恢复施法者最大生命值10%的生命,和抵御1次攻击的护盾"},
6029:{uuid:6029,name:"陨石术", sp_name:"fireys",path:"6029",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:4,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,hited:0.3,shield:0,speed:500,sonsk:0,hero:0,info:"在最前方敌人位置,召唤陨石攻击敌人,造成500%攻击的伤害"},
6030:{uuid:6030,name:"闪电呼吸",sp_name:"dianquan",path:"6030",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤闪电攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"},
6031:{uuid:6031,name:"召唤仆从",sp_name:"zhaohuan",path:"6031",TargetType:1,TargetGroup:0,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:120,sonsk:0,hero:5211,info:"召唤一个与施法者等级相同的骷髅战士为我方而战"},
6032:{uuid:6032,name:"自愈", sp_name:"heath_small",path:"6032",TargetType:1,TargetGroup:0,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:120,sonsk:0,hero:0,info:"主动:自己回复自身5%最大生命值的生命"},
6033:{uuid:6033,name:"震地裂击",sp_name:"cuida",path:"6033",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:500,sonsk:6035,hero:0,info:"捶爆前方目标造成300%攻击的伤害震慑敌人本局内全部敌方降低对方10%攻击力"},
6034:{uuid:6034,name:"风暴之矢",sp_name:"bingyu",path:"6034",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"射出能量暴风箭攻击最前方范围敌人,每波造成80%攻击的伤害"}
6001:{uuid:6001,name:"凛冬之触",sp_name:"ball_blue",path:"6001",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"},
6002:{uuid:6002,name:"烈焰之怒",sp_name:"ball_red",path:"6002",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"},
6003:{uuid:6003,name:"奥术冲击",sp_name:"ball_green",path:"6003",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"},
6004:{uuid:6004,name:"神圣裁决",sp_name:"ball_yellow",path:"6004",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"},
6005:{uuid:6005,name:"破空斩击",sp_name:"patk",path:"6005",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"攻击前方直线100码内的敌人造成50%伤害"},
6006:{uuid:6006,name:"穿心箭矢",sp_name:"arrow",path:"6006",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人释放箭矢,造成100%攻击的伤害"},
6007:{uuid:6007,name:"铁斧打击",sp_name:"mon_ft",path:"6007",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"},
6008:{uuid:6008,name:"木棍打击",sp_name:"mon_ly",path:"6008",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出木棍,造成100%攻击的伤害"},
6009:{uuid:6009,name:"飞刀打击",sp_name:"mon_xd",path:"6009",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"},
6010:{uuid:6010,name:"石斧打击",sp_name:"mon_sf",path:"6010",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"向最前方敌人扔出石斧,造成100%攻击的伤害"},
6011:{uuid:6011,name:"烈火呼吸",sp_name:"firequan",path:"6011",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"},
6012:{uuid:6012,name:"大火球" ,sp_name:"fire",path:"6012",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"},
6013:{uuid:6013,name:"火墙", sp_name:"firewall",path:"6013",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:4,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,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:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,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:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率眩晕敌人"},
6016:{uuid:6016,name:"龙卷风", sp_name:"bwind",path:"6016",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,50%几率击退敌人"},
6017:{uuid:6017,name:"生命之泉",sp_name:"heath",path:"6017",TargetType:1,TargetGroup:2,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"5秒持续为全体友方恢复施法者最大生命值15%的生命"},
6018:{uuid:6018,name:"神圣护盾",sp_name:"shield",path:"6018",TargetType:1,TargetGroup:0,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:30,speed:720,sonsk:0,hero:0,info:"召唤圣盾保护自己,可以抵御3次攻击"},
6019:{uuid:6019,name:"战争咆哮",sp_name:"apup",path:"6019",TargetType:1,TargetGroup:2,act:"max",CdType:2,AnimType:0,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,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:4,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"攻击最后方的敌人,造成600%攻击的伤害"},
6022:{uuid:6022,name:"寒霜之矛",sp_name:"icez",path:"6022",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤冰刺攻击敌人,造成200%攻击的伤害,20%几率冰冻敌人"},
6023:{uuid:6023,name:"冰墙", sp_name:"icet",path:"6023",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤冰墙攻击敌人,造成200%攻击的伤害,50%几率击退敌人"},
6024:{uuid:6024,name:"旋风斩", sp_name:"fwind",path:"6024",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:3,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,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:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤一个能量球射向前方敌人,对遇到的第一个敌人造成500%攻击的伤害,并击退"},
6026:{uuid:6026,name:"潮汐", sp_name:"watert",path:"6026",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤水柱攻击敌人,每秒造成100%攻击的伤害,50%几率击退敌人"},
6027:{uuid:6027,name:"国王霸气",sp_name:"kingba",path:"6027",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:3,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"释放霸气攻击周围敌人,造成400%伤害,并100%几率击退敌人"},
6028:{uuid:6028,name:"自然庇佑",sp_name:"heath2",path:"6028",TargetType:1,TargetGroup:2,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"为全体友方恢复施法者最大生命值10%的生命,和抵御1次攻击的护盾"},
6029:{uuid:6029,name:"陨石术", sp_name:"fireys",path:"6029",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:4,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"在最前方敌人位置,召唤陨石攻击敌人,造成500%攻击的伤害"},
6030:{uuid:6030,name:"闪电呼吸",sp_name:"dianquan",path:"6030",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"召唤闪电攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"},
6031:{uuid:6031,name:"召唤仆从",sp_name:"zhaohuan",path:"6031",TargetType:1,TargetGroup:0,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:5211,info:"召唤一个与施法者等级相同的骷髅战士为我方而战"},
6032:{uuid:6032,name:"自愈", sp_name:"heath_small",path:"6032",TargetType:1,TargetGroup:0,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"主动:自己回复自身5%最大生命值的生命"},
6033:{uuid:6033,name:"震地裂击",sp_name:"cuida",path:"6033",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:6035,hero:0,info:"捶爆前方目标造成300%攻击的伤害震慑敌人本局内全部敌方降低对方10%攻击力"},
6034:{uuid:6034,name:"风暴之矢",sp_name:"bingyu",path:"6034",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,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,hited:0.3,shield:0,speed:720,sonsk:0,hero:0,info:"射出能量暴风箭攻击最前方范围敌人,每波造成80%攻击的伤害"}
};

View File

@@ -1,4 +1,3 @@
import { Talents } from "./TalentSet"
/**
* kind 1:烈焰 2:寒冰 3:自然 4:暗影 5:神圣
**/
@@ -26,10 +25,19 @@ export enum HeroType {
remote = 1,
mage = 2,
}
export enum HeroFac {
hero = 0,
enemy = 1,
}
export const HeroList = [5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011]
export const MonList = [5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227]
export const HeroSet = {
StartPos:[-300,-350,-350]
Start_x:[-200,-260,-320],
Start_y:[70,0,-70]
}
export const MonSet = {
Start_x:[200,260,320],
Start_y:[70,0,-70]
}
export const HeroInfo = {
5001:{uuid:5001,name:"神圣守护",path:"k2", quality:3,kind:1,type:0,hp:200,ap:10,dis:400,a_cd:1,speed:50,skills:[6005],tals:"说明"},

View File

@@ -24,6 +24,9 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
const shouldStop = enemiesStop;
view.is_atking = shouldStop;
// 更新渲染层级
this.updateRenderOrder(e);
// 同步状态
if (!shouldStop) {
if(view.is_stop||view.is_dead) return //停止移动或者死亡不移动
@@ -134,4 +137,29 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
}
});
}
/** 更新渲染层级 */
private updateRenderOrder(entity: ecs.Entity) {
const current = entity.get(HeroViewComp);
// 查找所有单位
const allUnits = ecs.query(ecs.allOf(HeroViewComp)).filter(e => {
const other = e.get(HeroViewComp);
return other.fac === current.fac; // 按阵营分组
});
// 按y坐标从大到小排序y坐标越小显示在上层
const sortedUnits = allUnits.sort((a, b) => {
const posA = a.get(HeroViewComp).node.position.y;
const posB = b.get(HeroViewComp).node.position.y;
return posB - posA; // 修改排序顺序
});
// 设置渲染顺序
// 根据y坐标设置层级y坐标越小的显示在上层
const index = sortedUnits.findIndex(e => e === entity);
current.node.setSiblingIndex(index);
}
}

View File

@@ -89,6 +89,8 @@ export class HeroViewComp extends CCComp {
onLoad() {
this.as = this.getComponent(HeroSpine);
let anm = this.node.getChildByName("anm")
anm.setScale(anm.scale.x*0.7,anm.scale.y*0.7);
// 注册单个碰撞体的回调函数
// let collider = this.getComponent(Collider2D);
@@ -157,12 +159,8 @@ export class HeroViewComp extends CCComp {
let hp_progress= this.hp/this.hp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.is_boss) return
this.node.getChildByName("top").getChildByName("hp").active = true;
// if(this.hp == this.hp_max){
// this.node.getChildByName("top").getChildByName("hp").active = false;
// } else{
// this.node.getChildByName("top").getChildByName("hp").active = true;
// }
this.node.getChildByName("top").getChildByName("hp").active = (this.hp == this.hp_max) ? false : true;
}
//移动
@@ -265,7 +263,7 @@ export class HeroViewComp extends CCComp {
return this.node.position.y <= -900;
}
to_alive(){
let pos =v3(HeroSet.StartPos[this.type],this.node.position.y,this.node.position.z)
let pos =v3(HeroSet.Start_x[this.type],HeroSet.Start_y[this.type],this.node.position.z)
this.node.setPosition(pos)
this.revive()
}

View File

@@ -78,29 +78,18 @@ export class Monster extends ecs.Entity {
hv.hero_name= hero.name;
hv.speed =hv.ospeed = hero.speed;
hv.dis = hero.dis;
hv.pw = hero.pw;
hv.pwm= hero.pwm;
hv.pws= hero.pws
hv.apw=hero.apw;
hv.uapw=hero.uapw;
hv.cpw=hero.cpw;
hv.dpw=hero.dpw;
hv.dopw=hero.dopw;
hv.hp= hv.hp_max =hero.hp*(1+(lv-1)*0.2);
hv.ap = hero.ap*(1+(lv-1)*0.2);
hv.def= hero.def*(1+(lv-1)*0.2);
hv.hp= hv.hp_max =hero.hp;
hv.ap = hero.ap;
hv.cd = hero.a_cd
hv.crit = hero.crit*(1+(lv-1)*0.2); //暴击率
hv.crit_add = hero.crit_add*(1+(lv-1)*0.2);//暴击伤害加成
hv.dodge = hero.dodge*(1+(lv-1)*0.2); //闪避率
hv.atk_skill=hero.skills[0]
this.add(hv);
// 初始化多个技能组件
const skillsComp = this.get(HeroSkillsComp);
// 正确初始化已有技能
hero.skills.forEach(skillId => {
this.addSkill(skillId); // 使用addSkill方法确保初始化
});
// // 初始化多个技能组件
// const skillsComp = this.get(HeroSkillsComp);
// // 正确初始化已有技能
// hero.skills.forEach(skillId => {
// this.addSkill(skillId); // 使用addSkill方法确保初始化
// });
// 初始化移动参数
const move = this.get(BattleMoveComp);

View File

@@ -2,7 +2,7 @@ import { _decorator, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { BoxSet } from "../common/config/BoxSet";
import { HeroList, HeroSet } from "../common/config/heroSet";
import { HeroInfo, HeroList, HeroSet } from "../common/config/heroSet";
import { Hero } from "../hero/Hero";
import { smc } from "../common/SingletonModuleComp";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
@@ -25,6 +25,9 @@ export class MissionHeroCompComp extends CCComp {
protected update(dt: number): void {
if(smc.mission.status != 1) return
}
init(){
}
test_call(){
this.addHero(5010)
@@ -41,7 +44,8 @@ export class MissionHeroCompComp extends CCComp {
private addHero(uuid:number=1001,i:number=0) {
let hero = ecs.getEntity<Hero>(Hero);
let scale = 1
let pos:Vec3 = v3(HeroSet.StartPos[1]-i*10,BoxSet.GAME_LINE);
let y=RandomManager.instance.getRandomInt(0,HeroSet.Start_y.length,1)
let pos:Vec3 = v3(HeroSet.Start_x[HeroInfo[uuid].type],HeroSet.Start_y[y]);
hero.load(pos,scale,uuid);
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */

View File

@@ -3,7 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { Monster } from "../hero/Mon";
import { BoxSet } from "../common/config/BoxSet";
import { HeroSet } from "../common/config/heroSet";
import { HeroSet, MonSet } from "../common/config/heroSet";
import { Missions } from "../common/config/MissionSet";
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
@@ -72,7 +72,9 @@ export class MissionMonCompComp extends CCComp {
private addMonster(uuid:number=1001,i:number=0,is_boss:boolean=false) {
let mon = ecs.getEntity<Monster>(Monster);
let scale = -1
let pos:Vec3 = v3(-1*HeroSet.StartPos[1]+i*10,BoxSet.GAME_LINE);
let x=RandomManager.instance.getRandomInt(0,MonSet.Start_x.length,1)
let y=RandomManager.instance.getRandomInt(0,MonSet.Start_y.length,1)
let pos:Vec3 = v3(MonSet.Start_x[2],MonSet.Start_y[y]);
mon.load(pos,scale,uuid,is_boss);
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */

View File

@@ -8,6 +8,7 @@ import { GameEvent } from "../common/config/GameEvent";
import { Skill } from "../skills/Skill";
import { SkillCom } from "../skills/SkillCom";
import { AnimType } from "../common/config/SkillSet";
import { BoxSet } from "../common/config/BoxSet";
/** 技能系统 */
@@ -47,8 +48,8 @@ export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUp
const targets = this.selectEnemyTargets(caster, config);
if (targets.length === 0) return;
skillEntity.load(
new Vec3(view.node.position.x, view.node.position.y+view.node.getComponent(UITransform).contentSize.height/2, 0), // 起始位置
view.box_group, // 阵营
new Vec3(view.node.position.x, view.node.position.y+BoxSet.ATK_Y, 0), // 起始位置
view.fac, // 阵营
view.node.parent, // 父节点
config.uuid, // 技能ID
new Vec3(targets[0]?.get(HeroViewComp).node.position.x, targets[0]?.get(HeroViewComp).node.position.y, 0), // 目标位置

View File

@@ -55,8 +55,8 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
const skillPos = skill.node.position;
// 根据技能配置获取判定范围
const config = SkillSet[skill.s_uuid];
const rangeX = config?.rangeX || 20; // 默认值为10
const rangeY = config?.rangeY || 30;
const rangeX = config?.rangeX || 30; // 默认值为10
const rangeY = config?.rangeY || 40;
const distanceX = Math.abs(targetPos.x - skillPos.x);
const distanceY = Math.abs(targetPos.y+40 - skillPos.y);
const isInRange = distanceX < rangeX && distanceY < rangeY;

View File

@@ -56,6 +56,7 @@ export class Skill extends ecs.Entity {
skillComp.caster = caster;
skillComp.prefabName = config.sp_name;
skillComp.group = group;
skillComp.fac = group;
if(group==BoxSet.HERO){
skillComp.fac=0;
}else{

View File

@@ -4,9 +4,10 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { smc } from "../common/SingletonModuleComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
import { AnimType, endType } from "../common/config/SkillSet";
import { AnimType, endType, SkillSet } from "../common/config/SkillSet";
import { EndAnmCom } from './EndAnmCom';
import { BoxSet } from "../common/config/BoxSet";
import { HeroFac, HeroSet } from "../common/config/heroSet";
const { ccclass, property } = _decorator;
@@ -38,6 +39,9 @@ export class SkillCom extends CCComp {
rigid:RigidBody2D=null!; // 动画名称
target:any=null;
caster:any=null;
distance_x:number=0;
distance_y:number=0;
private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向
protected onLoad(): void {
@@ -60,6 +64,44 @@ export class SkillCom extends CCComp {
// this.rigid.wakeUp();
// }
// 根据动画类型开始相应的运动
let dir_x = this.target.node.position.x > this.node.position.x ? 1 : -1
this.node.scale = v3(dir_x,1,1)
// 根据目标位置设置节点朝向
if (this.target && this.target.node) {
// 计算朝向
let direction = this.target.node.position.x > this.node.position.x ? 1 : -1;
// 设置节点缩放来改变朝向
this.node.scale = v3(direction * Math.abs(this.scale), this.scale, 1);
}
let dir_y = (this.target.node.position.y+BoxSet.ATK_Y) > this.node.position.y ? 1 : -1
if(this.target.node.position.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.target.node.position.y-this.node.position.y)/Math.abs(this.target.node.position.x-this.node.position.x)*dir_y;
this.startMovement();
// 计算目标角度
if (this.target && this.target.node) {
const targetPos = this.target.node.position;
const currentPos = this.node.position;
// 计算角度(弧度)
const dx = targetPos.x - currentPos.x;
const dy = (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();
}
// onBeginContact (seCol: Collider2D, oCol: Collider2D) {
@@ -70,9 +112,6 @@ export class SkillCom extends CCComp {
private startMovement() {
switch(this.animType) {
case AnimType.linear:
this.startLinearMove();
break;
case AnimType.parabolic:
this.startBezierMove();
break;
@@ -88,19 +127,19 @@ export class SkillCom extends CCComp {
}
}
private startLinearMove() {
if(this.group==BoxSet.HERO){
this.targetPos.x=720
}else{
this.targetPos.x=-720
private startLinearMove(dt: number) {
if (!this.speed || this.is_destroy) return;
// 使用角度方向移动
const newX = this.node.position.x + this.distance_x * dt;
const newY = this.node.position.y + this.distance_y * dt;
this.node.setPosition(newX, newY, this.node.position.z);
// 检查是否超出边界
if (newX < -400 || newX > 400) {
this.is_destroy = true;
}
const duration = Vec3.distance(this.startPos, this.targetPos) / this.speed;
tween(this.node)
.to(duration, { position: this.targetPos })
.call(() => {
this.is_destroy = true;
})
.start();
}
private startBezierMove() {
@@ -191,6 +230,8 @@ export class SkillCom extends CCComp {
update(deltaTime: number) {
if(smc.mission.pause) return;
this.toDestroy();
this.startLinearMove(deltaTime);
}
toDestroy() {
if(this.is_destroy){
@@ -202,7 +243,7 @@ export class SkillCom extends CCComp {
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.is_destroy=false
this.is_destroy = false;
this.node.destroy();
this.animType = 0;
this.endType = 0;
@@ -210,6 +251,7 @@ export class SkillCom extends CCComp {
this.inTime = 0;
this.startPos.set();
this.targetPos.set();
this.moveDirection = null; // 重置移动方向
}
}