重新 使用碰撞来处理 抛射型技能逻辑处理

This commit is contained in:
panw
2025-03-26 11:04:58 +08:00
parent 0f9fb4e8fb
commit ae30a865c7
23 changed files with 388 additions and 1352 deletions

View File

@@ -7,7 +7,6 @@ import { UIConfigData } from './game/common/config/GameUIConfig';
import { smc } from './game/common/SingletonModuleComp';
import { Initialize } from './game/initialize/Initialize';
import { EcsPositionSystem } from './game/common/ecs/position/EcsPositionSystem';
import { EcsSkillSystem } from './game/skill/EcsSkillSystem';
const { ccclass, property } = _decorator;
@@ -25,8 +24,7 @@ export class Main extends Root {
}
protected async initEcsSystem() {
oops.ecs.add(new EcsPositionSystem());
oops.ecs.add(new EcsSkillSystem());
// oops.ecs.add(new EcsPositionSystem());
// oops.ecs.add(new EcsRoleSystem());
// oops.ecs.add(new EcsInitializeSystem());

View File

@@ -76,16 +76,16 @@ info:技能描述
*/
export const SkillSet = {
6001:{uuid:6001,name:"凛冬之触",sp_name:"ball_blue",path:"6001",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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:1,endType:2,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%攻击的伤害"},
6001:{uuid:6001,name:"凛冬之触",sp_name:"ball_blue",path:"6001",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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_blue",path:"6002",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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_blue",path:"6003",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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_blue",path:"6004",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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:"ball_blue",path:"6005",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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:"ball_blue",path:"6006",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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:"ball_blue",path:"6007",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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:"ball_blue",path:"6008",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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:"ball_blue",path:"6009",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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:"ball_blue",path:"6010",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,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%攻击伤害"},

View File

@@ -32,42 +32,42 @@ export const HeroSet = {
StartPos:[-300,-350,-350]
}
export const HeroInfo = {
5001:{uuid:5001,name:"神圣守护",path:"k2", quality:3,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:140,skills:[6005],tals:"说明"},
5002:{uuid:5002,name:"幻影剑豪",path:"k1", quality:3,kind:2,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:140,skills:[6005],tals:"说明"},
5003:{uuid:5003,name:"战争领主",path:"k5", quality:3,kind:2,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:140,skills:[6005],tals:"说明"},
5004:{uuid:5004,name:"混沌法师",path:"zh1", quality:3,kind:2,type:2,hp:200,ap:100,dis:500,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5005:{uuid:5005,name:"火焰法师",path:"zh2", quality:3,kind:2,type:2,hp:200,ap:150,dis:500,a_cd:1.5,speed:120,skills:[6003],tals:"说明"},
5006:{uuid:5006,name:"风暴精灵",path:"m4", quality:3,kind:2,type:2,hp:200,ap:150,dis:500,a_cd:1.5,speed:100,skills:[6001],tals:"说明"},
5007:{uuid:5007,name:"生命圣者",path:"d1", quality:3,kind:2,type:2,hp:200,ap:100,dis:500,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5008:{uuid:5008,name:"战争祭祀",path:"d2", quality:3,kind:2,type:2,hp:200,ap:100,dis:500,a_cd:1.5,speed:100,skills:[6003],tals:"说明"},
5009:{uuid:5009,name:"暴风射手",path:"a5", quality:3,kind:2,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:120,skills:[6006],tals:"说明"},
5010:{uuid:5010,name:"苍穹射手",path:"a3", quality:3,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:120,skills:[6006],tals:"说明"},
5011:{uuid:5011,name:"幽灵射手",path:"a4", quality:3,kind:2,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:120,skills:[6006],tals:"说明"},
5201:{uuid:5201,name:"兽人战士",path:"mor1", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5202:{uuid:5202,name:"兽人刺客",path:"mor2", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5203:{uuid:5203,name:"兽人护卫",path:"mor3", quality:1,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:50,skills:[6007],tals:"说明"},
5204:{uuid:5204,name:"石卫", path:"mgem1",quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5205:{uuid:5205,name:"土卫", path:"mgem2",quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5206:{uuid:5206,name:"树人", path:"mgem3",quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5207:{uuid:5207,name:"小骷髅", path:"mkl1", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5208:{uuid:5208,name:"小骷髅", path:"mkl2", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5209:{uuid:5209,name:"小骷髅", path:"mkl3", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5210:{uuid:5210,name:"骷髅战士",path:"mkl4", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5211:{uuid:5211,name:"骷髅战士",path:"mkl5", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5212:{uuid:5212,name:"骷髅战士",path:"mkl6", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5213:{uuid:5213,name:"骷髅射手",path:"mkla1",quality:1,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:50,skills:[6005],tals:"说明"},
5214:{uuid:5214,name:"骷髅射手",path:"mkla2",quality:1,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:50,skills:[6005],tals:"说明"},
5215:{uuid:5215,name:"骷髅射手",path:"mkla3",quality:1,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:50,skills:[6005],tals:"说明"},
5216:{uuid:5216,name:"元素1", path:"my1", quality:2,kind:1,type:2,hp:200,ap:150,dis:500,a_cd:1.5,speed:50,skills:[6001],tals:"说明"},
5217:{uuid:5217,name:"元素2", path:"my2", quality:2,kind:1,type:2,hp:200,ap:150,dis:500,a_cd:1.5,speed:50,skills:[6002],tals:"说明"},
5218:{uuid:5218,name:"元素3", path:"my3", quality:2,kind:1,type:2,hp:200,ap:150,dis:500,a_cd:1.5,speed:50,skills:[6003],tals:"说明"},
5219:{uuid:5219,name:"牛头战士",path:"mn1", quality:2,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5220:{uuid:5220,name:"牛头战士",path:"mn2", quality:1,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:50,skills:[6010],tals:"说明"},
5221:{uuid:5221,name:"牛头战士",path:"mn3", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5222:{uuid:5222,name:"独眼巨人",path:"md1", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6005],tals:"说明"},
5223:{uuid:5223,name:"独眼巨人",path:"md2", quality:1,kind:1,type:0,hp:200,ap:100,dis:180,a_cd:1,speed:50,skills:[6008],tals:"说明"},
5224:{uuid:5224,name:"独眼巨人",path:"md3", quality:1,kind:1,type:1,hp:200,ap:150,dis:400,a_cd:1.2,speed:50,skills:[6005],tals:"说明"},
5225:{uuid:5225,name:"精英独眼",path:"md4", quality:3,kind:1,type:2,hp:200,ap:150,dis:500,a_cd:1,speed:50,skills:[6009],tals:"说明"},
5226:{uuid:5226,name:"精英牛头",path:"mn4", quality:3,kind:1,type:2,hp:200,ap:150,dis:500,a_cd:1,speed:50,skills:[6010],tals:"说明"},
5227:{uuid:5227,name:"精英兽人",path:"mor4", quality:3,kind:1,type:2,hp:200,ap:150,dis:500,a_cd:1,speed:50,skills:[6009],tals:"说明"}
5001:{uuid:5001,name:"神圣守护",path:"k2", quality:3,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5002:{uuid:5002,name:"幻影剑豪",path:"k1", quality:3,kind:2,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5003:{uuid:5003,name:"战争领主",path:"k5", quality:3,kind:2,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5004:{uuid:5004,name:"混沌法师",path:"zh1", quality:3,kind:2,type:2,hp:200,ap:10,dis:500,a_cd:1.5,speed:500,skills:[6003],tals:"说明"},
5005:{uuid:5005,name:"火焰法师",path:"zh2", quality:3,kind:2,type:2,hp:200,ap:15,dis:500,a_cd:1.5,speed:500,skills:[6003],tals:"说明"},
5006:{uuid:5006,name:"风暴精灵",path:"m4", quality:3,kind:2,type:2,hp:200,ap:15,dis:500,a_cd:1.5,speed:500,skills:[6001],tals:"说明"},
5007:{uuid:5007,name:"生命圣者",path:"d1", quality:3,kind:2,type:2,hp:200,ap:10,dis:500,a_cd:1.5,speed:500,skills:[6003],tals:"说明"},
5008:{uuid:5008,name:"战争祭祀",path:"d2", quality:3,kind:2,type:2,hp:200,ap:10,dis:500,a_cd:1.5,speed:500,skills:[6003],tals:"说明"},
5009:{uuid:5009,name:"暴风射手",path:"a5", quality:3,kind:2,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6006],tals:"说明"},
5010:{uuid:5010,name:"苍穹射手",path:"a3", quality:3,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6006],tals:"说明"},
5011:{uuid:5011,name:"幽灵射手",path:"a4", quality:3,kind:2,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6006],tals:"说明"},
5201:{uuid:5201,name:"兽人战士",path:"mor1", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5202:{uuid:5202,name:"兽人刺客",path:"mor2", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5203:{uuid:5203,name:"兽人护卫",path:"mor3", quality:1,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6007],tals:"说明"},
5204:{uuid:5204,name:"石卫", path:"mgem1",quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5205:{uuid:5205,name:"土卫", path:"mgem2",quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5206:{uuid:5206,name:"树人", path:"mgem3",quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5207:{uuid:5207,name:"小骷髅", path:"mkl1", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5208:{uuid:5208,name:"小骷髅", path:"mkl2", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5209:{uuid:5209,name:"小骷髅", path:"mkl3", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5210:{uuid:5210,name:"骷髅战士",path:"mkl4", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5211:{uuid:5211,name:"骷髅战士",path:"mkl5", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5212:{uuid:5212,name:"骷髅战士",path:"mkl6", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5213:{uuid:5213,name:"骷髅射手",path:"mkla1",quality:1,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6005],tals:"说明"},
5214:{uuid:5214,name:"骷髅射手",path:"mkla2",quality:1,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6005],tals:"说明"},
5215:{uuid:5215,name:"骷髅射手",path:"mkla3",quality:1,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6005],tals:"说明"},
5216:{uuid:5216,name:"元素1", path:"my1", quality:2,kind:1,type:2,hp:200,ap:15,dis:500,a_cd:1.5,speed:500,skills:[6001],tals:"说明"},
5217:{uuid:5217,name:"元素2", path:"my2", quality:2,kind:1,type:2,hp:200,ap:15,dis:500,a_cd:1.5,speed:500,skills:[6002],tals:"说明"},
5218:{uuid:5218,name:"元素3", path:"my3", quality:2,kind:1,type:2,hp:200,ap:15,dis:500,a_cd:1.5,speed:500,skills:[6003],tals:"说明"},
5219:{uuid:5219,name:"牛头战士",path:"mn1", quality:2,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5220:{uuid:5220,name:"牛头战士",path:"mn2", quality:1,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6010],tals:"说明"},
5221:{uuid:5221,name:"牛头战士",path:"mn3", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5222:{uuid:5222,name:"独眼巨人",path:"md1", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6005],tals:"说明"},
5223:{uuid:5223,name:"独眼巨人",path:"md2", quality:1,kind:1,type:0,hp:200,ap:10,dis:180,a_cd:1,speed:500,skills:[6008],tals:"说明"},
5224:{uuid:5224,name:"独眼巨人",path:"md3", quality:1,kind:1,type:1,hp:200,ap:15,dis:400,a_cd:1.2,speed:500,skills:[6005],tals:"说明"},
5225:{uuid:5225,name:"精英独眼",path:"md4", quality:3,kind:1,type:2,hp:200,ap:15,dis:500,a_cd:1,speed:500,skills:[6009],tals:"说明"},
5226:{uuid:5226,name:"精英牛头",path:"mn4", quality:3,kind:1,type:2,hp:200,ap:15,dis:500,a_cd:1,speed:500,skills:[6010],tals:"说明"},
5227:{uuid:5227,name:"精英兽人",path:"mor4", quality:3,kind:1,type:2,hp:200,ap:15,dis:500,a_cd:1,speed:500,skills:[6009],tals:"说明"}
};

View File

@@ -3,6 +3,6 @@ import { BattleMoveSystem } from "./BattleMoveSystem";
export class EcsPositionSystem extends ecs.System {
constructor() {
super();
this.add(new BattleMoveSystem());
// this.add(new BattleMoveSystem());
}
}

View File

@@ -1,4 +1,4 @@
import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Color} from "cc";
import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Color, RigidBody, RigidBody2D} 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 { HeroSpine } from "./HeroSpine";
@@ -24,7 +24,6 @@ export class HeroViewComp extends CCComp {
BUFFCOMP:BuffComp=null!
enemy_pos:Vec3=null!
// enemy:any=null!;
as: HeroSpine = null!
anm_timer:Timer = new Timer(0.3);
anm_name="idle"
@@ -37,9 +36,10 @@ export class HeroViewComp extends CCComp {
scale: number = 1; /** 角色阵营 1hero -1 :mon */
type: number = 0; /**角色类型 0近战-需要贴身 1远程-保持距离 2辅助 */
fac:number=0; //阵营 0hero 1monster
box_group:number = BoxSet.HERO;
atk_range:number = 150;
box_group:number = BoxSet.HERO;
rigid:RigidBody2D=null!;
is_dead:boolean = false; //是否摧毁
@@ -120,8 +120,39 @@ export class HeroViewComp extends CCComp {
onLoad() {
this.as = this.getComponent(HeroSpine);
// 注册单个碰撞体的回调函数
} /** 视图层逻辑代码分离演示 */
let collider = this.getComponent(Collider2D);
collider.group = this.box_group;
// console.log("hero collider ",this.scale,collider);
if (collider) {
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
// collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this);
// collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
this.rigid = this.getComponent(RigidBody2D);
if(this.rigid.sleep){
console.log("hero rigid sleep ",this.scale,this.rigid);
this.rigid.wakeUp();
}
}
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
console.log("碰撞开始 ",this.scale,seCol,oCol);
}
onEndContact (seCol: Collider2D, oCol: Collider2D) {
console.log("碰撞结束 ",this.scale,seCol,oCol);
}
onPreSolve (seCol: Collider2D, oCol: Collider2D) {
console.log("碰撞预处理 ",this.scale,seCol,oCol);
}
onPostSolve (seCol: Collider2D, oCol: Collider2D) {
console.log("碰撞后处理 ",this.scale,seCol,oCol);
}
/** 视图层逻辑代码分离演示 */
start () {
this.as.idle()
this.BUFFCOMP=this.node.getComponent(BuffComp);

View File

@@ -17,15 +17,18 @@ const { ccclass, property } = _decorator;
export class MissionHeroCompComp extends CCComp {
timer:Timer=new Timer(2)
onLoad(){
this.on(GameEvent.UserHeroCard,this.call_hero,this)
// this.on(GameEvent.UserHeroCard,this.call_hero,this)
}
start() {
this.test_call()
}
protected update(dt: number): void {
if(smc.mission.status != 1) return
}
test_call(){
this.addHero(5010)
}
call_hero(event: string, args: any){
this.timer.reset()
let hero_list =HeroList

View File

@@ -6,6 +6,7 @@ import { BoxSet } from "../common/config/BoxSet";
import { HeroSet } 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";
const { ccclass, property } = _decorator;
@@ -13,19 +14,23 @@ const { ccclass, property } = _decorator;
@ccclass('MissionMonCompComp')
@ecs.register('MissionMonComp', false)
export class MissionMonCompComp extends CCComp {
timer:Timer=new Timer(5)
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
this.test_call()
}
protected update(dt: number): void {
// if(this.timer.update(dt)){
// this.mon_refresh()
// }
}
test_call(){
this.addMonster(5202,0,true)
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
mon_refresh(){
let num =3
let t_num= Missions[0].length

View File

@@ -1,12 +0,0 @@
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { HeroSkillSystem } from "./HeroSkillSystem";
export class EcsSkillSystem extends ecs.System {
constructor() {
super();
// this.add(new HeroSkillSystem());
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "ea1f8dae-6593-46bf-b20b-a301b495a434",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,26 +1,3 @@
/**
* 这是一个 使用cocos creator 3.8.2引擎 开发的游戏英雄技能系统TS脚本
* SkillSet 技能配置表
* HeroViewComp 英雄视图组件
* HeroSkillsComp 英雄技能组件
* Skill 技能实体
* SkillCom 技能视图组件
* 目前实现功能:
* 1. 技能冷却
* 2. 技能释放
* 3. 技能目标选择
* 4. 基础攻击技能的伤害应用 及view的伤害显示
* 未完成功能
* 1. 技能的动画显示和运动
* 2. debuff技能的实现和动画显示
* 3. buff技能实现和动画显示
*/
import { Node, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { HeroViewComp } from "../hero/HeroViewComp";
@@ -37,6 +14,7 @@ import { AnimType } from "../common/config/SkillSet";
/** 技能系统 */
@ecs.register('HeroSkillSystem')
export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
// export class HeroSkillSystem implements ecs.ISystemUpdate {
// private updateInterval: number = 0.1; // 每0.1秒更新一次
// private accumulator: number = 0;
private _timers: { [key: string]: number } = {};
@@ -50,6 +28,7 @@ export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUp
update(e: ecs.Entity) {
return false
// 处理伤害队列
this.processDamageQueue();
const view = e.get(HeroViewComp);
@@ -258,18 +237,19 @@ export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUp
const targetView = target.get(HeroViewComp);
const skillView = skillEntity.get(SkillCom);
if (!casterView || !targetView || !skillView) return;
// 计算距离
const distance = this.calculateDistance(
skillView.node.position,
targetView.node.position
);
// 假设技能效果移动速度为 500 units/second
const EFFECT_SPEED = 500;
// 计算实际延迟时间(秒)
const actualDelay = distance / EFFECT_SPEED;
const actualDelay = distance / (skillView.speed+targetView.speed);
console.log("skillView:"+skillView.node.position+ " targetView:"+targetView.node.position+ " actualDelay:"+actualDelay + " dis:"+distance+ " skillView.speed:"+skillView.speed+ " targetView.speed:"+targetView.speed);
this._damageQueue.push({
timer: actualDelay,
callback: () => {

View File

@@ -31,7 +31,34 @@ export class SkillCom extends CCComp {
prefabName: string = ""; // 预制体名称
group:number = 0; //阵营
animName: string = ""; // 动画名称
box_group:number = 0; //碰撞组
protected onLoad(): void {
let collider = this.getComponent(Collider2D);
collider.group = this.box_group;
// console.log("hero collider ",this.scale,collider);
if (collider) {
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
// collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this);
// collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
}
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
}
onEndContact (seCol: Collider2D, oCol: Collider2D) {
}
onPreSolve (seCol: Collider2D, oCol: Collider2D) {
}
onPostSolve (seCol: Collider2D, oCol: Collider2D) {
}
start() {
oops.message.on(GameEvent.MissionEnd, this.doDestroy, this);