feat: 添加战斗结算奖励系统

1.  新增结算奖励配置常量,定义金币、天赋经验、英雄碎片的发放规则与胜利加成系数
2.  新增RewardItemComp通用奖励条目组件,实现数量展示与弹跳入场动画
3.  为VictoryComp添加结算奖励逻辑:计算发放奖励、渲染奖励UI并添加入场动画效果
4.  新增金币、天赋经验奖励预制体并配置到结算弹窗中
5.  调整ui3.plist的图片边框参数适配新奖励图标
This commit is contained in:
pan
2026-09-01 10:18:55 +08:00
parent 89cc7e25b2
commit f40ff033c2
13 changed files with 3492 additions and 2300 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,899 @@
[
{
"__type__": "cc.Prefab",
"_name": "reward_item_exp",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "reward_item_exp",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 16
},
{
"__id__": 22
},
{
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 34
},
{
"__id__": 36
}
],
"_prefab": {
"__id__": 38
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 81.456,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 11
},
{
"__id__": 13
}
],
"_prefab": {
"__id__": 15
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "ItemFrame02_Single_Gray",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
}
],
"_prefab": {
"__id__": 10
},
"_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": 0.5,
"y": 0.5,
"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__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 140,
"height": 140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0af0qvhONENbQ7VGnZDica"
},
{
"__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": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@5eaff",
"__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": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "86TCikdfVHgpQMxXNQIMPm"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"_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": 60,
"_originalHeight": 62,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "78iixvi+NHTYPTyPR5T8YM"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "cbkcNX6spFZoV0Wq+QuzM7",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
"width": 70,
"height": 70
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c6Ux/HhHdBfZQMd0NVreIX"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_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": "c0B1iavUxAUZrad/TzzzDB"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "bbIROaQytLa7tkpPKzVoid",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Icon",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
},
{
"__id__": 19
}
],
"_prefab": {
"__id__": 21
},
"_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": 0.4,
"y": 0.4,
"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__": 16
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_contentSize": {
"__type__": "cc.Size",
"width": 102,
"height": 107
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "54EYuEBjxM4YnwDzq8nUpt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 16
},
"_enabled": true,
"__prefab": {
"__id__": 20
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@d9047",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "59y6ViOVNPd7M4d+rJy8fK"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "81a6ino0dLi4Kxb/NpuPYy",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
},
{
"__id__": 25
}
],
"_prefab": {
"__id__": 27
},
"_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__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 24
},
"_contentSize": {
"__type__": "cc.Size",
"width": 34.0146484375,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "cbewm4XtZP7IxLCF2+Hb4s"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 26
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "EXP",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 15,
"_fontSize": 15,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": true,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "12FmeZwFdHMJ78eJSLCEZN"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "4e1AoZvgpLJ7nR1HuAmFZy",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "num",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 29
},
{
"__id__": 31
}
],
"_prefab": {
"__id__": 33
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 18.627,
"y": -19.839,
"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__": 28
},
"_enabled": true,
"__prefab": {
"__id__": 30
},
"_contentSize": {
"__type__": "cc.Size",
"width": 26.24609375,
"height": 31.72
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d08UCcdkFBFpbDsvDVeW9I"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 28
},
"_enabled": true,
"__prefab": {
"__id__": 32
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "99",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 22,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": true,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "dcMaL7S59EZ45JC8ZAcdFG"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7bVF5TCMhCxYHg/COrstD8",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 35
},
"_contentSize": {
"__type__": "cc.Size",
"width": 70,
"height": 70
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "71tWa+8EFHdJy9NyDH9eU6"
},
{
"__type__": "7e48dbWsJxANrnlAANRAYby",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 37
},
"count_label": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0fByt84dpKPYZlPZfpn8Um"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "47Sc4S8E5EfJ3uZtG97byB",
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "db18158c-588a-49ea-a224-cace29d5c912",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "reward_item_exp"
}
}

View File

@@ -0,0 +1,734 @@
[
{
"__type__": "cc.Prefab",
"_name": "reward_item_gold",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "reward_item_gold",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 16
},
{
"__id__": 22
}
],
"_active": true,
"_components": [
{
"__id__": 28
},
{
"__id__": 30
}
],
"_prefab": {
"__id__": 32
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 11
},
{
"__id__": 13
}
],
"_prefab": {
"__id__": 15
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "ItemFrame02_Single_Gray",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
}
],
"_prefab": {
"__id__": 10
},
"_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": 0.5,
"y": 0.5,
"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__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 140,
"height": 140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6etF0z2bNMvZfcKMKcf+XE"
},
{
"__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": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@5eaff",
"__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": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "f4BQyrtixM7aRzKRI0+fN4"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"_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": 60,
"_originalHeight": 62,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ebBYK2S0hLEKtcTPzjiZWA"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "73lTA8SbdPp5PUMKKaQbr1",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
"width": 70,
"height": 70
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "aakHNvSzpGfIL+hjM94BUL"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_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": "44cGz2I3hE+7DP4PaG+vpL"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "22JrmAuP9Mc5nhUqnn0DQH",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Icon",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
},
{
"__id__": 19
}
],
"_prefab": {
"__id__": 21
},
"_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__": 16
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_contentSize": {
"__type__": "cc.Size",
"width": 38,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9fYt43CI5LVKv3KVmz2xQI"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 16
},
"_enabled": true,
"__prefab": {
"__id__": 20
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@a9695",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "caMrqV9NVKuLdbw5U1X9/n"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "04m+B47pZBYJC4kS+1Rl8u",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "num",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
},
{
"__id__": 25
}
],
"_prefab": {
"__id__": 27
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 18.627,
"y": -19.839,
"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__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 24
},
"_contentSize": {
"__type__": "cc.Size",
"width": 26.24609375,
"height": 31.72
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "19sM4nlv1KaY+OIHJ5tlYo"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 26
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "99",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 22,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": true,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e1h5mbeZBFw6EOg39xn44T"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "61yc2n1yhL7pOYMzvC2Tyn",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 29
},
"_contentSize": {
"__type__": "cc.Size",
"width": 70,
"height": 70
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7855LM0WhDAZgzfFAZdwDU"
},
{
"__type__": "7e48dbWsJxANrnlAANRAYby",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 31
},
"count_label": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ad8TyCDhhOg6n3u1MOLxT+"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "10z6GxEehAebPrefUJTgkq",
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f802de61-c1b5-4575-ab88-2e6fc4e15e5c",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "reward_item_gold"
}
}

View File

@@ -44,25 +44,28 @@
},
{
"__id__": 150
},
{
"__id__": 168
}
],
"_active": true,
"_components": [
{
"__id__": 168
"__id__": 198
},
{
"__id__": 170
"__id__": 200
},
{
"__id__": 172
"__id__": 202
},
{
"__id__": 174
"__id__": 204
}
],
"_prefab": {
"__id__": 176
"__id__": 206
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -3868,6 +3871,481 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Rewards",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 169
},
{
"__id__": 177
},
{
"__id__": 185
}
],
"_active": true,
"_components": [
{
"__id__": 193
},
{
"__id__": 195
}
],
"_prefab": {
"__id__": 197
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -227.118,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 168
},
"_prefab": {
"__id__": 170
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 169
},
"asset": {
"__uuid__": "f802de61-c1b5-4575-ab88-2e6fc4e15e5c",
"__expectedType__": "cc.Prefab"
},
"fileId": "10z6GxEehAebPrefUJTgkq",
"instance": {
"__id__": 171
},
"targetOverrides": null
},
{
"__type__": "cc.PrefabInstance",
"fileId": "b5AF11DKdNponYuZ5McsDz",
"prefabRootNode": {
"__id__": 1
},
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 172
},
{
"__id__": 174
},
{
"__id__": 175
},
{
"__id__": 176
}
],
"removedComponents": []
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 173
},
"propertyPath": [
"_name"
],
"value": "reward_item_gold"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"10z6GxEehAebPrefUJTgkq"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 173
},
"propertyPath": [
"_lpos"
],
"value": {
"__type__": "cc.Vec3",
"x": -90,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 173
},
"propertyPath": [
"_lrot"
],
"value": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 173
},
"propertyPath": [
"_euler"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 168
},
"_prefab": {
"__id__": 178
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 177
},
"asset": {
"__uuid__": "db18158c-588a-49ea-a224-cace29d5c912",
"__expectedType__": "cc.Prefab"
},
"fileId": "47Sc4S8E5EfJ3uZtG97byB",
"instance": {
"__id__": 179
},
"targetOverrides": null
},
{
"__type__": "cc.PrefabInstance",
"fileId": "25MhRHMVhGS7j//M5snvkH",
"prefabRootNode": {
"__id__": 1
},
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 180
},
{
"__id__": 182
},
{
"__id__": 183
},
{
"__id__": 184
}
],
"removedComponents": []
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 181
},
"propertyPath": [
"_name"
],
"value": "reward_item_exp"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"47Sc4S8E5EfJ3uZtG97byB"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 181
},
"propertyPath": [
"_lpos"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 181
},
"propertyPath": [
"_lrot"
],
"value": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 181
},
"propertyPath": [
"_euler"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 168
},
"_prefab": {
"__id__": 186
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 185
},
"asset": {
"__uuid__": "4b8fb686-b649-4525-9aae-df0e7369205b",
"__expectedType__": "cc.Prefab"
},
"fileId": "24rlgXRJ9AHLGpMW+aYyEx",
"instance": {
"__id__": 187
},
"targetOverrides": null
},
{
"__type__": "cc.PrefabInstance",
"fileId": "d2BEWXbMlGFIsn1hlQMVR9",
"prefabRootNode": {
"__id__": 1
},
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 188
},
{
"__id__": 190
},
{
"__id__": 191
},
{
"__id__": 192
}
],
"removedComponents": []
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 189
},
"propertyPath": [
"_name"
],
"value": "clips"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"24rlgXRJ9AHLGpMW+aYyEx"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 189
},
"propertyPath": [
"_lpos"
],
"value": {
"__type__": "cc.Vec3",
"x": 90,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 189
},
"propertyPath": [
"_lrot"
],
"value": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 189
},
"propertyPath": [
"_euler"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 168
},
"_enabled": true,
"__prefab": {
"__id__": 194
},
"_contentSize": {
"__type__": "cc.Size",
"width": 250,
"height": 200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7dsZEiP41NhL4M2/NjpZCI"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 168
},
"_enabled": true,
"__prefab": {
"__id__": 196
},
"_resizeMode": 1,
"_layoutType": 1,
"_cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_startAxis": 0,
"_paddingLeft": 0,
"_paddingRight": 0,
"_paddingTop": 0,
"_paddingBottom": 0,
"_spacingX": 20,
"_spacingY": 0,
"_verticalDirection": 1,
"_horizontalDirection": 0,
"_constraint": 0,
"_constraintNum": 2,
"_affectedByScale": false,
"_isAlign": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b9EzIUlHpPlpvFLBGZOkY3"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e84cB5sbVA+JkeMVQTgwOQ",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -3878,7 +4356,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 169
"__id__": 199
},
"_contentSize": {
"__type__": "cc.Size",
@@ -3906,7 +4384,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 171
"__id__": 201
},
"rank_icon": {
"__id__": 106
@@ -3932,6 +4410,21 @@
"__uuid__": "12df63de-cda7-4be2-8e23-ea387fbba6f5",
"__expectedType__": "cc.Prefab"
},
"rewards_container": {
"__id__": 168
},
"clip_prefab": {
"__uuid__": "4b8fb686-b649-4525-9aae-df0e7369205b",
"__expectedType__": "cc.Prefab"
},
"reward_gold_prefab": {
"__uuid__": "f802de61-c1b5-4575-ab88-2e6fc4e15e5c",
"__expectedType__": "cc.Prefab"
},
"reward_exp_prefab": {
"__uuid__": "db18158c-588a-49ea-a224-cace29d5c912",
"__expectedType__": "cc.Prefab"
},
"_id": ""
},
{
@@ -3948,7 +4441,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 173
"__id__": 203
},
"_alignFlags": 45,
"_target": null,
@@ -3984,7 +4477,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 175
"__id__": 205
},
"_id": ""
},
@@ -4004,6 +4497,15 @@
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 185
},
{
"__id__": 177
},
{
"__id__": 169
},
{
"__id__": 77
}

View File

@@ -530,10 +530,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3612,10 +3612,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3658,10 +3658,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3704,10 +3704,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3750,10 +3750,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3796,10 +3796,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3842,10 +3842,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -3888,10 +3888,10 @@
"height": 62,
"rawWidth": 60,
"rawHeight": 62,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 30,
"borderRight": 30,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,

View File

@@ -211,3 +211,20 @@ export function getLvColor(lv: number): Color {
* 用于 BG_node 下子节点的显隐切换
*/
export const CARD_LV_BG_COLORS: string[] = ["green", "blue", "purple", "yellow", "red"];
/**
* 战斗结算奖励配置(每局结束后发放:英雄碎片 + 金币 + 天赋经验)。
* 数值均为"失败基准",胜利时整体乘以 victory_multiplier。
*/
export const VICTORY_REWARD_SET = {
/** 金币:base + wave_win_count × per_wave */
gold: { base: 100, per_wave: 50 },
/** 天赋经验:base + wave_win_count × per_wave */
talent_exp: { base: 20, per_wave: 10 },
/** 每个出场英雄保底碎片数 */
played_fragment: 1,
/** 随机英雄碎片数量(发放给随机抽中的 1 个英雄) */
random_fragment: 2,
/** 胜利加成系数(失败 1.0) */
victory_multiplier: 1.2,
};

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "18fae899-4daa-406a-806a-2857fad8b648",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,60 @@
/**
* @file RewardItemComp.ts
* @description 结算奖励条目组件(UI 视图层)
*
* 挂载在 reward_item.prefab 上,用于展示单个非英雄碎片类奖励(金币 / 天赋经验等)。
* 图标在编辑器内直接配置好(Sprite 静态图),组件只负责:
* 1. 设置数量文本("+N")。
* 2. 播放入场弹跳动画(scale 0 → 1,backOut)。
*
* 英雄碎片奖励不使用本组件,而是复用 clips.prefab + ChipComp(见 VictoryComp.renderRewards)。
*/
import { _decorator, Label, tween, v3, Tween } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
const { ccclass, property } = _decorator;
/** 奖励条目入场动画时长(秒) */
const ENTER_DURATION = 0.35;
/**
* RewardItemComp —— 单个结算奖励条目视图组件
*/
@ccclass('RewardItemComp')
@ecs.register('RewardItemComp', false)
export class RewardItemComp extends CCComp {
@property({ type: Label, tooltip: "数量文本(count_label)" })
count_label: Label = null!;
/**
* 设置奖励数量并播放入场动画。
* @param count 奖励数量(展示为 "+N")
*/
setReward(count: number) {
if (this.count_label) {
this.count_label.string = `+${count}`;
}
this.playEnter();
}
/** 入场动画:从 0 缩放弹至 1 */
private playEnter() {
Tween.stopAllByTarget(this.node);
this.node.setScale(0, 0, 1);
tween(this.node)
.to(ENTER_DURATION, { scale: v3(1, 1, 1) }, { easing: 'backOut' })
.start();
}
protected onDestroy(): void {
Tween.stopAllByTarget(this.node);
super.onDestroy();
}
/** ECS 组件移除时销毁节点 */
reset() {
this.node.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "7e48d6d6-b09c-4036-b9e5-0003510186f2",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -16,6 +16,11 @@ import { getRankByScore, getNextRank, getRankProgress, ScoreRankInfo } from "../
import { LangPrefix, lang, langf } from "../common/LangUtil";
import { mLogger } from "../common/Logger";
import { UIID } from "../common/config/GameUIConfig";
import { VICTORY_REWARD_SET } from "../common/config/GameSet";
import { HeroInfo } from "../common/config/heroSet";
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
import { ChipComp } from "./ChipComp";
import { RewardItemComp } from "./RewardItemComp";
const { ccclass, property } = _decorator;
@@ -23,6 +28,28 @@ const { ccclass, property } = _decorator;
const SCORE_TWEEN_DURATION = 1.6;
/** 段位晋升动效时长(秒) */
const RANK_UP_DURATION = 0.5;
/** 奖励条目逐个入场的间隔(秒) */
const REWARD_ENTER_INTERVAL = 0.12;
/** 单个英雄碎片奖励 */
interface FragmentReward {
/** 英雄模板 uuid */
uuid: number;
/** 碎片数量 */
count: number;
/** 是否为本局出场英雄(否则为随机英雄) */
isPlayed: boolean;
}
/** 结算奖励结果 */
interface RewardResult {
/** 发放的金币数量 */
gold: number;
/** 发放的天赋经验数量 */
talentExp: number;
/** 英雄碎片奖励列表 */
fragments: FragmentReward[];
}
/**
* VictoryComp —— 战斗结算弹窗视图组件
@@ -69,6 +96,20 @@ export class VictoryComp extends CCComp {
@property({ type: Prefab, tooltip: "亮点成就标签预制体" })
highlight_prefab: Prefab = null!;
// ======================== 结算奖励绑定 ========================
@property({ type: Node, tooltip: "结算奖励条目容器(rewards_container,横向 Layout)" })
rewards_container: Node = null!;
@property({ type: Prefab, tooltip: "英雄碎片条目预制体(clips.prefab,挂 ChipComp,num 子节点显示数量)" })
clip_prefab: Prefab = null!;
@property({ type: Prefab, tooltip: "金币奖励条目预制体(reward_item_gold.prefab,挂 RewardItemComp)" })
reward_gold_prefab: Prefab = null!;
@property({ type: Prefab, tooltip: "天赋经验奖励条目预制体(reward_item_exp.prefab,挂 RewardItemComp)" })
reward_exp_prefab: Prefab = null!;
/** 调试日志开关 */
debugMode: boolean = false;
/** 奖励等级(预留) */
@@ -84,6 +125,11 @@ export class VictoryComp extends CCComp {
diamond: 0
}
// ======================== 结算奖励(运行时) ========================
/** 本次结算实际发放的奖励结果(供渲染) */
private _rewardResult: RewardResult = null!;
// ======================== 动画状态 ========================
/** 动画期间实时显示的分数(tween 驱动) */
@@ -128,6 +174,9 @@ export class VictoryComp extends CCComp {
// 计算总分并写入历史纪录
this.calculateTotalScore();
// 计算并发放结算奖励(英雄碎片 + 金币 + 天赋经验)
this.grantRewards(!!args.victory);
// 每次战斗结束都标记数据脏并触发云端同步(防抖 3 秒后自动上传)
smc.updateCloudData();
@@ -136,6 +185,9 @@ export class VictoryComp extends CCComp {
// 渲染亮点标签
this.renderHighlights();
// 渲染结算奖励条目
this.renderRewards();
}
// ======================== 分数计算(逻辑层,保持不变) ========================
@@ -440,6 +492,145 @@ export class VictoryComp extends CCComp {
.start();
}
// ======================== 结算奖励 ========================
/**
* 收集本局出场英雄的 uuid 列表(去重)。
* 来源 = 存活英雄(heroGrid 中实体的 hero_uuid)+ 死亡英雄快照(dead_heroes)。
*/
private collectPlayedHeroUuids(): number[] {
const uuidSet = new Set<number>();
// 存活英雄:heroGrid 存 eid,反查实体属性
for (const eid of smc.mission.heroGrid) {
if (eid < 0) continue;
const entity = ecs.getEntityByEid(eid);
const attrs = entity?.get(HeroAttrsComp);
if (attrs && attrs.fac === 0) {
uuidSet.add(attrs.hero_uuid);
}
}
// 死亡英雄快照
const deadList = smc.mission.dead_heroes || [];
for (const rec of deadList) {
if (rec && rec.uuid > 0) uuidSet.add(rec.uuid);
}
return [...uuidSet];
}
/**
* 从全英雄池中随机抽取 1 个英雄 uuid(优先未出场,避免与出场碎片重复)。
*/
private pickRandomHeroUuid(exclude: Set<number>): number {
const all = Object.keys(HeroInfo).map(k => Number(k)).filter(u => u > 0);
const candidates = all.filter(u => !exclude.has(u));
const pool = candidates.length > 0 ? candidates : all;
if (pool.length === 0) return 0;
return pool[Math.floor(Math.random() * pool.length)];
}
/**
* 计算并发放结算奖励,结果存入 _rewardResult。
* @param isVictory 是否胜利(胜利整体 ×1.2)
*/
private grantRewards(isVictory: boolean) {
const s = smc.vmdata.scores;
const cfg = VICTORY_REWARD_SET;
const mult = isVictory ? cfg.victory_multiplier : 1.0;
const wave = Math.max(0, s.wave_win_count || 0);
// 1. 金币 / 天赋经验(按波次计算,胜利加成)
const gold = Math.floor((cfg.gold.base + wave * cfg.gold.per_wave) * mult);
const talentExp = Math.floor((cfg.talent_exp.base + wave * cfg.talent_exp.per_wave) * mult);
// 2. 英雄碎片:出场英雄各保底 + 1 个随机英雄
const playedUuids = this.collectPlayedHeroUuids();
const playedSet = new Set(playedUuids);
const fragments: FragmentReward[] = playedUuids.map(uuid => ({
uuid,
count: cfg.played_fragment,
isPlayed: true,
}));
const randomUuid = this.pickRandomHeroUuid(playedSet);
if (randomUuid > 0) {
fragments.push({ uuid: randomUuid, count: cfg.random_fragment, isPlayed: false });
}
// 3. 落地发放
if (gold > 0) {
smc.data.gold = (smc.data.gold || 0) + gold; // 持久化(存档口径)
smc.updateGold(gold); // 驱动 MVVM 展示
}
if (talentExp > 0) {
smc.addTalentExp(talentExp);
}
for (const f of fragments) {
smc.addHeroFragments(f.uuid, f.count);
}
this._rewardResult = { gold, talentExp, fragments };
mLogger.log(this.debugMode, 'VictoryComp', '[VictoryComp] 结算奖励发放', {
isVictory, wave, gold, talentExp, fragments,
});
}
/**
* 渲染结算奖励条目(金币 / 天赋经验 / 英雄碎片),逐个弹跳入场。
*/
private renderRewards() {
if (!this.rewards_container || !this._rewardResult) return;
this.rewards_container.removeAllChildren();
const items: Node[] = [];
const r = this._rewardResult;
// 金币条目
if (this.reward_gold_prefab && r.gold > 0) {
const node = instantiate(this.reward_gold_prefab);
node.getComponent(RewardItemComp)?.setReward(r.gold);
items.push(node);
}
// 天赋经验条目
if (this.reward_exp_prefab && r.talentExp > 0) {
const node = instantiate(this.reward_exp_prefab);
node.getComponent(RewardItemComp)?.setReward(r.talentExp);
items.push(node);
}
// 英雄碎片条目(复用 clips.prefab + ChipComp,num 子节点显示数量)
if (this.clip_prefab) {
for (const f of r.fragments) {
const node = instantiate(this.clip_prefab);
node.getComponent(ChipComp)?.setHeroByUuid(f.uuid);
const numLabel = node.getChildByName("num")?.getComponent(Label);
if (numLabel) {
numLabel.string = `+${f.count}`;
numLabel.node.active = true;
}
items.push(node);
}
}
// 逐个入场(初始隐藏,间隔弹出)
items.forEach((node, i) => {
node.active = false;
this.rewards_container.addChild(node);
this.scheduleOnce(() => {
node.active = true;
// 碎片条目没有 RewardItemComp,手动播一次弹跳
if (!node.getComponent(RewardItemComp)) {
Tween.stopAllByTarget(node);
node.setScale(0, 0, 1);
tween(node).to(0.35, { scale: v3(1, 1, 1) }, { easing: 'backOut' }).start();
}
}, REWARD_ENTER_INTERVAL * (i + 1));
});
}
// ======================== 亮点成就 ========================
/**
@@ -524,9 +715,10 @@ export class VictoryComp extends CCComp {
}
protected onDestroy(): void {
// 停止所有动画,防止节点销毁后 tween 回调访问无效对象
// 停止所有动画与延迟回调,防止节点销毁后 tween/scheduleOnce 访问无效对象
if (this.rank_icon) Tween.stopAllByTarget(this.rank_icon.node);
if (this.gain_label) Tween.stopAllByTarget(this.gain_label.node);
this.unscheduleAllCallbacks();
super.onDestroy();
mLogger.log(this.debugMode, 'VictoryComp', "释放胜利界面");
}