From 553642812530ab1168d0aea0478c6422bac5fc76 Mon Sep 17 00:00:00 2001 From: walkpan Date: Mon, 3 Feb 2025 01:07:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E7=B3=BB=E7=BB=9F=20?= =?UTF-8?q?=E5=88=9D=E6=AD=A5=E6=90=AD=E5=BB=BA,=E4=B8=8B=E6=AD=A5=20=20?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/heros/a3.prefab | 82 +--- assets/resources/game/heros/a4.prefab | 82 +--- assets/resources/game/heros/a5.prefab | 82 +--- assets/resources/game/heros/d1.prefab | 82 +--- assets/resources/game/heros/d2.prefab | 82 +--- assets/resources/game/heros/mn1.prefab | 45 +-- assets/resources/game/heros/mn2.prefab | 45 +-- assets/script/game/common/config/SkillSet.ts | 128 +++--- .../common/ecs/position/BattleMoveSystem.ts | 6 +- assets/script/game/hero/Hero.ts | 31 ++ assets/script/game/hero/HeroViewComp.ts | 368 ++++-------------- assets/script/game/skill/HeroSkillSystem.ts | 234 ++++++++++- assets/script/game/skill/heroSkillsComp.ts | 27 +- assets/script/game/skills/EndAnmBomCom.ts | 13 +- tsconfig.json | 4 +- 15 files changed, 465 insertions(+), 846 deletions(-) diff --git a/assets/resources/game/heros/a3.prefab b/assets/resources/game/heros/a3.prefab index d8261e99..3f8db601 100644 --- a/assets/resources/game/heros/a3.prefab +++ b/assets/resources/game/heros/a3.prefab @@ -59,16 +59,10 @@ }, { "__id__": 89 - }, - { - "__id__": 91 - }, - { - "__id__": 93 } ], "_prefab": { - "__id__": 95 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1352,74 +1346,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 86 - }, - "enabledContactListener": true, - "bullet": true, - "awakeOnLoad": true, - "_group": 4, - "_type": 1, - "_allowSleep": false, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d8rVs6intBQ7lRU8Dw4zXV" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 88 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1430,7 +1356,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 86 }, "anm": { "__id__": 22 @@ -1451,7 +1377,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 88 }, "_id": "" }, @@ -1469,7 +1395,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 90 }, "_id": "" }, diff --git a/assets/resources/game/heros/a4.prefab b/assets/resources/game/heros/a4.prefab index 68924593..a7cc0d5c 100644 --- a/assets/resources/game/heros/a4.prefab +++ b/assets/resources/game/heros/a4.prefab @@ -59,16 +59,10 @@ }, { "__id__": 89 - }, - { - "__id__": 91 - }, - { - "__id__": 93 } ], "_prefab": { - "__id__": 95 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1352,74 +1346,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 86 - }, - "enabledContactListener": true, - "bullet": true, - "awakeOnLoad": true, - "_group": 4, - "_type": 1, - "_allowSleep": false, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d8rVs6intBQ7lRU8Dw4zXV" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 88 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1430,7 +1356,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 86 }, "anm": { "__id__": 22 @@ -1451,7 +1377,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 88 }, "_id": "" }, @@ -1469,7 +1395,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 90 }, "_id": "" }, diff --git a/assets/resources/game/heros/a5.prefab b/assets/resources/game/heros/a5.prefab index 7887a4dd..13d1b4cb 100644 --- a/assets/resources/game/heros/a5.prefab +++ b/assets/resources/game/heros/a5.prefab @@ -59,16 +59,10 @@ }, { "__id__": 89 - }, - { - "__id__": 91 - }, - { - "__id__": 93 } ], "_prefab": { - "__id__": 95 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1352,74 +1346,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 86 - }, - "enabledContactListener": true, - "bullet": true, - "awakeOnLoad": true, - "_group": 4, - "_type": 1, - "_allowSleep": false, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d8rVs6intBQ7lRU8Dw4zXV" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 88 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1430,7 +1356,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 86 }, "anm": { "__id__": 22 @@ -1451,7 +1377,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 88 }, "_id": "" }, @@ -1469,7 +1395,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 90 }, "_id": "" }, diff --git a/assets/resources/game/heros/d1.prefab b/assets/resources/game/heros/d1.prefab index d58b97c7..f1e33bf5 100644 --- a/assets/resources/game/heros/d1.prefab +++ b/assets/resources/game/heros/d1.prefab @@ -59,16 +59,10 @@ }, { "__id__": 90 - }, - { - "__id__": 92 - }, - { - "__id__": 94 } ], "_prefab": { - "__id__": 96 + "__id__": 92 }, "_lpos": { "__type__": "cc.Vec3", @@ -1365,74 +1359,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 87 - }, - "enabledContactListener": true, - "bullet": true, - "awakeOnLoad": true, - "_group": 4, - "_type": 1, - "_allowSleep": false, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d8rVs6intBQ7lRU8Dw4zXV" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 89 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1443,7 +1369,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 87 }, "anm": { "__id__": 22 @@ -1464,7 +1390,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 93 + "__id__": 89 }, "_id": "" }, @@ -1482,7 +1408,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 95 + "__id__": 91 }, "_id": "" }, diff --git a/assets/resources/game/heros/d2.prefab b/assets/resources/game/heros/d2.prefab index db88a92c..aa8e4825 100644 --- a/assets/resources/game/heros/d2.prefab +++ b/assets/resources/game/heros/d2.prefab @@ -59,16 +59,10 @@ }, { "__id__": 90 - }, - { - "__id__": 92 - }, - { - "__id__": 94 } ], "_prefab": { - "__id__": 96 + "__id__": 92 }, "_lpos": { "__type__": "cc.Vec3", @@ -1365,74 +1359,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 87 - }, - "enabledContactListener": true, - "bullet": true, - "awakeOnLoad": true, - "_group": 4, - "_type": 1, - "_allowSleep": false, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d8rVs6intBQ7lRU8Dw4zXV" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 89 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1443,7 +1369,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 87 }, "anm": { "__id__": 22 @@ -1464,7 +1390,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 93 + "__id__": 89 }, "_id": "" }, @@ -1482,7 +1408,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 95 + "__id__": 91 }, "_id": "" }, diff --git a/assets/resources/game/heros/mn1.prefab b/assets/resources/game/heros/mn1.prefab index 5f2e4b2d..396f4e0c 100644 --- a/assets/resources/game/heros/mn1.prefab +++ b/assets/resources/game/heros/mn1.prefab @@ -59,13 +59,10 @@ }, { "__id__": 89 - }, - { - "__id__": 91 } ], "_prefab": { - "__id__": 93 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1349,40 +1346,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 86 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1393,7 +1356,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 86 }, "anm": { "__id__": 22 @@ -1414,7 +1377,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 88 }, "_id": "" }, @@ -1432,7 +1395,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 90 }, "_id": "" }, diff --git a/assets/resources/game/heros/mn2.prefab b/assets/resources/game/heros/mn2.prefab index 7c36870c..3f3aa8d6 100644 --- a/assets/resources/game/heros/mn2.prefab +++ b/assets/resources/game/heros/mn2.prefab @@ -59,13 +59,10 @@ }, { "__id__": 89 - }, - { - "__id__": 91 } ], "_prefab": { - "__id__": 93 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1349,40 +1346,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "14OhXRCixNOaApgow/hFbp" }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 86 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": false, - "_friction": 1, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.8, - "y": 37.7 - }, - "_size": { - "__type__": "cc.Size", - "width": 50.8, - "height": 78.6 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b2Dt9lJI9FyJCDezkDBPBl" - }, { "__type__": "a0379fmhvBHcbNcBF/l43O8", "_name": "", @@ -1393,7 +1356,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 86 }, "anm": { "__id__": 22 @@ -1414,7 +1377,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 88 }, "_id": "" }, @@ -1432,7 +1395,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 90 }, "_id": "" }, diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 5d2471a7..ab19b57d 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -22,12 +22,12 @@ mber = 0;0:碰撞不消亡 1:碰撞即消亡 fname:"",flash:false,with:false,debuff: 0depb:50,:无,1:冰,2:灼烧,3:眩晕,4:降低攻击,5:降低hp,6:降低防御,7:吸血,8:击退 */ -export enum SkTG { - self = 0, - friend= 1, - team= 2, - enemy= 3, - all= 4, +export enum TargetGroup { + Self = 0, // 自身 + Ally = 1, // 友方单位 + Team = 2, // 整个队伍 + Enemy = 3, // 敌方单位 + All = 4 // 所有单位 } /* type : @@ -40,21 +40,35 @@ type : 7: 辅助 8: 随机 */ -export enum SkType { - frontRow = 1, - backRow = 2, - leastHealth = 3, - highestHealth = 4, - melee = 5, - ranged = 6, - support = 7, - random = 8, - all = 9, +export enum TargetType { + /** 前排目标(最靠近敌方阵营的单位) */ + Frontline = 1, // 最前排单位 + /** 后排目标(离敌方阵营最远的单位) */ + Backline = 2, // 最后排单位 + /** 生命值最低的目标 */ + LowestHP = 3, // 最低生命值 + /** 生命值最高的目标 */ + HighestHP = 4, // 最高生命值 + /** 近战职业目标 */ + Melee =5, // 近战职业 + /** 远程职业目标 */ + Ranged =6, // 远程职业 + /** 辅助职业目标 */ + SupportClass =7, // 辅助职业 + /** 随机目标 */ + Random =8 // 随机目标 } export enum skRun { runing = 0, dead = 1, } +//技能释放cd: 0:技能配置的cd,1:HeroViewComp.cd 值,2:HeroViewComp.pw:0值,当HeroViewComppw==HeroViewComp.pwm值是 释放 +export enum CdType { + SkillCD = 0, // 使用技能配置的cd + HeroCD = 1, // 使用英雄公共CD + HeroPower = 2 // 能量型技能(需满能量) +} + export const MSklist = [6001,6002] export const MSkillset={ @@ -85,52 +99,38 @@ export const MSlist={ * } */ export const SkillSet = { - 6001:{uuid:6001,path:"6001",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"寒冰弹",sp_name:"ball_blue",info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"}, - 6002:{uuid:6002,path:"6002",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"火焰弹",sp_name:"ball_red",info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"}, - 6003:{uuid:6003,path:"6003",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"魔法弹",sp_name:"ball_green",info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"}, - 6004:{uuid:6004,path:"6004",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"圣光弹",sp_name:"ball_yellow",info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"}, - 6005:{uuid:6005,path:"6005",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"普通攻击",sp_name:"patk",info:"攻击前方直线100码内的敌人造成50%伤害"}, - 6006:{uuid:6006,path:"6006",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"射击",sp_name:"arrow",info:"向最前方敌人释放箭矢,造成100%攻击的伤害"}, - 6007:{uuid:6007,path:"6007",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"铁斧",sp_name:"mon_ft",info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"}, - 6008:{uuid:6008,path:"6008",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"木棍",sp_name:"mon_ly",info:"向最前方敌人扔出木棍,造成100%攻击的伤害"}, - 6009:{uuid:6009,path:"6009",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"飞刀",sp_name:"mon_xd",info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"}, - 6010:{uuid:6010,path:"6010",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"石斧",sp_name:"mon_sf",info:"向最前方敌人扔出石斧,造成100%攻击的伤害"}, - 6011:{uuid:6011,path:"6011",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:0.5,shield:0,speed:100,sonsk:0,hero:0,name:"烈火呼吸",sp_name:"firequan",info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, - 6012:{uuid:6012,path:"6012",type:1,tg:3,fname:"",flash:false,with:false,debuff:2,depb:20,debtime:2,derate:100,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"大火球",sp_name:"fire",info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"}, - 6013:{uuid:6013,path:"6013",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:10,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"火墙",sp_name:"firewall",info:"在最前方敌人位置,召唤一堵火墙,持续10秒,每秒造成50%攻击伤害"}, - 6014:{uuid:6014,path:"6014",type:1,tg:3,fname:"",flash:false,with:false,debuff:1,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"寒冰箭",sp_name:"arrow_blue",info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率冰冻敌人"}, - 6015:{uuid:6015,path:"6015",type:1,tg:3,fname:"",flash:false,with:false,debuff:3,depb:20,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"烈焰射击",sp_name:"arrow_yellow",info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率眩晕敌人"}, - 6016:{uuid:6016,path:"6016",type:1,tg:3,fname:"",flash:false,with:false,debuff:8,depb:50,debtime:1,derate:0,in:1,count:1,def:0,apup:0,ap:200,mhp:0,hp:0,cd:1,shield:0,speed:300,sonsk:0,hero:0,name:"龙卷风",sp_name:"bwind",info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,50%几率击退敌人"}, - 6017:{uuid:6017,path:"6017",type:1,tg:2,fname:"buff_do",flash:true,with:false,debuff:0,depb:0,debtime:0,derate:0,in:5,count:1,def:0,apup:0,ap:100,mhp:0,hp:3,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"复苏",sp_name:"heath",info:"5秒持续为全体友方恢复施法者最大生命值15%的生命"}, - 6018:{uuid:6018,path:"6018",type:1,tg:0,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:3,speed:350,sonsk:0,hero:0,name:"圣盾",sp_name:"shield",info:"召唤圣盾保护自己,可以抵御3次攻击"}, - 6019:{uuid:6019,path:"6019",type:1,tg:2,fname:"buff_do2",flash:true,with:false,debuff:0,depb:0,debtime:0,derate:0,in:1,count:1,def:0,apup:20,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"狂暴",sp_name:"apup",info:"为全体友方增加施法者攻击力20%的攻击"}, - 6021:{uuid:6021,path:"6021",type:2,tg:3,fname:"buff_do",flash:true,with:false,debuff:0,depb:0,debtime:0,derate:0,in:1,count:1,def:0,apup:0,ap:600,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"致命射击",sp_name:"shoot2",info:"攻击最后方的敌人,造成600%攻击的伤害"}, - 6022:{uuid:6022,path:"6022",type:1,tg:3,fname:"",flash:false,with:false,debuff:1,depb:50,debtime:2,derate:0,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"冰刺",sp_name:"icez",info:"在最前方敌人位置,召唤冰刺攻击敌人,造成200%攻击的伤害,20%几率冰冻敌人"}, - 6023:{uuid:6023,path:"6023",type:1,tg:3,fname:"",flash:false,with:false,debuff:8,depb:50,debtime:1,derate:0,in:1,count:1,def:0,apup:0,ap:400,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"冰墙",sp_name:"icet",info:"在最前方敌人位置,召唤冰墙攻击敌人,造成200%攻击的伤害,50%几率击退敌人"}, - 6024:{uuid:6024,path:"6024",type:1,tg:3,fname:"",flash:false,with:true,debuff:8,depb:50,debtime:1,derate:0,in:2,count:1,def:0,apup:0,ap:80,mhp:0,hp:0,cd:0.5,shield:0,speed:100,sonsk:0,hero:0,name:"旋风斩",sp_name:"fwind",info:"旋转武器对周围的敌人造成80%攻击,2秒内旋转4次"}, - 6025:{uuid:6025,path:"6025",type:1,tg:3,fname:"",flash:false,with:false,debuff:8,depb:50,debtime:1,derate:0,in:3,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:1,shield:0,speed:500,sonsk:0,hero:0,name:"火焰漩涡",sp_name:"fireball",info:"召唤一个能量球射向前方敌人,对遇到的第一个敌人造成500%攻击的伤害,并击退"}, - 6026:{uuid:6026,path:"6026",type:1,tg:3,fname:"",flash:false,with:false,debuff:8,depb:50,debtime:2,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:1,shield:0,speed:500,sonsk:0,hero:0,name:"潮汐",sp_name:"watert",info:"在最前方敌人位置,召唤水柱攻击敌人,每秒造成100%攻击的伤害,50%几率击退敌人"}, - 6027:{uuid:6027,path:"6027",type:1,tg:3,fname:"",flash:false,with:false,debuff:8,depb:100,debtime:2,derate:0,in:3,count:1,def:0,apup:2,ap:400,mhp:0,hp:0,cd:1,shield:0,speed:500,sonsk:0,hero:0,name:"国王霸气",sp_name:"kingba",info:"释放霸气攻击周围敌人,造成400%伤害,并100%几率击退敌人"}, - 6028:{uuid:6028,path:"6028",type:1,tg:2,fname:"buff_do",flash:true,with:false,debuff:0,depb:0,debtime:0,derate:0,in:2,count:1,def:0,apup:0,ap:100,mhp:0,hp:10,cd:1,shield:1,speed:350,sonsk:0,hero:0,name:"自然庇佑",sp_name:"heath2",info:"为全体友方恢复施法者最大生命值10%的生命,和抵御1次攻击的护盾"}, - 6029:{uuid:6029,path:"6029",type:1,tg:3,fname:"",flash:false,with:false,debuff:8,depb:50,debtime:2,derate:0,in:3,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:1,shield:0,speed:500,sonsk:0,hero:0,name:"陨石术",sp_name:"fireys",info:"在最前方敌人位置,召唤陨石攻击敌人,造成500%攻击的伤害"}, - 6030:{uuid:6030,path:"6030",type:1,tg:3,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:0.5,shield:0,speed:100,sonsk:0,hero:0,name:"闪电呼吸",sp_name:"dianquan",info:"召唤闪电攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, - 6031:{uuid:6031,path:"6031",type:1,tg:0,fname:"buff_do",flash:true,with:false,debuff:0,depb:0,debtime:0,derate:0,in:2,count:1,def:20,apup:0,ap:70,mhp:0,hp:70,cd:1,shield:0,speed:120,sonsk:0,hero:5211,name:"召唤仆从",sp_name:"zhaohuan",info:"召唤一个与施法者等级相同的骷髅战士为我方而战"}, - 6032:{uuid:6032,path:"6032",type:1,tg:0,fname:"",flash:false,with:false,debuff:0,depb:0,debtime:0,derate:0,in:2,count:1,def:0,apup:0,ap:100,mhp:0,hp:5,cd:1,shield:0,speed:120,sonsk:0,hero:0,name:"自愈",sp_name:"heath_small",info:"主动:自己回复自身5%最大生命值的生命"}, - 6033:{uuid:6033,path:"6033",type:1,tg:3,fname:"",flash:false,with:false,debuff:4,depb:100,debtime:1,derate:20,in:1,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:1,shield:0,speed:500,sonsk:6035,hero:0,name:"爆锤",sp_name:"cuida",info:"捶爆前方目标,造成300%攻击的伤害,震慑敌人,本局内全部敌方降低对方10%攻击力"}, - 6034:{uuid:6034,path:"6034",type:1,tg:3,fname:"",flash:false,with:false,debuff:4,depb:100,debtime:1,derate:20,in:1,count:1,def:0,apup:0,ap:80,mhp:0,hp:0,cd:1,shield:0,speed:350,sonsk:0,hero:0,name:"暴风箭",sp_name:"bingyu",info:"射出能量暴风箭攻击最前方范围敌人,每波造成80%攻击的伤害"}, - 7001: { - prefab: "arrow", // 预制体路径 - range: 500, // 攻击距离 - width: 30, // 攻击宽度 - penetrate: 3, // 最大穿透数 - speed: 800, // 飞行速度(像素/秒) - hitInterval: 0.1 // 伤害间隔(秒) - }, - 8001: { - prefab: "fireball", - speed: 600, - range: 800, - penetrate: 2, - collisionRadius: 50 // 碰撞检测半径 - } + 6001:{uuid:6001,path:"6001",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"凛冬之触",sp_name:"ball_blue",info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"}, + 6002:{uuid:6002,path:"6002",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"烈焰之怒",sp_name:"ball_red",info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"}, + 6003:{uuid:6003,path:"6003",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"奥术冲击",sp_name:"ball_green",info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"}, + 6004:{uuid:6004,path:"6004",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"神圣裁决",sp_name:"ball_yellow",info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"}, + 6005:{uuid:6005,path:"6005",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"破空斩击",sp_name:"patk",info:"攻击前方直线100码内的敌人造成50%伤害"}, + 6006:{uuid:6006,path:"6006",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"穿心箭矢",sp_name:"arrow",info:"向最前方敌人释放箭矢,造成100%攻击的伤害"}, + 6007:{uuid:6007,path:"6007",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"铁斧打击",sp_name:"mon_ft",info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"}, + 6008:{uuid:6008,path:"6008",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"木棍打击",sp_name:"mon_ly",info:"向最前方敌人扔出木棍,造成100%攻击的伤害"}, + 6009:{uuid:6009,path:"6009",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"飞刀打击",sp_name:"mon_xd",info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"}, + 6010:{uuid:6010,path:"6010",TargetType:1,TargetGroup:3,CdType:CdType.HeroCD,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"石斧打击",sp_name:"mon_sf",info:"向最前方敌人扔出石斧,造成100%攻击的伤害"}, + 6011:{uuid:6011,path:"6011",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:0.5,hited:0.3,shield:0,speed:100,sonsk:0,hero:0,name:"烈火呼吸",sp_name:"firequan",info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, + 6012:{uuid:6012,path:"6012",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"大火球",sp_name:"fire",info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"}, + 6013:{uuid:6013,path:"6013",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"火墙",sp_name:"firewall",info:"在最前方敌人位置,召唤一堵火墙,持续10秒,每秒造成50%攻击伤害"}, + 6014:{uuid:6014,path:"6014",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"寒冰箭",sp_name:"arrow_blue",info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率冰冻敌人"}, + 6015:{uuid:6015,path:"6015",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"烈焰射击",sp_name:"arrow_yellow",info:"召唤大火球攻击前方所有敌人,造成200%攻击的伤害,20%几率眩晕敌人"}, + 6016:{uuid:6016,path:"6016",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"buff_do",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"生命之泉",sp_name:"heath",info:"5秒持续为全体友方恢复施法者最大生命值15%的生命"}, + 6018:{uuid:6018,path:"6018",TargetType:1,TargetGroup:0,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:30,speed:350,sonsk:0,hero:0,name:"神圣护盾",sp_name:"shield",info:"召唤圣盾保护自己,可以抵御3次攻击"}, + 6019:{uuid:6019,path:"6019",TargetType:1,TargetGroup:2,CdType:CdType.HeroPower,fname:"buff_do2",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"战争咆哮",sp_name:"apup",info:"为全体友方增加施法者攻击力20%的攻击"}, + 6021:{uuid:6021,path:"6021",TargetType:2,TargetGroup:3,CdType:CdType.HeroPower,fname:"buff_do",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"死亡射击",sp_name:"shoot2",info:"攻击最后方的敌人,造成600%攻击的伤害"}, + 6022:{uuid:6022,path:"6022",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"寒霜之矛",sp_name:"icez",info:"在最前方敌人位置,召唤冰刺攻击敌人,造成200%攻击的伤害,20%几率冰冻敌人"}, + 6023:{uuid:6023,path:"6023",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"冰墙",sp_name:"icet",info:"在最前方敌人位置,召唤冰墙攻击敌人,造成200%攻击的伤害,50%几率击退敌人"}, + 6024:{uuid:6024,path:"6024",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:0.5,hited:0.3,shield:0,speed:100,sonsk:0,hero:0,name:"旋风斩",sp_name:"fwind",info:"旋转武器对周围的敌人造成80%攻击,2秒内旋转4次"}, + 6025:{uuid:6025,path:"6025",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"buff_do",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"自然庇佑",sp_name:"heath2",info:"为全体友方恢复施法者最大生命值10%的生命,和抵御1次攻击的护盾"}, + 6029:{uuid:6029,path:"6029",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:0.5,hited:0.3,shield:0,speed:100,sonsk:0,hero:0,name:"闪电呼吸",sp_name:"dianquan",info:"召唤闪电攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, + 6031:{uuid:6031,path:"6031",TargetType:1,TargetGroup:0,CdType:CdType.HeroPower,fname:"buff_do",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:10,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,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"",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:10,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,CdType:CdType.HeroPower,fname:"",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:10,buff_cd:1,hited:0.3,shield:0,speed:350,sonsk:0,hero:0,name:"风暴之矢",sp_name:"bingyu",info:"射出能量暴风箭攻击最前方范围敌人,每波造成80%攻击的伤害"}, + 6035:{uuid:6035,path:"6035",TargetType:1,TargetGroup:3,CdType:CdType.HeroPower,fname:"",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:1,count:1,def:0,apup:0,ap:500,mhp:0,hp:0,cd:10,buff_cd:1,hited:0.3,shield:0,speed:500,sonsk:0,hero:0,name:"召唤仆从",sp_name:"zhaohuan",info:"召唤一个与施法者等级相同的骷髅战士为我方而战"} }; \ No newline at end of file diff --git a/assets/script/game/common/ecs/position/BattleMoveSystem.ts b/assets/script/game/common/ecs/position/BattleMoveSystem.ts index 3bcbfda3..b79ee1b6 100644 --- a/assets/script/game/common/ecs/position/BattleMoveSystem.ts +++ b/assets/script/game/common/ecs/position/BattleMoveSystem.ts @@ -25,12 +25,16 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU const delta = view.speed * this.dt * move.direction; const newX = view.node.position.x + delta; - + view.status_change("move") // 限制移动范围 if (this.validatePosition(newX, move)) { view.node.setPosition(newX, view.node.position.y, 0); } } + else{ + view.status_change("idle") + } + // console.log(`[${view.hero_name}] 类型:${view.type} 是否停止:${shouldStop} 方向:${move.direction} 位置:${view.node.position.x.toFixed(1)}`); } diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 60d3f680..c0e300cd 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -85,12 +85,43 @@ export class Hero extends ecs.Entity { this.add(hv); // 初始化多个技能组件 + const skillsComp = this.get(HeroSkillsComp); + // 正确初始化已有技能 + hero.skills.forEach(skillId => { + this.addSkill(skillId); // 使用addSkill方法确保初始化 + }); // 初始化移动参数 const move = this.get(BattleMoveComp); move.direction = 1; // 向右移动 move.targetX = 800; // 右边界 + } + // 添加技能 + public addSkill(skillId: number) { + const comp = this.get(HeroSkillsComp); + if (comp.skills.indexOf(skillId) === -1) { + comp.skills.push(skillId); + comp.cooldowns.set(skillId, 0); + comp.counters.set(skillId, 0); + console.log(`技能${skillId}初始化完成`, + '当前cooldowns:', comp.cooldowns, + '当前counters:', comp.counters); + } + } + + // 移除技能 + public removeSkill(skillId: number) { + const comp = this.get(HeroSkillsComp); + comp.skills = comp.skills.filter(id => id !== skillId); + } + + public levelUp() { + // ...升级逻辑... + const comp = this.get(HeroSkillsComp); + comp.skills.forEach(skillId => { + comp.resetCooldown(skillId); + }); } } \ No newline at end of file diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index e1d097e7..5da6989d 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -1,4 +1,4 @@ -import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label,RigidBody2D ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween} from "cc"; +import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween} 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"; @@ -7,15 +7,16 @@ import { BoxSet, GameSet } from "../common/config/BoxSet"; import { smc } from "../common/SingletonModuleComp"; import { Skill } from "../skills/Skill"; import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; -import { SkillCom } from "../skills/SkillCom"; -import { SkillSet, SkTG, SkType } from "../common/config/SkillSet"; +import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet"; import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager"; import { HeroSet } from "../common/config/heroSet"; import { BuffComp } from "./BuffComp"; import { MonModelComp } from "./MonModelComp"; import { getMonsterDrops, MonsterType } from "../common/config/RewardSet"; +import { HeroSkillsComp } from "../skill/heroSkillsComp"; const { ccclass, property } = _decorator; + /** 角色显示组件 */ @ccclass('HeroViewComp') // 定义为 Cocos Creator 组件 @ecs.register('HeroView', false) // 定义为 ECS 组件 @@ -49,11 +50,10 @@ export class HeroViewComp extends CCComp { hp: number = 100; /** 血量 */ hp_max: number = 100; /** 最大血量 */ - rhp_max: number = 100; hp_speed: number = 0; //每秒回复量 - pw: number = 0; /**能量**/ - pwm: number = 15; /** 能量最大值 */ + pw: number = 0; // 当前能量值 + pwm: number = 100; // 最大能量值 pws: number = 1; //能量回复速度每0.1秒回复量 apw:number=0; uapw:number=0; @@ -78,7 +78,6 @@ export class HeroViewComp extends CCComp { dexp:number=0; //死亡经验 */ ap: number = 10; /**攻击力 */ - ap_max: number = 0; ap_buff: number = 0; ap_buffs:any = []; // atk_speed: number = 1; @@ -87,14 +86,11 @@ export class HeroViewComp extends CCComp { at: number = 0; /** 冷却时间 */ def: number = 0; //防御 - def_max: number = 0; vun: number = 0; //易伤 crit: number = 0; //暴击率 - crit_max: number = 0; crit_add: number = 0;//暴击伤害加成 dodge: number = 10; //闪避率 - dodge_max: number = 10; //闪避率 shield:number = 0; //护盾,免伤1次减1 @@ -139,9 +135,7 @@ export class HeroViewComp extends CCComp { if (this.pwt.update(dt)) { this.pw+=this.pws } - this.check_power() this.check_atk_counts() - this.check_mission_buff() this.hp_show() if(this.ice_cd > 0){ this.ice_cd -=dt; @@ -153,34 +147,21 @@ export class HeroViewComp extends CCComp { } this.at += dt; this.in_stop(dt); - this.in_atk(dt); + } hp_show(){ - let hp_progress= this.hp/this.rhp_max; + let hp_progress= this.hp/this.hp_max; this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress; if(this.is_boss) return - if(this.hp == this.rhp_max){ + if(this.hp == this.hp_max){ this.node.getChildByName("top").getChildByName("hp").active = false; } else{ this.node.getChildByName("top").getChildByName("hp").active = true; } } //移动 - check_mission_buff(){ - this.ap_max=(100+smc.vmdata.mission.ap)/100*this.ap - this.crit_max=(100+smc.vmdata.mission.crit)/100*this.crit - this.def_max=(100+smc.vmdata.mission.def)/100*this.def - this.dodge_max=(100+smc.vmdata.mission.dodge)/100*this.dodge - this.rhp_max=(100+smc.vmdata.mission.hp)/100*this.hp_max - if(this.box_group == BoxSet.MONSTER){ - this.ap_max=(100+smc.vmdata.mission.map)/100*this.ap - this.crit_max=(100+smc.vmdata.mission.mcrit)/100*this.crit - this.def_max=(100+smc.vmdata.mission.mdef)/100*this.def - this.dodge_max=(100+smc.vmdata.mission.mdodge)/100*this.dodge - this.rhp_max=(100+smc.vmdata.mission.mhp)/100*this.hp_max - } - } + //状态切换 status_change(type:string){ @@ -210,7 +191,7 @@ export class HeroViewComp extends CCComp { this.hp_less(l_hp,skill.is_crit); } check_less(ap:number,is_crit:boolean,crit_add:number=0){ - let d=this.def_max/ap + let d=this.def/ap if(d > 1) d = 1 let l_hp=ap*(1-d*GameSet.DEF_RATE) //防御最高减免伤害比率计算 if(is_crit){ @@ -228,50 +209,50 @@ export class HeroViewComp extends CCComp { * @param l_hp - 可选参数,表示英雄的当前生命值,默认为0 */ check_debuff(skill:any,l_hp:number=0){ - // console.log(this.hero_name+this.uuid+": skillname: "+skill.s_name+" :check_debuff "+skill.debuff); - if(skill.debuff == 0) return - let num=RandomManager.instance.getRandomInt(0,100) - switch (skill.debuff){ - case 1: - // console.log(this.hero_name+":"+this.uuid+"冰冻触判断: i="+num+":rate="+skill.rate); - if(num > skill.depb) return - // console.log(this.hero_name+":"+this.uuid+"冰冻触成功: i="+num+":debtime="+skill.debtime); - this.ice_cd = skill.debtime - this.BUFFCOMP.in_iced(skill.debtime) - break; - case 2: - if(num > skill.depb) return - // console.log(this.hero_name+":"+this.uuid+"debuff触发成功: i="+num+":debtime="+skill.debtime+":l_hp="+l_hp); - this.BUFFCOMP.in_fired(skill.debtime,l_hp*skill.derate/100) - break; - case 3: - if(num > skill.depb) return - this.yun_cd = skill.debtime - this.BUFFCOMP.in_yun(skill.debtime) - break; - case 4: - if(num > skill.depb) return - this.BUFFCOMP.buff_get("deap") - this.ap = this.ap-Math.floor(l_hp*skill.derate/100) - break; - case 5: - if(num > skill.depb) return - break; - case 6: - if(num > skill.depb) return - break; - case 7: - if(num > skill.depb) return - break; - case 8: - if(num > skill.depb) return - if(this.node.position.x > 300||this.node.position.x < -300) return - tween(this.node).to( 0.1, - { position: new Vec3(this.node.position.x-this.scale*50,this.node.position.y) }, - { } - ).start(); - break; - } + // // console.log(this.hero_name+this.uuid+": skillname: "+skill.s_name+" :check_debuff "+skill.debuff); + // if(skill.debuff == 0) return + // let num=RandomManager.instance.getRandomInt(0,100) + // switch (skill.debuff){ + // case 1: + // // console.log(this.hero_name+":"+this.uuid+"冰冻触判断: i="+num+":rate="+skill.rate); + // if(num > skill.depb) return + // // console.log(this.hero_name+":"+this.uuid+"冰冻触成功: i="+num+":debtime="+skill.debtime); + // this.ice_cd = skill.debtime + // this.BUFFCOMP.in_iced(skill.debtime) + // break; + // case 2: + // if(num > skill.depb) return + // // console.log(this.hero_name+":"+this.uuid+"debuff触发成功: i="+num+":debtime="+skill.debtime+":l_hp="+l_hp); + // this.BUFFCOMP.in_fired(skill.debtime,l_hp*skill.derate/100) + // break; + // case 3: + // if(num > skill.depb) return + // this.yun_cd = skill.debtime + // this.BUFFCOMP.in_yun(skill.debtime) + // break; + // case 4: + // if(num > skill.depb) return + // this.BUFFCOMP.buff_get("deap") + // this.ap = this.ap-Math.floor(l_hp*skill.derate/100) + // break; + // case 5: + // if(num > skill.depb) return + // break; + // case 6: + // if(num > skill.depb) return + // break; + // case 7: + // if(num > skill.depb) return + // break; + // case 8: + // if(num > skill.depb) return + // if(this.node.position.x > 300||this.node.position.x < -300) return + // tween(this.node).to( 0.1, + // { position: new Vec3(this.node.position.x-this.scale*50,this.node.position.y) }, + // { } + // ).start(); + // break; + // } } @@ -280,14 +261,14 @@ export class HeroViewComp extends CCComp { /** * 检查是否触发暴击,并执行相应的暴击效果。 * @returns {boolean} 如果触发暴击则返回 true,否则返回 false。 - * 该方法首先通过 RandomManager 获取一个随机数,如果该随机数小于当前暴击最大值(crit_max), + * 该方法首先通过 RandomManager 获取一个随机数,如果该随机数小于当前暴击最大值(crit), * 则触发暴击效果,包括显示暴击提示、增加暴击计数、增加暴击经验以及增加暴击威力。 * 如果未触发暴击,则直接返回 false。 */ check_crit():boolean { let i = RandomManager.instance.getRandomInt(0,100,3) - if(i < this.crit_max){ + if(i < this.crit){ // this.BUFFCOMP.tooltip(5,"*会心一击*"); this.crit_count += 1 this.exp_add(this.cexp) // 暴击经验 @@ -306,8 +287,8 @@ export class HeroViewComp extends CCComp { check_dodge():boolean { let i = RandomManager.instance.getRandomInt(0,100,3) - if(this.dodge_max > GameSet.DODGE_MAX) this.dodge_max = GameSet.DODGE_MAX - if(i < this.dodge_max){ + if(this.dodge > GameSet.DODGE_MAX) this.dodge = GameSet.DODGE_MAX + if(i < this.dodge){ // console.log("闪避触发: i="+i+":dodge="+dodge); this.BUFFCOMP.tooltip(5,"闪避"); this.exp_add(this.doexp) // 闪避经验 @@ -370,28 +351,7 @@ export class HeroViewComp extends CCComp { // } // } } - in_atk(dt: number) { - if(this.at >= this.cd){ - if(this.is_atking){ - this.at = 0; - this.atk_count++ - this.exp_add(this.aexp) //攻击经验 - this.power_add(this.apw) - // console.log("cd:"+this.cd); - this.as.atk(); - } - } - } - //能量判断 - check_power(){ - if(this.pw >= this.pwm){ - this.pw = 0 - this.BUFFCOMP.max_show() - return true - }else{ - return false - } - } + //使用max_skill do_skill(skill:number){ // this.at = 0; //共享普攻攻击cd @@ -402,194 +362,12 @@ export class HeroViewComp extends CCComp { this.BUFFCOMP.show_do_buff(SkillSet[skill].fname) },0.1) } - switch (SkillSet[skill].tg) { - case SkTG.self: //自己 - this.do_add_buff(this.node.getComponent(HeroViewComp),skill) - break; - case SkTG.friend: //伙伴 - if(this.box_group == BoxSet.HERO) this.check_other_hero_buff(skill) - if(this.box_group == BoxSet.MONSTER) this.check_other_mon_buff(skill) - break; - case SkTG.team: //自己和伙伴 - this.do_all_buff(skill) - break; - case SkTG.enemy: //敌人 - this.shoot_enemy(skill) - break; - case SkTG.all: //敌人和自己 - this.do_add_buff(this.node.getComponent(HeroViewComp),skill) - this.shoot_enemy(skill) - break; - } - } - shoot_enemy(sk:number,y:number=0,x:number=0){ - // console.log("mon shoot_enemy"); - let skill = ecs.getEntity(Skill); - let t_pos=v3(smc.mon_front_x,BoxSet.GAME_LINE) //最前排目标 - if(this.box_group==BoxSet.MONSTER){ - t_pos=v3(smc.hero_front_x,BoxSet.GAME_LINE) - } - switch(SkillSet[sk].type){ - case SkType.leastHealth: //血量最少单体 - t_pos=this.check_heros().l_hero.node.position - if(this.box_group==BoxSet.MONSTER) t_pos=this.check_mons().l_hero.node.position - break; - case SkType.highestHealth: //血量最多单体 - t_pos=this.check_heros().m_hero.node.position - if(this.box_group==BoxSet.MONSTER) t_pos=this.check_mons().m_hero.node.position - break; - case SkType.backRow: //最后排 - t_pos=v3(smc.mon_back_x,BoxSet.GAME_LINE) - if(this.box_group==BoxSet.MONSTER){ - t_pos=v3(smc.hero_back_x,BoxSet.GAME_LINE) - } - break; - } - let pos =this.node.position - let is_crit=this.check_crit() - this.to_console(this.scale+this.hero_name+"使用技能:"+sk+SkillSet[sk].name+" pos:"+pos+" t_pos:"+t_pos+" box:"+this.box_group,); - skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add,this.rhp_max); } - check_heros(){ - let heros:any = ecs.query(ecs.allOf(HeroModelComp)); - let l_hp:number=0 - let h_hp:number=9999999999 - let right_x:number=360 - let left_x:number=-360 - let f_hero:any= null - let b_hero:any= null - let l_hero:any= null - let m_hero:any= null - let r_hero:any= null - let i = RandomManager.instance.getRandomInt(0,heros.length-1,3) - while(!heros[i].HeroView){ - i = RandomManager.instance.getRandomInt(0,heros.length-1,3) - if(!heros[i].HeroView.in_grave){ - r_hero= heros[i].HeroView - break - } - } - for (let i = 0; i < heros.length; i++) { - let hero:any = heros[i].HeroView; - if (hero.in_grave) continue - if((hero.rhp_max-hero.hp) > l_hp){ - l_hp = (hero.rhp_max-hero.hp) - l_hero = hero - } - if((hero.rhp_max-hero.hp) < h_hp){ - h_hp = (hero.rhp_max-hero.hp) - m_hero = hero - } - if(hero.node.position.x > left_x){ - left_x = hero.node.position.x - f_hero = hero - } - if(hero.node.position.x < right_x){ - right_x = hero.node.position.x - b_hero = hero - } - } - return {l_hero,m_hero,f_hero,b_hero,r_hero} - } - check_mons(){ - let heros:any=ecs.query(ecs.allOf(MonModelComp)) - let l_hp:number=0 - let h_hp:number=9999999999 - let right_x:number=360 - let left_x:number=-360 - let f_hero:any= null - let b_hero:any= null - let l_hero:any= null - let m_hero:any= null - let r_hero:any= null - let i = RandomManager.instance.getRandomInt(0,heros.length-1,3) - while(!heros[i].HeroView){ - i = RandomManager.instance.getRandomInt(0,heros.length-1,3) - if(!heros[i].HeroView.in_grave){ - r_hero= heros[i].HeroView - break - } - } - for (let i = 0; i < heros.length; i++) { - let hero:any = heros[i].HeroView; - if (hero.in_grave) continue - if((hero.rhp_max-hero.hp) > l_hp){ - l_hp = (hero.rhp_max-hero.hp) - l_hero = hero - } - if((hero.rhp_max-hero.hp) < h_hp){ - h_hp = (hero.rhp_max-hero.hp) - m_hero = hero - } - if(hero.node.position.x < right_x){ - right_x = hero.node.position.x - f_hero = hero - } - if(hero.node.position.x > left_x){ - left_x = hero.node.position.x - b_hero = hero - } - } - return {l_hero,m_hero,f_hero,b_hero,r_hero} - } - check_other_hero_buff(skill:number){ - switch(SkillSet[skill].type){ - case SkType.random: - this.do_add_buff(this.check_heros().r_hero,skill) - break; - case SkType.leastHealth: //血量最少单体 - this.do_add_buff(this.check_heros().l_hero,skill) - break; - case SkType.highestHealth: //血量最多单体 - this.do_add_buff(this.check_heros().m_hero,skill) - break; - case SkType.frontRow: //最前排 - this.do_add_buff(this.check_heros().f_hero,skill) - break; - case SkType.backRow: //最后排 - this.do_add_buff(this.check_heros().b_hero,skill) - break; - } - } - check_other_mon_buff(skill:number){ - switch(SkillSet[skill].type){ - case SkType.random: - this.do_add_buff(this.check_mons().r_hero,skill) - break; - case SkType.leastHealth: //血量最少单体 - this.do_add_buff(this.check_mons().l_hero,skill) - break; - case SkType.highestHealth: //血量最多单体 - this.do_add_buff(this.check_mons().m_hero,skill) - break; - case SkType.frontRow: //最前排 - this.do_add_buff(this.check_mons().f_hero,skill) - break; - case SkType.backRow: //最后排 - this.do_add_buff(this.check_mons().b_hero,skill) - break; - } - } - do_all_buff(sk:number){ - let skill = ecs.getEntity(Skill); - let pos=v3(0,0) - let t_pos = pos - // this.to_console("to_all_buff:"+sk) - let is_crit=this.check_crit() - skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add,this.rhp_max); - // this.to_console("使用buff:"+sk+" t_pos:"+t_pos+" box:"+this.box_group); + shoot_enemy(sk:number,y:number=0,x:number=0){ + // console.log("mon shoot_enemy"); } - do_add_buff(hero:any,sk:number){ - let skill = ecs.getEntity(Skill); - let t_pos=hero.node.position - let pos = this.node.position - // this.to_console("do_add_buff:"+hero.hero_name+" "+sk); - let is_crit=this.check_crit() - skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add,this.rhp_max); - // this.to_console(this.scale+this.hero_name+"使用buff:"+sk+SkillSet[sk].name+" t_pos:"+t_pos+" box:"+this.box_group,); - } exp_add(exp:number=0){ if(this.box_group==BoxSet.HERO){ @@ -658,18 +436,18 @@ export class HeroViewComp extends CCComp { } add_hp_max(hprate: number=0){ this.BUFFCOMP.buff_get("hp") - this.hp_max += Math.floor(hprate/100*this.rhp_max) ; + this.hp_max += Math.floor(hprate/100*this.hp_max) ; this.add_hp2(hprate) } de_hp_max(hprate: number=0){ this.BUFFCOMP.buff_get("dehp") - this.hp_max -= Math.floor(hprate/100*this.rhp_max) ; + this.hp_max -= Math.floor(hprate/100*this.hp_max) ; } add_hp(hp: number = 0) { this.BUFFCOMP.heathed(); this.hp+=Math.floor(hp); - if(this.hp > this.rhp_max){ - this.hp = this.rhp_max; + if(this.hp > this.hp_max){ + this.hp = this.hp_max; } this.BUFFCOMP.tooltip(2,hp.toFixed(0)); } @@ -686,8 +464,8 @@ export class HeroViewComp extends CCComp { }else{ this.BUFFCOMP.tooltip(1,hp.toFixed(0),250); } - if(this.hp > this.rhp_max){ - this.hp = this.rhp_max; + if(this.hp > this.hp_max){ + this.hp = this.hp_max; } if(this.hp <= 0){ this.dead(); @@ -759,6 +537,7 @@ export class HeroViewComp extends CCComp { to_alive(){ let pos =v3(HeroSet.StartPos[this.type],this.node.position.y,this.node.position.z) this.node.setPosition(pos) + this.revive() } to_console(value:any,value2:any=null,value3:any=null){ @@ -769,4 +548,13 @@ export class HeroViewComp extends CCComp { this.node.destroy(); } + playSkillEffect() { + this.as.max() + } + + public revive() { + this.hp = this.hp_max; + const skills = this.ent.get(HeroSkillsComp); + skills.resetAllCooldowns(); + } } \ No newline at end of file diff --git a/assets/script/game/skill/HeroSkillSystem.ts b/assets/script/game/skill/HeroSkillSystem.ts index d49bb616..07048bca 100644 --- a/assets/script/game/skill/HeroSkillSystem.ts +++ b/assets/script/game/skill/HeroSkillSystem.ts @@ -2,23 +2,245 @@ import { Node, Vec3 } from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroSkillsComp } from "./heroSkillsComp"; +import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet"; +import { CdType } from "../common/config/SkillSet"; /** 技能系统 */ @ecs.register('HeroSkillSystem') -export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { +export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { + private updateInterval: number = 0.2; // 每0.1秒更新一次 + private accumulator: number = 0; + filter(): ecs.IMatcher { return ecs.allOf(HeroSkillsComp, HeroViewComp); - } update(e: ecs.Entity) { - let skills = e.get(HeroSkillsComp); - let view = e.get(HeroViewComp); - + const view = e.get(HeroViewComp); + const skills = e.get(HeroSkillsComp); + + // 使用固定时间步长更新 + this.accumulator += this.dt; + while (this.accumulator >= this.updateInterval) { + this.accumulator -= this.updateInterval; + + // 只在攻击状态触发技能 + if (view.is_atking) { + this.processSkills(e, skills); + } + + // 更新所有技能冷却 + skills.skills.forEach(skillId => { + this.updateCooldown(skills, skillId); + }); + } } - + /** 处理所有技能逻辑 */ + private processSkills(entity: ecs.Entity, comp: HeroSkillsComp) { + comp.skills.forEach(skillId => { + const config = SkillSet[skillId]; + if (!config) return; + + // 检查释放条件 + if (this.checkSkillCondition(entity, config)) { + this.castSkill(entity, skillId, config); + } + }); + } + + /** 更新技能冷却 */ + private updateCooldown(comp: HeroSkillsComp, skillId: number) { + let cd = comp.cooldowns.has(skillId) ? comp.cooldowns.get(skillId)! : 0; + if (cd > 0) { + comp.cooldowns.set(skillId, cd - this.updateInterval); + } + } + + /** 检查技能释放条件 */ + private checkSkillCondition(entity: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]): boolean { + const view = entity.get(HeroViewComp); + const comp = entity.get(HeroSkillsComp); + switch(config.CdType){ + case CdType.SkillCD: + console.log("技能计时器",comp.cooldowns.get(config.uuid as number) ?? 0,config.cd) + return (comp.cooldowns.get(config.uuid as number) ?? 0) <= 0; + case CdType.HeroCD: + console.log("普攻计时器",view.at,view.cd) + return view.at >= view.cd; + case CdType.HeroPower: + console.log("能量计时器",view.pw,view.pwm) + return view.pw >= view.pwm; + } + } + + + + /** 施放技能 */ + private castSkill(caster: ecs.Entity, skillId: number, config: typeof SkillSet[keyof typeof SkillSet]) { + const view = caster.get(HeroViewComp); + const comp = caster.get(HeroSkillsComp); + console.log(view.hero_name+"施放技能",comp,view) + + switch(config.CdType) { + case CdType.SkillCD: + view.as.max() + console.log("重置技能计时器",view.as,config.cd) + comp.cooldowns.set(skillId, config.cd); // 重置冷却时间 + break; + case CdType.HeroCD: + view.as.atk() + console.log("重置普攻计时器",view.at,view.cd) + view.at = view.at-view.cd; // 重置普攻计时器 + break; + case CdType.HeroPower: + view.as.max() + console.log("重置能量计时器",view.pw,view.pwm) + view.pw = view.pw-view.pwm; + break; + } + + // 选择目标 + const targets = this.selectTargets(caster, config); + // 应用技能效果 + targets.forEach(target => { + this.applySkillEffect(caster, target, config); + }); + // 重置计数器 + if (config.count) { + comp.counters.set(skillId, (comp.counters.get(skillId) || 0) + 1); + } + + // 触发技能动画等表现 + + } + + /** 选择技能目标 */ + private selectTargets(caster: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]): ecs.Entity[] { + const casterView = caster.get(HeroViewComp); + const team = casterView.fac; + const isEnemyTeam = team === 0 ? 1 : 0; + + // 第一阶段:基础目标筛选 + let candidates = ecs.query(ecs.allOf(HeroViewComp)).filter(e => { + const view = e.get(HeroViewComp); + // 根据技能目标类型筛选 + switch(config.TargetGroup) { + case TargetGroup.Enemy: + return view.fac !== team; + case TargetGroup.Ally: + return view.fac === team && e !== caster; + case TargetGroup.Self: + return e === caster; + default: + return true; + } + }); + + // 第二阶段:位置/血量等精细筛选 + switch(config.TargetType) { + case TargetType.Frontline: + return this.filterFrontRow(candidates, isEnemyTeam); + case TargetType.Backline: + return this.filterBackRow(candidates, isEnemyTeam); + case TargetType.LowestHP: + return this.filterLowestHealth(candidates); + case TargetType.HighestHP: + return this.filterHighestHealth(candidates); + case TargetType.Melee: + return candidates.filter(e => e.get(HeroViewComp).type === 0); + case TargetType.Ranged: + return candidates.filter(e => e.get(HeroViewComp).type === 1); + case TargetType.SupportClass: + return candidates.filter(e => e.get(HeroViewComp).type === 2); + case TargetType.Random: + return this.pickRandomTarget(candidates, config.count || 1); + default: + return candidates; + } + } + + /** 筛选最前排单位 */ + private filterFrontRow(entities: ecs.Entity[], isEnemyTeam: number): ecs.Entity[] { + // 敌方最前排是x坐标最大的,我方最前排是x坐标最小的 + const keyPos = isEnemyTeam ? + Math.min(...entities.map(e => e.get(HeroViewComp).node.position.x)) : + Math.max(...entities.map(e => e.get(HeroViewComp).node.position.x)); + + return entities.filter(e => + Math.abs(e.get(HeroViewComp).node.position.x - keyPos) < 10 + ); + } + + /** 筛选最后排单位 */ + private filterBackRow(entities: ecs.Entity[], isEnemyTeam: number): ecs.Entity[] { + // 敌方最后排是x坐标最小的,我方最后排是x坐标最大的 + const keyPos = isEnemyTeam ? + Math.max(...entities.map(e => e.get(HeroViewComp).node.position.x)) : + Math.min(...entities.map(e => e.get(HeroViewComp).node.position.x)); + + return entities.filter(e => + Math.abs(e.get(HeroViewComp).node.position.x - keyPos) < 10 + ); + } + + /** 筛选血量最低单位 */ + private filterLowestHealth(entities: ecs.Entity[]): ecs.Entity[] { + const minHp = Math.min(...entities.map(e => e.get(HeroViewComp).hp)); + return entities.filter(e => e.get(HeroViewComp).hp === minHp); + } + + /** 筛选血量最高单位 */ + private filterHighestHealth(entities: ecs.Entity[]): ecs.Entity[] { + const maxHp = Math.max(...entities.map(e => e.get(HeroViewComp).hp)); + return entities.filter(e => e.get(HeroViewComp).hp === maxHp); + } + + /** 随机选择目标 */ + private pickRandomTarget(entities: ecs.Entity[], count: number): ecs.Entity[] { + const shuffled = [...entities].sort(() => 0.5 - Math.random()); + return shuffled.slice(0, count); + } + + /** 应用技能效果 */ + private applySkillEffect(caster: ecs.Entity, target: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]) { + const casterView = caster.get(HeroViewComp); + const targetView = target.get(HeroViewComp); + + // 计算基础伤害 + const damage = casterView.ap * (config.ap / 100); + + // 应用伤害/治疗 + if (config.ap > 0) { + targetView.hp -= damage; + } + if (config.hp > 0) { + targetView.hp += casterView.hp_max * (config.hp / 100); + } + + // 应用debuff + if (config.debuff > 0) { + this.applyDebuff(target, config); + } + } + + /** 应用负面状态 */ + private applyDebuff(target: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]) { + // 实现debuff逻辑... + } + + /** 外部调用重置冷却 */ + public resetSkillCooldown(entity: ecs.Entity, skillId: number) { + const comp = entity.get(HeroSkillsComp); + comp.resetCooldown(skillId); + } + + /** 重置所有技能冷却 */ + public resetAllCooldowns(entity: ecs.Entity) { + const comp = entity.get(HeroSkillsComp); + comp.resetAllCooldowns(); + } } diff --git a/assets/script/game/skill/heroSkillsComp.ts b/assets/script/game/skill/heroSkillsComp.ts index 0454c7af..126c14ac 100644 --- a/assets/script/game/skill/heroSkillsComp.ts +++ b/assets/script/game/skill/heroSkillsComp.ts @@ -1,10 +1,31 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; @ecs.register('HeroSkills') export class HeroSkillsComp extends ecs.Comp { - /** 移动方向:1向右,-1向左 */ - + /** 当前拥有的技能ID列表 */ + skills: number[] = []; + /** 技能冷却计时器 [技能ID:剩余冷却时间] */ + cooldowns: Map = new Map(); + /** 技能触发计数器 [技能ID:触发次数] */ + counters: Map = new Map(); reset() { - + this.skills = []; + this.cooldowns.clear(); + this.counters.clear(); + + } + + /** 重置指定技能冷却 */ + resetCooldown(skillId: number) { + if (this.cooldowns.has(skillId)) { + this.cooldowns.set(skillId, 0); + } + } + + /** 重置所有技能冷却 */ + resetAllCooldowns() { + this.cooldowns.forEach((value, key) => { + this.cooldowns.set(key, 0); + }); } } \ No newline at end of file diff --git a/assets/script/game/skills/EndAnmBomCom.ts b/assets/script/game/skills/EndAnmBomCom.ts index 06ddc6e7..a50f58e0 100644 --- a/assets/script/game/skills/EndAnmBomCom.ts +++ b/assets/script/game/skills/EndAnmBomCom.ts @@ -9,17 +9,12 @@ export class EndAnmBomCom extends Component { time:number = 0 base:SkillCom = null collider:Collider2D = null - rigid:RigidBody2D= null is_complete:boolean = false start() { this.base =this.node.getComponent(SkillCom) this.collider = this.getComponent(Collider2D); - this.rigid = this.getComponent(RigidBody2D); - console.log("collider",this.collider,this.rigid) - this.rigid.sleep() - this.scheduleOnce(()=>{ - this.rigid.wakeUp() - },0.5) + + // this.collider.enabled = false // if(this.base.box_group ==BoxSet.HERO) this.collider.group = BoxSet.MONSTER @@ -56,7 +51,7 @@ export class EndAnmBomCom extends Component { // // this.collider.enabled = true // console.log("动画结束,开始伤害") // } - this.rigid.wakeUp() + // this.collider.enabled = true console.log("动画结束,开始伤害") this.base.is_destroy = true @@ -67,7 +62,7 @@ export class EndAnmBomCom extends Component { // this.collider.group = this.base.box_group // this.node.active=false // this.node.active=true - this.rigid.wakeUp() + // this.collider.enabled = true console.log("onEnvent,开始伤害",event) this.is_complete=true diff --git a/tsconfig.json b/tsconfig.json index 7dc649a9..66c3e018 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,8 @@ /* Add your custom configuration here. */ "compilerOptions": { - "strict": false + "strict": false, + "target": "es2016", + "lib": ["es2016", "dom"] } }