From c8c3dde2e4318964b5a56139f82e6bef6bd458da Mon Sep 17 00:00:00 2001 From: walkpan Date: Fri, 13 Mar 2026 23:15:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(card):=20=E6=96=B0=E5=A2=9E=E5=8D=A1?= =?UTF-8?q?=E7=89=8C=E7=B3=BB=E7=BB=9F=E6=A0=B8=E5=BF=83=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8E=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 CardComp 组件用于卡牌视图展示 - 新增 CardSet 配置文件,包含卡牌类型、种类枚举和完整卡池配置 - 重构 HSkillComp 组件,优化技能调试面板布局和交互逻辑 - 更新 MissionCardComp 组件,移除旧卡牌类型依赖 - 调整 GameSet 配置文件,移除 CardType 和 CardKind 枚举 - 更新卡牌预制体结构,优化 UI 布局和组件绑定 - 新增特殊卡牌效果系统,支持抽英雄和重复使用等特殊能力 - 实现卡牌按权重抽取算法和卡池等级管理机制 --- assets/resources/gui/element/card.prefab | 589 +++++++------ assets/resources/gui/role_controller.prefab | 871 +++++++++---------- assets/script/game/common/config/CardSet.ts | 163 ++++ assets/script/game/common/config/GameSet.ts | 18 - assets/script/game/common/config/SkillSet.ts | 2 +- assets/script/game/map/CardComp.ts | 103 +++ assets/script/game/map/CardComp.ts.meta | 1 + assets/script/game/map/HSkillComp.ts | 198 ++++- assets/script/game/map/MissionCardComp.ts | 599 +------------ assets/script/game/map/MissionComp.ts | 2 +- 10 files changed, 1179 insertions(+), 1367 deletions(-) create mode 100644 assets/script/game/common/config/CardSet.ts create mode 100644 assets/script/game/map/CardComp.ts create mode 100644 assets/script/game/map/CardComp.ts.meta diff --git a/assets/resources/gui/element/card.prefab b/assets/resources/gui/element/card.prefab index 276150ad..b7677362 100644 --- a/assets/resources/gui/element/card.prefab +++ b/assets/resources/gui/element/card.prefab @@ -25,35 +25,35 @@ "__id__": 56 }, { - "__id__": 64 + "__id__": 72 }, { - "__id__": 70 + "__id__": 80 }, { - "__id__": 78 + "__id__": 94 }, { - "__id__": 92 + "__id__": 108 }, { - "__id__": 106 + "__id__": 114 }, { - "__id__": 112 - }, - { - "__id__": 118 + "__id__": 120 } ], "_active": true, "_components": [ { - "__id__": 136 + "__id__": 138 + }, + { + "__id__": 140 } ], "_prefab": { - "__id__": 138 + "__id__": 142 }, "_lpos": { "__type__": "cc.Vec3", @@ -1282,32 +1282,39 @@ }, { "__type__": "cc.Node", - "_name": "hp", + "_name": "Mask", "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 1 }, - "_children": [], - "_active": false, - "_components": [ + "_children": [ { "__id__": 57 + } + ], + "_active": true, + "_components": [ + { + "__id__": 63 }, { - "__id__": 59 + "__id__": 65 }, { - "__id__": 61 + "__id__": 67 + }, + { + "__id__": 69 } ], "_prefab": { - "__id__": 63 + "__id__": 71 }, "_lpos": { "__type__": "cc.Vec3", - "x": 71.5, - "y": -81, + "x": 0, + "y": 43.45, "z": 0 }, "_lrot": { @@ -1333,22 +1340,72 @@ }, "_id": "" }, + { + "__type__": "cc.Node", + "_name": "icon", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 56 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 58 + }, + { + "__id__": 60 + } + ], + "_prefab": { + "__id__": 62 + }, + "_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": 2.2, + "y": 2.2, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 56 + "__id__": 57 }, "_enabled": true, "__prefab": { - "__id__": 58 + "__id__": 59 }, "_contentSize": { "__type__": "cc.Size", - "width": 58, - "height": 50 + "width": 78, + "height": 78 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1359,7 +1416,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "echbIL321NULA+TdS2I5DY" + "fileId": "53i++BbrpGfogNtHdxhJgi" }, { "__type__": "cc.Sprite", @@ -1367,11 +1424,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 56 + "__id__": 57 }, "_enabled": true, "__prefab": { - "__id__": 60 + "__id__": 61 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1384,12 +1441,12 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@9e897", + "__uuid__": "031877cb-0f3d-4e92-bc5d-e492a0d95a08@98f14", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, "_fillType": 0, - "_sizeMode": 1, + "_sizeMode": 0, "_fillCenter": { "__type__": "cc.Vec2", "x": 0, @@ -1404,43 +1461,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "dcCbJghTZCN4vA233KHUGB" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 56 - }, - "_enabled": true, - "__prefab": { - "__id__": 62 - }, - "_alignFlags": 36, - "_target": null, - "_left": 0, - "_right": -10, - "_top": 0, - "_bottom": -5, - "_horizontalCenter": 0, - "_verticalCenter": 0, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 0, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "bdJn8UIuBKHKOYw4u/hUX6" + "fileId": "16gtGxN+pPdIA+0elXNMvr" }, { "__type__": "cc.PrefabInfo", @@ -1450,77 +1471,27 @@ "asset": { "__id__": 0 }, - "fileId": "b2Os5an2hNNbNgcmPe0MIj", + "fileId": "d7HZmy0BdBZLbXKCWMJwdg", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null }, - { - "__type__": "cc.Node", - "_name": "Gear_Shield_03_Blue", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": false, - "_components": [ - { - "__id__": 65 - }, - { - "__id__": 67 - } - ], - "_prefab": { - "__id__": 69 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -79.68899999999996, - "y": -82.37400000000002, - "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.UITransform", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 66 + "__id__": 64 }, "_contentSize": { "__type__": "cc.Size", - "width": 56, - "height": 56 + "width": 149, + "height": 117.1 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1531,15 +1502,37 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "b4OssxKxFNiaAHverAg/TM" + "fileId": "3axggZWXJNXJxmEWk7T7xL" }, { - "__type__": "cc.Sprite", + "__type__": "cc.Mask", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 56 + }, + "_enabled": true, + "__prefab": { + "__id__": 66 + }, + "_type": 0, + "_inverted": false, + "_segments": 64, + "_alphaThreshold": 0.1, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "3bY1Mb96tOQqgMjtiXPN9c" + }, + { + "__type__": "cc.Graphics", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 56 }, "_enabled": true, "__prefab": { @@ -1555,31 +1548,65 @@ "b": 255, "a": 255 }, - "_spriteFrame": { - "__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@ab734", - "__expectedType__": "cc.SpriteFrame" + "_lineWidth": 1, + "_strokeColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": { - "__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4", - "__expectedType__": "cc.SpriteAtlas" + "_lineJoin": 2, + "_lineCap": 0, + "_fillColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 0 }, + "_miterLimit": 10, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "97z7izLh9MzKfcCXKZp0XC" + "fileId": "b3OE+TXMVFyJ1ZGwFjQmJp" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 56 + }, + "_enabled": true, + "__prefab": { + "__id__": 70 + }, + "_alignFlags": 45, + "_target": null, + "_left": 13, + "_right": 13, + "_top": 13, + "_bottom": 99.9, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 120, + "_originalHeight": 120, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2cIPXUnexKK4JlcNtZjQLc" }, { "__type__": "cc.PrefabInfo", @@ -1589,7 +1616,7 @@ "asset": { "__id__": 0 }, - "fileId": "6e+yaK3T5OXIsQ83VWfHos", + "fileId": "134+c+R0VFKoBoQc1xmPUb", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -1605,23 +1632,23 @@ "_children": [], "_active": true, "_components": [ - { - "__id__": 71 - }, { "__id__": 73 }, { "__id__": 75 + }, + { + "__id__": 77 } ], "_prefab": { - "__id__": 77 + "__id__": 79 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0.10000000000000853, - "y": -63.5, + "x": 0, + "y": -58, "z": 0 }, "_lrot": { @@ -1633,8 +1660,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 0.3, - "y": 0.3, + "x": 0.5, + "y": 0.5, "z": 1 }, "_mobility": 0, @@ -1653,16 +1680,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 70 + "__id__": 72 }, "_enabled": true, "__prefab": { - "__id__": 72 + "__id__": 74 }, "_contentSize": { "__type__": "cc.Size", - "width": 509.33333333333337, - "height": 270 + "width": 302, + "height": 180 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1681,11 +1708,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 70 + "__id__": 72 }, "_enabled": true, "__prefab": { - "__id__": 74 + "__id__": 76 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1713,7 +1740,10 @@ "_fillRange": 0, "_isTrimmedMode": true, "_useGrayscale": false, - "_atlas": null, + "_atlas": { + "__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4", + "__expectedType__": "cc.SpriteAtlas" + }, "_id": "" }, { @@ -1726,18 +1756,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 70 + "__id__": 72 }, "_enabled": true, "__prefab": { - "__id__": 76 + "__id__": 78 }, "_alignFlags": 44, "_target": null, - "_left": 11.2, - "_right": 11, + "_left": 12, + "_right": 12, "_top": 0, - "_bottom": 11, + "_bottom": 12, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -1779,28 +1809,28 @@ }, "_children": [ { - "__id__": 79 + "__id__": 81 } ], "_active": true, "_components": [ - { - "__id__": 85 - }, { "__id__": 87 }, { "__id__": 89 + }, + { + "__id__": 91 } ], "_prefab": { - "__id__": 91 + "__id__": 93 }, "_lpos": { "__type__": "cc.Vec3", - "x": -59.995999999999995, - "y": -83.615, + "x": -58.5, + "y": -73.97800000000001, "z": 0 }, "_lrot": { @@ -1832,25 +1862,25 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 78 + "__id__": 80 }, "_children": [], "_active": true, "_components": [ { - "__id__": 80 + "__id__": 82 }, { - "__id__": 82 + "__id__": 84 } ], "_prefab": { - "__id__": 84 + "__id__": 86 }, "_lpos": { "__type__": "cc.Vec3", - "x": 13.923, - "y": 2, + "x": 12, + "y": 0, "z": 0 }, "_lrot": { @@ -1882,15 +1912,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 79 + "__id__": 81 }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 83 }, "_contentSize": { "__type__": "cc.Size", - "width": 44.04296875, + "width": 50, "height": 29.2 }, "_anchorPoint": { @@ -1910,11 +1940,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 79 + "__id__": 81 }, "_enabled": true, "__prefab": { - "__id__": 83 + "__id__": 85 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1926,14 +1956,14 @@ "b": 255, "a": 255 }, - "_string": "3333", + "_string": "9999", "_horizontalAlign": 0, "_verticalAlign": 1, - "_actualFontSize": 18, + "_actualFontSize": 19, "_fontSize": 18, "_fontFamily": "Arial", "_lineHeight": 20, - "_overflow": 0, + "_overflow": 2, "_enableWrapText": true, "_font": null, "_isSystemFontUsed": true, @@ -1991,11 +2021,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 88 }, "_contentSize": { "__type__": "cc.Size", @@ -2019,11 +2049,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 90 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2064,18 +2094,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 92 }, "_alignFlags": 12, "_target": null, - "_left": 16.504000000000005, + "_left": 18, "_right": 0, "_top": 0, - "_bottom": 20.885000000000005, + "_bottom": 30.522, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -2117,28 +2147,28 @@ }, "_children": [ { - "__id__": 93 + "__id__": 95 } ], "_active": true, "_components": [ - { - "__id__": 99 - }, { "__id__": 101 }, { "__id__": 103 + }, + { + "__id__": 105 } ], "_prefab": { - "__id__": 105 + "__id__": 107 }, "_lpos": { "__type__": "cc.Vec3", - "x": 16.795, - "y": -83.615, + "x": 12.397999999999996, + "y": -74.868, "z": 0 }, "_lrot": { @@ -2170,25 +2200,25 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 92 + "__id__": 94 }, "_children": [], "_active": true, "_components": [ { - "__id__": 94 + "__id__": 96 }, { - "__id__": 96 + "__id__": 98 } ], "_prefab": { - "__id__": 98 + "__id__": 100 }, "_lpos": { "__type__": "cc.Vec3", - "x": 13.923, - "y": 2, + "x": 12, + "y": 0, "z": 0 }, "_lrot": { @@ -2220,15 +2250,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 95 }, "_enabled": true, "__prefab": { - "__id__": 95 + "__id__": 97 }, "_contentSize": { "__type__": "cc.Size", - "width": 44.04296875, + "width": 50, "height": 29.2 }, "_anchorPoint": { @@ -2248,11 +2278,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 95 }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 99 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2264,14 +2294,14 @@ "b": 255, "a": 255 }, - "_string": "3333", + "_string": "9999", "_horizontalAlign": 0, "_verticalAlign": 1, - "_actualFontSize": 18, + "_actualFontSize": 19, "_fontSize": 18, "_fontFamily": "Arial", "_lineHeight": 20, - "_overflow": 0, + "_overflow": 2, "_enableWrapText": true, "_font": null, "_isSystemFontUsed": true, @@ -2329,11 +2359,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 92 + "__id__": 94 }, "_enabled": true, "__prefab": { - "__id__": 100 + "__id__": 102 }, "_contentSize": { "__type__": "cc.Size", @@ -2357,11 +2387,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 92 + "__id__": 94 }, "_enabled": true, "__prefab": { - "__id__": 102 + "__id__": 104 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2402,18 +2432,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 92 + "__id__": 94 }, "_enabled": true, "__prefab": { - "__id__": 104 + "__id__": 106 }, "_alignFlags": 12, "_target": null, - "_left": 93.295, + "_left": 88.898, "_right": 0, "_top": 0, - "_bottom": 20.885000000000005, + "_bottom": 29.632000000000005, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -2457,19 +2487,19 @@ "_active": true, "_components": [ { - "__id__": 107 + "__id__": 109 }, { - "__id__": 109 + "__id__": 111 } ], "_prefab": { - "__id__": 111 + "__id__": 113 }, "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -44.118, + "y": -35.362, "z": 0 }, "_lrot": { @@ -2501,11 +2531,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 106 + "__id__": 108 }, "_enabled": true, "__prefab": { - "__id__": 108 + "__id__": 110 }, "_contentSize": { "__type__": "cc.Size", @@ -2529,11 +2559,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 106 + "__id__": 108 }, "_enabled": true, "__prefab": { - "__id__": 110 + "__id__": 112 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2616,14 +2646,14 @@ "_active": true, "_components": [ { - "__id__": 113 + "__id__": 115 }, { - "__id__": 115 + "__id__": 117 } ], "_prefab": { - "__id__": 117 + "__id__": 119 }, "_lpos": { "__type__": "cc.Vec3", @@ -2660,11 +2690,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 112 + "__id__": 114 }, "_enabled": true, "__prefab": { - "__id__": 114 + "__id__": 116 }, "_contentSize": { "__type__": "cc.Size", @@ -2688,11 +2718,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 112 + "__id__": 114 }, "_enabled": true, "__prefab": { - "__id__": 116 + "__id__": 118 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2753,23 +2783,23 @@ }, "_children": [ { - "__id__": 119 + "__id__": 121 }, { - "__id__": 125 + "__id__": 127 } ], "_active": true, "_components": [ { - "__id__": 131 + "__id__": 133 }, { - "__id__": 133 + "__id__": 135 } ], "_prefab": { - "__id__": 135 + "__id__": 137 }, "_lpos": { "__type__": "cc.Vec3", @@ -2806,20 +2836,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 118 + "__id__": 120 }, "_children": [], "_active": true, "_components": [ { - "__id__": 120 + "__id__": 122 }, { - "__id__": 122 + "__id__": 124 } ], "_prefab": { - "__id__": 124 + "__id__": 126 }, "_lpos": { "__type__": "cc.Vec3", @@ -2856,11 +2886,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 121 }, "_enabled": true, "__prefab": { - "__id__": 121 + "__id__": 123 }, "_contentSize": { "__type__": "cc.Size", @@ -2884,11 +2914,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 121 }, "_enabled": true, "__prefab": { - "__id__": 123 + "__id__": 125 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2945,20 +2975,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 118 + "__id__": 120 }, "_children": [], "_active": true, "_components": [ { - "__id__": 126 + "__id__": 128 }, { - "__id__": 128 + "__id__": 130 } ], "_prefab": { - "__id__": 130 + "__id__": 132 }, "_lpos": { "__type__": "cc.Vec3", @@ -2995,11 +3025,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 125 + "__id__": 127 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 129 }, "_contentSize": { "__type__": "cc.Size", @@ -3023,11 +3053,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 125 + "__id__": 127 }, "_enabled": true, "__prefab": { - "__id__": 129 + "__id__": 131 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3104,11 +3134,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 132 + "__id__": 134 }, "_contentSize": { "__type__": "cc.Size", @@ -3132,11 +3162,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 120 }, "_enabled": true, "__prefab": { - "__id__": 134 + "__id__": 136 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3191,7 +3221,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 137 + "__id__": 139 }, "_contentSize": { "__type__": "cc.Size", @@ -3209,6 +3239,39 @@ "__type__": "cc.CompPrefabInfo", "fileId": "b6/HPesdpG8ZsWB4vg6xf2" }, + { + "__type__": "c4842RlEXFBsYWrZpIuY9c0", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 141 + }, + "Lock": null, + "unLock": null, + "ap_node": { + "__id__": 81 + }, + "hp_node": { + "__id__": 95 + }, + "name_node": { + "__id__": 108 + }, + "icon_node": null, + "cost_node": { + "__id__": 127 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "16+V8j5YNCq7Gvn0mNsD05" + }, { "__type__": "cc.PrefabInfo", "root": { diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index 0a36d33a..1138eaaf 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -22,32 +22,29 @@ "__id__": 2 }, { - "__id__": 409 + "__id__": 411 }, { - "__id__": 543 + "__id__": 547 }, { - "__id__": 552 - }, - { - "__id__": 560 + "__id__": 556 } ], "_active": true, "_components": [ + { + "__id__": 602 + }, + { + "__id__": 604 + }, { "__id__": 606 - }, - { - "__id__": 608 - }, - { - "__id__": 610 } ], "_prefab": { - "__id__": 612 + "__id__": 608 }, "_lpos": { "__type__": "cc.Vec3", @@ -116,10 +113,13 @@ }, { "__id__": 406 + }, + { + "__id__": 408 } ], "_prefab": { - "__id__": 408 + "__id__": 410 }, "_lpos": { "__type__": "cc.Vec3", @@ -8990,6 +8990,40 @@ "__type__": "cc.CompPrefabInfo", "fileId": "a1CK5uLEdCcbq4grojkxGU" }, + { + "__type__": "b3d6eSQ8ulPP79kPpPIytqU", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 409 + }, + "card1": { + "__id__": 343 + }, + "card2": { + "__id__": 355 + }, + "card3": { + "__id__": 367 + }, + "card4": { + "__id__": 379 + }, + "btnClose": null, + "Lock": null, + "unLock": null, + "noStop": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f9o2hpPnBPmqjcVCGnse3t" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -9013,29 +9047,29 @@ }, "_children": [ { - "__id__": 410 + "__id__": 412 }, { - "__id__": 426 + "__id__": 428 }, { - "__id__": 462 + "__id__": 464 } ], "_active": false, "_components": [ - { - "__id__": 536 - }, - { - "__id__": 538 - }, { "__id__": 540 + }, + { + "__id__": 542 + }, + { + "__id__": 544 } ], "_prefab": { - "__id__": 542 + "__id__": 546 }, "_lpos": { "__type__": "cc.Vec3", @@ -9072,27 +9106,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 409 + "__id__": 411 }, "_children": [ { - "__id__": 411 + "__id__": 413 } ], "_active": true, "_components": [ - { - "__id__": 419 - }, { "__id__": 421 }, { "__id__": 423 + }, + { + "__id__": 425 } ], "_prefab": { - "__id__": 425 + "__id__": 427 }, "_lpos": { "__type__": "cc.Vec3", @@ -9129,23 +9163,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 410 + "__id__": 412 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 412 - }, { "__id__": 414 }, { "__id__": 416 + }, + { + "__id__": 418 } ], "_prefab": { - "__id__": 418 + "__id__": 420 }, "_lpos": { "__type__": "cc.Vec3", @@ -9182,11 +9216,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 411 + "__id__": 413 }, "_enabled": true, "__prefab": { - "__id__": 413 + "__id__": 415 }, "_contentSize": { "__type__": "cc.Size", @@ -9210,11 +9244,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 411 + "__id__": 413 }, "_enabled": true, "__prefab": { - "__id__": 415 + "__id__": 417 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -9258,11 +9292,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 411 + "__id__": 413 }, "_enabled": true, "__prefab": { - "__id__": 417 + "__id__": 419 }, "_alignFlags": 45, "_target": null, @@ -9307,11 +9341,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 410 + "__id__": 412 }, "_enabled": true, "__prefab": { - "__id__": 420 + "__id__": 422 }, "_contentSize": { "__type__": "cc.Size", @@ -9335,11 +9369,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 410 + "__id__": 412 }, "_enabled": true, "__prefab": { - "__id__": 422 + "__id__": 424 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -9383,11 +9417,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 410 + "__id__": 412 }, "_enabled": true, "__prefab": { - "__id__": 424 + "__id__": 426 }, "_alignFlags": 45, "_target": null, @@ -9430,17 +9464,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 409 + "__id__": 411 }, "_prefab": { - "__id__": 427 + "__id__": 429 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 426 + "__id__": 428 }, "asset": { "__uuid__": "b111b7ce-9621-4519-b4b8-7a5a64c2e98e", @@ -9448,7 +9482,7 @@ }, "fileId": "24rlgXRJ9AHLGpMW+aYyEx", "instance": { - "__id__": 428 + "__id__": 430 }, "targetOverrides": null }, @@ -9461,9 +9495,6 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 429 - }, { "__id__": 431 }, @@ -9480,7 +9511,7 @@ "__id__": 439 }, { - "__id__": 442 + "__id__": 441 }, { "__id__": 444 @@ -9508,6 +9539,9 @@ }, { "__id__": 460 + }, + { + "__id__": 462 } ], "removedComponents": [] @@ -9515,7 +9549,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 430 + "__id__": 432 }, "propertyPath": [ "_name" @@ -9531,7 +9565,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 432 + "__id__": 434 }, "propertyPath": [ "_lpos" @@ -9552,7 +9586,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 434 + "__id__": 436 }, "propertyPath": [ "_lrot" @@ -9574,7 +9608,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 436 + "__id__": 438 }, "propertyPath": [ "_euler" @@ -9595,7 +9629,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 438 + "__id__": 440 }, "propertyPath": [ "clickEvents", @@ -9612,14 +9646,14 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 440 + "__id__": 442 }, "propertyPath": [ "clickEvents", "0" ], "value": { - "__id__": 441 + "__id__": 443 } }, { @@ -9631,7 +9665,7 @@ { "__type__": "cc.ClickEvent", "target": { - "__id__": 409 + "__id__": 411 }, "component": "", "_componentId": "11498TbVJpO6qmZ8m9k55Zx", @@ -9641,13 +9675,13 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 443 + "__id__": 445 }, "propertyPath": [ "_target" ], "value": { - "__id__": 426 + "__id__": 428 } }, { @@ -9659,7 +9693,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 445 + "__id__": 447 }, "propertyPath": [ "_bottom" @@ -9675,7 +9709,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 447 + "__id__": 449 }, "propertyPath": [ "_spriteFrame" @@ -9691,26 +9725,6 @@ "87x48JBkdLQ7whX1NTSH9o" ] }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 449 - }, - "propertyPath": [ - "_contentSize" - ], - "value": { - "__type__": "cc.Size", - "width": 300, - "height": 120 - } - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "b6/HPesdpG8ZsWB4vg6xf2" - ] - }, { "__type__": "CCPropertyOverrideInfo", "targetInfo": { @@ -9728,7 +9742,7 @@ { "__type__": "cc.TargetInfo", "localID": [ - "06atudk+BHR4nPzR3SmW4Z" + "b6/HPesdpG8ZsWB4vg6xf2" ] }, { @@ -9736,6 +9750,26 @@ "targetInfo": { "__id__": 453 }, + "propertyPath": [ + "_contentSize" + ], + "value": { + "__type__": "cc.Size", + "width": 300, + "height": 120 + } + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "06atudk+BHR4nPzR3SmW4Z" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 455 + }, "propertyPath": [ "_lineHeight" ], @@ -9750,7 +9784,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 455 + "__id__": 457 }, "propertyPath": [ "_contentSize" @@ -9770,7 +9804,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 457 + "__id__": 459 }, "propertyPath": [ "_fontSize" @@ -9786,7 +9820,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 459 + "__id__": 461 }, "propertyPath": [ "_actualFontSize" @@ -9802,7 +9836,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 461 + "__id__": 463 }, "propertyPath": [ "_outlineWidth" @@ -9821,33 +9855,33 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 409 + "__id__": 411 }, "_children": [ { - "__id__": 463 + "__id__": 465 }, { - "__id__": 485 + "__id__": 487 }, { - "__id__": 507 + "__id__": 511 } ], "_active": true, "_components": [ - { - "__id__": 529 - }, - { - "__id__": 531 - }, { "__id__": 533 + }, + { + "__id__": 535 + }, + { + "__id__": 537 } ], "_prefab": { - "__id__": 535 + "__id__": 539 }, "_lpos": { "__type__": "cc.Vec3", @@ -9884,27 +9918,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 462 + "__id__": 464 }, "_children": [ { - "__id__": 464 + "__id__": 466 }, { - "__id__": 470 + "__id__": 472 }, { - "__id__": 476 + "__id__": 478 } ], "_active": true, "_components": [ { - "__id__": 482 + "__id__": 484 } ], "_prefab": { - "__id__": 484 + "__id__": 486 }, "_lpos": { "__type__": "cc.Vec3", @@ -9941,20 +9975,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 463 + "__id__": 465 }, "_children": [], "_active": true, "_components": [ { - "__id__": 465 + "__id__": 467 }, { - "__id__": 467 + "__id__": 469 } ], "_prefab": { - "__id__": 469 + "__id__": 471 }, "_lpos": { "__type__": "cc.Vec3", @@ -9991,11 +10025,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 464 + "__id__": 466 }, "_enabled": true, "__prefab": { - "__id__": 466 + "__id__": 468 }, "_contentSize": { "__type__": "cc.Size", @@ -10019,11 +10053,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 464 + "__id__": 466 }, "_enabled": true, "__prefab": { - "__id__": 468 + "__id__": 470 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10077,20 +10111,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 463 + "__id__": 465 }, "_children": [], "_active": false, "_components": [ { - "__id__": 471 + "__id__": 473 }, { - "__id__": 473 + "__id__": 475 } ], "_prefab": { - "__id__": 475 + "__id__": 477 }, "_lpos": { "__type__": "cc.Vec3", @@ -10127,11 +10161,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 470 + "__id__": 472 }, "_enabled": true, "__prefab": { - "__id__": 472 + "__id__": 474 }, "_contentSize": { "__type__": "cc.Size", @@ -10155,11 +10189,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 470 + "__id__": 472 }, "_enabled": true, "__prefab": { - "__id__": 474 + "__id__": 476 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10213,20 +10247,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 463 + "__id__": 465 }, "_children": [], "_active": true, "_components": [ { - "__id__": 477 + "__id__": 479 }, { - "__id__": 479 + "__id__": 481 } ], "_prefab": { - "__id__": 481 + "__id__": 483 }, "_lpos": { "__type__": "cc.Vec3", @@ -10243,8 +10277,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1.3, - "y": 1.3, + "x": 0.7, + "y": 0.7, "z": 1 }, "_mobility": 0, @@ -10263,11 +10297,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 476 + "__id__": 478 }, "_enabled": true, "__prefab": { - "__id__": 478 + "__id__": 480 }, "_contentSize": { "__type__": "cc.Size", @@ -10291,11 +10325,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 476 + "__id__": 478 }, "_enabled": true, "__prefab": { - "__id__": 480 + "__id__": 482 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10349,11 +10383,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 463 + "__id__": 465 }, "_enabled": true, "__prefab": { - "__id__": 483 + "__id__": 485 }, "_contentSize": { "__type__": "cc.Size", @@ -10390,27 +10424,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 462 + "__id__": 464 }, "_children": [ { - "__id__": 486 + "__id__": 488 }, { - "__id__": 492 + "__id__": 494 }, { - "__id__": 498 + "__id__": 500 } ], "_active": true, "_components": [ { - "__id__": 504 + "__id__": 506 + }, + { + "__id__": 508 } ], "_prefab": { - "__id__": 506 + "__id__": 510 }, "_lpos": { "__type__": "cc.Vec3", @@ -10447,20 +10484,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 485 + "__id__": 487 }, "_children": [], "_active": true, "_components": [ { - "__id__": 487 + "__id__": 489 }, { - "__id__": 489 + "__id__": 491 } ], "_prefab": { - "__id__": 491 + "__id__": 493 }, "_lpos": { "__type__": "cc.Vec3", @@ -10497,11 +10534,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 486 + "__id__": 488 }, "_enabled": true, "__prefab": { - "__id__": 488 + "__id__": 490 }, "_contentSize": { "__type__": "cc.Size", @@ -10525,11 +10562,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 486 + "__id__": 488 }, "_enabled": true, "__prefab": { - "__id__": 490 + "__id__": 492 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10583,20 +10620,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 485 + "__id__": 487 }, "_children": [], "_active": true, "_components": [ { - "__id__": 493 + "__id__": 495 }, { - "__id__": 495 + "__id__": 497 } ], "_prefab": { - "__id__": 497 + "__id__": 499 }, "_lpos": { "__type__": "cc.Vec3", @@ -10633,11 +10670,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 492 + "__id__": 494 }, "_enabled": true, "__prefab": { - "__id__": 494 + "__id__": 496 }, "_contentSize": { "__type__": "cc.Size", @@ -10661,11 +10698,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 492 + "__id__": 494 }, "_enabled": true, "__prefab": { - "__id__": 496 + "__id__": 498 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10719,20 +10756,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 485 + "__id__": 487 }, "_children": [], "_active": true, "_components": [ { - "__id__": 499 + "__id__": 501 }, { - "__id__": 501 + "__id__": 503 } ], "_prefab": { - "__id__": 503 + "__id__": 505 }, "_lpos": { "__type__": "cc.Vec3", @@ -10749,8 +10786,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1.3, - "y": 1.3, + "x": 0.7, + "y": 0.7, "z": 1 }, "_mobility": 0, @@ -10769,11 +10806,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 498 + "__id__": 500 }, "_enabled": true, "__prefab": { - "__id__": 500 + "__id__": 502 }, "_contentSize": { "__type__": "cc.Size", @@ -10797,11 +10834,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 498 + "__id__": 500 }, "_enabled": true, "__prefab": { - "__id__": 502 + "__id__": 504 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10855,11 +10892,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 485 + "__id__": 487 }, "_enabled": true, "__prefab": { - "__id__": 505 + "__id__": 507 }, "_contentSize": { "__type__": "cc.Size", @@ -10877,6 +10914,62 @@ "__type__": "cc.CompPrefabInfo", "fileId": "a4Vy1zT+FB3YUAPoQBMIYV" }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 487 + }, + "_enabled": true, + "__prefab": { + "__id__": 509 + }, + "clickEvents": [], + "_interactable": true, + "_transition": 3, + "_normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": null, + "_hoverSprite": null, + "_pressedSprite": null, + "_disabledSprite": null, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d4a+E6PepIYpeu+tAO3nAi" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -10896,27 +10989,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 462 + "__id__": 464 }, "_children": [ { - "__id__": 508 + "__id__": 512 }, { - "__id__": 514 + "__id__": 518 }, { - "__id__": 520 + "__id__": 524 } ], "_active": true, "_components": [ { - "__id__": 526 + "__id__": 530 } ], "_prefab": { - "__id__": 528 + "__id__": 532 }, "_lpos": { "__type__": "cc.Vec3", @@ -10953,20 +11046,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 507 + "__id__": 511 }, "_children": [], "_active": true, "_components": [ { - "__id__": 509 + "__id__": 513 }, { - "__id__": 511 + "__id__": 515 } ], "_prefab": { - "__id__": 513 + "__id__": 517 }, "_lpos": { "__type__": "cc.Vec3", @@ -11003,11 +11096,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 508 + "__id__": 512 }, "_enabled": true, "__prefab": { - "__id__": 510 + "__id__": 514 }, "_contentSize": { "__type__": "cc.Size", @@ -11031,11 +11124,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 508 + "__id__": 512 }, "_enabled": true, "__prefab": { - "__id__": 512 + "__id__": 516 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11089,20 +11182,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 507 + "__id__": 511 }, "_children": [], "_active": false, "_components": [ { - "__id__": 515 + "__id__": 519 }, { - "__id__": 517 + "__id__": 521 } ], "_prefab": { - "__id__": 519 + "__id__": 523 }, "_lpos": { "__type__": "cc.Vec3", @@ -11139,11 +11232,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 514 + "__id__": 518 }, "_enabled": true, "__prefab": { - "__id__": 516 + "__id__": 520 }, "_contentSize": { "__type__": "cc.Size", @@ -11167,11 +11260,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 514 + "__id__": 518 }, "_enabled": true, "__prefab": { - "__id__": 518 + "__id__": 522 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11225,20 +11318,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 507 + "__id__": 511 }, "_children": [], "_active": true, "_components": [ { - "__id__": 521 + "__id__": 525 }, { - "__id__": 523 + "__id__": 527 } ], "_prefab": { - "__id__": 525 + "__id__": 529 }, "_lpos": { "__type__": "cc.Vec3", @@ -11275,11 +11368,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 520 + "__id__": 524 }, "_enabled": true, "__prefab": { - "__id__": 522 + "__id__": 526 }, "_contentSize": { "__type__": "cc.Size", @@ -11303,11 +11396,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 520 + "__id__": 524 }, "_enabled": true, "__prefab": { - "__id__": 524 + "__id__": 528 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11361,11 +11454,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 507 + "__id__": 511 }, "_enabled": true, "__prefab": { - "__id__": 527 + "__id__": 531 }, "_contentSize": { "__type__": "cc.Size", @@ -11402,11 +11495,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 462 + "__id__": 464 }, "_enabled": true, "__prefab": { - "__id__": 530 + "__id__": 534 }, "_contentSize": { "__type__": "cc.Size", @@ -11430,11 +11523,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 462 + "__id__": 464 }, "_enabled": true, "__prefab": { - "__id__": 532 + "__id__": 536 }, "_alignFlags": 44, "_target": null, @@ -11466,11 +11559,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 462 + "__id__": 464 }, "_enabled": true, "__prefab": { - "__id__": 534 + "__id__": 538 }, "_resizeMode": 1, "_layoutType": 1, @@ -11517,11 +11610,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 409 + "__id__": 411 }, "_enabled": true, "__prefab": { - "__id__": 537 + "__id__": 541 }, "_contentSize": { "__type__": "cc.Size", @@ -11545,11 +11638,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 409 + "__id__": 411 }, "_enabled": true, "__prefab": { - "__id__": 539 + "__id__": 543 }, "_alignFlags": 21, "_target": null, @@ -11581,11 +11674,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 409 + "__id__": 411 }, "_enabled": true, "__prefab": { - "__id__": 541 + "__id__": 545 }, "_id": "" }, @@ -11613,14 +11706,14 @@ "__id__": 1 }, "_prefab": { - "__id__": 544 + "__id__": 548 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 543 + "__id__": 547 }, "asset": { "__uuid__": "26bff847-cd29-48a5-bbfa-c3e2dbda688d", @@ -11628,7 +11721,7 @@ }, "fileId": "5a9CMsVQhKP5Y+UJfTKPbx", "instance": { - "__id__": 545 + "__id__": 549 }, "targetOverrides": null }, @@ -11641,20 +11734,20 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 546 - }, - { - "__id__": 548 - }, - { - "__id__": 549 - }, { "__id__": 550 }, { - "__id__": 551 + "__id__": 552 + }, + { + "__id__": 553 + }, + { + "__id__": 554 + }, + { + "__id__": 555 } ], "removedComponents": [] @@ -11662,7 +11755,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 547 + "__id__": 551 }, "propertyPath": [ "_name" @@ -11678,7 +11771,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 547 + "__id__": 551 }, "propertyPath": [ "_lpos" @@ -11693,7 +11786,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 547 + "__id__": 551 }, "propertyPath": [ "_lrot" @@ -11709,7 +11802,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 547 + "__id__": 551 }, "propertyPath": [ "_euler" @@ -11724,161 +11817,13 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 547 + "__id__": 551 }, "propertyPath": [ "_active" ], "value": false }, - { - "__type__": "cc.Node", - "_name": "heros", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 553 - }, - { - "__id__": 555 - }, - { - "__id__": 557 - } - ], - "_prefab": { - "__id__": 559 - }, - "_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.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 552 - }, - "_enabled": true, - "__prefab": { - "__id__": 554 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 720, - "height": 1280 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b8vVetBXhGSLtWapythsNV" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 552 - }, - "_enabled": true, - "__prefab": { - "__id__": 556 - }, - "_alignFlags": 45, - "_target": null, - "_left": 0, - "_right": 0, - "_top": 0, - "_bottom": 0, - "_horizontalCenter": 0, - "_verticalCenter": 0, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 100, - "_originalHeight": 100, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "1bjrc7Mm1FhaxD2BxE8ATI" - }, - { - "__type__": "34b93EodQVFeZHJqT6fEECt", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 552 - }, - "_enabled": true, - "__prefab": { - "__id__": 558 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "67WIbhAu1DVbMGPhRTEI8H" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "5bTPc9EWtItJLLe+mJi4PT", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, { "__type__": "cc.Node", "_name": "top", @@ -11889,23 +11834,23 @@ }, "_children": [ { - "__id__": 561 + "__id__": 557 } ], "_active": true, "_components": [ + { + "__id__": 595 + }, + { + "__id__": 597 + }, { "__id__": 599 - }, - { - "__id__": 601 - }, - { - "__id__": 603 } ], "_prefab": { - "__id__": 605 + "__id__": 601 }, "_lpos": { "__type__": "cc.Vec3", @@ -11942,30 +11887,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 560 + "__id__": 556 }, "_children": [ { - "__id__": 562 + "__id__": 558 } ], "_active": true, "_components": [ + { + "__id__": 586 + }, + { + "__id__": 588 + }, { "__id__": 590 }, { "__id__": 592 - }, - { - "__id__": 594 - }, - { - "__id__": 596 } ], "_prefab": { - "__id__": 598 + "__id__": 594 }, "_lpos": { "__type__": "cc.Vec3", @@ -12002,27 +11947,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 561 + "__id__": 557 }, "_children": [ { - "__id__": 563 + "__id__": 559 }, { - "__id__": 571 + "__id__": 567 }, { - "__id__": 577 + "__id__": 573 } ], "_active": true, "_components": [ { - "__id__": 587 + "__id__": 583 } ], "_prefab": { - "__id__": 589 + "__id__": 585 }, "_lpos": { "__type__": "cc.Vec3", @@ -12059,23 +12004,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 562 + "__id__": 558 }, "_children": [], "_active": true, "_components": [ + { + "__id__": 560 + }, + { + "__id__": 562 + }, { "__id__": 564 - }, - { - "__id__": 566 - }, - { - "__id__": 568 } ], "_prefab": { - "__id__": 570 + "__id__": 566 }, "_lpos": { "__type__": "cc.Vec3", @@ -12112,11 +12057,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 563 + "__id__": 559 }, "_enabled": true, "__prefab": { - "__id__": 565 + "__id__": 561 }, "_contentSize": { "__type__": "cc.Size", @@ -12140,11 +12085,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 563 + "__id__": 559 }, "_enabled": true, "__prefab": { - "__id__": 567 + "__id__": 563 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12188,11 +12133,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 563 + "__id__": 559 }, "_enabled": true, "__prefab": { - "__id__": 569 + "__id__": 565 }, "_alignFlags": 40, "_target": null, @@ -12237,20 +12182,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 562 + "__id__": 558 }, "_children": [], "_active": true, "_components": [ { - "__id__": 572 + "__id__": 568 }, { - "__id__": 574 + "__id__": 570 } ], "_prefab": { - "__id__": 576 + "__id__": 572 }, "_lpos": { "__type__": "cc.Vec3", @@ -12287,11 +12232,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 571 + "__id__": 567 }, "_enabled": true, "__prefab": { - "__id__": 573 + "__id__": 569 }, "_contentSize": { "__type__": "cc.Size", @@ -12315,11 +12260,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 571 + "__id__": 567 }, "_enabled": true, "__prefab": { - "__id__": 575 + "__id__": 571 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12376,26 +12321,26 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 562 + "__id__": 558 }, "_children": [], "_active": true, "_components": [ + { + "__id__": 574 + }, + { + "__id__": 576 + }, { "__id__": 578 }, { "__id__": 580 - }, - { - "__id__": 582 - }, - { - "__id__": 584 } ], "_prefab": { - "__id__": 586 + "__id__": 582 }, "_lpos": { "__type__": "cc.Vec3", @@ -12432,11 +12377,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 577 + "__id__": 573 }, "_enabled": true, "__prefab": { - "__id__": 579 + "__id__": 575 }, "_contentSize": { "__type__": "cc.Size", @@ -12460,11 +12405,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 577 + "__id__": 573 }, "_enabled": true, "__prefab": { - "__id__": 581 + "__id__": 577 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12528,11 +12473,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 577 + "__id__": 573 }, "_enabled": true, "__prefab": { - "__id__": 583 + "__id__": 579 }, "_alignFlags": 10, "_target": null, @@ -12564,11 +12509,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 577 + "__id__": 573 }, "_enabled": true, "__prefab": { - "__id__": 585 + "__id__": 581 }, "templateMode": true, "watchPath": "data.data.gold", @@ -12601,11 +12546,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 562 + "__id__": 558 }, "_enabled": true, "__prefab": { - "__id__": 588 + "__id__": 584 }, "_contentSize": { "__type__": "cc.Size", @@ -12642,11 +12587,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 561 + "__id__": 557 }, "_enabled": true, "__prefab": { - "__id__": 591 + "__id__": 587 }, "_contentSize": { "__type__": "cc.Size", @@ -12670,11 +12615,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 561 + "__id__": 557 }, "_enabled": true, "__prefab": { - "__id__": 593 + "__id__": 589 }, "_alignFlags": 8, "_target": null, @@ -12706,11 +12651,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 561 + "__id__": 557 }, "_enabled": true, "__prefab": { - "__id__": 595 + "__id__": 591 }, "_resizeMode": 0, "_layoutType": 1, @@ -12744,11 +12689,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 561 + "__id__": 557 }, "_enabled": true, "__prefab": { - "__id__": 597 + "__id__": 593 }, "_alignFlags": 40, "_target": null, @@ -12793,11 +12738,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 560 + "__id__": 556 }, "_enabled": true, "__prefab": { - "__id__": 600 + "__id__": 596 }, "_contentSize": { "__type__": "cc.Size", @@ -12821,11 +12766,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 560 + "__id__": 556 }, "_enabled": true, "__prefab": { - "__id__": 602 + "__id__": 598 }, "_alignFlags": 17, "_target": null, @@ -12857,11 +12802,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 560 + "__id__": 556 }, "_enabled": true, "__prefab": { - "__id__": 604 + "__id__": 600 }, "_id": "" }, @@ -12892,7 +12837,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 607 + "__id__": 603 }, "_contentSize": { "__type__": "cc.Size", @@ -12920,7 +12865,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 609 + "__id__": 605 }, "_alignFlags": 45, "_target": null, @@ -12956,7 +12901,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 611 + "__id__": 607 }, "debugMode": false, "_id": "" @@ -12978,10 +12923,10 @@ "targetOverrides": [], "nestedPrefabInstanceRoots": [ { - "__id__": 543 + "__id__": 547 }, { - "__id__": 426 + "__id__": 428 }, { "__id__": 379 diff --git a/assets/script/game/common/config/CardSet.ts b/assets/script/game/common/config/CardSet.ts new file mode 100644 index 00000000..cb16291e --- /dev/null +++ b/assets/script/game/common/config/CardSet.ts @@ -0,0 +1,163 @@ +/** 卡牌大类定义 */ +export enum CardType { + Hero = 1, + Skill = 2, + Potion = 3, + Special = 4, + Buff = 5, + Debuff = 6, +} + +/** 卡池等级定义 */ +export enum CardKind { + LV1 = 1, + LV2 = 2, + LV3 = 3, + LV4 = 4, + LV5 = 5, + LV6 = 6, +} + +/** 通用卡牌配置 */ +export interface CardConfig { + uuid: number + type: CardType + cost: number + weight: number + lv: CardKind +} + +/** 特殊卡效果类型 */ +export enum SpecialEffectType { + DrawHero = 1, + RepeatNextUse = 2, +} + +/** 特殊卡效果参数 */ +export interface SpecialCardEffect { + type: SpecialEffectType + drawHeroCount?: number + drawHeroLv?: CardKind + repeatNextUseTimes?: number +} + +/** 特殊卡完整配置 */ +export interface SpecialCardConfig extends CardConfig { + effect: SpecialCardEffect +} + +/** 卡池默认初始等级 */ +export const CARD_POOL_INIT_LEVEL = CardKind.LV1 +/** 卡池等级上限 */ +export const CARD_POOL_MAX_LEVEL = CardKind.LV6 + +/** 基础卡池(英雄、技能、Buff、Debuff) */ +export const CardPoolList: CardConfig[] = [ + { uuid: 5001, type: CardType.Hero, cost: 3, weight: 20, lv: 1 }, + { uuid: 5003, type: CardType.Hero, cost: 3, weight: 20, lv: 1 }, + { uuid: 5002, type: CardType.Hero, cost: 3, weight: 25, lv: 2 }, + { uuid: 5005, type: CardType.Hero, cost: 3, weight: 25, lv: 2 }, + { uuid: 5004, type: CardType.Hero, cost: 3, weight: 30, lv: 3 }, + { uuid: 5006, type: CardType.Hero, cost: 3, weight: 35, lv: 4 }, + { uuid: 5007, type: CardType.Hero, cost: 3, weight: 40, lv: 5 }, + + + + { uuid: 6001, type: CardType.Skill, cost: 1, weight: 20, lv: 1 }, + { uuid: 6002, type: CardType.Skill, cost: 1, weight: 20, lv: 1 }, + { uuid: 6003, type: CardType.Skill, cost: 2, weight: 25, lv: 2 }, + { uuid: 6100, type: CardType.Skill, cost: 4, weight: 25, lv: 2 }, + { uuid: 6004, type: CardType.Skill, cost: 3, weight: 30, lv: 3 }, + { uuid: 6102, type: CardType.Skill, cost: 4, weight: 35, lv: 4 }, + { uuid: 6101, type: CardType.Skill, cost: 5, weight: 40, lv: 5 }, + { uuid: 6103, type: CardType.Skill, cost: 6, weight: 45, lv: 6 }, + + { uuid: 10001, type: CardType.Buff, cost: 2, weight: 30, lv: 1 }, + { uuid: 10101, type: CardType.Buff, cost: 3, weight: 26, lv: 2 }, + { uuid: 10011, type: CardType.Buff, cost: 3, weight: 24, lv: 3 }, + { uuid: 10311, type: CardType.Buff, cost: 4, weight: 20, lv: 4 }, + { uuid: 10302, type: CardType.Buff, cost: 5, weight: 18, lv: 5 }, + + { uuid: 10201, type: CardType.Debuff, cost: 3, weight: 24, lv: 2 }, + { uuid: 10211, type: CardType.Debuff, cost: 4, weight: 20, lv: 3 }, + { uuid: 10312, type: CardType.Debuff, cost: 4, weight: 18, lv: 4 }, + { uuid: 20001, type: CardType.Debuff, cost: 5, weight: 14, lv: 5 }, + { uuid: 20011, type: CardType.Debuff, cost: 6, weight: 12, lv: 6 }, +] + +/** 特殊卡定义表 */ +export const SpecialCardList: Record = { + 7001: { + uuid: 7001, + type: CardType.Special, + cost: 6, + weight: 20, + lv: CardKind.LV3, + effect: { + type: SpecialEffectType.DrawHero, + drawHeroCount: 4, + drawHeroLv: CardKind.LV3, + }, + }, + 7002: { + uuid: 7002, + type: CardType.Special, + cost: 5, + weight: 20, + lv: CardKind.LV4, + effect: { + type: SpecialEffectType.RepeatNextUse, + repeatNextUseTimes: 1, + }, + }, +} + + + +/** 规范等级到合法区间 [LV1, LV6] */ +const clampCardLv = (lv: number): CardKind => { + const value = Math.floor(lv) + if (value < CARD_POOL_INIT_LEVEL) return CARD_POOL_INIT_LEVEL + if (value > CARD_POOL_MAX_LEVEL) return CARD_POOL_MAX_LEVEL + return value as CardKind +} + +/** 单次按权重抽取一张卡 */ +const weightedPick = (cards: CardConfig[]): CardConfig | null => { + if (cards.length === 0) return null + const totalWeight = cards.reduce((total, card) => total + card.weight, 0) + let random = Math.random() * totalWeight + for (const card of cards) { + random -= card.weight + if (random <= 0) return card + } + return cards[cards.length - 1] +} + +/** 连续抽取 count 张卡,允许重复 */ +const pickCards = (cards: CardConfig[], count: number): CardConfig[] => { + if (cards.length === 0 || count <= 0) return [] + const selected: CardConfig[] = [] + while (selected.length < count) { + const pick = weightedPick(cards) + if (!pick) break + selected.push(pick) + } + return selected +} + +/** 获取指定等级可出现的基础卡池(英雄+技能) */ +export const getCardPoolByLv = (lv: number): CardConfig[] => { + const cardLv = clampCardLv(lv) + return CardPoolList.filter(card => card.lv <= cardLv) +} + +/** 常规发牌:前 2 英雄 + 后 2 其他 */ +export const getCardsByLv = (lv: number): CardConfig[] => { + const pool = getCardPoolByLv(lv) + const heroPool = pool.filter(card => card.type === CardType.Hero) + const otherPool = pool.filter(card => card.type !== CardType.Hero) + const heroes = pickCards(heroPool, 2) + const others = pickCards(otherPool, 2) + return [...heroes, ...others] +} diff --git a/assets/script/game/common/config/GameSet.ts b/assets/script/game/common/config/GameSet.ts index f9a6b3f7..1e5960e4 100644 --- a/assets/script/game/common/config/GameSet.ts +++ b/assets/script/game/common/config/GameSet.ts @@ -22,24 +22,6 @@ export enum BoxSet { //攻击距离 } -export enum CardType { - Talent = 1, - Skill = 2, - Potion = 3, - Partner = 4, - Attr = 5, -} - -export enum CardKind { - Atk = 1, - Atted = 2, - Buff = 3, - Attr = 4, - Skill = 5, - Hp = 6, - Dead = 7, - Partner = 8, -} export enum FacSet { diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 21b087da..210fc7e7 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -232,7 +232,7 @@ export const SkillSet: Record = { ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],debuffs:[],info:"对前方目标造成150%攻击的伤害", }, - // ========== 基础buff ========== 6100-6199 + //============================= ====== 基础buff ====== ========================== 6100-6199 6100: { uuid:6100,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Self,TType:TType.LowestHP,act:"atk",DTType:DTType.single, ap:30,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, diff --git a/assets/script/game/map/CardComp.ts b/assets/script/game/map/CardComp.ts new file mode 100644 index 00000000..9affd11f --- /dev/null +++ b/assets/script/game/map/CardComp.ts @@ -0,0 +1,103 @@ +import { mLogger } from "../common/Logger"; +import { _decorator, Label, Node, tween, Vec3, Color, Sprite, Tween, SpriteAtlas, resources } 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 { GameEvent } from "../common/config/GameEvent"; +import { smc } from "../common/SingletonModuleComp"; +import { HeroAttrsComp } from "../hero/HeroAttrsComp"; +import { CardType } from "../common/config/CardSet"; + + + +const { ccclass, property } = _decorator; + +interface ICardEvent { + type?: CardType; + level?: number; +} + +/** 视图层对象 */ +@ccclass('CardComp') +@ecs.register('CardComp', false) +export class CardComp extends CCComp { + private debugMode: boolean = true; + /** 视图层逻辑代码分离演示 */ + @property(Node) + Lock: Node = null! + @property(Node) + unLock: Node = null! + @property(Node) + ap_node=null! + @property(Node) + hp_node=null! + @property(Node) + name_node=null! + @property(Node) + icon_node=null! + @property(Node) + cost_node=null! + + card_cost:number=0 + card_type:CardType=CardType.Hero + card_uuid:number=0 + // 是否处于锁定状态 + private isLocked: boolean = true; + // 图标图集缓存 + private uiconsAtlas: SpriteAtlas | null = null; + + onLoad() { + + + } + + onDestroy() { + + } + init(){ + this.onMissionStart(); + } + + /** 游戏开始初始化 */ + onMissionStart() { + + } + + /** 游戏结束清理 */ + onMissionEnd() { + + } + start() { + // 初始隐藏或显示逻辑 + this.node.active = false; + } + + updateCardInfo(card:Node, data: any){ + + } + + private updateIcon(node: Node, iconId: string) { + + } + + updateCardData(index: number, data: any) { + + } + + selectCard(e: any, index: string) { + + } + + + /** + * 关闭界面 + */ + close() { + + } + + /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ + reset() { + this.node.destroy(); + } +} diff --git a/assets/script/game/map/CardComp.ts.meta b/assets/script/game/map/CardComp.ts.meta new file mode 100644 index 00000000..fafb5ccd --- /dev/null +++ b/assets/script/game/map/CardComp.ts.meta @@ -0,0 +1 @@ +{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"c4842465-1171-41b1-85ab-66922e63d734","files":[],"subMetas":{},"userData":{}} diff --git a/assets/script/game/map/HSkillComp.ts b/assets/script/game/map/HSkillComp.ts index 5d817ae2..ee724d47 100644 --- a/assets/script/game/map/HSkillComp.ts +++ b/assets/script/game/map/HSkillComp.ts @@ -1,11 +1,10 @@ -import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3, ProgressBar, SpriteAtlas } from 'cc'; -import { oops } from 'db://oops-framework/core/Oops'; -import { getHeroList, getPreAttr, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet'; -import { smc } from '../common/SingletonModuleComp'; -import { GameEvent } from '../common/config/GameEvent'; +import { _decorator, instantiate, Label, Node, Prefab, UITransform, v3, Vec3 } from 'cc'; import { CCComp } from 'db://oops-framework/module/common/CCComp'; import { ecs } from 'db://oops-framework/libs/ecs/ECS'; import { SkillSet } from '../common/config/SkillSet'; +import { BoxSet, FacSet } from '../common/config/GameSet'; +import { smc } from '../common/SingletonModuleComp'; +import { Skill } from '../skill/Skill'; import { mLogger } from '../common/Logger'; const { ccclass, property } = _decorator; @@ -13,46 +12,185 @@ const { ccclass, property } = _decorator; @ecs.register('HSkillComp', false) export class HSkillComp extends CCComp { debugMode: boolean = false; + private readonly panelName: string = 'skill_debug_panel'; + private readonly panelWidth: number = 680; + private readonly panelHeight: number = 1180; + private readonly colCount: number = 4; + private readonly cellWidth: number = 160; + private readonly cellHeight: number = 68; + private readonly startX: number = -240; + private readonly startY: number = 560; + @property(Prefab) + btnPrefab: Prefab | null = null; - h_uuid:number=0 - private uiconsAtlas: SpriteAtlas | null = null; - + private panelNode: Node | null = null; + private buttonNodes: Node[] = []; + private mockCasterNode: Node | null = null; + private mockCasterView: any = null; + private currentSkill: Skill | null = null; protected onLoad(): void { + this.ensurePanel(); } - start() { - + this.renderSkillButtons(); } - start_test(){ - this.node.active=true - this.node.parent.getChildByName("mission_home").active=false + start_test() { + this.node.active = true; + const home = this.node.parent?.getChildByName('mission_home'); + if (home) { + home.active = false; + } + this.renderSkillButtons(); } - end_test(){ - this.node.parent.getChildByName("mission_home").active=true - this.node.active=false + end_test() { + const home = this.node.parent?.getChildByName('mission_home'); + if (home) { + home.active = true; + } + this.node.active = false; } - update(deltaTime: number) { - - } - update_data(uuid:number){ - + update_data(uuid: number) { + this.renderSkillButtons(); } - load_hui(uuid:number){ - var path = "game/gui/hui"; - var prefab: Prefab = oops.res.get(path, Prefab)!; - var node = instantiate(prefab); - // 将节点添加到父节点下 - this.node.addChild(node); - // 设置节点位置 + private ensurePanel() { + let panel = this.node.getChildByName(this.panelName); + if (!panel) { + panel = new Node(this.panelName); + panel.parent = this.node; + const transform = panel.addComponent(UITransform); + transform.setContentSize(this.panelWidth, this.panelHeight); + panel.setPosition(0, 640, 0); + } + this.panelNode = panel; + } + + private renderSkillButtons() { + this.ensurePanel(); + const prefab = this.getBtnPrefab(); + if (!prefab || !this.panelNode || !this.panelNode.isValid) { + return; + } + this.clearButtons(); + const skillIds = Object.keys(SkillSet).map(Number).sort((a, b) => a - b); + skillIds.forEach((skillId, index) => { + const btnNode = instantiate(prefab); + btnNode.parent = this.panelNode; + const row = Math.floor(index / this.colCount); + const col = index % this.colCount; + btnNode.setPosition( + this.startX + col * this.cellWidth, + this.startY - row * this.cellHeight, + 0 + ); + const label = btnNode.getChildByName('Label')?.getComponent(Label); + if (label) { + const conf = SkillSet[skillId]; + label.string = `${skillId} ${conf?.name ?? ''}`; + } + btnNode.on(Node.EventType.TOUCH_END, () => this.playDebugSkill(skillId), this); + this.buttonNodes.push(btnNode); + }); + } + + private clearButtons() { + this.buttonNodes.forEach(node => { + if (!node || !node.isValid) { + return; + } + node.off(Node.EventType.TOUCH_END); + node.destroy(); + }); + this.buttonNodes.length = 0; + } + + private getBtnPrefab(): Prefab | null { + if (this.btnPrefab) { + return this.btnPrefab; + } + mLogger.error(this.debugMode, 'HSkillComp', '[HSkillComp] 未绑定 Btn 预制体,请在编辑器中设置 btnPrefab'); + return null; + } + + private getSkillParent(): Node { + const layer = smc.map?.MapView?.scene?.entityLayer?.node?.getChildByName('SKILL'); + if (layer && layer.isValid) { + return layer; + } + return this.node; + } + + private ensureMockCaster(parent: Node, startPos: Vec3): any { + if (!this.mockCasterNode || !this.mockCasterNode.isValid) { + this.mockCasterNode = new Node('debug_caster'); + this.mockCasterNode.parent = parent; + this.mockCasterNode.setScale(v3(1, 1, 1)); + this.mockCasterNode.active = false; + } else if (this.mockCasterNode.parent !== parent) { + this.mockCasterNode.parent = parent; + } + this.mockCasterNode.setPosition(startPos); + const mockAttrs = { + hero_name: '技能调试器', + ap: 100, + critical: 0, + critical_dmg: 50, + freeze_chance: 0, + stun_chance: 0, + back_chance: 0, + slow_chance: 0, + puncture: 0, + puncture_dmg: 0, + wfuny: 0, + fac: FacSet.HERO + }; + const mockEntity = { + eid: -10086, + get: () => mockAttrs + }; + this.mockCasterView = { + node: this.mockCasterNode, + box_group: BoxSet.HERO, + ent: mockEntity + }; + return this.mockCasterView; + } + + private playDebugSkill(skillId: number) { + const conf = SkillSet[skillId]; + if (!conf) { + return; + } + this.destroyCurrentSkill(); + const parent = this.getSkillParent(); + const startPos = v3(-260, -40, 0); + const targetPos = v3(260, -40, 0); + const caster = this.ensureMockCaster(parent, startPos); + const skill = ecs.getEntity(Skill); + skill.load(startPos.clone(), parent, skillId, targetPos, caster, 0); + this.currentSkill = skill; + } + + private destroyCurrentSkill() { + if (!this.currentSkill) { + return; + } + this.currentSkill.destroy(); + this.currentSkill = null; } reset() { - this.node.destroy() + this.destroyCurrentSkill(); + this.clearButtons(); + if (this.mockCasterNode && this.mockCasterNode.isValid) { + this.mockCasterNode.destroy(); + this.mockCasterNode = null; + } + this.node.destroy(); } -} \ No newline at end of file +} diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 4adef92d..9f4f5817 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -5,8 +5,8 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { GameEvent } from "../common/config/GameEvent"; import { smc } from "../common/SingletonModuleComp"; -import { CardType, FightSet, CardKind } from "../common/config/GameSet"; import { HeroAttrsComp } from "../hero/HeroAttrsComp"; +import { CardType } from "../common/config/CardSet"; @@ -32,61 +32,20 @@ export class MissionCardComp extends CCComp { @property(Node) card4:Node = null! - @property(Node) - btnClose: Node = null! - - @property(Node) - Lock: Node = null! - @property(Node) - unLock: Node = null! - @property(Node) - noStop: Node = null! - // card1_data: ICardInfo = null! // card2_data: ICardInfo = null! // card3_data: ICardInfo = null! // card4_data: ICardInfo = null! - // 当前卡片类型 (用于特殊获取模式) - curCardType: CardType | null = null; - - // 是否处于锁定状态 - private isLocked: boolean = true; - // 是否永久解锁(本局) - private isAdUnlocked: boolean = false; - - // 图标图集缓存 + private uiconsAtlas: SpriteAtlas | null = null; onLoad() { - if (this.btnClose) { - this.btnClose.on(Node.EventType.TOUCH_END, this.onGiveUp, this); - } - - oops.message.on(GameEvent.TalentSelect, this.onTalentSelect, this); - oops.message.on(GameEvent.AttrSelect, this.onAttrSelect, this); - oops.message.on(GameEvent.HeroSkillSelect, this.onHeroSkillSelect, this); - oops.message.on(GameEvent.ShopOpen, this.onShopOpen, this); - oops.message.on(GameEvent.MissionStart, this.onMissionStart, this); - oops.message.on(GameEvent.MissionEnd, this.onMissionEnd, this); - oops.message.on(GameEvent.ToCallFriend, this.onCallFriend, this); - + } onDestroy() { - if (this.btnClose) { - this.btnClose.off(Node.EventType.TOUCH_END, this.onGiveUp, this); - } - - oops.message.off(GameEvent.TalentSelect, this.onTalentSelect, this); - oops.message.off(GameEvent.AttrSelect, this.onAttrSelect, this); - oops.message.off(GameEvent.HeroSkillSelect, this.onHeroSkillSelect, this); - oops.message.off(GameEvent.ShopOpen, this.onShopOpen, this); - oops.message.off(GameEvent.MissionStart, this.onMissionStart, this); - oops.message.off(GameEvent.MissionEnd, this.onMissionEnd, this); - oops.message.off(GameEvent.ToCallFriend, this.onCallFriend, this); - - this.ent.destroy(); + } init(){ this.onMissionStart(); @@ -94,569 +53,27 @@ export class MissionCardComp extends CCComp { /** 游戏开始初始化 */ onMissionStart() { - this.isLocked = true; - this.isAdUnlocked = false; - this.noStop.active = false; - if (this.Lock) this.Lock.active = false; // 初始不显示,等待 showCardType - if(this.unLock) this.unLock.active=false - this.eventQueue = []; + } /** 游戏结束清理 */ onMissionEnd() { - this.eventQueue = []; - this.node.active = false; - this.hasSelected = false; - - // 停止所有卡片动画 - const cards = [this.card1, this.card2, this.card3, this.card4]; - cards.forEach(card => { - if (card) { - Tween.stopAllByTarget(card); - const selected = card.getChildByName("selected"); - if (selected) Tween.stopAllByTarget(selected); - } - }); + } start() { - // 初始隐藏或显示逻辑 - this.node.active = false; - this.resetCardStates(); + } private resetCardStates() { - const cards = [this.card1, this.card2, this.card3, this.card4]; - cards.forEach(card => { - if (card) { - const selected = card.getChildByName("selected"); - if (selected) selected.active = false; - // 恢复缩放和颜色 - card.setScale(1, 1, 1); - const sprite = card.getComponent(Sprite); - if (sprite) sprite.color = new Color(255, 255, 255); - } - }); - } - - // 是否已经选择了天赋 - private hasSelected: boolean = false; - - // 事件队列 - private eventQueue: ICardEvent[] = []; - - private onShopOpen(event: string, args: any) { - this.eventQueue.push({ type: CardType.Potion }); - this.checkQueue(); - } - - private onAttrSelect(event: string, args: any) { - this.eventQueue.push({ type: CardType.Attr }); - this.checkQueue(); - } - - private onTalentSelect(event: string, args: any) { - this.eventQueue.push({ type: CardType.Talent }); - this.checkQueue(); - } - - private onHeroSkillSelect(event: string, args: any) { - this.eventQueue.push({ type: CardType.Skill }); - this.checkQueue(); - } - - private onCallFriend(event: string, args: any) { - this.eventQueue.push({ type: CardType.Partner }); - this.checkQueue(); - } - - - - private checkQueue() { - if (this.node.active) return; - if (this.eventQueue.length === 0) return; - - const event = this.eventQueue.shift(); - if (event) { - if (event.type !== undefined) { - this.showCardType(event.type); - } - } - } - - /** - * 显示指定类型的卡牌(特殊获取模式) - */ - private showCardType(type: CardType) { - this.curCardType = type; - // 获取当前英雄等级作为参考,或者默认1级 - const level = smc.vmdata.hero.lv || 1; - this.fetchCards(level, type); - this.openUI(); - } - - private openUI() { - this.node.active = true; - this.hasSelected = false; - - // 根据锁定状态显示 Lock 节点 (仅在特殊模式下可能需要锁定?或者统一逻辑) - // 原逻辑:Lock.active = this.isLocked - if (this.Lock) { - this.Lock.active = this.isLocked; - } - - // 显示 noStop 节点 - if (this.noStop) { - this.noStop.active = true; - this.checkNoStop() - } - // 如果没有开启 noStop,则暂停怪物行动 - if (!smc.data.noStop) { - smc.mission.stop_mon_action = true; - } - - this.resetCardStates(); - this.playShowAnimation(); } - checkNoStop(){ - this.noStop.getChildByName("no").active=!smc.data.noStop - - // 更新暂停状态 - if (this.node.active) { - smc.mission.stop_mon_action = !smc.data.noStop; - } - } - switchNoStop(){ - smc.data.noStop=!smc.data.noStop - this.checkNoStop() - } - private playShowAnimation() { - const cards = [this.card1, this.card2, this.card3, this.card4]; - cards.forEach((card, index) => { - if (card) { - card.setScale(Vec3.ZERO); - tween(card) - .delay(index * 0.1) - .to(0.4, { scale: new Vec3(1, 1, 1) }, { easing: 'backOut' }) - .start(); - } - }); - } - - /** - * 专门的获取卡牌方法 - * @param level 等级 - * @param forcedType 强制类型 (可选) - */ - fetchCards(level: number, forcedType?: CardType){ - // 获取主角已有的属性倾向 (已拥有的永久属性Buff) - - - // 使用 CardSet 的 getCardOptions 获取卡牌 - // 这里我们要获取 4 张卡牌 - // const options = getCardOptions(level, 4, [], forcedType, preferredAttrs); - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] 获取到的卡牌选项: ${JSON.stringify(options)}`); - // // 更新卡片数据 - // if (options.length > 0) this.updateCardData(1, options[0]); - // if (options.length > 1) this.updateCardData(2, options[1]); - // if (options.length > 2) this.updateCardData(3, options[2]); - // if (options.length > 3) this.updateCardData(4, options[3]); - - // // 如果获取不足4张,隐藏多余的卡片节点 (UI可能需要处理空数据) - // if (options.length < 4 && this.card4) this.card4.active = false; - // if (options.length < 3 && this.card3) this.card3.active = false; - // if (options.length < 2 && this.card2) this.card2.active = false; - // if (options.length < 1 && this.card1) this.card1.active = false; - } - - updateCardInfo(card:Node, data: any){ - if(!card) return - card.active = true; - // 隐藏选中状态 - const selected = card.getChildByName("selected"); - if(selected) selected.active = false; - - let name = card.getChildByName("name") - if(name){ - name.getComponent(Label)!.string = data.name - } - let info = card.getChildByName("info")?.getChildByName("Label") - if(info){ - // ICardInfo 已经标准化了 desc,直接使用 - info.getComponent(Label)!.string = data.desc || ""; - } - - // 先隐藏所有类型标识 - const typeNodes = ["Atk", "Atked", "Buff", "Attr", "Skill", "Hp", "Dead", "Partner"]; - - // 1. 处理 card 直接子节点 - typeNodes.forEach(nodeName => { - const node = card.getChildByName(nodeName); - if (node) node.active = false; - }); - - // 2. 处理 card/type 下的子节点 - const typeContainer = card.getChildByName("type"); - if (typeContainer) { - typeNodes.forEach(nodeName => { - const node = typeContainer.getChildByName(nodeName); - if (node) node.active = false; - }); - } - - // 根据 kind 激活对应节点 - let activeNodeName = ""; - switch (data.kind) { - case CardKind.Atk: - activeNodeName = "Atk"; - break; - case CardKind.Atted: - activeNodeName = "Atked"; - break; - case CardKind.Buff: - activeNodeName = "Buff"; - break; - case CardKind.Attr: - activeNodeName = "Attr"; - break; - case CardKind.Skill: - activeNodeName = "Skill"; - break; - case CardKind.Hp: - activeNodeName = "Hp"; - break; - case CardKind.Dead: - activeNodeName = "Dead"; - break; - case CardKind.Partner: - activeNodeName = "Partner"; - break; - } - - if (activeNodeName) { - // 激活 card 下的节点 - const activeNode = card.getChildByName(activeNodeName); - if (activeNode) activeNode.active = true; - - // 激活 card/type 下的节点 - if (typeContainer) { - const activeTypeNode = typeContainer.getChildByName(activeNodeName); - if (activeTypeNode) activeTypeNode.active = true; - } - } - - // 更新图标 (如果存在 icon 节点) - // 注意:根据 Prefab 分析,icon 可能在 card/Mask/icon 路径下,也可能在各个分类节点下 - // 这里尝试统一查找 icon 节点 - let iconNode: Node | null = null; - - // 1. 尝试查找通用的 mask/icon (根据之前 card.prefab 分析,有个 Mask/icon 节点) - const maskNode = card.getChildByName("Mask"); - if (maskNode) { - iconNode = maskNode.getChildByName("icon"); - } - - if (iconNode && data.icon) { - this.updateIcon(iconNode, data.icon); - } - } - - private updateIcon(node: Node, iconId: string) { - if (!node || !iconId) return; - - const sprite = node.getComponent(Sprite); - if (!sprite) return; - - if (this.uiconsAtlas) { - const frame = this.uiconsAtlas.getSpriteFrame(iconId); - if (frame) { - sprite.spriteFrame = frame; - } - } else { - // 加载图集 - resources.load("gui/uicons", SpriteAtlas, (err, atlas) => { - if (err) { - mLogger.error(this.debugMode, 'MissionCard', "[MissionCardComp] Failed to load uicons atlas", err); - return; - } - this.uiconsAtlas = atlas; - const frame = atlas.getSpriteFrame(iconId); - if (frame) { - sprite.spriteFrame = frame; - } - }); - } - } - - updateCardData(index: number, data: any) { - // 使用动态属性访问 - (this as any)[`card${index}_data`] = data; - this.updateCardInfo((this as any)[`card${index}`], data); - } - - selectCard(e: any, index: string) { - mLogger.log(this.debugMode, 'MissionCard', "selectCard", index) - let _index = parseInt(index); - // 如果已经选择过,则不再处理 - if (this.hasSelected) return; - - // 动态获取数据和节点 - let selectedData: any; - let selectedCardNode: Node | null = (this as any)[`card${_index}`]; - - if (selectedData && selectedCardNode) { - this.hasSelected = true; - mLogger.log(this.debugMode, 'MissionCard', "选择卡片:", selectedData.name, "类型:", selectedData.type); - - // 未选中的卡片缩小 - const cards = [this.card1, this.card2, this.card3, this.card4]; - cards.forEach(card => { - if (card && card !== selectedCardNode) { - tween(card).to(0.2, { scale: Vec3.ZERO }).start(); - } - }); - - // 显示当前选中的 selected 节点 - const selected = selectedCardNode.getChildByName("selected"); - if(selected) { - selected.active = true; - selected.setScale(Vec3.ZERO); - tween(selected).to(0.2, { scale: new Vec3(1, 1, 1) }, { easing: 'backOut' }).start(); - } - - // 选中卡片动效后触发逻辑 - tween(selectedCardNode) - .to(0.1, { scale: new Vec3(1.1, 1.1, 1.1) }) - .to(0.1, { scale: new Vec3(1, 1, 1) }) - .delay(0.5) - // .call(() => { - // // @ts-ignore - // let role = entities.length > 0 ? entities[0] : null; - - // if (!role) { - // } else { - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] 成功定位主角实体: ${role.eid}`); - // } - - // if (role) { - // switch (selectedData.type) { - // case CardType.Talent: - // smc.addTalentRecord(selectedData.uuid); - // // 直接调用 TalComp 添加天赋 - // const talComp = role.get(TalComp); - // if (talComp) { - // const beforeCount = Object.keys(talComp.Tals).length; - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Talent Before: Count=${beforeCount}, Tals=${JSON.stringify(talComp.Tals)}`); - // talComp.addTal(selectedData.uuid); - // const afterCount = Object.keys(talComp.Tals).length; - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Talent After: Count=${afterCount}, Added=${selectedData.uuid}, Tals=${JSON.stringify(talComp.Tals)}`); - // } - // break; - // case CardType.Skill: - // smc.addSkillRecord(selectedData.uuid); - // // 直接调用 HeroSkillsComp 添加技能 - // const skillComp = role.get(HeroSkillsComp); - // if (skillComp) { - // const beforeCount = Object.keys(skillComp.skills).length; - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Skill Before: Count=${beforeCount}, Skills=${JSON.stringify(skillComp.skills)}`); - // skillComp.addSkill(selectedData.uuid); - // const afterCount = Object.keys(skillComp.skills).length; - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Skill After: Count=${afterCount}, Added=${selectedData.uuid}, Skills=${JSON.stringify(skillComp.skills)}`); - // } - // break; - // case CardType.Partner: - // // 伙伴是召唤新实体,依然适合用事件,或者直接调用 summon 方法 - // oops.message.dispatchEvent(GameEvent.CallFriend, { uuid: selectedData.uuid }); - // break; - // case CardType.Potion: - // // 药水直接作用于 HeroAttrsComp - // const attrsComp = role.get(HeroAttrsComp); - // if (attrsComp) { - // const potion = PotionCards[selectedData.uuid]; - // if (potion) { - // const beforeVal = attrsComp.Attrs[potion.attr] || 0; - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Potion Before: Attr[${potion.attr}]=${beforeVal}, Attrs=${JSON.stringify(attrsComp.Attrs)}`); - - // const buffConf: BuffConf = { - // buff: potion.attr, - // value: potion.value, - // BType: BType.RATIO, - // time: potion.duration, - // chance: 1, - // }; - // attrsComp.addBuff(buffConf); - // smc.updateHeroInfo(attrsComp); - - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Potion Applied: ${potion.desc}, Value=${potion.value}, Attrs=${JSON.stringify(attrsComp.Attrs)}`); - // oops.gui.toast(potion.desc); - // } - // } - // break; - // case CardType.Attr: - // // 属性卡:使用 addBuff 添加永久属性加成 - // const attrCard = AttrCards[selectedData.uuid]; - // if (attrCard) { - // const attrsComp = role.get(HeroAttrsComp); - // if (attrsComp) { - // // 记录变更前状态 - // const roleBefore = attrsComp.Attrs[attrCard.attr] || 0; - - // // 根据属性类型决定 Buff 类型 - // // 如果属性本身是 RATIO 型(如暴击率),AttrCards 中的值(如2)应该作为 VALUE 添加(因为 recalculateSingleAttr 会把 VALUE 和 RATIO 相加) - // // 但如果属性本身是 VALUE 型(如攻击力),AttrCards 中的值是直接加数值,也应该作为 VALUE 添加 - // // 结论:无论属性类型如何,AttrCards 中的配置都是"增加的点数",所以统一使用 BType.VALUE - // // 修正:虽然 AttrsType 定义了属性本身的类型,但在 addBuff 中,BType.VALUE 表示"加法叠加",BType.RATIO 表示"乘法叠加" - // // 对于数值型属性(如攻击力):BType.VALUE 是 +10,BType.RATIO 是 +10% - // // 对于百分比型属性(如暴击率):BType.VALUE 是 +2(%),BType.RATIO 是 +2%(即 *1.02,通常不这么用) - // // 所以,AttrCards 配置的值应当被视为"绝对值增量",对应 BType.VALUE - - // // 构造永久 Buff (time: 0) - // const buffConf: BuffConf = { - // buff: attrCard.attr, - // value: attrCard.value, - // BType: BType.RATIO, // 始终使用 VALUE 类型,代表数值/点数叠加 - // time: 0, - // chance: 1, - // }; - - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Adding Buff: Attr=${attrCard.attr}, Val=${attrCard.value}, Type=VALUE`); - // attrsComp.addBuff(buffConf); - // // addBuff 内部会自动调用 recalculateSingleAttr 和 updateHeroInfo - - // const roleAfter = attrsComp.Attrs[attrCard.attr] || 0; - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] Attr After: Hero=${roleAfter} (Change: ${roleAfter - roleBefore})`); - - // oops.gui.toast(attrCard.desc); - // } - // } else { - // mLogger.warn(this.debugMode, 'MissionCard', `[MissionCard] 未找到属性卡配置: UUID=${selectedData.uuid}`); - // } - // break; - // } - // } else { - // mLogger.log(this.debugMode, 'MissionCard', `[MissionCard] 主角实体无效,无法应用卡牌效果`); - // } - - // // 记录已获取的卡牌 - // oops.message.dispatchEvent(GameEvent.UpdateMissionGet, { - // uuid: selectedData.uuid, - // icon: selectedData.icon, - // kind: selectedData.kind - // }); - - // this.close(); - // }) - .start(); - } - } - - /** 看广告关闭 Lock */ - watchAdCloseLock() { - // TODO: 此处接入 IAA 广告 SDK - mLogger.log(this.debugMode, 'MissionCard', "播放激励视频广告..."); - - // 模拟广告播放成功回调 - this.isLocked = false; - this.isAdUnlocked = true; - if (this.Lock) { - this.Lock.active = false; - oops.gui.toast("解锁成功"); - } - this.closeUnLock(); - } - coinCloseLock(){ - let cost = smc.vmdata.mission_data.unlockCoin; - if (smc.vmdata.gold >= cost) { - // 扣除金币 - if (smc.updateGold(-cost)) { - this.isLocked = false; - if (this.Lock) { - this.Lock.active = false; - } - oops.gui.toast("解锁成功"); - this.closeUnLock(); - } else { - oops.gui.toast("交易失败"); - } - } else { - oops.gui.toast("金币不足"); - } - } - showUnLock(){ - if (this.unLock) { - this.unLock.active = true; - this.unLock.setScale(Vec3.ZERO); - tween(this.unLock) - .to(0.2, { scale: new Vec3(1, 1, 1) }, { easing: 'backOut' }) - .start(); - } - } - closeUnLock(){ - if (this.unLock && this.unLock.active) { - tween(this.unLock) - .to(0.2, { scale: Vec3.ZERO }, { easing: 'backIn' }) - .call(() => { - this.unLock.active = false; - }) - .start(); - } - } - /** 放弃选择 */ - onGiveUp() { - if (this.hasSelected) return; - this.hasSelected = true; - - // 隐藏关闭按钮 - if (this.btnClose) { - this.btnClose.active = false; - } - - const cards = [this.card1, this.card2, this.card3, this.card4]; - let delayTime = 0.2; - - cards.forEach(card => { - if (card && card.active) { - tween(card).to(delayTime, { scale: Vec3.ZERO }).start(); - } - }); - - // 动画结束后关闭 - this.scheduleOnce(() => { - this.close(); - }, delayTime); - } /** * 关闭界面 */ close() { - this.node.active = false; - - // 恢复游戏运行状态(取消暂停) - smc.mission.stop_mon_action = false; - - // 关闭时隐藏按钮,避免下次打开其他类型时闪烁 - if (this.btnClose) { - this.btnClose.active = false; - } - - // 关闭时隐藏 Lock 节点 - if (this.Lock) { - this.Lock.active = false; - } - - // 关闭时隐藏 noStop 节点 - if (this.noStop) { - this.noStop.active = false; - } - - // 恢复锁定状态(如果没有永久解锁) - if (!this.isAdUnlocked) { - this.isLocked = true; - } - - this.checkQueue(); + } /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 2efceccd..45308147 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -9,7 +9,7 @@ import { GameEvent } from "../common/config/GameEvent"; import { HeroViewComp } from "../hero/HeroViewComp"; import { UIID } from "../common/config/GameUIConfig"; import { SkillView } from "../skill/SkillView"; -import { FightSet, CardType, FacSet } from "../common/config/GameSet"; +import { FightSet } from "../common/config/GameSet"; import { mLogger } from "../common/Logger"; const { ccclass, property } = _decorator;