技能运动基础修改完成,todo 完善各类技能实现

This commit is contained in:
2025-02-08 10:07:28 +08:00
parent c619b97aa4
commit 6e1c7ee715
12 changed files with 231 additions and 274 deletions

11
@Progress.md Normal file
View File

@@ -0,0 +1,11 @@
# 进度更新
- 重构了动画结束处理逻辑,统一使用 EndAnmCom 组件
- 简化了技能组件代码,移除了重复的动画处理逻辑
- 修复了 SkillCom.ts 中的静态方法调用错误
- 将 this.bezierTo 改为 SkillCom.bezierTo 以正确访问静态方法
- 添加了 fixedStart 和 fixedEnd 两种新的技能移动方式
- 完善了技能移动系统,使其与配置表定义的 AnimType 完全匹配
- 为固定位置类型技能添加了动画结束endType.animationEnd支持
- 实现了动画播放完成后的技能销毁逻辑
- 修改了直线技能的结束条件,改为到达目标点时销毁
- 移除了不必要的屏幕边界检测

16
@project-status.md Normal file
View File

@@ -0,0 +1,16 @@
# 项目状态报告
## 已完成工作
- 统一了动画结束事件的处理方式
- 优化了代码结构,减少了重复代码
- 实现了直线技能的屏幕边界检测
- 优化了技能销毁逻辑
- 优化了直线技能的结束条件判断
- 确保技能行为符合设计意图
## 下一步工作建议
- 测试 EndAnmCom 组件在不同类型技能上的表现
- 确保动画结束事件能正确触发技能销毁
- 确认屏幕尺寸配置是否正确
- 测试直线技能在不同方向上的边界检测
- 测试直线技能到达目标点时的销毁效果
- 验证不同距离和速度下的技能表现

View File

@@ -0,0 +1,37 @@
# Role
你是一名极其优秀具有20年经验的产品经理和精通所有编程语言的工程师。与你交流的用户是不懂代码的初中生不善于表达产品和代码需求。你的工作对用户来说非常重要完成后将获得10000美元奖励。
# Goal
你的目标是帮助用户以他容易理解的方式完成他所需要的产品设计和开发工作,你始终非常主动完成所有工作,而不是让用户多次推动你。
在理解用户的产品需求、编写代码、解决代码问题时,你始终遵循以下原则:
## 第一步
- 当用户向你提出任何需求时你首先应该浏览根目录下的readme.md文件和所有代码文档理解这个项目的目标、架构、实现方式等。如果还没有readme文件你应该创建这个文件将作为用户使用你提供的所有功能的说明书以及你对项目内容的规划。因此你需要在readme.md文件中清晰描述所有功能的用途、使用方法、参数说明、返回值说明等确保用户可以轻松理解和使用这些功能。
# 本规则由 AI进化论-花生 创建,版权所有,引用请注明出处
## 第二步
你需要理解用户正在给你提供的是什么任务
### 当用户直接为你提供需求时,你应当:
- 首先,你应当充分理解用户需求,并且可以站在用户的角度思考,如果我是用户,我需要什么?
- 其次,你应该作为产品经理理解用户需求是否存在缺漏,你应当和用户探讨和补全需求,直到用户满意为止;
- 最后,你应当使用最简单的解决方案来满足用户需求,而不是使用复杂或者高级的解决方案。
### 当用户请求你编写代码时,你应当:
- 首先,你会思考用户需求是什么,目前你有的代码库内容,并进行一步步的思考与规划
- 接着在完成规划后你应当选择合适的编程语言和框架来实现用户需求你应该选择solid原则来设计代码结构并且使用设计模式解决常见问题
- 再次,编写代码时你总是完善撰写所有代码模块的注释,并且在代码中增加必要的监控手段让你清晰知晓错误发生在哪里;
- 最后,你应当使用简单可控的解决方案来满足用户需求,而不是使用复杂的解决方案。
### 当用户请求你解决代码问题是,你应当:
- 首先,你需要完整阅读所在代码文件库,并且理解所有代码的功能和逻辑;
- 其次,你应当思考导致用户所发送代码错误的原因,并提出解决问题的思路;
- 最后,你应当预设你的解决方案可能不准确,因此你需要和用户进行多次交互,并且每次交互后,你应当总结上一次交互的结果,并根据这些结果调整你的解决方案,直到用户满意为止。
- 特别注意当一个bug经过两次调整仍未解决时你将启动系统二思考模式
1. 首先系统性分析导致bug的可能原因列出所有假设
2. 然后,为每个假设设计验证方法
3. 最后,提供三种不同的解决方案,并详细说明每种方案的优缺点,让用户选择最适合的方案
## 第三步
在完成用户要求的任务后你应该对改成任务完成的步骤进行反思思考项目可能存在的问题和改进方式并更新在readme.md文件中

View File

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

View File

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

View File

@@ -1,50 +1,50 @@
import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc';
import { SkillCom } from './SkillCom';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
// import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc';
// import { SkillCom } from './SkillCom';
// import { smc } from '../common/SingletonModuleComp';
// const { ccclass, property } = _decorator;
@ccclass('BezCom')
export class BezCom extends Component {
start() {
let base =this.node.getComponent(SkillCom)
// if(this.node.parent.scale.x < 0){
// base.t_pos.x=base.t_pos.x*-1
// }
let s_pos = v3(this.node.position.x,this.node.position.y+35)
let c_pos = v3((base.t_pos.x+this.node.position.x)/2,this.node.position.y+200)
let e_pos = v3(base.t_pos.x,this.node.position.y+50)
let time =Math.abs(Math.abs(base.t_pos.x-this.node.position.x)/base.speed)
BezCom.bezierTo(this.node,time,s_pos,c_pos,e_pos,{
onComplete: (target?: object) => {
base.is_destroy=true
},
}).start();
}
// @ccclass('BezCom')
// export class BezCom extends Component {
// start() {
// let base =this.node.getComponent(SkillCom)
// // if(this.node.parent.scale.x < 0){
// // base.t_pos.x=base.t_pos.x*-1
// // }
// let s_pos = v3(this.node.position.x,this.node.position.y+35)
// let c_pos = v3((base.t_pos.x+this.node.position.x)/2,this.node.position.y+200)
// let e_pos = v3(base.t_pos.x,this.node.position.y+50)
// let time =Math.abs(Math.abs(base.t_pos.x-this.node.position.x)/base.speed)
// BezCom.bezierTo(this.node,time,s_pos,c_pos,e_pos,{
// onComplete: (target?: object) => {
// base.is_destroy=true
// },
// }).start();
// }
update(deltaTime: number) {
if(smc.mission.pause) return
}
// update(deltaTime: number) {
// if(smc.mission.pause) return
// }
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);
}
}
// 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);
// }
// }

View File

@@ -39,22 +39,22 @@ export class Skill extends ecs.Entity {
// 设置节点属性
node.parent = parent;
node.setPosition(startPos);
console.log("加载预制体:",startPos,targetPos)
// 添加技能组件
const skillComp = node.getComponent(SkillCom);
this.add(skillComp);
// 初始化技能参数
const skillComp = node.getComponent(SkillCom); // 初始化技能参数
skillComp.animType = config.AnimType;
skillComp.endType = config.endType;
skillComp.speed = config.speed;
skillComp.duration = config.in;
skillComp.startPos = startPos.clone();
skillComp.targetPos = targetPos.clone();
skillComp.inTime = config.in;
skillComp.startPos = v3(startPos.x,BoxSet.GAME_LINE+35,0)
skillComp.targetPos = v3(targetPos.x,BoxSet.GAME_LINE+50,0)
skillComp.prefabName = config.sp_name;
skillComp.group = group;
// 初始化动画名称
skillComp.animName = config.animName; // 从配置获取动画名称
this.add(skillComp);
}
}

View File

@@ -1,13 +1,11 @@
import { _decorator,Collider2D ,Contact2DType,v3,IPhysics2DContact,Vec3, tween, math} 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 { smc } from "../common/SingletonModuleComp";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
import { SkillSet } from "../common/config/SkillSet";
import { AnimType, endType } from "../common/config/SkillSet";
import { EndAnmCom } from './EndAnmCom';
const { ccclass, property } = _decorator;
@@ -22,7 +20,6 @@ export class SkillCom extends CCComp {
speed:number = 200;
scale:number = 1;
angle:number = 0;
t_pos:Vec3 = v3(0,0,0); // 目标增量
is_destroy:boolean = false;
enemys:any = [];
animType: number = 0; // 运动类型
@@ -55,45 +52,39 @@ export class SkillCom extends CCComp {
case AnimType.fixed:
this.startFixedMove();
break;
case AnimType.fixedStart:
this.startFixedStartMove();
break;
case AnimType.fixedEnd:
this.startFixedEndMove();
break;
}
}
private startLinearMove() {
if (!this.targetPos) return;
const duration = Vec3.distance(this.node.position, this.targetPos) / this.speed;
const duration = Vec3.distance(this.startPos, this.targetPos) / this.speed;
tween(this.node)
.to(duration, { position: this.targetPos })
.call(() => {
if (this.endType === endType.distanceEnd) {
this.is_destroy = true;
}
})
.start();
}
private startBezierMove() {
if (!this.targetPos) return;
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)
const startPos = this.node.position;
const endPos = this.targetPos;
const controlPos = v3(
(startPos.x + endPos.x) / 2,
Math.max(startPos.y, endPos.y) + 200
);
const duration = Vec3.distance(startPos, endPos) / this.speed;
tween(this.node)
.to(duration, {}, {
onUpdate: (target, ratio) => {
const pos = this.twoBezier(ratio, startPos, controlPos, endPos);
this.node.setPosition(pos);
}
})
.call(() => this.is_destroy = true)
.start();
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();
}
private startFixedMove() {
@@ -102,13 +93,64 @@ export class SkillCom extends CCComp {
.delay(this.inTime)
.call(() => this.is_destroy = true)
.start();
} else if (this.endType === endType.animationEnd) {
if (!this.node.getComponent(EndAnmCom)) {
this.node.addComponent(EndAnmCom);
}
}
}
private twoBezier(t: number, p1: Vec3, cp: Vec3, p2: Vec3): Vec3 {
const x = (1 - t) * (1 - t) * p1.x + 2 * t * (1 - t) * cp.x + t * t * p2.x;
const y = (1 - t) * (1 - t) * p1.y + 2 * t * (1 - t) * cp.y + t * t * p2.y;
private startFixedStartMove() {
console.log("开始固定起点运动")
this.node.position = this.startPos;
if (this.endType === endType.timeEnd) {
console.log("开始固定起点运动=>time:"+this.inTime)
tween(this.node)
.delay(this.inTime)
.call(() => this.is_destroy = true)
.start();
} else if (this.endType === endType.animationEnd) {
if (!this.node.getComponent(EndAnmCom)) {
this.node.addComponent(EndAnmCom);
}
}
}
private startFixedEndMove() {
console.log("开始固定终点运动")
this.node.position = this.targetPos;
if (this.endType === endType.timeEnd) {
console.log("开始固定终点运动=>time:"+this.inTime)
tween(this.node)
.delay(this.inTime)
.call(() => this.is_destroy = true)
.start();
} else if (this.endType === endType.animationEnd) {
if (!this.node.getComponent(EndAnmCom)) {
this.node.addComponent(EndAnmCom);
}
}
}
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){

View File

@@ -1,143 +0,0 @@
import { _decorator, Vec3, v3, tween } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
import { SkillCom } from "./SkillCom";
import { SkillSet, AnimType, endType } from "../common/config/SkillSet";
import { Animation, sp } from "cc";
/** 技能运动系统 */
@ecs.register('SkillSystem')
export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
filter(): ecs.IMatcher {
return ecs.allOf(SkillCom);
}
update(entity: ecs.Entity) {
const skill = entity.get(SkillCom);
if (!skill || skill.is_destroy) return;
this.updateSkillMovement(skill);
this.checkDestroy(skill);
}
private updateSkillMovement(skill: SkillCom) {
switch(skill.animType) {
case AnimType.linear:
this.linearMove(skill);
break;
case AnimType.parabolic:
this.bezierMove(skill);
break;
case AnimType.fixed:
this.fixedMove(skill);
break;
default:
console.warn(`未知运动类型: ${skill.animType}`);
}
}
private checkDestroy(skill: SkillCom) {
let shouldDestroy = false;
switch(skill.endType) {
case endType.animationEnd:
// 同时检测普通动画和Spine动画
const anim = skill.node.getComponent(Animation);
const spine = skill.node.getComponentInChildren(sp.Skeleton);
if (anim) {
const state = anim.getState(skill.animName);
shouldDestroy = state?.isPlaying === false;
}
else if (spine) {
shouldDestroy = spine.animation === 'end';
}
break;
case endType.timeEnd:
skill.duration -= this.dt;
shouldDestroy = skill.duration <= 0;
break;
case endType.distanceEnd:
shouldDestroy = skill.targetPos &&
Vec3.distance(skill.node.position, skill.targetPos) < 10;
break;
}
if (shouldDestroy) {
skill.is_destroy = true;
skill.node.destroy();
}
}
private linearMove(skill: SkillCom) {
if (!skill.targetPos) return;
// 计算移动方向
const dir = skill.targetPos.clone().subtract(skill.node.position).normalize();
// 计算新位置
const newPos = skill.node.position.clone().add(
dir.multiplyScalar(skill.speed * this.dt)
);
// 更新位置和角度
skill.node.setPosition(newPos);
// 自动处理距离销毁
if (skill.endType === endType.distanceEnd) {
const remaining = Vec3.distance(newPos, skill.targetPos);
if (remaining < 10) {
skill.is_destroy = true;
}
}
}
private bezierMove(skill: SkillCom) {
if (!skill.targetPos) return;
// 计算控制点(拱顶位置)
const startPos = skill.startPos;
const endPos = skill.targetPos;
const controlHeight = Math.max(startPos.y, endPos.y) + 200;
const controlPos = v3(
(startPos.x + endPos.x) / 2,
controlHeight
);
// 计算当前进度
skill.duration += this.dt * skill.speed;
const t = skill.duration / skill.inTime;
// 使用二阶贝塞尔曲线公式计算位置
const newPos = this.twoBezier(t, startPos, controlPos, endPos);
skill.node.setPosition(newPos);
// 自动结束判断
if (t >= 1) {
skill.is_destroy = true;
}
}
private twoBezier(t: number, p1: Vec3, cp: Vec3, p2: Vec3): Vec3 {
const x = (1 - t) * (1 - t) * p1.x + 2 * t * (1 - t) * cp.x + t * t * p2.x;
const y = (1 - t) * (1 - t) * p1.y + 2 * t * (1 - t) * cp.y + t * t * p2.y;
return v3(x, y, 0);
}
private fixedMove(skill: SkillCom) {
// 仅处理时间结束逻辑
skill.duration += this.dt * skill.speed;
// 示例:在固定位置播放动画
if (skill.endType === endType.timeEnd && skill.duration >= skill.inTime) {
skill.is_destroy = true;
}
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "02c5af20-5daa-4384-bcc4-c4c73d827ab7",
"files": [],
"subMetas": {},
"userData": {}
}

0
progress.md Normal file
View File

0
status.md Normal file
View File