2 Commits

Author SHA1 Message Date
walkpan
27541a054e fix: 修正关闭英雄弹窗时移除错误UI的问题
修复 HListComp.ts 中 closeHeros 方法错误移除 UIID.Ranks 的问题,改为正确移除 UIID.Heros
2026-04-09 09:37:06 +08:00
walkpan
36d65ac3cc feat: 添加英雄界面并移除英雄卡等级概率机制
- 新增英雄界面 UI 配置、预制体和动画资源
- 在 MissionHomeComp 中添加打开英雄界面的方法
- 移除 CardSet 中英雄卡从1级升级到2级的概率逻辑,简化抽卡规则
- 在 HlistComp 中添加关闭英雄界面的方法
2026-04-09 09:16:55 +08:00
14 changed files with 20626 additions and 10432 deletions

View File

@@ -0,0 +1,405 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "animation",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 6,
"speed": 1,
"wrapMode": 2,
"enableTrsBlending": false,
"_duration": 2,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
},
{
"__id__": 12
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 23
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.VectorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channels": [
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
},
{
"__id__": 10
}
],
"_nComponents": 3
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 3
},
"eulerAngles"
]
},
{
"__type__": "cc.animation.HierarchyPath",
"path": "Effect_Lihgt_02"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 5
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 7
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 9
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
1.5,
2
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -270,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -360,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 11
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.VectorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 13
},
"proxy": null
},
"_channels": [
{
"__id__": 15
},
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 21
}
],
"_nComponents": 3
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 14
},
"scale"
]
},
{
"__type__": "cc.animation.HierarchyPath",
"path": "Image_Glow_Circle_03"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 16
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
1,
2
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1.6,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1.8,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1.6,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 18
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
1,
2
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1.6,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1.8,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1.6,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 20
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
1,
2
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 22
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "1a0edaaf-b1c5-4a43-a874-afb780a978b3",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "animation"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "6e63f83d-28f6-415e-ac98-dabef66282d6",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "heros"
}
}

View File

@@ -37,17 +37,17 @@
"_active": true,
"_components": [
{
"__id__": 183
"__id__": 177
},
{
"__id__": 185
"__id__": 179
},
{
"__id__": 187
"__id__": 181
}
],
"_prefab": {
"__id__": 189
"__id__": 183
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -105,7 +105,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 55,
"y": 0,
"z": 0
},
"_lrot": {
@@ -145,8 +145,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 1170
"width": 730,
"height": 1290
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -182,7 +182,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@46c83",
"__uuid__": "d7d869bc-06aa-4876-806f-487e68b96780@1e2d6",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
@@ -198,7 +198,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
"__uuid__": "d7d869bc-06aa-4876-806f-487e68b96780",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
@@ -221,10 +221,10 @@
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 110,
"_left": -5,
"_right": -5,
"_top": -5,
"_bottom": -5,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -3835,89 +3835,35 @@
},
{
"__type__": "cc.Node",
"_name": "bg_title",
"_name": "top_btn_back",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 167
}
],
"_active": true,
"_components": [
{
"__id__": 176
},
{
"__id__": 178
},
{
"__id__": 180
}
],
"_prefab": {
"__id__": 182
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -590.092,
"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": "arrow",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 166
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 168
"__id__": 167
},
{
"__id__": 170
"__id__": 169
},
{
"__id__": 172
"__id__": 171
},
{
"__id__": 174
}
],
"_prefab": {
"__id__": 175
"__id__": 176
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -287.278,
"y": -4.225,
"x": -298.4,
"y": -559,
"z": 0
},
"_lrot": {
@@ -3929,8 +3875,8 @@
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1.9,
"y": 1.2,
"x": 0.8,
"y": 0.8,
"z": 1
},
"_mobility": 0,
@@ -3949,16 +3895,16 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 167
"__id__": 166
},
"_enabled": true,
"__prefab": {
"__id__": 169
"__id__": 168
},
"_contentSize": {
"__type__": "cc.Size",
"width": 46,
"height": 76
"width": 179,
"height": 140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -3969,7 +3915,7 @@
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3f8NdIlo9Nko0ZRXpoLG+C"
"fileId": "e5MSYRLPRGvaB6j6LMY0X4"
},
{
"__type__": "cc.Sprite",
@@ -3977,24 +3923,24 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 167
"__id__": 166
},
"_enabled": true,
"__prefab": {
"__id__": 171
"__id__": 170
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 226,
"g": 238,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@95d3a",
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@c874e",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@@ -4014,7 +3960,7 @@
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7d68k5bgtC2Ykasy8w3ODg"
"fileId": "daucmH7MZPZKwh5l1pGn+F"
},
{
"__type__": "cc.Button",
@@ -4022,15 +3968,15 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 167
"__id__": 166
},
"_enabled": true,
"__prefab": {
"__id__": 173
"__id__": 172
},
"clickEvents": [
{
"__id__": 174
"__id__": 173
}
],
"_interactable": true,
@@ -4069,12 +4015,14 @@
"_disabledSprite": null,
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": null,
"_target": {
"__id__": 166
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "afCUCqD2FJ2ZfriNs8+Exg"
"fileId": "54bJI2sblNtK+3i9X1v9Bn"
},
{
"__type__": "cc.ClickEvent",
@@ -4086,92 +4034,6 @@
"handler": "closeRanks",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7215cNR5tL/pl0phuIT/nF",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 166
},
"_enabled": true,
"__prefab": {
"__id__": 177
},
"_contentSize": {
"__type__": "cc.Size",
"width": 740,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c1g554QL5GrJaexXtPZY+E"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 166
},
"_enabled": true,
"__prefab": {
"__id__": 179
},
"_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@98637",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d0kTPKqZ1PzJou+mvzobUm"
},
{
"__type__": "cc.Widget",
"_name": "",
@@ -4182,14 +4044,14 @@
},
"_enabled": true,
"__prefab": {
"__id__": 181
"__id__": 175
},
"_alignFlags": 44,
"_alignFlags": 12,
"_target": null,
"_left": -10,
"_right": -10,
"_right": 0,
"_top": 0,
"_bottom": -25.091999999999985,
"_bottom": 25,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -4198,7 +4060,7 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 540,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
@@ -4206,7 +4068,7 @@
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "27yxJEidVPB4dVp5q14nCw"
"fileId": "1cV1psjb9AMJJN4Z6s7Q8d"
},
{
"__type__": "cc.PrefabInfo",
@@ -4216,7 +4078,7 @@
"asset": {
"__id__": 0
},
"fileId": "eegITyZ2ZG3Lkeb+C//7n7",
"fileId": "06BErKXotFubogbEshIx4i",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
@@ -4231,7 +4093,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 184
"__id__": 178
},
"_contentSize": {
"__type__": "cc.Size",
@@ -4259,7 +4121,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 186
"__id__": 180
},
"_alignFlags": 45,
"_target": null,
@@ -4295,7 +4157,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 188
"__id__": 182
},
"top1_node": {
"__id__": 47

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 291 KiB

View File

@@ -63,8 +63,6 @@ export const CARD_POOL_MAX_LEVEL = CardLV.LV5
/** 英雄最高等级限制 */
export const CARD_HERO_MAX_LEVEL = 3
/** 基础卡池(英雄、技能、功能) */
export const HERO_LV2_INIT_PROB = 0
export const HERO_LV2_PROB_INC_PER_LV = 0.02
export const CardPoolList: CardConfig[] = [
{ uuid: 5001, type: CardType.Hero, cost: 3, weight: 25, pool_lv: 1, kind: CKind.Hero, hero_lv: 1 },
@@ -186,20 +184,6 @@ const pickCards = (cards: CardConfig[], count: number): CardConfig[] => {
return selected
}
/** 根据概率尝试将抽到的英雄卡的 hero_lv 提升到 2 */
const applyHeroLv2Probability = (cards: CardConfig[], currentPoolLv: number): CardConfig[] => {
return cards.map(card => {
if (card.type === CardType.Hero && card.hero_lv === 1) {
const prob = HERO_LV2_INIT_PROB + HERO_LV2_PROB_INC_PER_LV * (currentPoolLv - card.pool_lv)
if (Math.random() < prob) {
// 升级到2级时花费呈指数增长 (1级cost * MERGE_NEED^(2-1))
return { ...card, hero_lv: 2, cost: card.cost * Math.pow(FightSet.MERGE_NEED, 1) }
}
}
return card
})
}
/** 获取指定等级可出现的基础卡池 */
export const getCardPoolByLv = (lv: number, onlyCurrentLv: boolean = false): CardConfig[] => {
const cardLv = clampCardLv(lv)
@@ -224,13 +208,13 @@ export const getCardsByLv = (
if (type !== undefined) {
const typeSet = normalizeTypeFilter(type)
const filteredPool = pool.filter(card => typeSet.has(card.type))
return applyHeroLv2Probability(pickCards(filteredPool, 4), lv)
return pickCards(filteredPool, 4)
}
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 applyHeroLv2Probability([...heroes, ...others], lv)
return [...heroes, ...others]
}
export const drawCardsByRule = (
@@ -270,9 +254,5 @@ export const drawCardsByRule = (
})
}
const picked = pickCards(pool, count)
// 如果明确指定了需要的 heroLv则不触发升级概率
if (options.heroLv !== undefined) {
return picked
}
return applyHeroLv2Probability(picked, lv)
}

View File

@@ -18,6 +18,7 @@ export enum UIID {
IBox,
Notity,
Ranks,
Heros,
}
/** 打开界面方式的配置数据 */
@@ -29,4 +30,5 @@ export var UIConfigData: { [key: number]: UIConfig } = {
[UIID.IBox]: { layer: LayerType.UI, prefab: "gui/element/ibox" },
[UIID.Notity]: { layer: LayerType.UI, prefab: "gui/element/notity" },
[UIID.Ranks]: { layer: LayerType.UI, prefab: "gui/element/ranks" },
[UIID.Heros]: { layer: LayerType.UI, prefab: "gui/element/heros" },
}

View File

@@ -25,6 +25,7 @@ import { HeroInfo, HeroList } from "../common/config/heroSet";
import { IType, SkillSet } from "../common/config/SkillSet";
import { oops } from "db://oops-framework/core/Oops";
import { mLogger } from "../common/Logger";
import { UIID } from "../common/config/GameUIConfig";
const {property, ccclass } = _decorator;
@@ -96,7 +97,14 @@ export class HListComp extends CCComp {
this.pre_btn?.on(NodeEventType.TOUCH_END, this.onPreClick, this);
this.next_btn?.on(NodeEventType.TOUCH_END, this.onNextClick, this);
}
/** 预留:弹窗打开时接收参数 */
onAdded(args: any) {
}
/** 关闭排行榜弹窗 */
closeHeros(){
oops.gui.remove(UIID.Heros)
}
start() {
// 初始化轮播节点数组和固定位置
if (this.phero1_icon && this.phero_icon && this.hero_icon && this.nhero_icon && this.nhero1_icon) {

View File

@@ -83,7 +83,9 @@ export class MissionHomeComp extends CCComp {
openRanks(){
oops.gui.open(UIID.Ranks)
}
openHero(){
oops.gui.open(UIID.Heros)
}
/** 任务结束回调:重新显示主页 */
mission_end(){
mLogger.log(this.debugMode, 'MissionHomeComp', "[MissionHomeComp]=>mission_end")