hch
2025-09-09 7ee06a9d53a47b106458c571fadbb7583b570766
Main/System/HeroUI/HeroDeleteWin.cs
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
@@ -5,7 +6,7 @@
/// <summary>
/// 武将培养界面
/// 武将遣散界面
/// </summary>
public class HeroDeleteWin : UIBase
{
@@ -150,7 +151,7 @@
            HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]);
            if (hero == null)
                continue;
            if (hero.heroStar > 1)
            if (hero.heroStarMaxBefore > 1)
            {
                hasStarHero = true;
                break;
@@ -192,16 +193,25 @@
            {
                if (!tmpDict.ContainsKey(itemInfo[0]))
                {
                    tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStar));
                    tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStarMaxBefore));
                }
                else
                {
                    tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStar);
                    tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStarMaxBefore);
                }
            }
            allItemDict = CommonFunc.AddDict(allItemDict, tmpDict);
        }
        //计算返还比例
        var _list = allItemDict.Keys.ToList();
        foreach (var key in _list)
        {
            allItemDict[key] = Math.Max((long)(allItemDict[key] * HeroUIManager.Instance.deletePayBackPer / 100.0), 1);
        }
        List<Item> items = CommonFunc.ChangeToItemList(allItemDict);
        ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard25"), Language.Get("herocard26"), (bool isOk) =>
@@ -220,7 +230,7 @@
                GameNetSystem.Instance.SendInfo(pack);
                HeroUIManager.Instance.selectDeleteHeroList.Clear();
            }
        });
        }, itemName:$"( {HeroUIManager.Instance.deletePayBackPer}% )");
    }