From 7e36704e54e79559e962d66d1b58a8fb82d23de4 Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Tue, 12 Dec 2023 18:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/mode/CampGuardianMode.prefab | 15 +- .../prefab/battle/role/CampGuardianMode.meta | 9 + .../CampGuardianMode/GRoleCGCrystal.prefab | 824 ++++++++++++++++++ .../GRoleCGCrystal.prefab.meta | 13 + .../script/battle/base/fsm/CampGuardian.meta | 9 + .../script/battle/base/role/CampGuardian.meta | 9 + .../base/role/CampGuardian/GRoleCGCrystal.ts | 26 + .../role/CampGuardian/GRoleCGCrystal.ts.meta | 9 + .../script/battle/base/role/GRoleBase.ts | 2 +- .../script/battle/modes/GCampGuardianMode.ts | 60 +- 10 files changed, 961 insertions(+), 15 deletions(-) create mode 100644 JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode.meta create mode 100644 JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab create mode 100644 JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab.meta create mode 100644 JisolGameCocos/assets/script/battle/base/fsm/CampGuardian.meta create mode 100644 JisolGameCocos/assets/script/battle/base/role/CampGuardian.meta create mode 100644 JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts create mode 100644 JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts.meta diff --git a/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab b/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab index 5cb8b768..0e7f3052 100644 --- a/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab +++ b/JisolGameCocos/assets/resources/prefab/battle/mode/CampGuardianMode.prefab @@ -547,8 +547,6 @@ "__id__": 0 }, "fileId": "9bI7zPvJdGubwAAo2uT7KC", - "instance": null, - "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -668,7 +666,7 @@ "fileId": "36KI0wow1LqrcICgBTdo4H" }, { - "__type__": "31e6dKeQdRNfaJKs3+cDKq9", + "__type__": "3771cqnl8VJGLmDGh8TRCiD", "_name": "", "_objFlags": 0, "__editorExtras__": {}, @@ -679,18 +677,19 @@ "__prefab": { "__id__": 29 }, - "rolePrefab": { - "__uuid__": "e989c288-5957-41c1-953c-190622651f52", + "crystalPrefab": { + "__uuid__": "96ad3740-fce8-4333-9f8e-eb85f43bf6f8", "__expectedType__": "cc.Prefab" }, - "objects": { - "__id__": 22 + "petPrefab": { + "__uuid__": "e989c288-5957-41c1-953c-190622651f52", + "__expectedType__": "cc.Prefab" }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "75m4P6RWFEhq6MmD8wKppa" + "fileId": "1dMzeFmQtOcan/YyCgK161" }, { "__type__": "cc.PrefabInfo", diff --git a/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode.meta b/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode.meta new file mode 100644 index 00000000..ac9fb6c3 --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "55aa7ae3-6800-47a7-b160-de32d06a0102", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab b/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab new file mode 100644 index 00000000..14937c1c --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab @@ -0,0 +1,824 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "GRoleCGCrystal", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false + }, + { + "__type__": "cc.Node", + "_name": "GRoleCGCrystal", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 16 + } + ], + "_active": true, + "_components": [ + { + "__id__": 30 + }, + { + "__id__": 32 + }, + { + "__id__": 34 + }, + { + "__id__": 36 + } + ], + "_prefab": { + "__id__": 38 + }, + "_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.Node", + "_name": "blood", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_active": true, + "_components": [ + { + "__id__": 9 + }, + { + "__id__": 11 + }, + { + "__id__": 13 + } + ], + "_prefab": { + "__id__": 15 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -51.954, + "y": 126.253, + "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.Node", + "_name": "Bar", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 4 + }, + { + "__id__": 6 + } + ], + "_prefab": { + "__id__": 8 + }, + "_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__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 15 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f6mlvX+zpDQKQyTNI8m1ge" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 7 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 61, + "b": 61, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "24a704da-2867-446d-8d1a-5e920c75e09d@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "ab2/RZSBpHM6hxBpsZcelP" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "d6plfNQY5CgK2nsYLzhuGq", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 10 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 15 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7eKZQXr4dA9ZZ1pNU9m4Id" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 12 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "9fd900dd-221b-4f89-8f2c-fba34243c835@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "6dRnnmVKhM8KMkR+Ef0QZc" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 14 + }, + "_barSprite": { + "__id__": 6 + }, + "_mode": 0, + "_totalLength": 100, + "_progress": 1, + "_reverse": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "13jsaXw0ZN24wtPkmda7Fc" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "4duWBgdflEeJnCTVFxBgL5", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "energy", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 17 + } + ], + "_active": true, + "_components": [ + { + "__id__": 23 + }, + { + "__id__": 25 + }, + { + "__id__": 27 + } + ], + "_prefab": { + "__id__": 29 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -51.954, + "y": 118.227, + "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.Node", + "_name": "Bar", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 18 + }, + { + "__id__": 20 + } + ], + "_prefab": { + "__id__": 22 + }, + "_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__": 17 + }, + "_enabled": true, + "__prefab": { + "__id__": 19 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "33XDUgb7hE7Iae0ToFMuDl" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": { + "__id__": 21 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 78, + "g": 156, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "24a704da-2867-446d-8d1a-5e920c75e09d@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "978QNpG8RAu5dOq5L5q74y" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "86H6XFlX5NF7gBNm1o/YQY", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_enabled": true, + "__prefab": { + "__id__": 24 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2fv65eXxBBLY9sDM8+GdTw" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_enabled": true, + "__prefab": { + "__id__": 26 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "9fd900dd-221b-4f89-8f2c-fba34243c835@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "6eKAM0oQ5H1LcXpcqmeYoy" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_enabled": true, + "__prefab": { + "__id__": 28 + }, + "_barSprite": { + "__id__": 20 + }, + "_mode": 0, + "_totalLength": 100, + "_progress": 1, + "_reverse": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "96r31KcJFBA6JkO6JK9juG" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "eezHTmz/xEZ72deCl7tprY", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 31 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.077707 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "39OM3yMTpFCaO9LSQd5hDg" + }, + { + "__type__": "7bbd2ZLN+pAR5d5W2wmy3A0", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 33 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_skeletonData": null, + "defaultSkin": "", + "defaultAnimation": "", + "_premultipliedAlpha": false, + "_timeScale": 1, + "_preCacheMode": 0, + "_cacheMode": 0, + "_defaultCacheMode": 0, + "_sockets": [], + "_useTint": false, + "_debugMesh": false, + "_debugBones": false, + "_debugSlots": false, + "_enableBatch": true, + "loop": true, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "27Fx6O7FRLnbRD+LXrrqfA" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 35 + }, + "tag": 0, + "_group": 1, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 42.22925458281746 + }, + "_size": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "adZ/2FFS1AnqaNLGcoBV8b" + }, + { + "__type__": "bff72O33LZKkJqJ4iGnVr8f", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 37 + }, + "spine": { + "__id__": 32 + }, + "bloodVolume": { + "__id__": 13 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "3ef0+NIGBBHqfAmJGXBcrj" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "6cAOnSDYJJRop1AtoHgJjk", + "instance": null, + "targetOverrides": null + } +] \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab.meta b/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab.meta new file mode 100644 index 00000000..26ca8983 --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/battle/role/CampGuardianMode/GRoleCGCrystal.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.49", + "importer": "prefab", + "imported": true, + "uuid": "96ad3740-fce8-4333-9f8e-eb85f43bf6f8", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "GRoleCGCrystal" + } +} diff --git a/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian.meta b/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian.meta new file mode 100644 index 00000000..227e422d --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/fsm/CampGuardian.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "54542374-5643-4a8a-bc84-142a621621ed", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/role/CampGuardian.meta b/JisolGameCocos/assets/script/battle/base/role/CampGuardian.meta new file mode 100644 index 00000000..cfa51a69 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/role/CampGuardian.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "6d1e9fb6-4004-4dd9-b0fc-37c6ef6d490f", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts b/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts new file mode 100644 index 00000000..150c8fe6 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts @@ -0,0 +1,26 @@ +import { _decorator } from "cc"; +import GFSMDefault from "../../fsm/Default/GFSMDefault"; +import { GFSMDefaultAnim } from "../../fsm/Default/GFSMDefaultAnim"; +import { GFSMAnimBase } from "../../fsm/GFSMAnimBase"; +import GFSMBase from "../../fsm/GFSMBase"; +import GRoleBase from "../GRoleBase"; +import { ProgressBar } from "cc"; +const { property,ccclass } = _decorator; + +//阵营守护 水晶 +@ccclass('GRoleCGCrystal') +export default class GRoleCGCrystal extends GRoleBase<{}>{ + + @property(ProgressBar) + bloodVolume:ProgressBar; + + protected fsmCreate(): GFSMBase { + return new GFSMBase(); + } + protected fsmAnimCreate(): GFSMDefaultAnim { + return new GFSMDefaultAnim(this.spine); + } + +} + + diff --git a/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts.meta b/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts.meta new file mode 100644 index 00000000..836af714 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/base/role/CampGuardian/GRoleCGCrystal.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "bff723b7-dcb6-4a90-9a89-e221a756bf1f", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts index 8f486800..56d5b5cd 100644 --- a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts +++ b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts @@ -98,7 +98,7 @@ export default abstract class GRoleBase extends GObject{ } //初始化 - protected init(role:TB.TbGRole){ + public init(role:TB.TbGRole){ console.log("初始化宠物",!!this.spine,!!(app.battleRes.getRoleSpine(role.id))); this.spine.skeletonData = app.battleRes.getRoleSpine(role.id); } diff --git a/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts b/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts index fd1422c7..569d9f0a 100644 --- a/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts @@ -3,29 +3,77 @@ import GDefaultMode from "./default/GDefaultMode"; import { TB } from "../../../resources/config/data/schema"; import GRoleDefault from "../base/role/GRoleDefault"; import { _decorator } from "cc"; +import GBaseMode from "../GBaseMode"; +import { Prefab } from "cc"; +import { instantiate } from "cc"; +import GRoleCGCrystal from "../base/role/CampGuardian/GRoleCGCrystal"; +import { TD } from "../../App"; +import { GTowards } from "../base/GObject"; +import GRoleBase from "../base/role/GRoleBase"; const { ccclass, property } = _decorator; +//阵营守护 角色 +export enum GCampGuardianEnum{ + PLAYER, //玩家 + ENEMY, //敌人 +} + //阵营守护 //玩家派兵攻击对方阵营 游戏参考 @ccclass('GCampGuardianMode') -export default class GCampGuardianMode extends GDefaultMode<{},{}>{ +export default class GCampGuardianMode extends GBaseMode<{},{}>{ //玩家水晶位置 - playerPos: Vec2 = new Vec2(-400,0); + playerPos: Vec2 = new Vec2(-600,0); //敌方水晶位置 - enemyPos: Vec2 = new Vec2(400,0); + enemyPos: Vec2 = new Vec2(600,0); + //我方水晶 + + //敌方水晶 + + //水晶预制体 + @property(Prefab) + crystalPrefab: Prefab; + + //角色预制体 + @property(Prefab) + petPrefab: Prefab; + + //玩家宠物 + playerRoles: GRoleBase<{}>[] = []; + //敌方宠物 + enemyRoles: GRoleBase<{}>[] = []; onSyncInitSuccess(){ - + //生成水晶 + this.onGenCrystal(GCampGuardianEnum.PLAYER); + this.onGenCrystal(GCampGuardianEnum.ENEMY); } - + //生成水晶 + onGenCrystal(type:GCampGuardianEnum){ + + let crystalNode = instantiate(this.crystalPrefab); + let crystal = crystalNode.getComponent(GRoleCGCrystal); + crystal.init(TD.TbGRole.get(10005)); + + switch(type){ + case GCampGuardianEnum.PLAYER: + this.addGObject(crystal,this.playerPos) + break; + case GCampGuardianEnum.ENEMY: + crystal.setTowards(GTowards.LEFT) + this.addGObject(crystal,this.enemyPos) + break; + } + + } // //生成宠物 - // onGenRole(info:TB.TbGRole):GRoleDefault { + // onGenRole(type:GCampGuardianEnum,info:TB.TbGRole):GRoleDefault { // let tactical = this.getInfo(type).tactical; // let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);