From 23e8ee01886faf8f1a77c79a2d93a52a860e6914 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期日, 24 八月 2025 22:41:12 +0800
Subject: [PATCH] 117 【武将】武将系统 - 重生 遣散
---
Main/Core/GameEngine/Player/PlayerBaseData.cs | 8
Main/System/CustomizedGift/CustomizedGiftChooseWin.cs | 2
Main/Core/GameEngine/Player/PlayerDatas.cs | 6
Main/System/HeroUI/HeroDeleteLineCell.cs.meta | 11
Main/System/HappyXB/HappyXBModel.cs | 22 -
Main/System/Invest/InvestModel.cs | 6
Main/System/Main/PlayerMainDate.cs | 15
Main/System/RoleParticulars/RoleParticularModel.cs | 4
Main/System/KnapSack/New/CommonItemBaisc.cs | 10
Main/System/Store/StoreModel.cs | 10
Main/System/HeroUI/HeroDeleteWin.cs | 232 ++++++++++++
Main/System/Tip/ConfirmCancel.cs | 12
Main/System/HeroUI/HeroDeleteHeadCell.cs | 94 +++++
Main/System/HappyXB/HeroCallScoreWin.cs | 2
Main/System/KnapSack/BackpackData.cs | 8
Main/System/ItemTip/BoxGetItemModel.cs | 18
Main/System/HeroUI/HeroTrainWinEx.cs.meta | 11
Main/System/Tip/ItemsConfirmCell.cs | 2
Main/System/Hero/HeroInfo.cs | 52 ++
Main/System/Recharge/RechargeManager.cs | 6
Main/Utility/CommonFunc.cs | 6
Main/System/CustomizedGift/CustomizedRechargeModel.cs | 4
Main/System/ItemTip/BoxItemWin.cs | 2
Main/System/Mail/MailInfoAwardItemCell.cs | 2
Main/System/HeroUI/HeroListWin.cs | 16
Main/System/Tip/ItemsConfirmWin.cs | 13
Main/System/ItemTip/ChooseItemsWin.cs | 2
Main/Core/GameEngine/Player/PlayerExtersionData.cs | 2
Main/System/KnapSack/Logic/ItemLogicUtility.cs | 8
Main/System/ItemTip/ChooseItemsCell.cs | 2
Main/System/ItemTip/ItemTipWin.cs | 2
Main/System/HeroUI/HeroDeleteLineCell.cs | 23 +
Main/System/HeroUI/HeroTrainWinEx.cs | 13
Main/System/KnapSack/Logic/SinglePack.cs | 6
Main/System/ItemTip/OwnMoneyCell.cs | 5
Main/System/HeroUI/HeroDeleteWin.cs.meta | 11
Main/System/Recharge/DailySpecialsModel.cs | 2
Main/System/HeroUI/HeroTrainWin.cs | 69 ++-
Main/System/KnapSack/PackManager.cs | 4
Main/System/Battle/BattleManager.cs | 4
Main/System/HappyXB/HeroCallWin.cs | 2
Main/System/CustomizedGift/CustomizedGiftChooseCell.cs | 2
Main/System/PhantasmPavilion/PhantasmPavilionModel.cs | 2
Main/System/ItemTip/ItemTipUtility.cs | 14
Main/System/HeroUI/HeroUIManager.Reborn.cs | 100 ++++
Main/System/HeroUI/HeroLVBreakWin.cs | 6
Main/System/Team/TeamType.cs | 6
Main/Utility/Constants.cs | 2
Main/Utility/UIHelper.cs | 175 ---------
Main/System/HeroUI/HeroDeleteHeadCell.cs.meta | 11
Main/System/Tip/FuncRuleWin.cs | 16
Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs | 4
Main/System/HeroUI/HeroUIManager.cs | 6
53 files changed, 751 insertions(+), 322 deletions(-)
diff --git a/Main/Core/GameEngine/Player/PlayerBaseData.cs b/Main/Core/GameEngine/Player/PlayerBaseData.cs
index 665ec99..8c33b85 100644
--- a/Main/Core/GameEngine/Player/PlayerBaseData.cs
+++ b/Main/Core/GameEngine/Player/PlayerBaseData.cs
@@ -11,18 +11,18 @@
public int TitleID;
public uint ExpPoint; //鎵╁厖缁忛獙鐐规暟锛堜嚎锛�
public uint TotalExp; //鎬荤粡楠�(灏忎簬浜块儴鍒�)
- public ulong curExp { get { return TotalExp + ExpPoint * Constants.ExpPointValue; } }
+ public long curExp { get { return TotalExp + ExpPoint * Constants.ExpPointValue; } }
public uint FamilyId; //瀹舵棌
public string FamilyName; //瀹舵棌鍚嶇О
public uint diamond; //浠欑帀
public uint bindDiamond; //鐏电煶
public uint copper; //閾滈挶
- public ulong allCopper { get { return (ulong)copper + (ulong)copperExtend * Constants.ExpPointValue; } }
- public ulong FightPoint; //鎴樻枟鍊�
+ public long allCopper { get { return copper + copperExtend * Constants.ExpPointValue; } }
+ public long FightPoint; //鎴樻枟鍊�
public ushort MapID; //瑙掕壊鎵�鍦ㄥ湴鍥� 鍦板浘瑙勫垯锛欳/S涓�涓�瀵瑰簲鐨勫父瑙勫湴鍥撅紝C鍋囧湴鍥撅紙ExAttr14锛夛紝澶欳涓�涓猄鍦板浘锛圗xAttr3锛�
public ushort PosX; //瑙掕壊鍧愭爣
public ushort PosY;
- public ulong HP; //褰撳墠HP
+ public long HP; //褰撳墠HP
public uint FreePoint; //鏈垎閰嶇偣鏁�
public uint FreeSkillPoint; //鏈垎閰嶇殑鎶�鑳界偣
public int STR; //鍔涢噺
diff --git a/Main/Core/GameEngine/Player/PlayerDatas.cs b/Main/Core/GameEngine/Player/PlayerDatas.cs
index f778b60..99522d5 100644
--- a/Main/Core/GameEngine/Player/PlayerDatas.cs
+++ b/Main/Core/GameEngine/Player/PlayerDatas.cs
@@ -38,7 +38,7 @@
public event Action<long> spNewGetEvent;
- private Dictionary<PlayerDataType, ulong> PlayerDataDict = new Dictionary<PlayerDataType, ulong>();
+ private Dictionary<PlayerDataType, long> PlayerDataDict = new Dictionary<PlayerDataType, long>();
public void InitPlayerData(H0102_tagCDBPlayer data)
{
@@ -526,9 +526,9 @@
}
}
- public ulong GetPlayerDataByType(PlayerDataType type)
+ public long GetPlayerDataByType(PlayerDataType type)
{
- ulong value = 0;
+ long value = 0;
PlayerDataDict.TryGetValue(type, out value);
return value;
}
diff --git a/Main/Core/GameEngine/Player/PlayerExtersionData.cs b/Main/Core/GameEngine/Player/PlayerExtersionData.cs
index 65f51cb..8fc1c34 100644
--- a/Main/Core/GameEngine/Player/PlayerExtersionData.cs
+++ b/Main/Core/GameEngine/Player/PlayerExtersionData.cs
@@ -4,7 +4,7 @@
public class PlayerExtersionData
{
- public ulong MaxHP; // 鏈�澶P 28,
+ public long MaxHP; // 鏈�澶P 28,
public int MaxMP; // 鏈�澶P 30,
public int ExpRate; // 褰撳墠缁忛獙鍊嶇巼 鍗曚綅涓虹櫨鍒嗘瘮 35,
public int DEF; // 澶栭槻 42
diff --git a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
index 8e75dcf..cf6bfd9 100644
--- a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
+++ b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
@@ -40,9 +40,9 @@
// 妫�鏌ヤ竴涓嬮敜瀛愮殑娑堣��
//FightPoint 鐢ㄤ簬璁板綍娑堣�楁垬閿ゅ�嶆暟锛屽皬浜庣瓑浜�1鏃堕粯璁�1鍊嶏紝澶т簬1鏃朵负瀵瑰簲娑堣�楀�嶅�硷紝0418鍒锋柊绫诲瀷22
Debug.LogError("HandModeOperationAgent DoNext 2");
- ulong costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint);
+ long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint);
- ulong cost = (costRate > 1 ? costRate : 1) * 1; // 1鏄粯璁ゆ秷鑰�
+ long cost = (costRate > 1 ? costRate : 1) * 1; // 1鏄粯璁ゆ秷鑰�
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 6ca51aa..b7898a9 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -32,8 +32,8 @@
protected void OnPlayerLoginOk()
{
- ulong exAttr1 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr1);
- ulong exAttr2 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr2);
+ long exAttr1 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr1);
+ long exAttr2 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr2);
int MapID = 1;
int FuncLineID = (int)exAttr2;
diff --git a/Main/System/CustomizedGift/CustomizedGiftChooseCell.cs b/Main/System/CustomizedGift/CustomizedGiftChooseCell.cs
index e0b5420..a48bb20 100644
--- a/Main/System/CustomizedGift/CustomizedGiftChooseCell.cs
+++ b/Main/System/CustomizedGift/CustomizedGiftChooseCell.cs
@@ -26,7 +26,7 @@
int selectID = selectItemInfo[CustomizedRechargeModel.Instance.chooseWinIndex][itemIndex];
int itemId = CTGSelectItemConfig.Get(selectID).ItemID;
int count = CTGSelectItemConfig.Get(selectID).ItemCount;
- var itemData = new ItemCellModel((int)itemId, false, (ulong)count);
+ var itemData = new ItemCellModel(itemId, false, count);
images[i].SetActive(CustomizedRechargeModel.Instance.GetChooseSubIndex(CustomizedRechargeModel.Instance.chooseWinIndex) - 1 == i);
itemCells[i].SetActive(true);
itemCells[i].Init(itemData);
diff --git a/Main/System/CustomizedGift/CustomizedGiftChooseWin.cs b/Main/System/CustomizedGift/CustomizedGiftChooseWin.cs
index 9377078..d8e64d2 100644
--- a/Main/System/CustomizedGift/CustomizedGiftChooseWin.cs
+++ b/Main/System/CustomizedGift/CustomizedGiftChooseWin.cs
@@ -105,7 +105,7 @@
if (chooseIndex != 0)
{
int selectID = ctgConfig.SelectItemInfo[i][chooseIndex - 1];
- var itemData = new ItemCellModel(CTGSelectItemConfig.Get(selectID).ItemID, false, (ulong)CTGSelectItemConfig.Get(selectID).ItemCount);
+ var itemData = new ItemCellModel(CTGSelectItemConfig.Get(selectID).ItemID, false, CTGSelectItemConfig.Get(selectID).ItemCount);
itemCellList[i].Init(itemData);
if (i == CustomizedRechargeModel.Instance.chooseWinIndex)
{
diff --git a/Main/System/CustomizedGift/CustomizedRechargeModel.cs b/Main/System/CustomizedGift/CustomizedRechargeModel.cs
index ad70ee9..261be8f 100644
--- a/Main/System/CustomizedGift/CustomizedRechargeModel.cs
+++ b/Main/System/CustomizedGift/CustomizedRechargeModel.cs
@@ -52,7 +52,7 @@
{
int selectID = selectItemInfo[j][selectedItemIndexs[j] - 1];
- items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, (ulong)CTGSelectItemConfig.Get(selectID).ItemCount));
+ items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, CTGSelectItemConfig.Get(selectID).ItemCount));
}
}
else
@@ -143,7 +143,7 @@
if (i < awards.Count)
{
var award = awards[i];
- var itemData = new ItemCellModel(award.id, false, (ulong)award.countEx);
+ var itemData = new ItemCellModel(award.id, false, award.countEx);
itemCells[i].Init(itemData);
itemCells[i].button.SetListener(() =>
{
diff --git a/Main/System/HappyXB/HappyXBModel.cs b/Main/System/HappyXB/HappyXBModel.cs
index 297dbbe..0af1b07 100644
--- a/Main/System/HappyXB/HappyXBModel.cs
+++ b/Main/System/HappyXB/HappyXBModel.cs
@@ -308,7 +308,7 @@
int moneyType = funcSet.CostMoneyType;
int xbOneMoney = funcSet.CostMoneyList[0];
- if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
+ if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
{
//鏆傚畾鍏呭�艰揣甯侀渶瑕佷簩娆$‘璁�
if (moneyType == 1)
@@ -327,14 +327,7 @@
}
else
{
- if (!GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
- {
- SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
- }
- else
- {
- ItemTipUtility.Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
- }
+ ItemTipUtility.ShowMoneyTip(moneyType);
}
}
}
@@ -363,7 +356,7 @@
//璐у竵瀵诲疂
int moneyType = funcSet.CostMoneyType;
- if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)needMoney)
+ if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
{
//鏆傚畾鍏呭�艰揣甯侀渶瑕佷簩娆$‘璁�
if (moneyType == 1)
@@ -382,14 +375,7 @@
}
else
{
- if (!GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
- {
- SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
- }
- else
- {
- ItemTipUtility.Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
- }
+ ItemTipUtility.ShowMoneyTip(moneyType);
}
}
diff --git a/Main/System/HappyXB/HeroCallScoreWin.cs b/Main/System/HappyXB/HeroCallScoreWin.cs
index 25c32b0..38c902a 100644
--- a/Main/System/HappyXB/HeroCallScoreWin.cs
+++ b/Main/System/HappyXB/HeroCallScoreWin.cs
@@ -43,7 +43,7 @@
var funcSet = TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore);
scoreProcessText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0];
sliderImg.fillAmount = (float)UIHelper.GetMoneyCnt(51) / TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0];
- if (UIHelper.GetMoneyCnt(51) >= (ulong)TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
+ if (UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
{
scoreProcessText.color = UIHelper.GetUIColor(TextColType.LightWhite);
}
diff --git a/Main/System/HappyXB/HeroCallWin.cs b/Main/System/HappyXB/HeroCallWin.cs
index 9e74658..a87d3a9 100644
--- a/Main/System/HappyXB/HeroCallWin.cs
+++ b/Main/System/HappyXB/HeroCallWin.cs
@@ -83,7 +83,7 @@
scoreText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0];
- if (UIHelper.GetMoneyCnt(51) >= (ulong)TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
+ if (UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
{
scoreTween.SetActive(true);
}
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index 2d0ae87..f22f394 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -115,6 +115,49 @@
return TeamManager.Instance.GetTeam(teamType).HasHeroInServer(itemHero.guid);
}
+ //鏄惁涓婁换浣曢樀瀹�
+ public bool IsInAnyTeam()
+ {
+ for (int i = 1; i < (int)TeamType.Max; i++)
+ {
+ if (TeamManager.Instance.GetTeam((TeamType)i).HasHeroInServer(itemHero.guid))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ //鏄惁涓婁换浣曢樀瀹癸紝涓斿彧鏈変竴鍙�
+ public bool IsInAnyTeamJustOne()
+ {
+ for (int i = 1; i < (int)TeamType.Max; i++)
+ {
+ var team = TeamManager.Instance.GetTeam((TeamType)i);
+ if (team.HasHeroInServer(itemHero.guid))
+ {
+ if (team.GetTeamHeroCount() == 1)
+ return true;
+ }
+ }
+ return false;
+ }
+
+ //涓嬮樀鎵�鏈夐樀瀹�
+ public void LeaveAllTeam()
+ {
+ for (int i = 1; i < (int)TeamType.Max; i++)
+ {
+ int pos;
+ var team = TeamManager.Instance.GetTeam((TeamType)i);
+ if (TeamManager.Instance.GetTeam((TeamType)i).RemoveHero(this, out pos))
+ {
+ //濡傛灉鏄渶鍚庝竴涓灏嗭紝鍒欓粯璁や笂闃典竴涓�
+ team.SaveTeam();
+ }
+ }
+ }
+
public long GetSkillsFightPower()
{
long fightPower = 0;
@@ -124,5 +167,14 @@
}
return fightPower;
}
+
+
+ public void ChangeLockState()
+ {
+ var pack = new CB238_tagCSHeroLock();
+ pack.ItemIndex = (ushort)itemHero.gridIndex;
+ pack.IsLock = isLock ? (byte)0 : (byte)1;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroDeleteHeadCell.cs b/Main/System/HeroUI/HeroDeleteHeadCell.cs
new file mode 100644
index 0000000..3fef0d9
--- /dev/null
+++ b/Main/System/HeroUI/HeroDeleteHeadCell.cs
@@ -0,0 +1,94 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class HeroDeleteHeadCell : MonoBehaviour
+{
+ [SerializeField] HeroHeadBaseCell heroHeadBaseCell;
+ [SerializeField] Image jobImg;
+ [SerializeField] Text nameText;
+ [SerializeField] GameObject selectRect;
+ [SerializeField] GameObject maskObj;
+ [SerializeField] GameObject onTeamObj;
+ [SerializeField] GameObject lockObj;
+ [SerializeField] GameObject awakeObj;
+ [SerializeField] Text awakeLVText;
+
+ public void Display(int index)
+ {
+ var guid = HeroUIManager.Instance.heroDeleteSortList[index];
+ var hero = HeroManager.Instance.GetHero(guid);
+ var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType);
+ selectRect.SetActive(HeroUIManager.Instance.selectDeleteHeroList.Contains(guid));
+ maskObj.SetActive(hero.isLock || hero.IsInAnyTeam()
+ || HeroUIManager.Instance.selectDeleteHeroList.Contains(guid) || hero.awakeLevel > 0);
+
+ lockObj.SetActive(hero.isLock);
+ onTeamObj.SetActive(hero.IsInAnyTeam());
+ awakeObj.SetActive(hero.awakeLevel > 0);
+ awakeLVText.text = hero.awakeLevel.ToString();
+
+ heroHeadBaseCell.Init(hero.heroId, hero.SkinID, hero.heroStar, hero.awakeLevel, hero.heroLevel, () =>
+ {
+ Click(hero, index);
+ });
+ nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel);
+
+ jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class));
+ }
+
+ void Click(HeroInfo hero, int index)
+ {
+ //涓婇樀 閿佸畾 瑙夐啋 鐨勬儏鍐�
+ if (hero.awakeLevel > 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroReborn1");
+ return;
+ }
+
+ if (hero.IsInAnyTeamJustOne())
+ {
+ //闃靛鑷冲皯瑕佹湁涓�涓灏嗕笂闃�
+ SysNotifyMgr.Instance.ShowTip("HeroFunc3");
+ return;
+ }
+
+ if (hero.isLock)
+ {
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
+ Language.Get("herocard66"), (bool isOK) =>
+ {
+ if (isOK)
+ {
+ hero.ChangeLockState();
+ }
+ });
+ return;
+ }
+
+ if (hero.IsInAnyTeam())
+ {
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
+ Language.Get("herocard65"), (bool isOK) =>
+ {
+ if (isOK)
+ {
+ hero.LeaveAllTeam();
+ }
+ });
+ return;
+ }
+
+ if (HeroUIManager.Instance.selectDeleteHeroList.Contains(hero.itemHero.guid))
+ {
+ HeroUIManager.Instance.selectDeleteHeroList.Remove(hero.itemHero.guid);
+ }
+ else
+ {
+ HeroUIManager.Instance.selectDeleteHeroList.Add(hero.itemHero.guid);
+ }
+
+ Display(index);
+ }
+}
+
diff --git a/Main/System/HeroUI/HeroDeleteHeadCell.cs.meta b/Main/System/HeroUI/HeroDeleteHeadCell.cs.meta
new file mode 100644
index 0000000..3f63431
--- /dev/null
+++ b/Main/System/HeroUI/HeroDeleteHeadCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c612a8c9405b7504197e93a1c71d9fc7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroDeleteLineCell.cs b/Main/System/HeroUI/HeroDeleteLineCell.cs
new file mode 100644
index 0000000..fffcb06
--- /dev/null
+++ b/Main/System/HeroUI/HeroDeleteLineCell.cs
@@ -0,0 +1,23 @@
+锘縰sing UnityEngine;
+
+public class HeroDeleteLineCell : CellView
+{
+ [SerializeField] HeroDeleteHeadCell[] cardList;
+
+ public void Display(int index)
+ {
+ for (int i = 0; i < cardList.Length; i++)
+ {
+ if (i + index < HeroUIManager.Instance.heroDeleteSortList.Count)
+ {
+ cardList[i].SetActive(true);
+ cardList[i].Display(index + i);
+ }
+ else
+ {
+ cardList[i].SetActive(false);
+ }
+ }
+ }
+}
+
diff --git a/Main/System/HeroUI/HeroDeleteLineCell.cs.meta b/Main/System/HeroUI/HeroDeleteLineCell.cs.meta
new file mode 100644
index 0000000..9509207
--- /dev/null
+++ b/Main/System/HeroUI/HeroDeleteLineCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bbe0726ecc72b50449e34339b7d9af94
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroDeleteWin.cs b/Main/System/HeroUI/HeroDeleteWin.cs
new file mode 100644
index 0000000..ddfb73e
--- /dev/null
+++ b/Main/System/HeroUI/HeroDeleteWin.cs
@@ -0,0 +1,232 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鍩瑰吇鐣岄潰
+/// </summary>
+public class HeroDeleteWin : UIBase
+{
+ [SerializeField] Button storeBtn;
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] HeroSelectBehaviour heroSelectBehaviour;
+ [SerializeField] GameObject noHeroObj;
+ [SerializeField] Button quickSelectBtn;
+ [SerializeField] Button deleteBtn;
+
+ protected override void InitComponent()
+ {
+ storeBtn.AddListener(() =>
+ {
+ // UIManager.Instance.OpenWindow<StoreWin>();
+ });
+ quickSelectBtn.AddListener(QuickSelect);
+ deleteBtn.AddListener(DeleteHero);
+ }
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ TeamManager.Instance.OnTeamChange += OnTeamChange;
+ PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
+ ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent;
+
+ HeroUIManager.Instance.selectHeroDeleteListJob = 0;
+ HeroUIManager.Instance.selectHeroDeleteListCountry = 0;
+
+ HeroUIManager.Instance.SortHeroDeleteList();
+ heroSelectBehaviour.Display(0, HeroUIManager.Instance.selectHeroDeleteListJob, HeroUIManager.Instance.selectHeroDeleteListCountry, SelectJobCountry);
+ RefreshEmptyTip();
+ CreateScroller();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ TeamManager.Instance.OnTeamChange -= OnTeamChange;
+ PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
+ ItemLogicUtility.Instance.OnGetItemShowEvent -= OnGetItemShowEvent;
+ HeroUIManager.Instance.selectDeleteHeroList.Clear();
+ }
+
+ void CreateScroller()
+ {
+ scroller.Refresh();
+ for (int i = 0; i < HeroUIManager.Instance.heroDeleteSortList.Count; i++)
+ {
+ if (i % 5 == 0)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ scroller.Restart();
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroDeleteLineCell;
+ _cell.Display(cell.index);
+ }
+
+ void SelectJobCountry(int job, int country)
+ {
+ HeroUIManager.Instance.selectHeroDeleteListJob = job;
+ HeroUIManager.Instance.selectHeroDeleteListCountry = country;
+ HeroUIManager.Instance.SortHeroDeleteList();
+ CreateScroller();
+ RefreshEmptyTip();
+ }
+
+ void RefreshEmptyTip()
+ {
+ if (HeroUIManager.Instance.heroDeleteSortList.Count <= 0)
+ {
+ noHeroObj.SetActive(true);
+ scroller.SetActive(false);
+ }
+ else
+ {
+ noHeroObj.SetActive(false);
+ scroller.SetActive(true);
+ }
+ }
+
+ void OnTeamChange(TeamType type)
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+
+ void RefreshItemLockEvent(PackType type, string guid, bool lockState)
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+
+ void QuickSelect()
+ {
+ //鍙�夌簿鑻�
+ for (int i = 0; i < HeroUIManager.Instance.heroDeleteSortList.Count; i++)
+ {
+ HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroDeleteSortList[i]);
+ if (hero == null)
+ continue;
+
+ if (hero.Quality > 2)
+ continue;
+ if (hero.awakeLevel > 0)
+ continue;
+ if (hero.isLock)
+ continue;
+ if (hero.IsInAnyTeam())
+ continue;
+
+ if (HeroUIManager.Instance.selectDeleteHeroList.Contains(hero.itemHero.guid))
+ continue;
+
+ HeroUIManager.Instance.selectDeleteHeroList.Add(hero.itemHero.guid);
+ }
+
+ if (HeroUIManager.Instance.selectDeleteHeroList.Count == 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroReborn2");
+ return;
+ }
+
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+
+ void DeleteHero()
+ {
+ if (HeroUIManager.Instance.selectDeleteHeroList.Count == 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroReborn3");
+ return;
+ }
+
+ bool hasStarHero = false;
+ for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++)
+ {
+ HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]);
+ if (hero == null)
+ continue;
+ if (hero.heroStar > 1)
+ {
+ hasStarHero = true;
+ break;
+ }
+ }
+
+ if (hasStarHero)
+ {
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("herocard67"), (bool isOK) =>
+ {
+ if (isOK)
+ {
+ ShowDeleteItems();
+ }
+ });
+ return;
+ }
+
+ ShowDeleteItems();
+
+ }
+
+ void ShowDeleteItems()
+ {
+ Dictionary<int, long> allItemDict = new Dictionary<int, long>();
+ for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++)
+ {
+ HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]);
+ if (hero == null)
+ continue;
+
+
+ allItemDict = CommonFunc.AddDict(allItemDict, CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.Quality, hero.heroLevel),
+ HeroUIManager.Instance.GetHeroBreakPayBack(hero.Quality, hero.breakLevel)));
+
+ Dictionary<int, long> tmpDict = new Dictionary<int, long>();
+
+ foreach (var itemInfo in hero.qualityConfig.DismissReturnItems)
+ {
+ if (!tmpDict.ContainsKey(itemInfo[0]))
+ {
+ tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStar));
+ }
+ else
+ {
+ tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStar);
+ }
+ }
+
+ allItemDict = CommonFunc.AddDict(allItemDict, tmpDict);
+ }
+
+ List<Item> items = CommonFunc.ChangeToItemList(allItemDict);
+ ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard25"), Language.Get("herocard26"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ //鍙戝寘
+ var pack = new CB240_tagCSHeroDismiss();
+ List<ushort> indexList = new List<ushort>();
+ for (int i = 0; i < HeroUIManager.Instance.selectDeleteHeroList.Count; i++)
+ {
+ indexList.Add((ushort)HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]).itemHero.gridIndex);
+ }
+ pack.ItemIndexList = indexList.ToArray();
+ pack.Count = (ushort)pack.ItemIndexList.Length;
+ GameNetSystem.Instance.SendInfo(pack);
+ HeroUIManager.Instance.selectDeleteHeroList.Clear();
+ }
+ });
+
+ }
+
+ void OnGetItemShowEvent()
+ {
+ HeroUIManager.Instance.SortHeroDeleteList();
+ CreateScroller();
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroDeleteWin.cs.meta b/Main/System/HeroUI/HeroDeleteWin.cs.meta
new file mode 100644
index 0000000..bb61e80
--- /dev/null
+++ b/Main/System/HeroUI/HeroDeleteWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d70030f1a7e3bc74fb1ed762daa7a2d3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroLVBreakWin.cs b/Main/System/HeroUI/HeroLVBreakWin.cs
index d63ffd4..833d6d7 100644
--- a/Main/System/HeroUI/HeroLVBreakWin.cs
+++ b/Main/System/HeroUI/HeroLVBreakWin.cs
@@ -65,7 +65,7 @@
}
moneyIcon.SetOrgSprite(ItemConfig.Get(nextBreakLVConfig.UPCostItem[0]).IconKey);
- moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], (ulong)nextBreakLVConfig.UPCostItem[1]);
+ moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], nextBreakLVConfig.UPCostItem[1]);
var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel + 1);
if (nextQualityBreakConfig == null)
@@ -99,12 +99,12 @@
void BreakLV()
{
- if (ItemLogicUtility.CheckItemCount(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], (ulong)hero.qualityBreakConfig.UPCostItem[1], 2))
+ if (ItemLogicUtility.CheckItemCount(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], hero.qualityBreakConfig.UPCostItem[1], 2))
{
var pack = new CB232_tagCSHeroBreak();
pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
GameNetSystem.Instance.SendInfo(pack);
- HeroUIManager.Instance.lastFightPower = new KeyValuePair<int, long>(hero.heroId, hero.CalculatePower(false));
+ HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
CloseWindow();
//璁剧疆涓瓑寰呭洖澶嶇殑鏍囪瘑 鏄剧ず鎴愬姛鐣岄潰
HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse()
diff --git a/Main/System/HeroUI/HeroListWin.cs b/Main/System/HeroUI/HeroListWin.cs
index 24f64af..7af32c7 100644
--- a/Main/System/HeroUI/HeroListWin.cs
+++ b/Main/System/HeroUI/HeroListWin.cs
@@ -48,6 +48,7 @@
heroListScroller.OnRefreshCell += OnRefreshCell;
PackManager.Instance.gridRefreshEvent += GridRefreshEvent;
PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
+ UIManager.Instance.OnCloseWindow += OnCloseWindow;
HeroUIManager.Instance.SortHeroList();
CreateScroller();
Refresh();
@@ -58,6 +59,21 @@
heroListScroller.OnRefreshCell -= OnRefreshCell;
PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
PackManager.Instance.gridRefreshEvent -= GridRefreshEvent;
+ UIManager.Instance.OnCloseWindow -= OnCloseWindow;
+ }
+
+
+ private void OnCloseWindow(UIBase closeUI)
+ {
+ //鍏朵粬姝﹀皢鍔熻兘浜х敓鏁版嵁鍙樺寲锛岄渶瑕佸埛鏂版灏嗗垪琛�
+ if (closeUI is HeroTrainWin ||
+ closeUI is HeroCallWin ||
+ closeUI is HeroPosWin)
+ {
+ HeroUIManager.Instance.SortHeroList();
+ CreateScroller();
+ Refresh();
+ }
}
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index bf6e1a9..215c2c7 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -84,7 +84,7 @@
ChangeHero(-1);
});
- lockBtn.AddListener(SetLockState);
+ lockBtn.AddListener(()=> { hero.ChangeLockState(); });
resetBtn.AddListener(ResetBtnClick);
deleteBtn.AddListener(DeleteHero);
awakeBtn.AddListener(() =>
@@ -122,6 +122,7 @@
{
PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
+ UIManager.Instance.OnCloseWindow += OnCloseWindow;
guid = HeroUIManager.Instance.selectHeroGuid;
hero = HeroManager.Instance.GetHero(guid);
unfoldState = false;
@@ -133,9 +134,21 @@
{
PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent;
+ UIManager.Instance.OnCloseWindow -= OnCloseWindow;
}
-
+ private void OnCloseWindow(UIBase closeUI)
+ {
+ //鍏朵粬鐣岄潰鍒犻櫎姝﹀皢浼氬奖鍝嶉�昏緫
+ if (closeUI is HeroDeleteWin)
+ {
+ HeroUIManager.Instance.SortHeroList();
+ if (HeroManager.Instance.GetHero(guid) == null)
+ {
+ CloseWindow();
+ }
+ }
+ }
public override void Refresh()
{
roleLhModel.Create(hero.SkinID, HeroUIManager.lihuiScale, motionName: "", isLh: true);
@@ -214,14 +227,6 @@
Refresh();
}
- void SetLockState()
- {
- var pack = new CB238_tagCSHeroLock();
- pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
- pack.IsLock = hero.isLock ? (byte)0 : (byte)1;
- GameNetSystem.Instance.SendInfo(pack);
- }
-
void ResetBtnClick()
{
//鍗囩骇銆佺獊鐮淬�佽閱�
@@ -235,7 +240,7 @@
var payBack1 = CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.Quality, hero.heroLevel),
- HeroUIManager.Instance.GetHeroBreakPayBack(hero.heroId, hero.breakLevel));
+ HeroUIManager.Instance.GetHeroBreakPayBack(hero.Quality, hero.breakLevel));
//宸茶閱掔殑闇�瑕佹秷鑰楄揣甯�
if (hero.awakeLevel == 0)
@@ -252,17 +257,30 @@
}
else
{
- payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.heroId, hero.awakeLevel));
+
+ if (HeroUIManager.Instance.awakeRebirthCnt >= HeroUIManager.Instance.rebornAwakeHeroMaxCount)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax");
+ return;
+ }
+
+ payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.Quality, hero.awakeLevel));
items = CommonFunc.ChangeToItemList(payBack1);
var info2 = Language.Get("herocard44", HeroUIManager.Instance.awakeRebirthCnt);
+ var payBackMoney = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel).RebirthCostMoney;
ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
{
if (isOk)
{
+ if (UIHelper.GetMoneyCnt(HeroUIManager.Instance.payBackMoneyType) < payBackMoney)
+ {
+ ItemTipUtility.ShowMoneyTip(HeroUIManager.Instance.payBackMoneyType);
+ return;
+ }
//鍙戝寘
SendReborn(hero.itemHero.gridIndex);
}
- }, info2, "", HeroUIManager.Instance.payBackMoney, HeroUIManager.Instance.payBackMoneyType);
+ }, info2, "", payBackMoney, HeroUIManager.Instance.payBackMoneyType);
}
@@ -273,15 +291,20 @@
var pack = new CB239_tagCSHeroRebirth();
pack.ItemIndex = (ushort)index;
GameNetSystem.Instance.SendInfo(pack);
+
+ HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
+
}
void DeleteHero()
{
- if (hero.isLock)
- {
- SysNotifyMgr.Instance.ShowTip("UnlockHero");
- return;
- }
+ // if (hero.isLock)
+ // {
+ // SysNotifyMgr.Instance.ShowTip("UnlockHero");
+ // return;
+ // }
+
+ UIManager.Instance.OpenWindow<HeroDeleteWin>();
}
void RefreshStars()
@@ -380,14 +403,14 @@
lvupBtnText.text = Language.Get("L1111");
var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel);
lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(breakConfig.UPCostItem[0]).IconKey);
- lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, breakConfig.UPCostItem[0], (ulong)breakConfig.UPCostItem[1], TextColType.NavyBrown);
+ lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, breakConfig.UPCostItem[0], breakConfig.UPCostItem[1], TextColType.NavyBrown);
}
else
{
lvupBtnText.text = Language.Get("L1109");
var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(lvupConfig.UPCostItem[0]).IconKey);
- lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], (ulong)lvupConfig.UPCostItem[1], TextColType.NavyBrown);
+ lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], lvupConfig.UPCostItem[1], TextColType.NavyBrown);
}
}
@@ -404,7 +427,7 @@
void LVUp()
{
int itemID = 0;
- ulong needCount = 0;
+ long needCount = 0;
if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero))
{
//绐佺牬
@@ -419,7 +442,7 @@
//鍗囩骇
var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
itemID = lvupConfig.UPCostItem[0];
- needCount = (ulong)lvupConfig.UPCostItem[1];
+ needCount = lvupConfig.UPCostItem[1];
if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, needCount, 2))
{
var pack = new CB230_tagCSHeroLVUP();
@@ -436,7 +459,7 @@
{
addPerObject.SetActive(false);
});
- HeroUIManager.Instance.lastFightPower = new KeyValuePair<int, long>(hero.heroId, hero.CalculatePower(false));
+ HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
}
}
diff --git a/Main/System/HeroUI/HeroTrainWinEx.cs b/Main/System/HeroUI/HeroTrainWinEx.cs
new file mode 100644
index 0000000..c3f9aee
--- /dev/null
+++ b/Main/System/HeroUI/HeroTrainWinEx.cs
@@ -0,0 +1,13 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鍩瑰吇鐣岄潰
+/// </summary>
+public partial class HeroTrainWin : UIBase
+{
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroTrainWinEx.cs.meta b/Main/System/HeroUI/HeroTrainWinEx.cs.meta
new file mode 100644
index 0000000..0820870
--- /dev/null
+++ b/Main/System/HeroUI/HeroTrainWinEx.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0a54f9a153cd2c04cb1deeeaa05b7741
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroUIManager.Reborn.cs b/Main/System/HeroUI/HeroUIManager.Reborn.cs
index 2ad8871..f411a1c 100644
--- a/Main/System/HeroUI/HeroUIManager.Reborn.cs
+++ b/Main/System/HeroUI/HeroUIManager.Reborn.cs
@@ -6,46 +6,60 @@
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
{
-
+
#region 閲嶇敓 閬f暎
public int awakeRebirthCnt { get; private set; }
public int payBackMoneyType;
- public int payBackMoney;
- public Dictionary<int, ulong> GetHeroLVPayBack(int quality, int lv)
+ public int rebornAwakeHeroMaxCount; //瑙夐啋姝﹀皢姣忔棩鐨勬渶澶ч噸鐢熸鏁�
+
+ public List<string> heroDeleteSortList { get; private set; } = new List<string>();
+ public int selectHeroDeleteListJob = 0; //绛涢�夎亴涓�
+ public int selectHeroDeleteListCountry = 0; //绛涢�夊浗瀹�
+
+ public List<string> selectDeleteHeroList { get; private set; } = new List<string>();
+
+
+ public Dictionary<int, long> GetHeroLVPayBack(int quality, int lv)
{
//姹囨�昏繑杩樻�绘暟閲�
- Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>();
+ Dictionary<int, long> itemCounDic = new Dictionary<int, long>();
for (int i = 1; i < lv; i++)
{
- var config = HeroQualityLVConfig.GetQualityLVConfig(quality, lv);
+ var config = HeroQualityLVConfig.GetQualityLVConfig(quality, i);
var itemID = config.UPCostItem[0];
- var count = (ulong)config.UPCostItem[1];
+ var count = config.UPCostItem[1];
if (!itemCounDic.ContainsKey(itemID))
{
itemCounDic[itemID] = count;
}
- itemCounDic[itemID] = itemCounDic[itemID] + count;
+ else
+ {
+ itemCounDic[itemID] += count;
+ }
}
return itemCounDic;
}
- public Dictionary<int, ulong> GetHeroBreakPayBack(int quality, int lv)
+ public Dictionary<int, long> GetHeroBreakPayBack(int quality, int lv)
{
//姹囨�昏繑杩樻�绘暟閲�
- Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>();
+ Dictionary<int, long> itemCounDic = new Dictionary<int, long>();
for (int i = 0; i < lv; i++)
{
- var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, lv);
+ var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, i);
var itemID = config.UPCostItem[0];
- var count = (ulong)config.UPCostItem[1];
+ var count = config.UPCostItem[1];
if (!itemCounDic.ContainsKey(itemID))
{
itemCounDic[itemID] = count;
}
- itemCounDic[itemID] = itemCounDic[itemID] + count;
+ else
+ {
+ itemCounDic[itemID] += count;
+ }
}
return itemCounDic;
@@ -53,20 +67,23 @@
}
- public Dictionary<int, ulong> GetHeroQualityAwakePayBack(int quality, int lv)
+ public Dictionary<int, long> GetHeroQualityAwakePayBack(int quality, int lv)
{
//姹囨�昏繑杩樻�绘暟閲�
- Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>();
+ Dictionary<int, long> itemCounDic = new Dictionary<int, long>();
for (int i = 0; i < lv; i++)
{
var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(quality, lv);
var itemID = config.UPCostItem[0];
- var count = (ulong)config.UPCostItem[1];
+ var count = config.UPCostItem[1];
if (!itemCounDic.ContainsKey(itemID))
{
itemCounDic[itemID] = count;
}
- itemCounDic[itemID] = itemCounDic[itemID] + count;
+ else
+ {
+ itemCounDic[itemID] = itemCounDic[itemID] + count;
+ }
}
return itemCounDic;
@@ -77,7 +94,56 @@
awakeRebirthCnt = netPack.AwakeRebirthCnt;
}
+
+ public void SortHeroDeleteList()
+ {
+ heroDeleteSortList = HeroManager.Instance.GetHeroGuidList(selectHeroDeleteListJob, selectHeroDeleteListCountry);
+ heroDeleteSortList.Sort(CmpDeleteHero);
+ }
+
+
+ int CmpDeleteHero(string guidA, string guidB)
+ {
+ HeroInfo heroA = HeroManager.Instance.GetHero(guidA);
+ HeroInfo heroB = HeroManager.Instance.GetHero(guidB);
+ if (heroA == null || heroB == null)
+ {
+ return 0;
+ }
+
+ // 鎺掑簭瑙勫垯锛氫笂闃�>姝﹀皢绛夌骇锛炵獊鐮寸瓑绾э紴姝﹀皢瑙夐啋闃剁骇锛炴灏嗗搧璐紴姝﹀皢鍚炲櫖鏄熺骇锛炴灏咺D
+ bool isInTeamA = heroA.IsInAnyTeam();
+ bool isInTeamB = heroB.IsInAnyTeam();
+ if (isInTeamA != isInTeamB)
+ {
+ return isInTeamA ? 1 : -1;
+ }
+ if (heroA.heroLevel != heroB.heroLevel)
+ {
+ return heroA.heroLevel < heroB.heroLevel ? -1 : 1;
+ }
+ if (heroA.breakLevel != heroB.breakLevel)
+ {
+ return heroA.breakLevel < heroB.breakLevel ? -1 : 1;
+ }
+ if (heroA.awakeLevel != heroB.awakeLevel)
+ {
+ return heroA.awakeLevel < heroB.awakeLevel ? -1 : 1;
+ }
+ if (heroA.Quality != heroB.Quality)
+ {
+ return heroA.Quality < heroB.Quality ? -1 : 1;
+ }
+ if (heroA.heroStar != heroA.heroStar)
+ {
+ return heroA.heroStar < heroB.heroStar ? -1 : 1;
+ }
+
+ return heroB.heroId.CompareTo(heroA.heroId);
+ }
+
+
#endregion
-
+
}
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 6772011..874b6f1 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -19,7 +19,7 @@
public const float lihuiScale = 0.6f; //绔嬬粯缂╂斁澶у皬
//鐢ㄤ簬闈炰笂闃垫灏嗘垬鍔涘彉鍖栨椂 姝﹀皢ID锛氫笂娆℃垬鍔�
- public KeyValuePair<int, long> lastFightPower = new KeyValuePair<int, long>(0, 0);
+ public KeyValuePair<string, long> lastFightPower = new KeyValuePair<string, long>();
public override void Init()
{
@@ -38,7 +38,7 @@
{
var config = FuncConfigConfig.Get("HeroRebirth");
payBackMoneyType = int.Parse(config.Numerical1);
- payBackMoney = int.Parse(config.Numerical2);
+ rebornAwakeHeroMaxCount = int.Parse(config.Numerical2);
}
public void OnBeforePlayerDataInitialize()
@@ -147,7 +147,7 @@
{
if (isOK)
{
- if (UIHelper.GetMoneyCnt(buyInfo[0]) < (ulong)buyInfo[1])
+ if (UIHelper.GetMoneyCnt(buyInfo[0]) < buyInfo[1])
{
SysNotifyMgr.Instance.ShowTip("LackMoney", buyInfo[0]);
return;
diff --git a/Main/System/Invest/InvestModel.cs b/Main/System/Invest/InvestModel.cs
index cebccca..161b1fb 100644
--- a/Main/System/Invest/InvestModel.cs
+++ b/Main/System/Invest/InvestModel.cs
@@ -116,7 +116,7 @@
items.Add(new Item()
{
id = itemArray[j][0],
- countEx = (ulong)itemArray[j][1],
+ countEx = itemArray[j][1],
bind = itemArray[j][2],
});
}
@@ -150,9 +150,9 @@
}
//鑾峰緱鍗曟姇璧勭殑鎬绘敹鐩�
- public ulong GetTotalIncome(int type)
+ public long GetTotalIncome(int type)
{
- ulong income = 0;
+ long income = 0;
if (m_InvestItems.ContainsKey(type))
{
var keyList = m_InvestItems[type].Keys.ToList();
diff --git a/Main/System/ItemTip/BoxGetItemModel.cs b/Main/System/ItemTip/BoxGetItemModel.cs
index 2811a19..522b6af 100644
--- a/Main/System/ItemTip/BoxGetItemModel.cs
+++ b/Main/System/ItemTip/BoxGetItemModel.cs
@@ -2,6 +2,7 @@
using LitJson;
using System.Collections.Generic;
+using UnityEngine;
/// <summary>
/// 瀹濈鍔熻兘 + 鑾峰彇濂栧姳鐣岄潰
@@ -76,14 +77,19 @@
// ModelCenter.Instance.GetModel<FairySiegeActModel>()?.OnUpdateAwardInfoAction(netPack);
// return;
// }
- if (!commonShowAwardEvents.Contains(eventName))
+ // if (!commonShowAwardEvents.Contains(eventName))
+ // return;
+ if (string.IsNullOrEmpty(eventName))
+ {
+ Debug.Log("鑾峰緱鐗╁搧灞曠ず 鏃犱簨浠跺悕");
return;
+ }
List<Item> showItems = new List<Item>();
if (netPack.Exp != 0 || netPack.ExpPoint != 0)
{
- ulong expValue = netPack.Exp + netPack.ExpPoint * (ulong)Constants.ExpPointValue;
+ long expValue = netPack.Exp + netPack.ExpPoint * Constants.ExpPointValue;
showItems.Add(new Item(GeneralDefine.expDisplayId, expValue));
}
if (netPack.MoneyList.Length != 0)
@@ -305,7 +311,7 @@
var selectlistDict = ConfigParse.GetDic<int, int>(config.SelectList);
foreach (var item in selectlistDict)
{
- itemIDs.Add(new Item(item.Key, (ulong)item.Value));
+ itemIDs.Add(new Item(item.Key, item.Value));
}
}
@@ -314,7 +320,7 @@
var itemListDict = ConfigParse.GetDic<int, int>(config.FixedItem);
foreach (var item in itemListDict)
{
- itemIDs.Add(new Item(item.Key, (ulong)item.Value));
+ itemIDs.Add(new Item(item.Key, item.Value));
}
}
@@ -324,7 +330,7 @@
for (int i = 0; i < arr.Count; i++)
{
- itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), ulong.Parse(arr[i][1][1].ToString())));
+ itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), long.Parse(arr[i][1][1].ToString())));
}
}
@@ -334,7 +340,7 @@
for (int i = 0; i < arr.Count; i++)
{
- itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), ulong.Parse(arr[i][1][1].ToString())));
+ itemIDs.Add(new Item(int.Parse(arr[i][1][0].ToString()), long.Parse(arr[i][1][1].ToString())));
}
}
diff --git a/Main/System/ItemTip/BoxItemWin.cs b/Main/System/ItemTip/BoxItemWin.cs
index 00b7866..4dc8d28 100644
--- a/Main/System/ItemTip/BoxItemWin.cs
+++ b/Main/System/ItemTip/BoxItemWin.cs
@@ -53,7 +53,7 @@
itemCount = ItemTipUtility.mainTipData.baseInfo.count;
guid = ItemTipUtility.mainTipData.guid;
- itemCell.Init(new ItemCellModel(itemID, false, (ulong)itemCount));
+ itemCell.Init(new ItemCellModel(itemID, false, itemCount));
var itemConfig = ItemConfig.Get(itemID);
nameText.text = itemConfig.ItemName;
descText.text = itemConfig.Description;
diff --git a/Main/System/ItemTip/ChooseItemsCell.cs b/Main/System/ItemTip/ChooseItemsCell.cs
index 189b175..eca485b 100644
--- a/Main/System/ItemTip/ChooseItemsCell.cs
+++ b/Main/System/ItemTip/ChooseItemsCell.cs
@@ -20,7 +20,7 @@
this.guid = _guid;
ItemConfig itemConfig = ItemConfig.Get(itemId);
int count = itemArr[1];
- itemCell.Init(new ItemCellModel(itemId, false, (ulong)count));
+ itemCell.Init(new ItemCellModel(itemId, false, count));
itemCell.button.SetListener(() =>
{
ItemTipUtility.Show(itemId);
diff --git a/Main/System/ItemTip/ChooseItemsWin.cs b/Main/System/ItemTip/ChooseItemsWin.cs
index c4ed39a..b5cd23b 100644
--- a/Main/System/ItemTip/ChooseItemsWin.cs
+++ b/Main/System/ItemTip/ChooseItemsWin.cs
@@ -43,7 +43,7 @@
guid = ItemTipUtility.mainTipData.guid;
InitItemsData();
- itemCell.Init(new ItemCellModel(itemID, false, (ulong)itemCount));
+ itemCell.Init(new ItemCellModel(itemID, false, itemCount));
var itemConfig = ItemConfig.Get(itemID);
nameText.text = itemConfig.ItemName;
descText.text = itemConfig.Description;
diff --git a/Main/System/ItemTip/ItemTipUtility.cs b/Main/System/ItemTip/ItemTipUtility.cs
index 76035e2..9c80061 100644
--- a/Main/System/ItemTip/ItemTipUtility.cs
+++ b/Main/System/ItemTip/ItemTipUtility.cs
@@ -223,6 +223,20 @@
public static TipData mainTipData { get; private set; } // 娉ㄦ剰褰撻�掕繘鐐瑰嚮鎵撳紑澶氫釜tip鐣岄潰浼氬彉鏇存暟鎹紝涓嶈兘渚濊禆姝ゅ��
public static TipData secondaryData { get; private set; }
+ public static void ShowMoneyTip(int moneyType)
+ {
+ if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
+ {
+ Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
+ }
+ else
+ {
+ SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
+ // Debug.LogErrorFormat("閰嶇疆MoneyDisplayModel 鏌ユ棤姝よ揣甯侊細{0}", moneyType);
+ }
+ }
+
+
public static void Show(int itemId, bool showGetWay = false)
{
if (!ItemConfig.HasKey(itemId))
diff --git a/Main/System/ItemTip/ItemTipWin.cs b/Main/System/ItemTip/ItemTipWin.cs
index 1fb83b2..7f99f08 100644
--- a/Main/System/ItemTip/ItemTipWin.cs
+++ b/Main/System/ItemTip/ItemTipWin.cs
@@ -19,7 +19,7 @@
var item = ItemTipUtility.mainTipData.baseInfo;
if (string.IsNullOrEmpty(ItemTipUtility.mainTipData.guid))
{
- itemCell.Init(new ItemCellModel(item.itemId, false, (ulong)item.count));
+ itemCell.Init(new ItemCellModel(item.itemId, false, item.count));
}
else
{
diff --git a/Main/System/ItemTip/OwnMoneyCell.cs b/Main/System/ItemTip/OwnMoneyCell.cs
index 61e4e58..93264d7 100644
--- a/Main/System/ItemTip/OwnMoneyCell.cs
+++ b/Main/System/ItemTip/OwnMoneyCell.cs
@@ -27,10 +27,7 @@
// break;
default:
{
- if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
- {
- ItemTipUtility.Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
- }
+ ItemTipUtility.ShowMoneyTip(moneyType);
}
break;
}
diff --git a/Main/System/KnapSack/BackpackData.cs b/Main/System/KnapSack/BackpackData.cs
index 058bfab..5dac9ab 100644
--- a/Main/System/KnapSack/BackpackData.cs
+++ b/Main/System/KnapSack/BackpackData.cs
@@ -9,11 +9,11 @@
public struct Item
{
public int id;
- public ulong countEx;
+ public long countEx;
public int quality;
public int bind; //缁戝畾 鎴栬�� 鎷嶅崠 浜ゆ槗
- public Item(int _id, ulong _count)
+ public Item(int _id, long _count)
{
this.id = _id;
this.quality = 0;
@@ -22,7 +22,7 @@
}
- public Item(int _id, ulong _count, int _quality)
+ public Item(int _id, long _count, int _quality)
{
this.id = _id;
this.quality = _quality;
@@ -30,7 +30,7 @@
this.countEx = _count;
}
- public Item(int _id, ulong _count, int _bind = 0, int _quality = 0)
+ public Item(int _id, long _count, int _bind = 0, int _quality = 0)
{
this.id = _id;
this.quality = _quality;
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
index 104a518..2602329 100644
--- a/Main/System/KnapSack/Logic/ItemLogicUtility.cs
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -270,7 +270,7 @@
/// <param name="needCount 闇�瑕佹暟閲�"></param>
/// <param name="needTips">0 涓嶅搷搴� 1 寮规彁绀� 2 寮硅幏鍙栭�斿緞tips</param>
/// <returns></returns>
- public static bool CheckItemCount(PackType packType, int itemId, ulong needCount, int needTips = 0)
+ public static bool CheckItemCount(PackType packType, int itemId, long needCount, int needTips = 0)
{
if (needCount <= 0)
{
@@ -296,14 +296,14 @@
return isEnough;
}
- public static bool CheckCurrencyCount(int moneyType, ulong needCount, bool needTips = false)
+ public static bool CheckCurrencyCount(int moneyType, long needCount, bool needTips = false)
{
if (needCount <= 0)
{
return true;
}
- ulong haveCount = UIHelper.GetMoneyCnt(moneyType);
+ long haveCount = UIHelper.GetMoneyCnt(moneyType);
bool isEnough = haveCount >= needCount;
@@ -895,7 +895,7 @@
#endregion
//璁剧疆鐜╁璐у竵鏄剧ず
- public string OnChangeCoinsUnit(ulong value)
+ public string OnChangeCoinsUnit(long value)
{
return UIHelper.ReplaceLargeNum(value);
}
diff --git a/Main/System/KnapSack/Logic/SinglePack.cs b/Main/System/KnapSack/Logic/SinglePack.cs
index ceea737..3666ed5 100644
--- a/Main/System/KnapSack/Logic/SinglePack.cs
+++ b/Main/System/KnapSack/Logic/SinglePack.cs
@@ -182,9 +182,9 @@
return list;
}
- public ulong GetCountById(int itemId, bool includeAuction = true)
+ public long GetCountById(int itemId, bool includeAuction = true)
{
- ulong count = 0;
+ long count = 0;
//閮ㄥ垎璐у竵鍜岀墿鍝佺粦瀹�
if (GeneralDefine.itemMoneyCountDict.ContainsKey(itemId))
@@ -202,7 +202,7 @@
{
continue;
}
- count += (ulong)item.count;
+ count += item.count;
}
}
return count;
diff --git a/Main/System/KnapSack/New/CommonItemBaisc.cs b/Main/System/KnapSack/New/CommonItemBaisc.cs
index 2298e1d..b2bfedc 100644
--- a/Main/System/KnapSack/New/CommonItemBaisc.cs
+++ b/Main/System/KnapSack/New/CommonItemBaisc.cs
@@ -195,7 +195,7 @@
public virtual void Init(ItemModel model, bool isCompare = false)
{
itemId = model.itemId;
- InitUI(model.guid, model.itemId, (ulong)model.count, model.isAuction, model.packType, isCompare, model.useDataDict);
+ InitUI(model.guid, model.itemId, model.count, model.isAuction, model.packType, isCompare, model.useDataDict);
}
/// <summary>
@@ -208,7 +208,7 @@
InitUI(model.guid, model.itemId, model.count, false, model.packType, model.isCompare, model.useDataDic);
}
- private void InitUI(string guid, int itemId, ulong count, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic)
+ private void InitUI(string guid, int itemId, long count, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic)
{
var config = ItemConfig.Get(itemId);
if (config == null) return;
@@ -371,7 +371,7 @@
{
public string guid { get; private set; }
public int itemId { get; private set; }
- public ulong count { get; private set; }
+ public long count { get; private set; }
public int score { get; private set; }
public bool isCompare { get; private set; }
public ItemConfig itemConfig { get { return ItemConfig.Get(itemId); } }
@@ -379,7 +379,7 @@
public Dictionary<int, List<int>> useDataDic { get; private set; }
- public ItemCellModel(int itemId, bool isPreview = false, ulong count = 0, string guid = "", PackType type = PackType.Deleted, bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
+ public ItemCellModel(int itemId, bool isPreview = false, long count = 0, string guid = "", PackType type = PackType.Deleted, bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
{
this.itemId = AdjustItemId(itemId);
this.guid = guid;
@@ -402,7 +402,7 @@
this.score = 0;
}
- public ItemCellModel(int itemId, bool isPreview, ulong count)
+ public ItemCellModel(int itemId, bool isPreview, long count)
{
this.itemId = AdjustItemId(itemId);
this.guid = "";
diff --git a/Main/System/KnapSack/PackManager.cs b/Main/System/KnapSack/PackManager.cs
index b351c6e..39aaa30 100644
--- a/Main/System/KnapSack/PackManager.cs
+++ b/Main/System/KnapSack/PackManager.cs
@@ -779,9 +779,9 @@
/// <param name="type"></param>
/// <param name="id"></param>
/// <returns></returns>
- public ulong GetItemCountByID(PackType type, int id, bool includeAuction = true)
+ public long GetItemCountByID(PackType type, int id, bool includeAuction = true)
{
- ulong count = 0;
+ long count = 0;
var singlePack = GetSinglePack(type);
if (singlePack != null)
{
diff --git a/Main/System/Mail/MailInfoAwardItemCell.cs b/Main/System/Mail/MailInfoAwardItemCell.cs
index f430bc5..dfbec30 100644
--- a/Main/System/Mail/MailInfoAwardItemCell.cs
+++ b/Main/System/Mail/MailInfoAwardItemCell.cs
@@ -13,7 +13,7 @@
if (index < 0 || index >= mailData.Items.Count)
return;
MailItemData data = mailData.Items[index];
- itemCell.Init(new ItemCellModel((int)data.ItemID, true, (ulong)data.Count));
+ itemCell.Init(new ItemCellModel((int)data.ItemID, true, data.Count));
itemCell.button.SetListener(() => ItemTipUtility.Show((int)data.ItemID));
imgHave.SetActive(mailState == 3);
diff --git a/Main/System/Main/PlayerMainDate.cs b/Main/System/Main/PlayerMainDate.cs
index b3d69bf..83a542b 100644
--- a/Main/System/Main/PlayerMainDate.cs
+++ b/Main/System/Main/PlayerMainDate.cs
@@ -47,19 +47,19 @@
}
- public void PowerAdd(ulong power)
+ public void PowerAdd(long power)
{
if (prowBool)
{
- prowNum = (long)power;
+ prowNum = power;
prowBool = false;
}
else
{
- if ((long)power != prowNum)
+ if (power != prowNum)
{
- prowNumChange = (long)power - prowNum;
- prowNum = (long)power;
+ prowNumChange = power - prowNum;
+ prowNum = power;
isAdd = prowNumChange > 0;
prowNumChange = Math.Abs(prowNumChange);
if (customDisplayPower != null && customDisplayPower())
@@ -75,7 +75,7 @@
}
else
{
- prowNum = (long)power;
+ prowNum = power;
}
}
}
@@ -99,7 +99,7 @@
/// <param name="hero"></param>
public void AddPowerNotOnTeam(HeroInfo hero)
{
- if (HeroUIManager.Instance.lastFightPower.Key != hero.heroId)
+ if (HeroUIManager.Instance.lastFightPower.Key != hero.itemHero.guid)
{
return;
}
@@ -110,6 +110,7 @@
}
prowNumChange = hero.CalculatePower() - HeroUIManager.Instance.lastFightPower.Value;
+ HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>();
isAdd = prowNumChange > 0;
prowNumChange = Math.Abs(prowNumChange);
prowNum = hero.CalculatePower();
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs b/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
index 617a7e2..7f64a15 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
@@ -430,7 +430,7 @@
return 0;
//婵�娲荤墿鍝佹暟閲忎笉瓒�
var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
- if (hasCnt < (ulong)count)
+ if (hasCnt < count)
return 0;
return 1;
}
diff --git a/Main/System/Recharge/DailySpecialsModel.cs b/Main/System/Recharge/DailySpecialsModel.cs
index 27c7802..31dc062 100644
--- a/Main/System/Recharge/DailySpecialsModel.cs
+++ b/Main/System/Recharge/DailySpecialsModel.cs
@@ -55,7 +55,7 @@
List<Item> itemList = new List<Item>();
for (int j = 0; j < giftInfoDict[giftInfokeyList[i]].Count; j++)
{
- Item item = new Item(giftInfoDict[giftInfokeyList[i]][j][0], (ulong)giftInfoDict[giftInfokeyList[i]][j][1]);
+ Item item = new Item(giftInfoDict[giftInfokeyList[i]][j][0], giftInfoDict[giftInfokeyList[i]][j][1]);
itemList.Add(item);
}
itemAllList.Add(itemList);
diff --git a/Main/System/Recharge/RechargeManager.cs b/Main/System/Recharge/RechargeManager.cs
index e15f1b3..603b5d9 100644
--- a/Main/System/Recharge/RechargeManager.cs
+++ b/Main/System/Recharge/RechargeManager.cs
@@ -204,7 +204,7 @@
m_RechargeGainItemDict.Add(configs[i].CTGID, _itemList);
for (int k = 0; k < _itemArray.Length; k++)
{
- Item _item = new Item(_itemArray[k][0], (ulong)_itemArray[k][1]);
+ Item _item = new Item(_itemArray[k][0], _itemArray[k][1]);
_itemList.Add(_item);
}
}
@@ -262,7 +262,7 @@
for (int i = 0; i < _itemJson[jobstr].Count; i++)
{
m_FirstChargeItemDict[day][job].Add(new Item(int.Parse(_itemJson[jobstr][i][0].ToString()),
- ulong.Parse(_itemJson[jobstr][i][1].ToString())));
+ long.Parse(_itemJson[jobstr][i][1].ToString())));
}
}
@@ -274,7 +274,7 @@
var _itemCommon = JsonMapper.ToObject<int[][]>(config.CommItemList);
for (int i = 0; i < _itemCommon.Length; i++)
{
- m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], (ulong)_itemCommon[i][1]));
+ m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], _itemCommon[i][1]));
}
diff --git a/Main/System/RoleParticulars/RoleParticularModel.cs b/Main/System/RoleParticulars/RoleParticularModel.cs
index f0023c6..ac99679 100644
--- a/Main/System/RoleParticulars/RoleParticularModel.cs
+++ b/Main/System/RoleParticulars/RoleParticularModel.cs
@@ -34,7 +34,7 @@
public int viewPlayerType { get; private set; }
private Dictionary<int, ViewPlayerData> viewPlayerDataDic = new Dictionary<int, ViewPlayerData>();
- private Dictionary<int, ulong> funcFightPowerDict = new Dictionary<int, ulong>();
+ private Dictionary<int, long> funcFightPowerDict = new Dictionary<int, long>();
public event Action PowerUpdate;
public static Action<int, int, ViewPlayerData> OnRevPackage; //灏介噺涓嶈鐢ㄧ涓�涓弬鏁皏iewtype鍋氬垽鏂紝瀹规槗鍑洪敊
@@ -212,7 +212,7 @@
}
}
- public ulong GetFuncFightPower(int type)
+ public long GetFuncFightPower(int type)
{
if (funcFightPowerDict.ContainsKey(type))
{
diff --git a/Main/System/Store/StoreModel.cs b/Main/System/Store/StoreModel.cs
index 68c176d..96dfc34 100644
--- a/Main/System/Store/StoreModel.cs
+++ b/Main/System/Store/StoreModel.cs
@@ -922,11 +922,11 @@
#endregion
- private ulong _price;
+ private long _price;
public void SendBuyShopItem(StoreConfig model, int count)
{
- _price = (ulong)(model.MoneyNumber * count);
+ _price = model.MoneyNumber * count;
if (MoneyIsEnough(model.MoneyType, _price))
{
@@ -1052,7 +1052,7 @@
}
- public bool MoneyIsEnough(int moneyType, ulong money)
+ public bool MoneyIsEnough(int moneyType, long money)
{
if (UIHelper.GetMoneyCnt(moneyType) < money)
{
@@ -1409,7 +1409,7 @@
{
if (!TryGetIsSellOut(storeConfig, out remainNum))
{
- if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= (ulong)storeConfig.MoneyNumber)
+ if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= storeConfig.MoneyNumber)
{
shopRedDict[storeConfig.ID].state = RedPointState.Simple;
}
@@ -1496,7 +1496,7 @@
{
break;
}
- if (!MoneyIsEnough(config.MoneyType, (ulong)config.MoneyNumber))
+ if (!MoneyIsEnough(config.MoneyType, config.MoneyNumber))
{
break;
}
diff --git a/Main/System/Team/TeamType.cs b/Main/System/Team/TeamType.cs
index 79b7b12..5c009fe 100644
--- a/Main/System/Team/TeamType.cs
+++ b/Main/System/Team/TeamType.cs
@@ -4,7 +4,9 @@
{
None = 0,
Story = 1, //涓荤嚎
- Arena = 2, //绔炴妧鍦鸿繘鏀�
- ArenaDefense = 3, //绔炴妧鍦洪槻瀹�
+ Arena = 2, //绔炴妧鍦鸿繘鏀�
+ ArenaDefense = 3, //绔炴妧鍦洪槻瀹�
+
+ Max, //鏈�澶у�兼斁鏈�鍚庯紝鐢ㄤ簬for寰幆锛屾晠闃靛鏋氫妇鎸夐『搴�+1瀹氫箟锛屽鏋滀笉鎸夋瑙勫垯璇蜂慨鏀筂ax鐩稿叧閫昏緫
}
diff --git a/Main/System/Tip/ConfirmCancel.cs b/Main/System/Tip/ConfirmCancel.cs
index dabaeca..cc00f34 100644
--- a/Main/System/Tip/ConfirmCancel.cs
+++ b/Main/System/Tip/ConfirmCancel.cs
@@ -261,7 +261,17 @@
public static string generalItemTip2;
public static List<Item> getItems { get; private set; }
- //澶氱墿鍝佺‘璁ゆ
+ /// <summary>
+ /// 澶氱墿鍝佺‘璁ゆ
+ /// </summary>
+ /// <param name="items"></param>
+ /// <param name="tiltle"></param>
+ /// <param name="info"></param>
+ /// <param name="func"></param>
+ /// <param name="info2"></param>
+ /// <param name="btnText">涓虹┖鏃堕粯璁ゆ樉绀虹‘瀹氭枃瀛�</param>
+ /// <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)
{
diff --git a/Main/System/Tip/FuncRuleWin.cs b/Main/System/Tip/FuncRuleWin.cs
index 7f8dd97..6ae2541 100644
--- a/Main/System/Tip/FuncRuleWin.cs
+++ b/Main/System/Tip/FuncRuleWin.cs
@@ -7,8 +7,8 @@
{
[SerializeField] Text m_Title;
[SerializeField] Text m_RuleTxt;
- [SerializeField] RectTransform scrollRect;
- [SerializeField] float maxHeight = 800f; // 璁剧疆鏈�澶ч珮搴﹂檺鍒�
+ // [SerializeField] RectTransform scrollRect;
+ // [SerializeField] float maxHeight = 800f; // 璁剧疆鏈�澶ч珮搴﹂檺鍒�
#region Built-in
@@ -25,12 +25,12 @@
}
//鎵撳紑鍚庡浐瀹氭枃鏈紝涓嶄細鍔ㄦ�佸彉鍖�
- protected override void NextFrameAfterOpen()
- {
- Vector2 newSizeDelta = scrollRect.sizeDelta;
- newSizeDelta.y = Mathf.Min(newSizeDelta.y, maxHeight); // 闄愬埗鏈�澶ч珮搴�
- scrollRect.sizeDelta = newSizeDelta;
- }
+ // protected override void NextFrameAfterOpen()
+ // {
+ // Vector2 newSizeDelta = scrollRect.sizeDelta;
+ // newSizeDelta.y = Mathf.Min(newSizeDelta.y, maxHeight); // 闄愬埗鏈�澶ч珮搴�
+ // scrollRect.sizeDelta = newSizeDelta;
+ // }
#endregion
diff --git a/Main/System/Tip/ItemsConfirmCell.cs b/Main/System/Tip/ItemsConfirmCell.cs
index 3fd9d7c..b4b6e85 100644
--- a/Main/System/Tip/ItemsConfirmCell.cs
+++ b/Main/System/Tip/ItemsConfirmCell.cs
@@ -9,7 +9,7 @@
public void Display(int index)
{
int itemID = ConfirmCancel.getItems[index].id;
- itemCell.Init(new ItemCellModel(itemID, false, (ulong)ConfirmCancel.getItems[index].countEx));
+ itemCell.Init(new ItemCellModel(itemID, false, ConfirmCancel.getItems[index].countEx));
itemCell.button.SetListener(() =>
{
ItemTipUtility.Show(itemID);
diff --git a/Main/System/Tip/ItemsConfirmWin.cs b/Main/System/Tip/ItemsConfirmWin.cs
index f231781..d05234e 100644
--- a/Main/System/Tip/ItemsConfirmWin.cs
+++ b/Main/System/Tip/ItemsConfirmWin.cs
@@ -33,7 +33,15 @@
{
m_Title.text = ConfirmCancel.generalTitle;
m_Info.text = ConfirmCancel.generalItemTip;
- m_Info2.text = ConfirmCancel.generalItemTip2;
+ if (string.IsNullOrEmpty(ConfirmCancel.generalItemTip2))
+ {
+ m_Info2.SetActive(false);
+ }
+ else
+ {
+ m_Info2.SetActive(true);
+ m_Info2.text = ConfirmCancel.generalItemTip2;
+ }
m_Scroller.OnRefreshCell += OnRefreshCell;
CreateScroller();
m_BtnText.text = string.IsNullOrEmpty(ConfirmCancel.OKName) ? Language.Get("L1001") : ConfirmCancel.OKName;
@@ -44,7 +52,7 @@
else
{
moneyObj.SetActive(true);
- moneyText.text = UIHelper.ShowUseMoney(ConfirmCancel.moneyType, (ulong)ConfirmCancel.moneyNeedCount);
+ moneyText.text = UIHelper.ShowUseMoney(ConfirmCancel.moneyType, ConfirmCancel.moneyNeedCount);
moneyIcon.SetIconWithMoneyType(ConfirmCancel.moneyType);
}
}
@@ -61,6 +69,7 @@
private void ConfirmBtn()
{
ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
+ CloseWindow();
}
diff --git a/Main/Utility/CommonFunc.cs b/Main/Utility/CommonFunc.cs
index 4ad96aa..e52487b 100644
--- a/Main/Utility/CommonFunc.cs
+++ b/Main/Utility/CommonFunc.cs
@@ -4,9 +4,9 @@
public class CommonFunc
{
- public static Dictionary<int, ulong> AddDict(Dictionary<int, ulong> dic1, Dictionary<int, ulong> dic2)
+ public static Dictionary<int, long> AddDict(Dictionary<int, long> dic1, Dictionary<int, long> dic2)
{
- var resultDic = new Dictionary<int, ulong>(dic1);
+ var resultDic = new Dictionary<int, long>(dic1);
foreach (var data in dic2)
{
if (resultDic.ContainsKey(data.Key))
@@ -21,7 +21,7 @@
- public static List<Item> ChangeToItemList(Dictionary<int, ulong> dict)
+ public static List<Item> ChangeToItemList(Dictionary<int, long> dict)
{
List<Item> itemlist = new List<Item>();
if (dict == null)
diff --git a/Main/Utility/Constants.cs b/Main/Utility/Constants.cs
index b4e0e74..6354591 100644
--- a/Main/Utility/Constants.cs
+++ b/Main/Utility/Constants.cs
@@ -38,7 +38,7 @@
public const float F_EPSILON = 0.00001f;
//鏈嶅姟绔殑澶ф暟鍊奸�氳繃涓や釜瀛楁琛ㄧず锛屽ぇ鏁板瓧浣嶅崟浣嶄负浜�
- public const ulong ExpPointValue = 100000000;
+ public const long ExpPointValue = 100000000;
public static readonly Vector3 Special_Hide_Position = new Vector3(10000, -10000, 10000);
public readonly static Vector2 DESIGN_RESOLUTION = new Vector2(750, 1334);
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index fb10fc0..f28674e 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -178,166 +178,7 @@
else if (span.TotalMinutes > 1) return Math.Floor(span.TotalMinutes) + Language.Get("L1073");
else return 1 + Language.Get("L1073");
}
- /// <summary>
- /// 鏍规嵁灞炴�ц幏鍙栫帺瀹舵暟鎹�
- /// </summary>
- /// <param name="type"></param>
- /// <returns></returns>
- public static ulong GetPropertyValue(PropertyType type)
- {
- switch (type)
- {
- case PropertyType.LV:
- return PlayerDatas.Instance.baseData.LV;
- case PropertyType.POWER:
- return (ulong)PlayerDatas.Instance.baseData.STR;
- case PropertyType.AGILITY:
- return (ulong)PlayerDatas.Instance.baseData.PHY;
- case PropertyType.PHYSIQUE:
- return (ulong)PlayerDatas.Instance.baseData.CON;
- case PropertyType.MENTALITY:
- return (ulong)PlayerDatas.Instance.baseData.PNE;
- case PropertyType.HP:
- return PlayerDatas.Instance.extersion.MaxHP;
- case PropertyType.ATK:
- return (ulong)PlayerDatas.Instance.extersion.MAXATK;
- case PropertyType.DEF:
- return (ulong)PlayerDatas.Instance.extersion.DEF;
- case PropertyType.HIT:
- return (ulong)PlayerDatas.Instance.extersion.HIT;
- case PropertyType.MISS:
- return (ulong)PlayerDatas.Instance.extersion.Miss;
- case PropertyType.ATKSPEED:
- return (ulong)PlayerDatas.Instance.extersion.battleValEx1;
- case PropertyType.CritChance:
- return (ulong)PlayerDatas.Instance.extersion.SuperHitRate;
- case PropertyType.CritHurt:
- return (ulong)PlayerDatas.Instance.extersion.SuperHit;
- case PropertyType.CritResis:
- return (ulong)PlayerDatas.Instance.extersion.SuperHitReduce;
- case PropertyType.HeartHit:
- return (ulong)PlayerDatas.Instance.extersion.luckHitRate;
- case PropertyType.HeartHurt:
- return (ulong)PlayerDatas.Instance.extersion.luckHitVal;
- case PropertyType.HeartResis:
- return (ulong)PlayerDatas.Instance.extersion.LuckyHitRateReduce;
- case PropertyType.SkillHurt:
- return (ulong)PlayerDatas.Instance.extersion.SkillAtkRate;
- case PropertyType.PVPAddHurt:
- return (ulong)PlayerDatas.Instance.extersion.DamagePVP;
- case PropertyType.PVPReduceHurt:
- return PlayerDatas.Instance.GetPlayerDataByType((PlayerDataType)191);
- case PropertyType.LifeReply:
- return (ulong)PlayerDatas.Instance.extersion.HPRestorePer;
- case PropertyType.HurtReflect:
- return (ulong)PlayerDatas.Instance.extersion.DamageBackRate;
- case PropertyType.MoveSpeed:
- return (ulong)PlayerDatas.Instance.extersion.SpeedValue;
- case PropertyType.PetAddHurt:
- return (ulong)PlayerDatas.Instance.extersion.PetDamPer;
- case PropertyType.RealHurt:
- return (ulong)PlayerDatas.Instance.extersion.realATK;
- case PropertyType.RealResis:
- return (ulong)PlayerDatas.Instance.extersion.realDEF;
- case PropertyType.DefyDef:
- return (ulong)PlayerDatas.Instance.extersion.IgnoreDefRate;
- case PropertyType.DefyDefResis:
- return (ulong)PlayerDatas.Instance.extersion.IgnoreDefRateReduce;
- case PropertyType.DefChance:
- return (ulong)PlayerDatas.Instance.extersion.DamChanceDef;
- case PropertyType.BloodHurt:
- return (ulong)PlayerDatas.Instance.extersion.BleedDamage;
- case PropertyType.AktReplyBlood:
- return (ulong)PlayerDatas.Instance.extersion.BattleValEx2;
- case PropertyType.Stun:
- return (ulong)PlayerDatas.Instance.extersion.FaintRate;
- case PropertyType.CtrlResis:
- return (ulong)PlayerDatas.Instance.extersion.FaintDefRate;
- case PropertyType.AddFinalHurt:
- return (ulong)PlayerDatas.Instance.extersion.FinalHurt;
- case PropertyType.ReduceFinalHurt:
- return (ulong)PlayerDatas.Instance.extersion.FinalHurtReduce;
- case PropertyType.PVPAddHurtPer:
- return (ulong)PlayerDatas.Instance.extersion.DamagePerPVP;
- case PropertyType.PVPReduceHurtPer:
- return (ulong)PlayerDatas.Instance.extersion.DamagePerPVPReduce;
- case PropertyType.DleHitChance:
- return (ulong)PlayerDatas.Instance.extersion.ComboDamPerRate;
- case PropertyType.DleHurt:
- return (ulong)PlayerDatas.Instance.extersion.ComboDamPer;
- case PropertyType.ReduceSkillHurtPercent:
- return (ulong)PlayerDatas.Instance.extersion.skillAtkRateReduce;
- case PropertyType.NpcHurtAddPer:
- return (ulong)PlayerDatas.Instance.extersion.NpcHurtAddPer;
- case PropertyType.Luck:
- return (ulong)PlayerDatas.Instance.extersion.luckValue;
- case PropertyType.Mater:
- return (ulong)PlayerDatas.Instance.baseData.mater;
- case PropertyType.Wood:
- return (ulong)PlayerDatas.Instance.baseData.wood;
- case PropertyType.Water:
- return (ulong)PlayerDatas.Instance.baseData.water;
- case PropertyType.Fire:
- return (ulong)PlayerDatas.Instance.baseData.fire;
- case PropertyType.Earth:
- return (ulong)PlayerDatas.Instance.baseData.earth;
- case PropertyType.ReduceCrit:
- return (ulong)PlayerDatas.Instance.baseData.reduceCrit;
- case PropertyType.ReduceHeartHurtPer:
- return (ulong)PlayerDatas.Instance.baseData.reduceHeartHurt;
- case PropertyType.ReduceFinalHurtPer:
- return (ulong)PlayerDatas.Instance.baseData.reduceFinalHurt;
- case PropertyType.AtkPercent:
- case PropertyType.CritHurtPercent:
- case PropertyType.DodgePercent:
- // return (ulong)ModelCenter.Instance.GetModel<ReikiRootModel>().GetReikiPropertyValue((int)type);
- // TODO YYL
- return 0ul;
- case PropertyType.SkillAddPerA:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerA;
- case PropertyType.SkillAddPerB:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerB;
- case PropertyType.SkillAddPerC:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerC;
- case PropertyType.SkillAddPerD:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerD;
- case PropertyType.SkillAddPerE:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerE;
- case PropertyType.SkillAddPerF:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerF;
- case PropertyType.SkillAddPerG:
- return (ulong)PlayerDatas.Instance.baseData.skillAddPerG;
- case PropertyType.SkillReducePerA:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerA;
- case PropertyType.SkillReducePerB:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerB;
- case PropertyType.SkillReducePerC:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerC;
- case PropertyType.SkillReducePerD:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerD;
- case PropertyType.SkillReducePerE:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerE;
- case PropertyType.SkillReducePerF:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerF;
- case PropertyType.SkillReducePerG:
- return (ulong)PlayerDatas.Instance.baseData.skillReducePerG;
- case PropertyType.ReduceSkillCDPer:
- return (ulong)PlayerDatas.Instance.extersion.battleValEx3;
- case PropertyType.AddFinalHurtPer:
- return (ulong)PlayerDatas.Instance.extersion.FunalHurtPer;
- case PropertyType.AddNormalHurt:
- return (ulong)PlayerDatas.Instance.baseData.NormalHurt;
- case PropertyType.AddNormalHurtPer:
- return (ulong)PlayerDatas.Instance.baseData.NormalHurtPer;
- case PropertyType.AddSkillHurt:
- return (ulong)PlayerDatas.Instance.baseData.FabaoHurt;
- case PropertyType.AddSkillHurtPer:
- return (ulong)PlayerDatas.Instance.baseData.FabaoHurtPer;
- case PropertyType.AddPVEHurt:
- return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.DamagePVE);
- }
- return 0;
- }
+
/// <summary>
@@ -1094,7 +935,7 @@
};
- public static ulong GetMoneyCnt(int moneyType)
+ public static long GetMoneyCnt(int moneyType)
{
switch (moneyType)
{
@@ -1112,7 +953,7 @@
}
case 18:
{
- return (ulong)PlayerDatas.Instance.extersion.honorValue;
+ return PlayerDatas.Instance.extersion.honorValue;
}
case 25:
{
@@ -1121,7 +962,7 @@
}
case 24:
{
- return (ulong)PlayerDatas.Instance.extersion.runeChip;
+ return PlayerDatas.Instance.extersion.runeChip;
}
case 15:
{
@@ -1249,15 +1090,15 @@
}
//鏄剧ず鏁伴噺, 鏍煎紡n/m, 瓒冲缁胯壊涓嶈冻绾㈣壊
- public static string ShowUseMoney(int moneyType, ulong useCnt, TextColType engoughColor = TextColType.Green)
+ public static string ShowUseMoney(int moneyType, long useCnt, TextColType engoughColor = TextColType.Green)
{
- ulong cnt = GetMoneyCnt(moneyType);
+ long cnt = GetMoneyCnt(moneyType);
return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
}
- public static string ShowUseItem(PackType type, int itemId, ulong useCnt, TextColType engoughColor = TextColType.Green)
+ public static string ShowUseItem(PackType type, int itemId, long useCnt, TextColType engoughColor = TextColType.Green)
{
- ulong cnt = PackManager.Instance.GetItemCountByID(type, itemId);
+ long cnt = PackManager.Instance.GetItemCountByID(type, itemId);
return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
}
--
Gitblit v1.8.0