From 3a15541170aa77a2c550e5e97c8a3042d9a9078b Mon Sep 17 00:00:00 2001 From: panfudan Date: Thu, 27 Mar 2025 12:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E4=B9=8B=E5=89=8D=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20+=20=E5=86=8D=E6=AC=A1=E5=8F=96=E6=B6=88=E7=A2=B0?= =?UTF-8?q?=E6=92=9E=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/heros/a3.prefab | 76 +---- assets/resources/game/heros/mor2.prefab | 76 +---- assets/resources/game/map/map_rpg.prefab | 312 ++++++++---------- assets/resources/game/skills/ball_blue.prefab | 76 +---- assets/script/Main.ts | 6 +- assets/script/game/common/config/SkillSet.ts | 22 +- .../common/ecs/position/BattleMoveSystem.ts | 18 +- assets/script/game/hero/HeroViewComp.ts | 40 +-- assets/script/game/map/CsuoComp.ts | 42 --- assets/script/game/map/CsuoComp.ts.meta | 9 - assets/script/game/map/HeroHomeComp.ts | 155 --------- assets/script/game/map/HeroHomeComp.ts.meta | 1 - assets/script/game/map/LuckHomeComp.ts | 142 -------- assets/script/game/map/LuckHomeComp.ts.meta | 9 - assets/script/game/map/MapMonsterComp.ts | 46 --- assets/script/game/map/MapMonsterComp.ts.meta | 9 - assets/script/game/map/MapSkillComp.ts | 64 ---- assets/script/game/map/MapSkillComp.ts.meta | 9 - assets/script/game/map/MissionHeroComp.ts | 4 +- assets/script/game/map/MissionMonComp.ts | 11 +- assets/script/game/map/RewardsComp.ts | 38 --- assets/script/game/map/RewardsComp.ts.meta | 9 - assets/script/game/map/ShopHomeComp.ts | 32 -- assets/script/game/map/ShopHomeComp.ts.meta | 9 - assets/script/game/map/SkillHomeComp.ts | 35 -- assets/script/game/map/SkillHomeComp.ts.meta | 9 - assets/script/game/map/unlockComp.ts | 24 -- assets/script/game/map/unlockComp.ts.meta | 9 - assets/script/game/skill/HeroSkillSystem.ts | 6 +- assets/script/game/skill/SkillSystem.ts | 13 +- assets/script/game/skills/Skill.ts | 5 + assets/script/game/skills/SkillCom.ts | 31 +- settings/v2/packages/engine.json | 3 +- 33 files changed, 220 insertions(+), 1130 deletions(-) delete mode 100644 assets/script/game/map/CsuoComp.ts delete mode 100644 assets/script/game/map/CsuoComp.ts.meta delete mode 100644 assets/script/game/map/HeroHomeComp.ts delete mode 100644 assets/script/game/map/HeroHomeComp.ts.meta delete mode 100644 assets/script/game/map/LuckHomeComp.ts delete mode 100644 assets/script/game/map/LuckHomeComp.ts.meta delete mode 100644 assets/script/game/map/MapMonsterComp.ts delete mode 100644 assets/script/game/map/MapMonsterComp.ts.meta delete mode 100644 assets/script/game/map/MapSkillComp.ts delete mode 100644 assets/script/game/map/MapSkillComp.ts.meta delete mode 100644 assets/script/game/map/RewardsComp.ts delete mode 100644 assets/script/game/map/RewardsComp.ts.meta delete mode 100644 assets/script/game/map/ShopHomeComp.ts delete mode 100644 assets/script/game/map/ShopHomeComp.ts.meta delete mode 100644 assets/script/game/map/SkillHomeComp.ts delete mode 100644 assets/script/game/map/SkillHomeComp.ts.meta delete mode 100644 assets/script/game/map/unlockComp.ts delete mode 100644 assets/script/game/map/unlockComp.ts.meta diff --git a/assets/resources/game/heros/a3.prefab b/assets/resources/game/heros/a3.prefab index 6ea7eff1..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", @@ -1409,74 +1403,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "654wWWbWpMeYe/ywRBGTMP" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 92 - }, - "enabledContactListener": true, - "bullet": false, - "awakeOnLoad": true, - "_group": 4, - "_type": 3, - "_allowSleep": true, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "4a5pvY6p9MZIAimZnbetm5" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 94 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": true, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 1.1, - "y": 40 - }, - "_size": { - "__type__": "cc.Size", - "width": 81.4, - "height": 80 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "ed4vkOAiZMzZOeFjz61GZe" - }, { "__type__": "cc.PrefabInfo", "root": { diff --git a/assets/resources/game/heros/mor2.prefab b/assets/resources/game/heros/mor2.prefab index ce5796c2..1f41f3bb 100644 --- a/assets/resources/game/heros/mor2.prefab +++ b/assets/resources/game/heros/mor2.prefab @@ -59,16 +59,10 @@ }, { "__id__": 89 - }, - { - "__id__": 91 - }, - { - "__id__": 93 } ], "_prefab": { - "__id__": 95 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1409,74 +1403,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "2elZ4bl4FIB4b+pDLWapI5" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 92 - }, - "enabledContactListener": true, - "bullet": false, - "awakeOnLoad": true, - "_group": 2, - "_type": 3, - "_allowSleep": true, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "e9/VwY2DBFMIaPEC/Xp2io" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 94 - }, - "tag": 0, - "_group": 2, - "_density": 1, - "_sensor": true, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": -1.3, - "y": 40 - }, - "_size": { - "__type__": "cc.Size", - "width": 82.2, - "height": 80 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "a80TNh7SBM941MDY4xS3RY" - }, { "__type__": "cc.PrefabInfo", "root": { diff --git a/assets/resources/game/map/map_rpg.prefab b/assets/resources/game/map/map_rpg.prefab index fe9a4e5b..0366c062 100644 --- a/assets/resources/game/map/map_rpg.prefab +++ b/assets/resources/game/map/map_rpg.prefab @@ -27,18 +27,18 @@ ], "_active": true, "_components": [ + { + "__id__": 96 + }, + { + "__id__": 98 + }, { "__id__": 100 - }, - { - "__id__": 102 - }, - { - "__id__": 104 } ], "_prefab": { - "__id__": 106 + "__id__": 102 }, "_lpos": { "__type__": "cc.Vec3", @@ -196,18 +196,18 @@ ], "_active": true, "_components": [ + { + "__id__": 89 + }, + { + "__id__": 91 + }, { "__id__": 93 - }, - { - "__id__": 95 - }, - { - "__id__": 97 } ], "_prefab": { - "__id__": 99 + "__id__": 95 }, "_lpos": { "__type__": "cc.Vec3", @@ -250,24 +250,24 @@ { "__id__": 8 }, + { + "__id__": 70 + }, { "__id__": 74 }, { - "__id__": 78 - }, - { - "__id__": 84 + "__id__": 80 } ], "_active": true, "_components": [ { - "__id__": 90 + "__id__": 86 } ], "_prefab": { - "__id__": 92 + "__id__": 88 }, "_lpos": { "__type__": "cc.Vec3", @@ -318,16 +318,10 @@ }, { "__id__": 67 - }, - { - "__id__": 69 - }, - { - "__id__": 71 } ], "_prefab": { - "__id__": 73 + "__id__": 69 }, "_lpos": { "__type__": "cc.Vec3", @@ -1651,46 +1645,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "463tPWLuVLS5+4BU5ZkZyJ" }, - { - "__type__": "b7739lRGUtNE4v/zX96Czu/", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 8 - }, - "_enabled": true, - "__prefab": { - "__id__": 70 - }, - "light": { - "__uuid__": "319c7eb8-9826-48b6-81e4-82559dbf82a8", - "__expectedType__": "cc.Prefab" - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "abjw1QslRMoJXlFkOcM3tw" - }, - { - "__type__": "c0f2fdqfBtOjKCjsgH1qG9+", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 8 - }, - "_enabled": true, - "__prefab": { - "__id__": 72 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "32/wDIt+VCGpWZs7dgIh/W" - }, { "__type__": "cc.PrefabInfo", "root": { @@ -1716,11 +1670,102 @@ "_active": true, "_components": [ { - "__id__": 75 + "__id__": 71 } ], "_prefab": { - "__id__": 77 + "__id__": 73 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 70 + }, + "_enabled": true, + "__prefab": { + "__id__": 72 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "31oHtMbJVMArMbwqigKTMo" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "dcwiHpOeZB4rB8JR5Z9iTM", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "EntityLayer", + "_objFlags": 512, + "__editorExtras__": {}, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 75 + }, + { + "__id__": 77 + } + ], + "_prefab": { + "__id__": 79 }, "_lpos": { "__type__": "cc.Vec3", @@ -1775,97 +1820,6 @@ }, "_id": "" }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "31oHtMbJVMArMbwqigKTMo" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "dcwiHpOeZB4rB8JR5Z9iTM", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "EntityLayer", - "_objFlags": 512, - "__editorExtras__": {}, - "_parent": { - "__id__": 7 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 79 - }, - { - "__id__": 81 - } - ], - "_prefab": { - "__id__": 83 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_mobility": 0, - "_layer": 1, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 78 - }, - "_enabled": true, - "__prefab": { - "__id__": 80 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 100 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_id": "" - }, { "__type__": "cc.CompPrefabInfo", "fileId": "f91Y4OCX1NFKfSWOAvmdSa" @@ -1876,11 +1830,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 74 }, "_enabled": true, "__prefab": { - "__id__": 82 + "__id__": 78 }, "_id": "" }, @@ -1913,14 +1867,14 @@ "_active": true, "_components": [ { - "__id__": 85 + "__id__": 81 }, { - "__id__": 87 + "__id__": 83 } ], "_prefab": { - "__id__": 89 + "__id__": 85 }, "_lpos": { "__type__": "cc.Vec3", @@ -1957,11 +1911,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 84 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 82 }, "_contentSize": { "__type__": "cc.Size", @@ -1985,11 +1939,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 84 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 84 }, "light": { "__uuid__": "319c7eb8-9826-48b6-81e4-82559dbf82a8", @@ -2024,7 +1978,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 87 }, "_contentSize": { "__type__": "cc.Size", @@ -2065,7 +2019,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 90 }, "_contentSize": { "__type__": "cc.Size", @@ -2093,7 +2047,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 96 + "__id__": 92 }, "camera": { "__id__": 3 @@ -2105,13 +2059,13 @@ "__id__": 67 }, "floorLayer": { - "__id__": 74 + "__id__": 70 }, "entityLayer": { - "__id__": 81 + "__id__": 77 }, "SkillLayer": { - "__id__": 87 + "__id__": 83 }, "isFollowPlayer": true, "_id": "" @@ -2130,7 +2084,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 98 + "__id__": 94 }, "_id": "" }, @@ -2161,7 +2115,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 97 }, "_contentSize": { "__type__": "cc.Size", @@ -2189,7 +2143,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 103 + "__id__": 99 }, "_cameraComponent": { "__id__": 3 @@ -2211,7 +2165,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 105 + "__id__": 101 }, "_alignFlags": 45, "_target": null, diff --git a/assets/resources/game/skills/ball_blue.prefab b/assets/resources/game/skills/ball_blue.prefab index fb00d2ba..e17198c9 100644 --- a/assets/resources/game/skills/ball_blue.prefab +++ b/assets/resources/game/skills/ball_blue.prefab @@ -32,16 +32,10 @@ }, { "__id__": 12 - }, - { - "__id__": 14 - }, - { - "__id__": 16 } ], "_prefab": { - "__id__": 18 + "__id__": 14 }, "_lpos": { "__type__": "cc.Vec3", @@ -283,74 +277,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "0cIZpMAklNUpGWSkPm4J6y" }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 15 - }, - "enabledContactListener": true, - "bullet": false, - "awakeOnLoad": true, - "_group": 4, - "_type": 3, - "_allowSleep": true, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "ccPNQAiCJDoqdJPvSfaTSM" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 17 - }, - "tag": 0, - "_group": 4, - "_density": 1, - "_sensor": true, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0.7, - "y": -0.8 - }, - "_size": { - "__type__": "cc.Size", - "width": 18.9, - "height": 17.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "05cKFJkU1GF6qeXylYGSZ2" - }, { "__type__": "cc.PrefabInfo", "root": { diff --git a/assets/script/Main.ts b/assets/script/Main.ts index 4c62810d..74ac8525 100644 --- a/assets/script/Main.ts +++ b/assets/script/Main.ts @@ -14,11 +14,7 @@ const { ccclass, property } = _decorator; @ccclass('Main') export class Main extends Root { start() { - PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb | - EPhysics2DDrawFlags.Pair | - EPhysics2DDrawFlags.CenterOfMass | - EPhysics2DDrawFlags.Joint | - EPhysics2DDrawFlags.Shape; + } protected async run() { smc.initialize = ecs.getEntity(Initialize); diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 03278f96..cd68ea64 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -51,6 +51,8 @@ export enum endType { animationEnd = 0, timeEnd = 1, distanceEnd = 2, + collision = 3, + countEnd = 4, } /* path: 图片地址 @@ -76,16 +78,16 @@ info:技能描述 */ export const SkillSet = { - 6001:{uuid:6001,name:"凛冬之触",sp_name:"ball_blue",path:"6001",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"}, - 6002:{uuid:6002,name:"烈焰之怒",sp_name:"ball_blue",path:"6002",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"}, - 6003:{uuid:6003,name:"奥术冲击",sp_name:"ball_blue",path:"6003",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"}, - 6004:{uuid:6004,name:"神圣裁决",sp_name:"ball_blue",path:"6004",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"}, - 6005:{uuid:6005,name:"破空斩击",sp_name:"ball_blue",path:"6005",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"攻击前方直线100码内的敌人造成50%伤害"}, - 6006:{uuid:6006,name:"穿心箭矢",sp_name:"ball_blue",path:"6006",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放箭矢,造成100%攻击的伤害"}, - 6007:{uuid:6007,name:"铁斧打击",sp_name:"ball_blue",path:"6007",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"}, - 6008:{uuid:6008,name:"木棍打击",sp_name:"ball_blue",path:"6008",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出木棍,造成100%攻击的伤害"}, - 6009:{uuid:6009,name:"飞刀打击",sp_name:"ball_blue",path:"6009",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"}, - 6010:{uuid:6010,name:"石斧打击",sp_name:"ball_blue",path:"6010",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:2,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出石斧,造成100%攻击的伤害"}, + 6001:{uuid:6001,name:"凛冬之触",sp_name:"ball_blue",path:"6001",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放寒冰弹,造成100%攻击的伤害"}, + 6002:{uuid:6002,name:"烈焰之怒",sp_name:"ball_red",path:"6002",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放火焰弹,造成100%攻击的伤害"}, + 6003:{uuid:6003,name:"奥术冲击",sp_name:"ball_green",path:"6003",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放魔法弹,造成100%攻击的伤害"}, + 6004:{uuid:6004,name:"神圣裁决",sp_name:"ball_yellow",path:"6004",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放圣光弹,造成100%攻击的伤害"}, + 6005:{uuid:6005,name:"破空斩击",sp_name:"patk",path:"6005",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"攻击前方直线100码内的敌人造成50%伤害"}, + 6006:{uuid:6006,name:"穿心箭矢",sp_name:"arrow",path:"6006",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人释放箭矢,造成100%攻击的伤害"}, + 6007:{uuid:6007,name:"铁斧打击",sp_name:"mon_ft",path:"6007",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出铁斧,造成100%攻击的伤害"}, + 6008:{uuid:6008,name:"木棍打击",sp_name:"mon_ly",path:"6008",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出木棍,造成100%攻击的伤害"}, + 6009:{uuid:6009,name:"飞刀打击",sp_name:"mon_xd",path:"6009",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出飞刀,造成100%攻击的伤害"}, + 6010:{uuid:6010,name:"石斧打击",sp_name:"mon_sf",path:"6010",TargetType:1,TargetGroup:3,act:"atk",CdType:1,AnimType:0,endType:3,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:0.8,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"向最前方敌人扔出石斧,造成100%攻击的伤害"}, 6011:{uuid:6011,name:"烈火呼吸",sp_name:"firequan",path:"6011",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,endType:1,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:3,count:1,def:0,apup:0,ap:100,mhp:0,hp:0,cd:5,buff_cd:0.5,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤烈焰攻击前方敌人,造成200%攻击的伤害,烈焰维持3秒"}, 6012:{uuid:6012,name:"大火球" ,sp_name:"fire",path:"6012",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:0,endType:1,fname:"max",flash:false,with:50,debuff:2,depb:20,debtime:2,derate:100,in:1,count:1,def:0,apup:0,ap:300,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"}, 6013:{uuid:6013,name:"火墙", sp_name:"firewall",path:"6013",TargetType:1,TargetGroup:3,act:"max",CdType:2,AnimType:4,endType:1,fname:"max",flash:false,with:50,debuff:0,depb:0,debtime:0,derate:0,in:10,count:1,def:0,apup:0,ap:50,mhp:0,hp:0,cd:5,buff_cd:1,hited:0.3,shield:0,speed:300,sonsk:0,hero:0,info:"在最前方敌人位置,召唤一堵火墙,持续10秒,每秒造成50%攻击伤害"}, diff --git a/assets/script/game/common/ecs/position/BattleMoveSystem.ts b/assets/script/game/common/ecs/position/BattleMoveSystem.ts index 95cadf28..46a3f092 100644 --- a/assets/script/game/common/ecs/position/BattleMoveSystem.ts +++ b/assets/script/game/common/ecs/position/BattleMoveSystem.ts @@ -19,9 +19,9 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU if (!move.moving) return; // 检测攻击范围内是否有敌人 // 检测友方碰撞和敌方攻击范围 - const alliesStop = this.checkAlliesInProximity(e); + // const alliesStop = this.checkAlliesInProximity(e); const enemiesStop = this.checkEnemiesInRange(e, view.dis); - const shouldStop = alliesStop || enemiesStop; + const shouldStop = enemiesStop; view.is_atking = shouldStop; // 同步状态 @@ -96,15 +96,15 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU } // 获取前一个单位(uuid比当前小的最近单位) - const prevUnit = sortedAllies[currentIndex - 1]; - const prevView = prevUnit.get(HeroViewComp); - const distToPrev = Math.abs(currentPos.x - prevView.node.position.x); + // const prevUnit = sortedAllies[currentIndex - 1]; + // const prevView = prevUnit.get(HeroViewComp); + // const distToPrev = Math.abs(currentPos.x - prevView.node.position.x); // 如果与前一个单位距离小于安全距离,则停止 - if (distToPrev < SAFE_DISTANCE) { - current.is_stop_temp = true; - return true; - } + // if (distToPrev < SAFE_DISTANCE) { + // current.is_stop_temp = true; + // return true; + // } // 如果与前一个单位距离大于安全距离,则移动 current.is_stop_temp = false; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 8b31a5ff..1711cb99 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -91,29 +91,29 @@ export class HeroViewComp extends CCComp { this.as = this.getComponent(HeroSpine); // 注册单个碰撞体的回调函数 - let collider = this.getComponent(Collider2D); - collider.group = this.box_group; - // console.log("hero collider ",this.scale,collider); - if (collider) { - collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); - // collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); - collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this); - // collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this); - } - this.rigid = this.getComponent(RigidBody2D); - if(this.rigid.sleep){ - console.log("hero rigid sleep ",this.scale,this.rigid); - this.rigid.wakeUp(); - } + // let collider = this.getComponent(Collider2D); + // collider.group = this.box_group; + // // console.log("hero collider ",this.scale,collider); + // if (collider) { + // collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); + // // collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); + // collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this); + // // collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this); + // } + // this.rigid = this.getComponent(RigidBody2D); + // if(this.rigid.sleep){ + // console.log("hero rigid sleep ",this.scale,this.rigid); + // this.rigid.wakeUp(); + // } } - onBeginContact (seCol: Collider2D, oCol: Collider2D) { - console.log("碰撞开始 ",this.scale,seCol,oCol); + // onBeginContact (seCol: Collider2D, oCol: Collider2D) { + // console.log("碰撞开始 ",this.scale,seCol,oCol); - } - onEndContact (seCol: Collider2D, oCol: Collider2D) { console.log("碰撞结束 ",this.scale,seCol,oCol);} - onPreSolve (seCol: Collider2D, oCol: Collider2D) {console.log("碰撞预处理 ",this.scale,seCol,oCol);} - onPostSolve (seCol: Collider2D, oCol: Collider2D) {console.log("碰撞后处理 ",this.scale,seCol,oCol); } + // } + // onEndContact (seCol: Collider2D, oCol: Collider2D) { console.log("碰撞结束 ",this.scale,seCol,oCol);} + // onPreSolve (seCol: Collider2D, oCol: Collider2D) {console.log("碰撞预处理 ",this.scale,seCol,oCol);} + // onPostSolve (seCol: Collider2D, oCol: Collider2D) {console.log("碰撞后处理 ",this.scale,seCol,oCol); } /** 视图层逻辑代码分离演示 */ start () { diff --git a/assets/script/game/map/CsuoComp.ts b/assets/script/game/map/CsuoComp.ts deleted file mode 100644 index c31e34a7..00000000 --- a/assets/script/game/map/CsuoComp.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { _decorator,NodeEventType,EventTouch } 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { UIID } from "../common/config/GameUIConfig"; -import { smc } from "../common/SingletonModuleComp"; - -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('CsuoComp') -@ecs.register('Csuo', false) -export class CsuoComp extends CCComp { - - protected onLoad() { - // this.node.on(NodeEventType.TOUCH_START, this.onTouch, this); - - } - onTouch() { - - } - onOk(){ - this.node.active=false; - } - oncancel(){ - - - } - - /** 视图层逻辑代码分离演示 */ - start() { - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - // this.on(ModuleEvent.Cmd, this.onHandler, this); - } - - - - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/CsuoComp.ts.meta b/assets/script/game/map/CsuoComp.ts.meta deleted file mode 100644 index dd1a7d87..00000000 --- a/assets/script/game/map/CsuoComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "bcd8a069-5208-4be1-8c8e-2cedddb3860a", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/HeroHomeComp.ts b/assets/script/game/map/HeroHomeComp.ts deleted file mode 100644 index 8a6b8ae0..00000000 --- a/assets/script/game/map/HeroHomeComp.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { _decorator,Button,color,EventHandler,EventTouch,instantiate,Label,NodeEventType,Prefab,ProgressBar,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } 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 { HeroInfo, HeroList } from "../common/config/heroSet"; -import { smc } from "../common/SingletonModuleComp"; -import { UIID } from "../common/config/GameUIConfig"; -import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { SkillSet } from "../common/config/SkillSet"; -import { getUpChipByLv, getUpGoldByRange, LvUp, SlvUp, UpGold } from "../common/config/RoleSet"; -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('HeroHomeComp') -@ecs.register('HeroHome', false) -export class HeroHomeComp extends CCComp { - h_uuid:number=0 - role:any=null - hero:any=null - gold_need:number=9999 - chip_need:number=9999 - slv:number=0 - protected onLoad(): void { - - } - start() { - // this.load_talents() - console.log("hero_home start") - // this.h_uuid=5001 - // this.hero_show(this.h_uuid) - this.loads() - this.node.getChildByName("show").active=false - } - loads(){ - let hc:number =HeroList.length - let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content") - - parent.getComponent(UITransform).setContentSize(hc*185,230) - // console.log("hc",hc,parent.getComponent(UITransform)) - console.log("parent",parent) - - - } - hero_show(uuid:number) { - this.node.getChildByName("show").active=true - this.h_uuid=uuid - this.hero=HeroInfo[uuid] - console.log("hero_show",uuid) - // let skill1 = SkillSet[this.hero.skill[0]] - // let skill2 = SkillSet[this.hero.skill[1]] - // var sk_path = "game/skills/skill_icon" - // var icon_path = "game/heros/herois" - - - - let content=this.node.getChildByName("show").getChildByName("content") - content.getChildByName("name").getChildByName("value").getComponent(Label).string=this.hero.name - content.getChildByName("name").getChildByName("g1").active=HeroInfo[uuid].quality==1 - content.getChildByName("name").getChildByName("g2").active=HeroInfo[uuid].quality==2 - content.getChildByName("name").getChildByName("g3").active=HeroInfo[uuid].quality==3 - this.clear_hero() - this.call_hero(uuid) - // resources.load(icon_path, SpriteAtlas, (err: any, atlas) => { - // const sprite = content.getChildByName("hero").getChildByName("icon").getComponent(Sprite); - // sprite.spriteFrame = atlas.getSpriteFrame(this.hero.path); - // }); - // resources.load(sk_path, SpriteAtlas, (err: any, atlas) => { - // const sprite = content.getChildByName("bottom").getChildByName("sk").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite); - // sprite.spriteFrame = atlas.getSpriteFrame(skill1.path); - // }); - // content.getChildByName("bottom").getChildByName("sk").getChildByName("name").getComponent(Label).string = skill1.name; - // content.getChildByName("bottom").getChildByName("sk").getChildByName("info").getComponent(Label).string = skill1.info; - // resources.load(sk_path, SpriteAtlas, (err: any, atlas) => { - // const sprite = content.getChildByName("bottom").getChildByName("sk2").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite); - // sprite.spriteFrame = atlas.getSpriteFrame(skill2.path); - // }); - // content.getChildByName("bottom").getChildByName("sk2").getChildByName("name").getComponent(Label).string = skill2.name; - // content.getChildByName("bottom").getChildByName("sk2").getChildByName("info").getComponent(Label).string = skill2.info; - - // tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = this.hero.tals[0] - // tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = this.hero.tals[1] - // tal.getChildByName("slv3").getChildByName("val").getComponent(Label).string = this.hero.tals[2] - // tal.getChildByName("slv4").getChildByName("val").getComponent(Label).string = this.hero.tals[3] - // tal.getChildByName("slv5").getChildByName("val").getComponent(Label).string = this.hero.tals[4] - this.update_data() - } - update_data(){ - let content=this.node.getChildByName("show").getChildByName("content") - // let slv_node=content.getChildByName("name").getChildByName("slv"); - // let slvup=content.getChildByName("slvup"); - let attr = content.getChildByName("attr"); - // slv_node.getChildByName("slv").getComponent(Label).string = smc.heros[uuid].slv.toString(); - // content.getChildByName("name").getChildByName("quality").getChildByName("q1").active = this.hero.quality == 1; - // content.getChildByName("name").getChildByName("quality").getChildByName("q2").active = this.hero.quality == 2; - // content.getChildByName("name").getChildByName("quality").getChildByName("q3").active = this.hero.quality == 3; - // content.getChildByName("name").getChildByName("quality").getChildByName("k1").active = this.hero.kind == 1; - // content.getChildByName("name").getChildByName("quality").getChildByName("k2").active = this.hero.kind == 2; - // content.getChildByName("name").getChildByName("quality").getChildByName("k3").active = this.hero.kind == 3; - // lvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*smc.heros[uuid].lv).toString() - attr.getChildByName("ap").getChildByName("val").getComponent(Label).string = this.hero.ap.toFixed(0).toString() - attr.getChildByName("hp").getChildByName("val").getComponent(Label).string = this.hero.hp.toFixed(0).toString() - attr.getChildByName("acd").getChildByName("val").getComponent(Label).string = this.hero.a_cd - attr.getChildByName("speed").getChildByName("val").getComponent(Label).string = this.hero.speed - attr.getChildByName("dis").getChildByName("val").getComponent(Label).string = this.hero.dis - - - - oops.message.dispatchEvent("hero_card_update_info",{uuid:this.h_uuid}) - } - lv_selcet(e:any,val:any){ - - } - - - call_hero(uuid:number){ - var path = "game/heros/uiheros/"+HeroInfo[uuid].path; - var prefab: Prefab = oops.res.get(path, Prefab)!; - var node = instantiate(prefab); - node.parent = this.node.getChildByName("show").getChildByName("content").getChildByName("hero").getChildByName("node") - } - clear_hero(){ - this.node.getChildByName("show").getChildByName("content").getChildByName("hero").getChildByName("node").destroyAllChildren() - } - pre_hero(){ - let hi= HeroList.indexOf(this.h_uuid) - if(hi==0){ - oops.gui.toast("已经是第一个英雄"); - return - } - this.h_uuid=HeroList[hi-1] - this.hero_show(this.h_uuid) - } - next_hero(){ - let hi= HeroList.indexOf(this.h_uuid) - if(hi==HeroList.length-1){ - oops.gui.toast("已经是最后一个英雄"); - return - } - this.h_uuid=HeroList[hi+1] - this.hero_show(this.h_uuid) - } - - - item_show(e:any,val:any){ - oops.gui.open(UIID.ItemInfo, {uuid:val,type:0}); - } - close_show(){ - this.node.getChildByName("show").active=false - } - close(){ - this.node.active=false - } - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/HeroHomeComp.ts.meta b/assets/script/game/map/HeroHomeComp.ts.meta deleted file mode 100644 index d7e6bf21..00000000 --- a/assets/script/game/map/HeroHomeComp.ts.meta +++ /dev/null @@ -1 +0,0 @@ -{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"f830455e-1cb8-4379-b382-6de74c383166","files":[],"subMetas":{},"userData":{}} diff --git a/assets/script/game/map/LuckHomeComp.ts b/assets/script/game/map/LuckHomeComp.ts deleted file mode 100644 index 96a517b8..00000000 --- a/assets/script/game/map/LuckHomeComp.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { _decorator, instantiate, Prefab ,Node, Label, Sprite, resources, SpriteAtlas, v3} 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { smc } from "../common/SingletonModuleComp"; -import { Item } from "./Item"; -import { Items } from "../common/config/Items"; -import { HChipComp } from "../hero/HChipComp"; -import { BoxDrop } from "../common/config/RewardSet"; -import { RandomManager } from "db://oops-framework/core/common/random/RandomManager"; -import { SChipComp } from "../hero/SChipComp"; -import { ItemComp } from "./ItemComp"; - -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('LuckHomeCompComp') -@ecs.register('LuckHomeComp', false) -export class LuckHomeCompComp extends CCComp { - @property({ type: Node }) - sbn: Node = null; - @property({ type: Node }) - mbn: Node | null = null; - @property({ type: Node }) - lbn: Node | null = null; - @property({ type: Node }) - btnno: Node | null = null; - @property({ type: Node }) - itmes: Node | null = null; - selected: string = ""; - - /** 视图层逻辑代码分离演示 */ - start() { - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - // this.on(ModuleEvent.Cmd, this.onHandler, this); - // this.frist(); - } - frist(){ - this.colse_reward() - } - - open_sb() { - smc.vmdata.box.num--; - this.open_reward() - this.get_reward(1) - } - open_mb() { - if (smc.vmdata.box.num < 5) {oops.gui.toast("宝箱数量不足");return;} - smc.vmdata.box.num=smc.vmdata.box.num-5; - this.open_reward() - for (let x = 0; x < 5; x++) { - this.get_reward(2) - } - } - open_lb() { - if (smc.vmdata.box.num < 15) {oops.gui.toast("宝箱数量不足");return;} - smc.vmdata.box.num=smc.vmdata.box.num-15; - this.open_reward() - for (let x = 0; x < 15; x++) { - this.get_reward(2) - } - } - colse_reward() { - this.node.getChildByName("reward").setScale(0,0,0); - this.node.getChildByName("reward").getChildByName("items").removeAllChildren(); - } - open_reward() { - this.node.getChildByName("reward").setScale(1,1,1); - } - get_reward(reward:number){ - console.log("get_reward",reward) - let list =BoxDrop[reward]; - let uuid= 0 - let num =1 - let i=0 - while (uuid==0) { - for (let x = 0; x < list.length; x++) { - let rate = Math.random()*100 - if(rate < list[x].dropRate){ - uuid=list[x].uuid; - num =RandomManager.instance.getRandomInt(list[x].num_max/2,list[x].num_max); - break; - } - } - i++; - } - switch(reward){ - - } - } - show_hero_chip(uuid:number,num:number){ - console.log("show_hero_chip",uuid,num) - let path = "game/gui/hchip"; - let prefab: Prefab = oops.res.get(path, Prefab)!; - let node = instantiate(prefab); - let hc= node.getComponent(HChipComp) - hc.update_data(uuid,num) - node.parent = this.node.getChildByName("reward").getChildByName("items"); - } - show_item(uuid:number,num:number){ - var path = "game/gui/item"; - var prefab: Prefab = oops.res.get(path, Prefab)!; - var node = instantiate(prefab); - let ic= node.getComponent(ItemComp) - ic.update_data(uuid,num) - node.parent = this.node.getChildByName("reward").getChildByName("items"); - - } - show_skill_chip(uuid:number,num:number){ - let path = "game/gui/schip"; - let prefab: Prefab = oops.res.get(path, Prefab)!; - let node = instantiate(prefab); - let sc= node.getComponent(SChipComp) - sc.update_data(uuid,num) - node.parent = this.node.getChildByName("reward").getChildByName("items"); - } - show_bbox() { - var parent = this.node.getChildByName("bbox") - var path = "game/gui/bbox"; - var prefab: Prefab = oops.res.get(path, Prefab)!; - let box = instantiate(prefab); - box.parent = parent; - parent.getChildByName("light").active = true; - this.scheduleOnce(()=>{ - parent.getChildByName("light").active = false; - }, 0.5) - this.scheduleOnce(()=>{ - box.destroy(); - }, 0.7) - } - to_open(){ - if(this.selected==""){return;} - switch(this.selected){ - - } - } - - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/LuckHomeComp.ts.meta b/assets/script/game/map/LuckHomeComp.ts.meta deleted file mode 100644 index 004c856a..00000000 --- a/assets/script/game/map/LuckHomeComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "461697d5-ffa2-4577-8e33-2c329f3410b5", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/MapMonsterComp.ts b/assets/script/game/map/MapMonsterComp.ts deleted file mode 100644 index 1693c71c..00000000 --- a/assets/script/game/map/MapMonsterComp.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { _decorator ,Vec3,v3, Prefab, instantiate,Node} 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 { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; -import { BoxSet, GameSet } from "../common/config/BoxSet"; -import { smc } from "../common/SingletonModuleComp"; -import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { MapViewScene } from "./view/MapViewScene"; -import { MissionSet,MissionNum,MonsetList, BossList } from "../common/config/MissionSet"; -import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager"; -import { Hero } from "../hero/Hero"; -import { HeroModelComp } from "../hero/HeroModelComp"; -import { Boss} from "../Boss/Boss"; -import { UIID } from "../common/config/GameUIConfig"; -import { Talents } from "../common/config/TalentSet"; -import { HeroViewComp } from "../hero/HeroViewComp"; -import { HeroSet } from "../common/config/heroSet"; -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('MapMonsterComp') -@ecs.register('MapMonster', false) -export class MapMonsterComp extends CCComp { - - - onLoad(){ - // 监听全局事件 - - - } - start() { - - } - - protected update(dt: number): void { - - } - - - /** 视图层逻辑代码分离演示 */ - - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/MapMonsterComp.ts.meta b/assets/script/game/map/MapMonsterComp.ts.meta deleted file mode 100644 index c0892163..00000000 --- a/assets/script/game/map/MapMonsterComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "c0f2f76a-7c1b-4e8c-a0a3-b201f5a86f7e", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/MapSkillComp.ts b/assets/script/game/map/MapSkillComp.ts deleted file mode 100644 index 9b30a2ff..00000000 --- a/assets/script/game/map/MapSkillComp.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { _decorator ,v3,Prefab,instantiate,Node} 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { BoxSet } from "../common/config/BoxSet"; -import { MapViewScene } from "./view/MapViewScene"; -import { smc } from "../common/SingletonModuleComp"; -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('MapSkillComp') -@ecs.register('MapSkill', false) -export class MapSkillComp extends CCComp { - // scene: MapViewScene = null; - @property(Prefab) - light: Prefab = null; - onLoad(){ - oops.message.on("monster_load", this.doMonsterLoad, this); - oops.message.on("hero_load", this.doHeroLoad, this); - oops.message.on("do_use_skill", this.doSkill, this); - oops.message.on("do_use_item", this.useItem, this); - } - doSkill(event: string, args: any){ - this.addCSkill(args.uuid); - } - addSkill(){ - - } - addCSkill(uuid:number=1001,args:any=null){ - - } - doMonsterLoad(){ - // const light = instantiate(this.light); - // light.setPosition(BoxSet.MONSTER_START,BoxSet.GAME_LINE); - // this.node.addChild(light); - } - doHeroLoad(){ - // const light = instantiate(this.light); - // light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0); - // this.node.addChild(light); - } - useItem(event: string, args: any){ - console.log("useItem"); - - } - /** 视图层逻辑代码分离演示 */ - start() { - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - // this.on(ModuleEvent.Cmd, this.onHandler, this); - } - - /** 全局消息逻辑处理 */ - // private onHandler(event: string, args: any) { - // switch (event) { - // case ModuleEvent.Cmd: - // break; - // } - // } - - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/MapSkillComp.ts.meta b/assets/script/game/map/MapSkillComp.ts.meta deleted file mode 100644 index a61dc861..00000000 --- a/assets/script/game/map/MapSkillComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "b7739951-194b-4d13-8bff-cd7f7a0b3bbf", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/MissionHeroComp.ts b/assets/script/game/map/MissionHeroComp.ts index cfdf897a..2377fffc 100644 --- a/assets/script/game/map/MissionHeroComp.ts +++ b/assets/script/game/map/MissionHeroComp.ts @@ -17,10 +17,10 @@ const { ccclass, property } = _decorator; export class MissionHeroCompComp extends CCComp { timer:Timer=new Timer(2) onLoad(){ - // this.on(GameEvent.UserHeroCard,this.call_hero,this) + this.on(GameEvent.UserHeroCard,this.call_hero,this) } start() { - this.test_call() + // this.test_call() } protected update(dt: number): void { if(smc.mission.status != 1) return diff --git a/assets/script/game/map/MissionMonComp.ts b/assets/script/game/map/MissionMonComp.ts index f6ffee42..c7c7edb7 100644 --- a/assets/script/game/map/MissionMonComp.ts +++ b/assets/script/game/map/MissionMonComp.ts @@ -7,6 +7,7 @@ import { HeroSet } from "../common/config/heroSet"; import { Missions } from "../common/config/MissionSet"; import { RandomManager } from "db://oops-framework/core/common/random/RandomManager"; import { Timer } from "db://oops-framework/core/common/timer/Timer"; +import { smc } from "../common/SingletonModuleComp"; const { ccclass, property } = _decorator; @@ -19,12 +20,14 @@ export class MissionMonCompComp extends CCComp { start() { // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 // this.on(ModuleEvent.Cmd, this.onHandler, this); - this.test_call() + // this.test_call() } protected update(dt: number): void { - // if(this.timer.update(dt)){ - // this.mon_refresh() - // } + if(!smc.mission.play||smc.mission.pause) return + if(this.timer.update(dt)){ + this.mon_refresh() + } + } test_call(){ this.addMonster(5202,0,true) diff --git a/assets/script/game/map/RewardsComp.ts b/assets/script/game/map/RewardsComp.ts deleted file mode 100644 index cdcdfd6c..00000000 --- a/assets/script/game/map/RewardsComp.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { _decorator } 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; - -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('RewardsComp') -@ecs.register('Rewards', false) -export class RewardsComp extends CCComp { - reward_lv = 1; - onLoad(){ - // 监听全局事件 - oops.message.on("do_reward", this.do_reward, this); - } - /** 视图层逻辑代码分离演示 */ - start() { - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - // this.on(ModuleEvent.Cmd, this.onHandler, this); - } - do_reward(){ - this.node.active = true; - } - /** 全局消息逻辑处理 */ - // private onHandler(event: string, args: any) { - // switch (event) { - // case ModuleEvent.Cmd: - // break; - // } - // } - - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } - -} \ No newline at end of file diff --git a/assets/script/game/map/RewardsComp.ts.meta b/assets/script/game/map/RewardsComp.ts.meta deleted file mode 100644 index 0f32f5f6..00000000 --- a/assets/script/game/map/RewardsComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "df8725c7-a5e8-4dfd-b357-59fb88b68283", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/ShopHomeComp.ts b/assets/script/game/map/ShopHomeComp.ts deleted file mode 100644 index 9c0fcabc..00000000 --- a/assets/script/game/map/ShopHomeComp.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { _decorator, instantiate, Prefab, UITransform } 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { UIID } from "../common/config/GameUIConfig"; -import { Items } from "../common/config/Items"; -import { Item } from "./Item"; -import { smc } from "../common/SingletonModuleComp"; -import { RewardComp } from "./RewardComp"; -import { SChipComp } from "../hero/SChipComp"; -import { HChipComp } from "../hero/HChipComp"; -import { Goods } from "./Goods"; - -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('ShopHomeComp') -@ecs.register('ShopHomeComp', false) -export class ShopHomeComp extends CCComp { - /** 视图层逻辑代码分离演示 */ - start() { - this.get_items(); - } - get_items(){ - let goodsnode = this.node.getChildByName("goods").getChildByName("view").getChildByName("content") - - } - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/ShopHomeComp.ts.meta b/assets/script/game/map/ShopHomeComp.ts.meta deleted file mode 100644 index a22a91a1..00000000 --- a/assets/script/game/map/ShopHomeComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "08123a0b-18dd-4dcb-8f8b-17664ff1ec67", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/SkillHomeComp.ts b/assets/script/game/map/SkillHomeComp.ts deleted file mode 100644 index ac06aa77..00000000 --- a/assets/script/game/map/SkillHomeComp.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { _decorator, UITransform } 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 { MSklist } from "../common/config/SkillSet"; -import { MSCard } from "./MSCard"; - -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('SkillHomeComp') -@ecs.register('SkillHome', false) -export class SkillHomeComp extends CCComp { - /** 视图层逻辑代码分离演示 */ - start() { - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - // this.on(ModuleEvent.Cmd, this.onHandler, this); - this.load_skill_card() - } - - load_skill_card(){ - let ms_num:number =MSklist.length - let parent= this.node.getChildByName("skills").getChildByName("view").getChildByName("content") - let height=ms_num*135 - parent.getComponent(UITransform).height=height - for (let i = 0; i < ms_num; i++) { - let msc =ecs.getEntity(MSCard) - msc.load(MSklist[i],parent,1) - } - } - - /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/map/SkillHomeComp.ts.meta b/assets/script/game/map/SkillHomeComp.ts.meta deleted file mode 100644 index e3260758..00000000 --- a/assets/script/game/map/SkillHomeComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "cf5847e5-a4d7-4a84-8064-024371ea2125", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/map/unlockComp.ts b/assets/script/game/map/unlockComp.ts deleted file mode 100644 index b47bccb5..00000000 --- a/assets/script/game/map/unlockComp.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { _decorator, Component, Node ,director,game} from 'cc'; -import { oops } from '../../../../extensions/oops-plugin-framework/assets/core/Oops'; -const { ccclass, property } = _decorator; - -@ccclass('unlock') -export class unlockComp extends Component { - start() { - - } - - doCancel() { - this.node.active = false - - } - doActive() { - this.node.active = true - - } - update(deltaTime: number) { - - } -} - - diff --git a/assets/script/game/map/unlockComp.ts.meta b/assets/script/game/map/unlockComp.ts.meta deleted file mode 100644 index 66120015..00000000 --- a/assets/script/game/map/unlockComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "3a67f9d9-8df3-4cfc-955d-1a8b1c30b2e8", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/skill/HeroSkillSystem.ts b/assets/script/game/skill/HeroSkillSystem.ts index 4ab874de..0c7551aa 100644 --- a/assets/script/game/skill/HeroSkillSystem.ts +++ b/assets/script/game/skill/HeroSkillSystem.ts @@ -1,4 +1,4 @@ -import { Node, Vec3 } from "cc"; +import { Node, UI, UITransform, Vec3 } from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { HeroViewComp } from "../hero/HeroViewComp"; import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet"; @@ -47,11 +47,11 @@ export class HeroSkillSystem extends ecs.ComblockSystem implements ecs.ISystemUp const targets = this.selectEnemyTargets(caster, config); if (targets.length === 0) return; skillEntity.load( - view.node.position, // 起始位置 + new Vec3(view.node.position.x, view.node.position.y+view.node.getComponent(UITransform).contentSize.height/2, 0), // 起始位置 view.box_group, // 阵营 view.node.parent, // 父节点 config.uuid, // 技能ID - targets[0]?.get(HeroViewComp).node.position, // 目标位置 + new Vec3(targets[0]?.get(HeroViewComp).node.position.x, targets[0]?.get(HeroViewComp).node.position.y, 0), // 目标位置 targets[0]?.get(HeroViewComp), view ); diff --git a/assets/script/game/skill/SkillSystem.ts b/assets/script/game/skill/SkillSystem.ts index b2d9f4ae..5bcc1baf 100644 --- a/assets/script/game/skill/SkillSystem.ts +++ b/assets/script/game/skill/SkillSystem.ts @@ -2,7 +2,7 @@ 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 { endType, SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet"; import { CdType } from "../common/config/SkillSet"; import { oops } from "db://oops-framework/core/Oops"; import { GameEvent } from "../common/config/GameEvent"; @@ -32,7 +32,7 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if(skill.atk_count < 1){ skill.atk_count++; // console.log("技能命中目标",skill.caster,skill.target,SkillSet[skill.s_uuid]); - this.applySkillEffect(skill.caster,skill.target,SkillSet[skill.s_uuid]); + this.applySkillEffect(skill.caster,skill.target,SkillSet[skill.s_uuid],e); } } this.processDamageQueue(); @@ -56,14 +56,14 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate // 根据技能配置获取判定范围 const config = SkillSet[skill.s_uuid]; const rangeX = config?.rangeX || 20; // 默认值为10 - const rangeY = config?.rangeY || 20; + const rangeY = config?.rangeY || 30; const distanceX = Math.abs(targetPos.x - skillPos.x); - const distanceY = Math.abs(targetPos.y - skillPos.y); + const distanceY = Math.abs(targetPos.y+40 - skillPos.y); const isInRange = distanceX < rangeX && distanceY < rangeY; return isInRange; } /** 应用技能效果 */ - private applySkillEffect(casterView:HeroViewComp, targetView: HeroViewComp, config: typeof SkillSet[keyof typeof SkillSet]) { + private applySkillEffect(casterView:HeroViewComp, targetView: HeroViewComp, config: typeof SkillSet[keyof typeof SkillSet],e:ecs.Entity) { // 直接计算伤害(包含防御减免) const damageResult = this.calculateDamage(casterView, targetView, config); // 将施法者传入applyDamage方法 @@ -71,6 +71,9 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate // 播放技能特效 casterView.playSkillEffect(config.uuid); console.log(`${casterView.hero_name} 对 ${targetView.hero_name} 造成 ${damageResult.value}伤害`); + if(config.endType === endType.collision){ + e.destroy(); + } } private calculateDamage(caster: HeroViewComp, target: HeroViewComp, config: typeof SkillSet[keyof typeof SkillSet]) { diff --git a/assets/script/game/skills/Skill.ts b/assets/script/game/skills/Skill.ts index 03afe72b..0ce74753 100644 --- a/assets/script/game/skills/Skill.ts +++ b/assets/script/game/skills/Skill.ts @@ -56,6 +56,11 @@ export class Skill extends ecs.Entity { skillComp.caster = caster; skillComp.prefabName = config.sp_name; skillComp.group = group; + if(group==BoxSet.HERO){ + skillComp.fac=0; + }else{ + skillComp.fac=1; + } console.log(config.sp_name+"技能配置",skillComp); // 初始化动画名称 skillComp.animName = config.animName; // 从配置获取动画名称 diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index 367c35f9..873d7e0b 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -33,7 +33,8 @@ export class SkillCom extends CCComp { duration: number = 0; // 技能持续时间 prefabName: string = ""; // 预制体名称 animName: string = ""; - group:number = 0; //阵营 + group:number = 0; //阵营 + fac:number=0; //阵营 rigid:RigidBody2D=null!; // 动画名称 target:any=null; caster:any=null; @@ -46,24 +47,24 @@ export class SkillCom extends CCComp { start() { oops.message.on(GameEvent.MissionEnd, this.doDestroy, this); this.node.active = true; - let collider = this.getComponent(Collider2D); - console.log(this.group +"技能 collider ",collider); - collider.group = this.group; - if (collider) { - collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); + // let collider = this.getComponent(Collider2D); + // console.log(this.group +"技能 collider ",collider); + // collider.group = this.group; + // if (collider) { + // collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); - } - this.rigid = this.getComponent(RigidBody2D); - if(this.rigid.sleep){ - console.log(this.scale+"技能 rigid sleep ",this.rigid); - this.rigid.wakeUp(); - } + // } + // this.rigid = this.getComponent(RigidBody2D); + // if(this.rigid.sleep){ + // console.log(this.scale+"技能 rigid sleep ",this.rigid); + // this.rigid.wakeUp(); + // } // 根据动画类型开始相应的运动 this.startMovement(); } - onBeginContact (seCol: Collider2D, oCol: Collider2D) { - console.log(this.scale+"碰撞开始 ",seCol,oCol); - } + // onBeginContact (seCol: Collider2D, oCol: Collider2D) { + // console.log(this.scale+"碰撞开始 ",seCol,oCol); + // } diff --git a/settings/v2/packages/engine.json b/settings/v2/packages/engine.json index 5331b8e0..a7b473b8 100644 --- a/settings/v2/packages/engine.json +++ b/settings/v2/packages/engine.json @@ -51,7 +51,7 @@ "_value": false }, "physics-2d": { - "_value": true, + "_value": false, "_option": "physics-2d-box2d" }, "physics-2d-box2d": { @@ -134,7 +134,6 @@ "gfx-webgl2", "intersection-2d", "particle-2d", - "physics-2d-box2d", "profiler", "skeletal-animation", "spine",