| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将培养界面 |
| | | /// 武将遣散界面 |
| | | /// </summary> |
| | | public class HeroDeleteWin : UIBase |
| | | { |
| | |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | if (hero.heroStar > 1) |
| | | if (hero.heroStarMaxBefore > 1) |
| | | { |
| | | hasStarHero = true; |
| | | break; |
| | |
| | | { |
| | | 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) => |
| | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | HeroUIManager.Instance.selectDeleteHeroList.Clear(); |
| | | } |
| | | }); |
| | | }, itemName:$"( {HeroUIManager.Instance.deletePayBackPer}% )"); |
| | | |
| | | } |
| | | |