From 7441e94419a3118f4c2fce46762a565437d4e79b Mon Sep 17 00:00:00 2001 From: panw Date: Tue, 14 Oct 2025 10:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E9=87=8D=E6=9E=84=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/skill/atk.meta | 9 + .../resources/game/skill/atk/atk_fire.prefab | 456 ++++++++++++++++++ .../atk_fire.prefab.meta} | 4 +- .../prefab/{atk1.prefab => atk_fire_1.prefab} | 181 +++++-- .../game/skill/prefab/atk_fire_1.prefab.meta | 13 + assets/script/game/common/config/heroSet.ts | 46 +- assets/script/game/skill/AtkConCom.ts | 233 +++++++++ ...oSkillSystem.ts.meta => AtkConCom.ts.meta} | 2 +- assets/script/game/skill/HeroSkillSystem.ts | 139 ------ assets/script/game/skills/Skill.ts | 2 +- assets/script/game/skills/SkillCom.ts | 6 - 11 files changed, 888 insertions(+), 203 deletions(-) create mode 100644 assets/resources/game/skill/atk.meta create mode 100644 assets/resources/game/skill/atk/atk_fire.prefab rename assets/resources/game/skill/{prefab/atk1.prefab.meta => atk/atk_fire.prefab.meta} (62%) rename assets/resources/game/skill/prefab/{atk1.prefab => atk_fire_1.prefab} (58%) create mode 100644 assets/resources/game/skill/prefab/atk_fire_1.prefab.meta create mode 100644 assets/script/game/skill/AtkConCom.ts rename assets/script/game/skill/{HeroSkillSystem.ts.meta => AtkConCom.ts.meta} (70%) delete mode 100644 assets/script/game/skill/HeroSkillSystem.ts diff --git a/assets/resources/game/skill/atk.meta b/assets/resources/game/skill/atk.meta new file mode 100644 index 00000000..87fed6b8 --- /dev/null +++ b/assets/resources/game/skill/atk.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "67e47971-0c35-4445-bf87-1f16671a8091", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/game/skill/atk/atk_fire.prefab b/assets/resources/game/skill/atk/atk_fire.prefab new file mode 100644 index 00000000..23658f6e --- /dev/null +++ b/assets/resources/game/skill/atk/atk_fire.prefab @@ -0,0 +1,456 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "atk_fire", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false + }, + { + "__type__": "cc.Node", + "_name": "atk_fire", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 10 + }, + { + "__id__": 18 + } + ], + "_active": true, + "_components": [ + { + "__id__": 26 + } + ], + "_prefab": { + "__id__": 28 + }, + "_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": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_prefab": { + "__id__": 3 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 2 + }, + "asset": { + "__uuid__": "dc4cc0a7-a040-4e87-9f75-0f20e3e25db9", + "__expectedType__": "cc.Prefab" + }, + "fileId": "cfqCWnxbFLNoQMedQXsav3", + "instance": { + "__id__": 4 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "52XpOnmEdOq4GXBa8gYxcr", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 5 + }, + { + "__id__": 7 + }, + { + "__id__": 8 + }, + { + "__id__": 9 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 6 + }, + "propertyPath": [ + "_name" + ], + "value": "boom" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "cfqCWnxbFLNoQMedQXsav3" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 6 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": 6.112, + "y": 45.573, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 6 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 6 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_prefab": { + "__id__": 11 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "43a67d73-b426-4f20-9a1f-1aaae1c82bd0", + "__expectedType__": "cc.Prefab" + }, + "fileId": "cfqCWnxbFLNoQMedQXsav3", + "instance": { + "__id__": 12 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "51heDVa6dNC5JOz0aq5R7A", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 13 + }, + { + "__id__": 15 + }, + { + "__id__": 16 + }, + { + "__id__": 17 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 14 + }, + "propertyPath": [ + "_name" + ], + "value": "ready" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "cfqCWnxbFLNoQMedQXsav3" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 14 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": 6.112, + "y": 45.573, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 14 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 14 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_prefab": { + "__id__": 19 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 18 + }, + "asset": { + "__uuid__": "26ff5f8c-e160-4977-bf1b-0b6153052bef", + "__expectedType__": "cc.Prefab" + }, + "fileId": "c46/YsCPVOJYA4mWEpNYRx", + "instance": { + "__id__": 20 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "76H0s8dtJM9pTFpU3wvET0", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 21 + }, + { + "__id__": 23 + }, + { + "__id__": 24 + }, + { + "__id__": 25 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 22 + }, + "propertyPath": [ + "_name" + ], + "value": "atk_fire" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "c46/YsCPVOJYA4mWEpNYRx" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 22 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 22 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 22 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 27 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 40, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.49664333316829656, + "y": 0.5156666649712457 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "63NP9yq3hEUKD/OZZZ5t7x" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "c46/YsCPVOJYA4mWEpNYRx", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": [ + { + "__id__": 18 + }, + { + "__id__": 10 + }, + { + "__id__": 2 + } + ] + } +] \ No newline at end of file diff --git a/assets/resources/game/skill/prefab/atk1.prefab.meta b/assets/resources/game/skill/atk/atk_fire.prefab.meta similarity index 62% rename from assets/resources/game/skill/prefab/atk1.prefab.meta rename to assets/resources/game/skill/atk/atk_fire.prefab.meta index bc6a9174..e3f37edf 100644 --- a/assets/resources/game/skill/prefab/atk1.prefab.meta +++ b/assets/resources/game/skill/atk/atk_fire.prefab.meta @@ -2,12 +2,12 @@ "ver": "1.1.50", "importer": "prefab", "imported": true, - "uuid": "2156ec29-33a9-443b-a791-89fe562f5b84", + "uuid": "845d0141-6de8-4498-9363-efacbc9a63e6", "files": [ ".json" ], "subMetas": {}, "userData": { - "syncNodeName": "atk1" + "syncNodeName": "atk_fire" } } diff --git a/assets/resources/game/skill/prefab/atk1.prefab b/assets/resources/game/skill/prefab/atk_fire_1.prefab similarity index 58% rename from assets/resources/game/skill/prefab/atk1.prefab rename to assets/resources/game/skill/prefab/atk_fire_1.prefab index c82f55bf..06218679 100644 --- a/assets/resources/game/skill/prefab/atk1.prefab +++ b/assets/resources/game/skill/prefab/atk_fire_1.prefab @@ -1,7 +1,7 @@ [ { "__type__": "cc.Prefab", - "_name": "atk1", + "_name": "atk_fire_1", "_objFlags": 0, "__editorExtras__": {}, "_native": "", @@ -13,7 +13,7 @@ }, { "__type__": "cc.Node", - "_name": "atk1", + "_name": "atk_fire_1", "_objFlags": 0, "__editorExtras__": {}, "_parent": null, @@ -32,15 +32,24 @@ }, { "__id__": 12 + }, + { + "__id__": 14 + }, + { + "__id__": 16 + }, + { + "__id__": 18 } ], "_prefab": { - "__id__": 14 + "__id__": 20 }, "_lpos": { "__type__": "cc.Vec3", - "x": 6.112, - "y": 45.573, + "x": 0, + "y": 0, "z": 0 }, "_lrot": { @@ -57,7 +66,7 @@ "z": 1 }, "_mobility": 0, - "_layer": 1, + "_layer": 1073741824, "_euler": { "__type__": "cc.Vec3", "x": 0, @@ -97,22 +106,22 @@ "__type__": "cc.Quat", "x": 0, "y": 0, - "z": 0, - "w": 1 + "z": 0.7071067811865475, + "w": 0.7071067811865476 }, "_lscale": { "__type__": "cc.Vec3", - "x": 2, - "y": 2, + "x": 0.8, + "y": 0.8, "z": 1 }, "_mobility": 0, - "_layer": 1, + "_layer": 1073741824, "_euler": { "__type__": "cc.Vec3", "x": 0, "y": 0, - "z": 0 + "z": 90 }, "_id": "" }, @@ -130,8 +139,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 127, - "height": 127 + "width": 64, + "height": 64 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -142,7 +151,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "ddhDbko4FLmKZGY46brX7z" + "fileId": "0bXCTL/l1A5YZuQAHcNimF" }, { "__type__": "cc.Sprite", @@ -166,8 +175,11 @@ "b": 255, "a": 255 }, - "_spriteFrame": null, - "_type": 0, + "_spriteFrame": { + "__uuid__": "56a24460-ef67-4aa0-a3f7-fad4007046dc@a22e7", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, "_fillType": 0, "_sizeMode": 1, "_fillCenter": { @@ -179,12 +191,15 @@ "_fillRange": 0, "_isTrimmedMode": true, "_useGrayscale": false, - "_atlas": null, + "_atlas": { + "__uuid__": "56a24460-ef67-4aa0-a3f7-fad4007046dc", + "__expectedType__": "cc.SpriteAtlas" + }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "c3vPZUzCRINL3sICnCZKIr" + "fileId": "b9QUlReiVJ7ZDxbXwpC4IM" }, { "__type__": "cc.PrefabInfo", @@ -194,7 +209,7 @@ "asset": { "__id__": 0 }, - "fileId": "feOW1uSctLKYCw3esMiuox", + "fileId": "9fUsJF0/xIH6lvrQ3ar5z7", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -213,19 +228,121 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 104, - "height": 75 + "width": 40, + "height": 40 }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 + "x": 0.49664333316829656, + "y": 0.5156666649712457 }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "a7pn5tzA1BSI1AfdpVsHh7" + "fileId": "63NP9yq3hEUKD/OZZZ5t7x" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 11 + }, + "tag": 8, + "_group": 4, + "_density": 1, + "_sensor": true, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": -0.7, + "y": 0.5 + }, + "_size": { + "__type__": "cc.Size", + "width": 29.5, + "height": 10.8 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "81sJPuCINN3rZBRiuXBK3i" + }, + { + "__type__": "cc.RigidBody2D", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 13 + }, + "enabledContactListener": true, + "bullet": false, + "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": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "4bT+t24ixB5JXaf1K0opLg" + }, + { + "__type__": "f680dkagx9PmbfqtF463/Ua", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "speed": 600, + "controlPointSide": 1, + "controlPointOffset": 0.1, + "controlPointRandomness": 0, + "autoRotate": true, + "showTrajectory": false, + "trajectoryColor": { + "__type__": "cc.Color", + "r": 0, + "g": 255, + "b": 0, + "a": 255 + }, + "trajectoryWidth": 3, + "easing": "linear", + "rotationSmoothness": 0.6, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5bdTSRB61JvJ58crjmM55d" }, { "__type__": "cc.Animation", @@ -237,7 +354,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 11 + "__id__": 17 }, "playOnLoad": true, "_clips": [ @@ -254,10 +371,10 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "63z5ZyjTNKYbn+kEVB1s3W" + "fileId": "81ijmfBpBLBYwxa+xOAd0J" }, { - "__type__": "0f3c4JhFbFO2rEFqBJJ7hFv", + "__type__": "411a8xY2rNF1JLZn+Qgqfqg", "_name": "", "_objFlags": 0, "__editorExtras__": {}, @@ -266,13 +383,15 @@ }, "_enabled": true, "__prefab": { - "__id__": 13 + "__id__": 19 }, + "anmEnd": false, + "cbox": true, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "32SLcINL1JHZ+vIyextzaC" + "fileId": "7frqHFRhdHXbaDJ490Ea1E" }, { "__type__": "cc.PrefabInfo", @@ -282,7 +401,7 @@ "asset": { "__id__": 0 }, - "fileId": "cfqCWnxbFLNoQMedQXsav3", + "fileId": "c46/YsCPVOJYA4mWEpNYRx", "instance": null, "targetOverrides": null } diff --git a/assets/resources/game/skill/prefab/atk_fire_1.prefab.meta b/assets/resources/game/skill/prefab/atk_fire_1.prefab.meta new file mode 100644 index 00000000..116b6bca --- /dev/null +++ b/assets/resources/game/skill/prefab/atk_fire_1.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.50", + "importer": "prefab", + "imported": true, + "uuid": "26ff5f8c-e160-4977-bf1b-0b6153052bef", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "atk_fire_1" + } +} diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 6fe78f45..406878da 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -105,101 +105,101 @@ export const MonSet = { export const HeroInfo = { //主将 5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.warrior,hp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6001,6301,6302,6303], + type:HType.warrior,hp:100,mp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6005,6005], buff:[],info:""}, 5002:{uuid:5002,name:"刺客",path:"hc1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:1, - type:HType.warrior,hp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6001,6301,6302,6303], + type:HType.warrior,hp:100,mp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6005,6005], buff:[],info:""}, 5005:{uuid:5005,name:"绿箭",path:"ha1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2, - type:HType.remote,hp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6003,6003,6301,6302,6303], + type:HType.remote,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6005,6005], buff:[],info:""}, 5007:{uuid:5007,name:"牧师",path:"hmh1", fac:FacSet.HERO, quality:QualitySet.PURPLE,lv:1,kind:2, - type:HType.mage,hp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6004,6004,6301,6302,6303], + type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6005,6005], buff:[],info:""}, 5008:{uuid:5008,name:"火女",path:"hmf1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2, - type:HType.mage,hp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6005,6005,6301,6302,6303], + type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6005,6005], buff:[],info:""}, // 5009:{uuid:5009,name:"风暴精灵",path:"hk1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2, -// type:HType.mage,hp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6006,6006,6301,6302,6303], +// type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6006,6006,6301,6302,6303], // buff:[],info:""}, // 5010:{uuid:5010,name:"战争祭祀",path:"hk1", fac:FacSet.HERO, quality:QualitySet.ORANGE,lv:1,kind:2, -// type:HType.mage,hp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6007,6007,6301,6302,6303], +// type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6007,6007,6301,6302,6303], // buff:[],info:""}, // 5011:{uuid:5011,name:"ha2",path:"ha2", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2, -// type:HType.remote,hp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6003,6003,6301,6302,6303], +// type:HType.remote,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6003,6003,6301,6302,6303], // buff:[],info:""}, //怪物 5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.warrior,hp:25,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001], + type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.remote,hp:20,def:5,ap:5,dis:350,cd:1,speed:100,skills:[6007], + type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.warrior,hp:25,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001], + type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5204:{uuid:5204,name:"石卫", path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.mage,hp:18,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001], + type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6005,6005], buff:[],info:"法师怪物-高伤害脆弱"}, 5205:{uuid:5205,name:"土卫", path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.mage,hp:18,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001], + type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6005,6005], buff:[],info:"法师怪物-高伤害脆弱"}, 5206:{uuid:5206,name:"树卫", path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.mage,hp:18,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001], + type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6005,6005], buff:[],info:"法师怪物-高伤害脆弱"}, 5219:{uuid:5219,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:2,kind:1, - type:HType.warrior,hp:25,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001], + type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5220:{uuid:5220,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.warrior,hp:25,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001], + type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5221:{uuid:5221,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.remote,hp:20,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6007], + type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5222:{uuid:5222,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.warrior,hp:25,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001], + type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5223:{uuid:5223,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.warrior,hp:25,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001], + type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5224:{uuid:5224,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1, - type:HType.remote,hp:20,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001], + type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6005,6005], buff:[],info:"普通怪物-战士型"}, 5225:{uuid:5225,name:"精英独眼",path:"mo1", fac:FacSet.MON, quality:QualitySet.BLUE,lv:1,kind:1, - type:HType.warrior,hp:45,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6006], + type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6006], buff:[],info:"精英怪物-战士型"}, 5226:{uuid:5226,name:"精英牛头",path:"mo1", fac:FacSet.MON, quality:QualitySet.BLUE,lv:1,kind:1, - type:HType.warrior,hp:45,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6007], + type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6005,6005], buff:[],info:"精英怪物-战士型"}, 5227:{uuid:5227,name:"精英兽人",path:"mo1", fac:FacSet.MON, quality:QualitySet.BLUE,lv:1,kind:1, - type:HType.warrior,hp:45,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6005], + type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6005,6005], buff:[],info:"精英怪物-战士型"}, }; diff --git a/assets/script/game/skill/AtkConCom.ts b/assets/script/game/skill/AtkConCom.ts new file mode 100644 index 00000000..e09a70e9 --- /dev/null +++ b/assets/script/game/skill/AtkConCom.ts @@ -0,0 +1,233 @@ +import { _decorator, Animation, Collider2D, Contact2DType, Tween, v3, Vec3 } from "cc"; +import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; +import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; +import { BezierMove } from "../BezierMove/BezierMove"; +import { AType, BuffAttr, DTType, EType, SkillSet, SType, TGroup } from "../common/config/SkillSet"; +import { BoxSet, FacSet } from "../common/config/BoxSet"; +import { HeroViewComp } from "../hero/HeroViewComp"; +import { GameEvent } from "../common/config/GameEvent"; +import { smc } from "../common/SingletonModuleComp"; +const { ccclass, property } = _decorator; + +/** 视图层对象 */ +@ccclass('AtkConCom') +@ecs.register('AtkCon', false) +export class AtkConCom extends CCComp { + @property({ type:Boolean }) + public anmEnd: boolean = false; + @property({ type:Boolean }) + public cbox: boolean = false; + // 核心标识和配置 + s_uuid:number = 0; + // 运行时状态(必须缓存的) + is_destroy:boolean = false; + startPos: Vec3 = v3(); // 起始位置 + targetPos: Vec3 = v3(); // 目标位置 + group:number = 0; //阵营 + fac:number=0; //阵营 + caster:any=null; + + // 战斗相关运行时数据 + ap:number=0; + burn_count:number=0; + burn_value:number=0; + stun_time:number=0; + stun_ratio:number=0; + frost_ratio:number=0; + frost_time:number=0; + run_time:number=0; + hited_time:number=0; + hit_count:number=0; + caster_crit:number=0; + caster_crit_d:number=0; + puncture:number=0; + puncture_damage:number=0; + debuff_up:number=0; + debuff_value:number=0; + debuff_count:number=0; + // 组件引用 + anim:Animation=null; + tweenInstance:Tween = null; + private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向 + // 缓存的配置对象(避免重复查找) + public skillConfig: any = null; + private isInitialized: boolean = false; + private initializeSkillConfig() { + if (this.isInitialized) return; + // 缓存技能配置,避免重复查找 + this.skillConfig = SkillSet[this.s_uuid]; + if (!this.skillConfig) { + // console.error("[SkillCom] 技能配置不存在:", this.s_uuid); + return; + } + this.isInitialized = true; + // console.log("[SkillCom] 技能配置初始化完成:", this.s_uuid, this.skillConfig.name); + } + start() { + this.initializeSkillConfig(); + // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 + // this.on(ModuleEvent.Cmd, this.onHandler, this); + this.node.setPosition(this.startPos.x,this.startPos.y,0) + this.anim=this.node.getComponent(Animation) + this.on(GameEvent.MissionEnd, this.doDestroy, this); + this.node.active = true; + let collider = this.getComponent(Collider2D); + if(collider) { + collider.group = this.group; + collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); + } + let bm=this.node.getComponent(BezierMove) + // //console.log(this.group +"技能 collider ",collider); + switch(this.skillConfig.AType){ + case AType.parabolic: + this.node.angle +=10 + // bm.speed=700 + if(this.group==BoxSet.MONSTER) {bm.controlPointSide=-1 } + bm.rotationSmoothness=0.6 + bm.moveTo(this.targetPos) + break; + case AType.linear: + let s_x=this.startPos.x + let s_y=this.startPos.y + let t_x=this.targetPos.x + let t_y=this.targetPos.y + // 设定目标x + this.targetPos.x = 400; + if(this.group == BoxSet.MONSTER) { + bm.controlPointSide = -1; + this.targetPos.x = -400; + } + // 计算斜率 + const k = (t_y - s_y) / (t_x - s_x); + // 按直线公式计算新的y + this.targetPos.y = k * (this.targetPos.x - s_x) + s_y; + bm.controlPointOffset=0 + bm.rotationSmoothness=0.6 + bm.moveTo(this.targetPos); + break; + case AType.StartEnd: + // 2段位移:先升高,然后移到目的地 + this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0) + this.do_anim() + break; + case AType.fixedEnd: + this.node.setPosition(this.targetPos.x > 360?300:this.targetPos.x,0,0) + this.do_anim() + break; + case AType.fixedStart: // + if(this.s_uuid==6001){ + console.log("skillcom startPos",this.startPos) + } + this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0) + this.do_anim() + break; + } + + } + do_anim(){ + if(this.node.getComponent(Animation)){ + let anim = this.node.getComponent(Animation); + //console.log("[SkillCom]:has anim",anim) + anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this); + } + + } + onAnimationFinished(){ + // console.log("[SkillCom]:onAnimationFinished",this.s_uuid) + if (!this.skillConfig) return; + + if(this.skillConfig.EType==EType.timeEnd) return + if(this.skillConfig.SType!=SType.damage){ + + } + this.is_destroy=true + } + onBeginContact (seCol: Collider2D, oCol: Collider2D) { + // console.log(this.scale+"碰撞开始 ",seCol,oCol); + if(seCol.node.position.x-oCol.node.position.x > 100 ) return + let target = oCol.getComponent(HeroViewComp) + if(oCol.group!=this.group){ + if(target == null) return; + if (!this.skillConfig) return; + // console.log("[SkillCom]:onBeginContact oCol||seCol",oCol.node.position,seCol.node.position) + this.single_damage(target,this.skillConfig.DTType==DTType.range?true:false) + // this.ent.destroy() + } + } + //单体伤害 + single_damage(target:HeroViewComp,is_range:boolean=false){ + // //console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit) + // if(this.hit_count > 0&&!is_range) this.ap=this.ap*(50+this.puncture_damage)/100 // 穿刺后 伤害减半,过滤范围伤害 + if(target == null) return; + if (!this.skillConfig) return; + let ap=this.ap + if(this.hit_count > 0 &&!is_range ){ + ap=ap*(50+this.puncture_damage)/100 + } + target.do_atked(ap,this.caster_crit,this.caster_crit_d, + this.burn_count,this.burn_value, + this.stun_time,this.stun_ratio, + this.frost_time,this.frost_ratio, + this.skillConfig.AtkedType + ) // ap 及暴击 属性已经在skill.ts 处理 + // console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position) + if(this.skillConfig.debuff>0){ + let debuff=this.skillConfig + let dev=debuff.deV*(100+this.debuff_value)/100 + let deR=debuff.deR+this.debuff_up + dev=Math.round(dev*100)/100 + let deC=debuff.deC+this.debuff_count //dec只作为次数叠加 + // //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC) + target.add_debuff(debuff.debuff,dev,deC,deR) + } + this.hit_count++ + // console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.skillConfig.hit,this.puncture) + if(this.hit_count>=(this.skillConfig.hit+this.puncture)&&(this.skillConfig.DTType!=DTType.range)&&(this.skillConfig.EType!=EType.animationEnd)&&(this.skillConfig.EType!=EType.timeEnd)) this.is_destroy=true // 技能命中次数 + } + update(deltaTime: number) { + // 确保配置已初始化(处理 update 可能先于 start 执行的情况) + if (!this.isInitialized) { + this.initializeSkillConfig(); + if (!this.skillConfig) return; + } + + if(smc.mission.pause) { + if(this.anim) this.anim.pause() + return; + } + if(this.anim) this.anim.resume() + if (!this.node || !this.node.isValid) return; + + if(this.skillConfig.EType==EType.timeEnd){ + this.run_time+=deltaTime + if(this.run_time>this.skillConfig.in){ + // //console.log("[SkillCom]: timeEnd destroy",this.s_uuid,this.run_time) + this.is_destroy=true + } + } + + //直线移动 + // if(this.skillConfig.AType == AType.linear) this.startLinearMove(deltaTime); + this.toDestroy(); + } + + toDestroy() { + if(this.is_destroy){ + if (this.ent) { + this.ent.destroy(); + } else { + // 如果ent不存在,直接销毁节点 + if (this.node && this.node.isValid) { + this.node.destroy(); + } + } + } + } + doDestroy(){ + // //console.log("[SkillCom]:doDestroy") + this.is_destroy=true + } + reset() { + this.node.destroy(); + } +} \ No newline at end of file diff --git a/assets/script/game/skill/HeroSkillSystem.ts.meta b/assets/script/game/skill/AtkConCom.ts.meta similarity index 70% rename from assets/script/game/skill/HeroSkillSystem.ts.meta rename to assets/script/game/skill/AtkConCom.ts.meta index 2087a30f..acc84afa 100644 --- a/assets/script/game/skill/HeroSkillSystem.ts.meta +++ b/assets/script/game/skill/AtkConCom.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.24", "importer": "typescript", "imported": true, - "uuid": "36448c83-0bd9-495b-806d-6e7d640370e3", + "uuid": "411a8c58-dab3-45d4-92d9-9fe420a9faa0", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/script/game/skill/HeroSkillSystem.ts b/assets/script/game/skill/HeroSkillSystem.ts deleted file mode 100644 index 51c7de5e..00000000 --- a/assets/script/game/skill/HeroSkillSystem.ts +++ /dev/null @@ -1,139 +0,0 @@ -// 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, TGroup, TType } from "../common/config/SkillSet"; -// import { CdType } from "../common/config/SkillSet"; -// import { oops } from "db://oops-framework/core/Oops"; -// import { GameEvent } from "../common/config/GameEvent"; -// import { Skill } from "../skills/Skill"; -// import { SkillCom } from "../skills/SkillCom"; -// import { AType } from "../common/config/SkillSet"; -// import { BoxSet } from "../common/config/BoxSet"; - - -// /** 技能系统 */ -// @ecs.register('HeroSkillSystem') -// export class HeroSkillSystem extends ecs.ComblockSystem { -// // export class HeroSkillSystem implements ecs.ISystemUpdate { -// // private updateInterval: number = 0.1; // 每0.1秒更新一次 -// // private accumulator: number = 0; -// private _timers: { [key: string]: number } = {}; -// private _damageQueue: Array<{ timer: number; callback: () => void }> = []; -// init(): void { -// oops.message.on(GameEvent.FightEnd, this.clear_timer, this); -// } -// filter(): ecs.IMatcher { -// return ecs.allOf(HeroViewComp); -// } -// update(e: ecs.Entity) { -// //return false -// // 处理伤害队列 -// const view = e.get(HeroViewComp); -// // 只在攻击状态触发技能 -// if (view.is_atking &&view.at > view.cd) { -// const config = SkillSet[view.atk_skill]; -// if (!config) return; -// this.castSkill(e, view.atk_skill, config); -// view.at = 0; -// } - -// } - -// /** 施放技能 */ -// private castSkill(caster: ecs.Entity, skillId: number, config: typeof SkillSet[keyof typeof SkillSet]) { -// const view = caster.get(HeroViewComp); -// // console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid); -// if (config.TGroup === TGroup.Enemy) { -// caster.get(HeroViewComp).playSkillEffect(config.uuid); -// this.doSkill(caster,config); -// } - -// if (config.TGroup === TGroup.Ally) { -// const targets = this.selectAllyTargets(caster, config); -// if (targets.length === 0) return; - -// } -// if (config.TGroup === TGroup.Self) { - -// } - -// } -// private doSkill(caster: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]) { -// const view = caster.get(HeroViewComp); -// const skillEntity = ecs.getEntity(Skill); -// const targets = this.selectEnemyTargets(caster, config); -// if (targets.length === 0) return; -// skillEntity.load( -// new Vec3(view.node.position.x, view.node.position.y+BoxSet.ATK_Y, 0), // 起始位置 -// view.box_group, // 阵营 -// view.node.parent, // 父节点 -// config.uuid, // 技能ID -// new Vec3(targets[0]?.get(HeroViewComp).node.position.x, targets[0]?.get(HeroViewComp).node.position.y, 0), // 目标位置 -// view -// ); -// // console.log("技能:"+config.uuid+"=>"+targets[0]?.get(HeroViewComp).hero_name); -// } - -// private selectEnemyTargets(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; -// const candidates= ecs.query(ecs.allOf(HeroViewComp)).filter(e => e.get(HeroViewComp).fac !== team); -// return this.filterFrontRow(candidates, isEnemyTeam); -// } -// private selectAllyTargets(caster: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]): ecs.Entity[] { -// const casterView = caster.get(HeroViewComp); -// const team = casterView.fac; -// const candidates= ecs.query(ecs.allOf(HeroViewComp)).filter(e => e.get(HeroViewComp).fac === team); -// // 第二阶段:位置/血量等精细筛选 -// switch(config.TType) { -// case TType.Melee: -// return candidates.filter(e => e.get(HeroViewComp).type === 0); -// case TType.Ranged: -// return candidates.filter(e => e.get(HeroViewComp).type === 1); -// case TType.SupportClass: -// return candidates.filter(e => e.get(HeroViewComp).type === 2); -// case TType.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 pickRandomTarget(entities: ecs.Entity[], count: number): ecs.Entity[] { -// const shuffled = [...entities].sort(() => 0.5 - Math.random()); -// return shuffled.slice(0, count); -// } - - -// public clear_timer() { -// // console.log("clear_timer"); -// Object.values(this._timers).forEach(clearTimeout); -// } -// onDestroy() { -// Object.values(this._timers).forEach(clearTimeout); -// } - - -// /** 应用负面状态 */ -// private applyDebuff(target: ecs.Entity, config: typeof SkillSet[keyof typeof SkillSet]) { -// // 实现debuff逻辑... -// } - -// } - - - diff --git a/assets/script/game/skills/Skill.ts b/assets/script/game/skills/Skill.ts index 68ee7783..b4ab08f2 100644 --- a/assets/script/game/skills/Skill.ts +++ b/assets/script/game/skills/Skill.ts @@ -45,7 +45,7 @@ export class Skill extends ecs.Entity { } // 加载预制体 - const path = `game/skills/${config.sp_name}`; + const path = `game/skill/atk/${config.sp_name}`; const prefab:Prefab = oops.res.get(path, Prefab); if (!prefab) { console.error("[Skill] 预制体加载失败:", path); diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index 478c006f..98d5a235 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -22,7 +22,6 @@ const { ccclass, property } = _decorator; export class SkillCom extends CCComp { // 核心标识和配置 s_uuid:number = 0; - // 运行时状态(必须缓存的) is_destroy:boolean = false; startPos: Vec3 = v3(); // 起始位置 @@ -81,14 +80,9 @@ export class SkillCom extends CCComp { this.initializeSkillConfig(); if (!this.skillConfig) return; this.node.setPosition(this.startPos.x,this.startPos.y,0) - this.anim=this.node.getComponent(Animation) - this.on(GameEvent.MissionEnd, this.doDestroy, this); this.node.active = true; - //console.log("[SkillCom]:caster",this.caster) - - let collider = this.getComponent(Collider2D); if(collider) { collider.group = this.group;