540 子 【幻境阁】新增称号加成效果 / 【幻境阁】新增称号加成效果-客户端
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: Monday, December 8, 2025
|
| | | // [ Date ]: Saturday, March 14, 2026
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int StarAddPer;
|
| | | public int[] BookActAwardMoney;
|
| | | public int[][] DismissReturnItems;
|
| | | public int[][] BeautyReturnItems;
|
| | | public int[][] TitleReturnItems;
|
| | | public int[] RecommendAwardMoney;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | |
| | |
|
| | | DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[7].Replace("(", "[").Replace(")", "]"));
|
| | |
|
| | | if (tables[8].Contains("[")) |
| | | BeautyReturnItems = JsonMapper.ToObject<int[][]>(tables[8].Replace("(", "[").Replace(")", "]")); |
| | |
|
| | | TitleReturnItems = JsonMapper.ToObject<int[][]>(tables[9].Replace("(", "[").Replace(")", "]")); |
| | |
|
| | | if (tables[10].Contains("[")) |
| | | { |
| | | RecommendAwardMoney = JsonMapper.ToObject<int[]>(tables[8]); |
| | | RecommendAwardMoney = JsonMapper.ToObject<int[]>(tables[10]); |
| | | } |
| | | else |
| | | { |
| | | string[] RecommendAwardMoneyStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] RecommendAwardMoneyStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | RecommendAwardMoney = new int[RecommendAwardMoneyStringArray.Length]; |
| | | for (int i=0;i<RecommendAwardMoneyStringArray.Length;i++) |
| | | { |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年11月18日 |
| | | // [ Date ]: Saturday, March 14, 2026
|
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public int[] AttrIDList; |
| | | public int[] InitAttrValueList; |
| | | public int[] AttrPerStarAddList; |
| | | public int EffType;
|
| | | public int EffTypeValue;
|
| | | public int EffValue;
|
| | | public int EffPerStarAdd;
|
| | | public string GetWayString; |
| | | |
| | | public override int LoadKey(string _key) |
| | |
| | | } |
| | | } |
| | | |
| | | GetWayString = tables[14]; |
| | | int.TryParse(tables[14],out EffType); |
| | |
|
| | | int.TryParse(tables[15],out EffTypeValue); |
| | |
|
| | | int.TryParse(tables[16],out EffValue); |
| | |
|
| | | int.TryParse(tables[17],out EffPerStarAdd); |
| | |
|
| | | GetWayString = tables[18];
|
| | | } |
| | | catch (Exception exception) |
| | | { |
| | |
| | | // 2.演武场挑战胜利,概率额外获得1个物品的概率 物品ID 概率 |
| | | // 3.游历体力上限增加 无 增加上限 |
| | | // 4.白骨盈野扫荡额外物品奖励 物品ID 个数 |
| | | // 5. 遣散/吞噬武将额外返还 无 百分比 |
| | | |
| | | public enum TalentEffectType |
| | | { |
| | |
| | | Arena = 2, |
| | | Travel = 3, |
| | | BoneField = 4, |
| | | HeroDelete = 5, |
| | | } |
| | | |
| | |
| | | allItemDict[key] = Math.Max((long)(allItemDict[key] * HeroUIManager.Instance.deletePayBackPer / 100.0), 1); |
| | | } |
| | | |
| | | List<Item> items = new List<Item>(); |
| | | foreach (var data in allItemDict) |
| | | { |
| | | items.Add(new Item(data.Key, data.Value, _dataEx:$"( {HeroUIManager.Instance.deletePayBackPer}% )")); |
| | | } |
| | | |
| | | Dictionary<int, long> moreMMItemDict = new Dictionary<int, long>(); |
| | | Dictionary<int, long> moreTitleItemDict = new Dictionary<int, long>(); |
| | | int beautyEffectPer = BeautyMMManager.Instance.GetTalentEffectByType(TalentEffectType.HeroDelete); |
| | | int titleEffect = PhantasmPavilionManager.Instance.GetTotalTalentValue(PhantasmPavilionType.Title, 3); |
| | | //红颜和称号额外获得 |
| | | if (beautyEffectPer > 0) |
| | | { |
| | | for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++) |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | |
| | | List<Item> items = CommonFunc.ChangeToItemList(allItemDict); |
| | | foreach (var tmp in hero.qualityConfig.BeautyReturnItems) |
| | | { |
| | | if (!moreMMItemDict.ContainsKey(tmp[0])) |
| | | { |
| | | moreMMItemDict.Add(tmp[0], (long)Math.Ceiling(tmp[1] * beautyEffectPer / 100.0f)); |
| | | } |
| | | else |
| | | { |
| | | moreMMItemDict[tmp[0]] += (long)Math.Ceiling(tmp[1] * beautyEffectPer / 100.0f); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | foreach (var key in moreMMItemDict.Keys) |
| | | { |
| | | items.Add(new Item(key, moreMMItemDict[key], 20, _dataEx: $"( {beautyEffectPer}% )")); |
| | | } |
| | | } |
| | | if (titleEffect > 0) |
| | | { |
| | | for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++) |
| | | { |
| | | HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]); |
| | | if (hero == null) |
| | | continue; |
| | | |
| | | foreach (var tmp in hero.qualityConfig.TitleReturnItems) |
| | | { |
| | | if (!moreTitleItemDict.ContainsKey(tmp[0])) |
| | | { |
| | | moreTitleItemDict.Add(tmp[0], (long)Math.Ceiling(tmp[1] * titleEffect / 100.0f)); |
| | | } |
| | | else |
| | | { |
| | | moreTitleItemDict[tmp[0]] += (long)Math.Ceiling(tmp[1] * titleEffect / 100.0f); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | foreach (var key in moreTitleItemDict.Keys) |
| | | { |
| | | items.Add(new Item(key, moreTitleItemDict[key], 30, _dataEx: $"( {titleEffect}% )")); |
| | | } |
| | | } |
| | | |
| | | ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard25"), Language.Get("herocard26"), (bool isOk) => |
| | | { |
| | | if (isOk) |
| | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | HeroUIManager.Instance.selectDeleteHeroList.Clear(); |
| | | } |
| | | }, itemName:$"( {HeroUIManager.Instance.deletePayBackPer}% )"); |
| | | }); |
| | | |
| | | } |
| | | |
| | |
| | | public long countEx; |
| | | public int quality; |
| | | public int useType; //用途定义:0 默认无 10 - 古宝 20 - 红颜 30 - 称号 40 -分解 |
| | | public string dataEx; |
| | | |
| | | public Item(int _id, long _count) |
| | | { |
| | |
| | | this.quality = 0; |
| | | this.useType = 0; |
| | | this.countEx = _count; |
| | | this.dataEx = ""; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public Item(int _id, long _count, int _useType = 0, int _quality = 0) |
| | | public Item(int _id, long _count, int _useType = 0, int _quality = 0, string _dataEx = "") |
| | | { |
| | | this.id = _id; |
| | | this.quality = _quality; |
| | | this.useType = _useType; |
| | | this.countEx = _count; |
| | | this.dataEx = _dataEx; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | void SelectTeamFunc(PhantasmPavilionType type, bool isRemove = false) |
| | | { |
| | | var lastType = manager.nowType; |
| | | manager.nowType = type; |
| | | |
| | | manager.SetSelectItemId(type); |
| | | if (isRemove) |
| | | { |
| | | manager.RemoveAllNewHeroByTabType(manager.nowType); |
| | | manager.RemoveAllNewHeroByTabType(lastType); |
| | | manager.UpdateRedPoint(); |
| | | RefreshAll(manager.nowType, false); |
| | | RefreshAll(lastType, false); |
| | | } |
| | | manager.nowType = type; |
| | | CreateAll(type); |
| | | } |
| | | |
| | |
| | | { |
| | | int id = cellView.info.Value.infoInt1; |
| | | PhantasmPavilionType type = manager.nowType; |
| | | //天赋 |
| | | if (index == 10000) |
| | | { |
| | | txtUnLockInfo.SetActive(true); |
| | | txtAddInfo.SetActive(false); |
| | | var effectInfo = PhantasmPavilionManager.Instance.GetTalentString(type, id); |
| | | txtUnLockInfo.text = effectInfo; |
| | | return; |
| | | } |
| | | |
| | | //属性 |
| | | int[] attrIDList = manager.GetAttrIDList(type, id); |
| | | int[] initAttrValueList = manager.GetInitAttrValueList(type, id); |
| | | if (attrIDList.IsNullOrEmpty() || initAttrValueList.IsNullOrEmpty() |
| | |
| | | int attrPerStarAdd = attrPerStarAddList[AttrIndex]; |
| | | return initAttrValue + info.Star * attrPerStarAdd; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获得单对象的天赋效果 |
| | | /// </summary> |
| | | /// <param name="id">ID</param> |
| | | /// <param name="defaultAttr">至少返回默认的 如未激活的时候</param> |
| | | /// <returns>返回天赋ID - 效果值,0代表没有天赋</returns> |
| | | public Int2 GetTalentEffect(PhantasmPavilionType type, int id) |
| | | { |
| | | if (PhantasmPavilionType.Title != type) |
| | | { |
| | | return new Int2(0, 0); |
| | | } |
| | | var config = TitleConfig.Get(id); |
| | | if (TryGetInfo(PhantasmPavilionType.Title, id, out PhantasmPavilionData info)) |
| | | { |
| | | if (info.State) |
| | | { |
| | | return new Int2(config.EffType, config.EffValue + info.Star * config.EffPerStarAdd); |
| | | } |
| | | } |
| | | |
| | | //未激活返回默认 |
| | | return new Int2(config.EffType, config.EffValue); |
| | | } |
| | | |
| | | public string GetTalentString(PhantasmPavilionType type, int id) |
| | | { |
| | | if (PhantasmPavilionType.Title != type) |
| | | { |
| | | return ""; |
| | | } |
| | | var config = TitleConfig.Get(id); |
| | | var values = GetTalentEffect(type, id); |
| | | |
| | | switch (config.EffType) |
| | | { |
| | | case 1: |
| | | return Language.Get("HJGTalent1", ItemConfig.Get(config.EffTypeValue).ItemName, values.y); |
| | | default: |
| | | return Language.Get($"HJGTalent{config.EffType}", values.y); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获得所有对象的天赋总值 |
| | | /// </summary> |
| | | public int GetTotalTalentValue(PhantasmPavilionType type, int effctType) |
| | | { |
| | | if (PhantasmPavilionType.Title != type) |
| | | { |
| | | return 0; |
| | | } |
| | | var effectValue = 0; |
| | | dataDict.TryGetValue(type, out var dict); |
| | | if (dict == null) |
| | | { |
| | | return 0; |
| | | } |
| | | foreach (var info in dict.Values) |
| | | { |
| | | if (!info.State) |
| | | { |
| | | continue; |
| | | } |
| | | var config = TitleConfig.Get((int)info.ID); |
| | | if (config.EffType != effctType) |
| | | continue; |
| | | effectValue += GetTalentEffect(type, (int)info.ID).y; |
| | | } |
| | | return effectValue; |
| | | |
| | | } |
| | | } |
| | |
| | | // 有没有属性 |
| | | public bool HasInitAttr(PhantasmPavilionType type, int id) |
| | | { |
| | | if (type == PhantasmPavilionType.Title) |
| | | { |
| | | //称号有特殊天赋效果 |
| | | var cfg = TitleConfig.Get(id); |
| | | if (cfg == null) |
| | | { |
| | | Debug.LogError($"TitleConfig.Get(id) is null, id: {id}"); |
| | | return false; |
| | | } |
| | | if(cfg.EffType > 0) |
| | | return true; |
| | | } |
| | | if (!Has(type, id)) |
| | | return false; |
| | | int[] attrIDList = GetAttrIDList(type, id); |
| | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public class PhantasmPavilionData |
| | |
| | | |
| | | void SelectTeamFunc(PhantasmPavilionType type, int order, bool isRemove = false) |
| | | { |
| | | var lastType = manager.nowType; |
| | | var lastOrder = functionOrder; |
| | | manager.nowType = type; |
| | | functionOrder = order; |
| | | manager.SetSelectItemId(type, order + 1); |
| | | if (isRemove) |
| | | { |
| | | manager.RemoveAllNewHeroByTabType(manager.nowType, functionOrder + 1); |
| | | manager.RemoveAllNewHeroByTabType(lastType, lastOrder + 1); |
| | | manager.UpdateRedPoint(); |
| | | RefreshAll(manager.nowType, functionOrder + 1, false); |
| | | RefreshAll(lastType, lastOrder + 1, false); |
| | | } |
| | | manager.nowType = type; |
| | | functionOrder = order; |
| | | CreateAll(); |
| | | } |
| | | |
| | |
| | | |
| | | void SelectTeamFunc(PhantasmPavilionType type, int order) |
| | | { |
| | | manager.SetSelectItemId(type, order + 1); |
| | | manager.nowType = type; |
| | | functionOrder = order; |
| | | manager.SetSelectItemId(type, order + 1); |
| | | CreateTitleScroller(); |
| | | CreateAll(); |
| | | } |
| | |
| | | scrInfo.AddCell(ScrollerDataType.Header, i, cellInfo); |
| | | } |
| | | } |
| | | |
| | | //称号有天赋 |
| | | if (TitleConfig.Get(id).EffType > 0) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = id; |
| | | scrInfo.AddCell(ScrollerDataType.Header, 10000, cellInfo); |
| | | } |
| | | scrInfo.Restart(); |
| | | } |
| | | |
| | |
| | | if (horizontal)
|
| | | {
|
| | |
|
| | | rect.sizeDelta = rect.sizeDelta.SetX(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing));
|
| | | rect.sizeDelta = rect.sizeDelta.SetX(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing +
|
| | | m_Scorller.padding.right + m_Scorller.padding.left));
|
| | | }
|
| | | else if (vertical)
|
| | | {
|
| | | rect.sizeDelta = rect.sizeDelta.SetY(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing));
|
| | | rect.sizeDelta = rect.sizeDelta.SetY(Math.Min(jiaMiddleWithMaxSize, (m_CellHeaderPrefab.height + m_Scorller.spacing) * _data.Count - m_Scorller.spacing +
|
| | | m_Scorller.padding.top + m_Scorller.padding.bottom));
|
| | | }
|
| | | if (rect.sizeDelta.x < jiaMiddleWithMaxSize)
|
| | | {
|
| | |
| | | public static int moneyNeedCount; |
| | | |
| | | public static List<Item> getItems { get; private set; } |
| | | public static string replaceItemName; |
| | | /// <summary> |
| | | /// 多物品展示确认框 |
| | | /// </summary> |
| | |
| | | /// <param name="moneyCnt"></param> |
| | | /// <param name="type"></param> |
| | | public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, Action<bool> func, |
| | | string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0, string itemName = "") |
| | | string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0) |
| | | { |
| | | getItems = items; |
| | | generalTitle = tiltle; |
| | |
| | | OnPopConfirmClickEvent = func; |
| | | moneyType = type; |
| | | moneyNeedCount = moneyCnt; |
| | | replaceItemName = itemName; |
| | | if (!UIManager.Instance.IsOpened<ItemsConfirmWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<ItemsConfirmWin>(); |
| | |
| | | {
|
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] Text itemName;
|
| | | [SerializeField] Image sourceImg;
|
| | |
|
| | | public void Display(int index, string replaceItemName)
|
| | | public void Display(int index)
|
| | | {
|
| | | int itemID = ConfirmCancel.getItems[index].id;
|
| | | itemCell.Init(new ItemCellModel(itemID, false, ConfirmCancel.getItems[index].countEx));
|
| | | var item = ConfirmCancel.getItems[index];
|
| | | int itemID = item.id;
|
| | | itemCell.Init(new ItemCellModel(itemID, false, item.countEx));
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | | itemName.text = string.IsNullOrEmpty(replaceItemName) ? ItemConfig.Get(itemID).ItemName : replaceItemName;
|
| | | itemName.text = string.IsNullOrEmpty(item.dataEx) ? ItemConfig.Get(itemID).ItemName : item.dataEx;
|
| | |
|
| | | sourceImg.SetActive(item.useType != 0);
|
| | | sourceImg.SetSprite($"AwardMark{item.useType}");
|
| | | sourceImg.SetNativeSize();
|
| | | }
|
| | | }
|
| | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as ItemsConfirmCell;
|
| | | _cell?.Display(cell.index, ConfirmCancel.replaceItemName);
|
| | | _cell?.Display(cell.index);
|
| | | }
|
| | |
|
| | | void CreateScroller()
|