From 82931aabaaa3e479bc04e11630a77cd9c9dd5fe3 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 26 十月 2018 20:05:36 +0800
Subject: [PATCH] Merge branch 'master' into leonard
---
System/KnapSack/Logic/PlayerPackModels.cs | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 220 insertions(+), 3 deletions(-)
diff --git a/System/KnapSack/Logic/PlayerPackModels.cs b/System/KnapSack/Logic/PlayerPackModels.cs
index dc469d7..7dc83ae 100644
--- a/System/KnapSack/Logic/PlayerPackModels.cs
+++ b/System/KnapSack/Logic/PlayerPackModels.cs
@@ -16,16 +16,18 @@
public Dictionary<int, int[]> DungeonToDrugDict { get; private set; } //key 鍓湰ID,value涓硅嵂ID鍒楄〃
public List<AttrFruitConfig> makeDruglist { get; private set; }
public Dictionary<int, Dictionary<int, int>> decomposeAttrDict = new Dictionary<int, Dictionary<int, int>>();
- public static string StrengthAttrShift_RecordKey = "StrengthAttrShift";
+ public static string StrengthAttrShift_RecordKey = "";
public const string RecordKnapsackTitle = "RecordKnapsackTitle";
+ public string RoleEquipLocalSave = "";
public int MaxBagGridCnt { get; private set; }
public int InitBagGridCnt { get; private set; }
public int MaxDepotGridCnt { get; private set; }
public int InitDepotGridCnt { get; private set; }
BlastFurnaceModel FurnaceModel { get { return ModelCenter.Instance.GetModel<BlastFurnaceModel>(); } }
-
+ public List<int> LocalSavePlaceArray { get; private set;}
public override void Init()
{
+ ParseConfig();
List<DungeonOpenTimeConfig> dungeonlist = Config.Instance.GetAllValues<DungeonOpenTimeConfig>();
if (dungeonlist != null)
{
@@ -81,9 +83,12 @@
InitBagGridCnt = int.Parse(Config.Instance.Get<FuncConfigConfig>("InitBagCellCount").Numerical1);
MaxBagGridCnt = int.Parse(Config.Instance.Get<FuncConfigConfig>("MaxBagCellCount").Numerical1);
MaxDepotGridCnt = int.Parse(Config.Instance.Get<FuncConfigConfig>("MaxDepotCellCount").Numerical1);
+ SetRoleEquipRedpoint();
}
+
public void OnBeforePlayerDataInitialize()
{
+ PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= UpdatePlayerLv;
LocalSave.DeleteKey(RecordKnapsackTitle);
cacheMapId = 0;
playerPackDict.Clear();
@@ -112,7 +117,19 @@
PackSendQuestMgr.Instance.SendOpenWarehouse();
SetPlayerAttrActiveRedPoint();
EquipDecomRedCtrl();
- StrengthAttrShift_RecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID,StrengthAttrShift_RecordKey);
+ RoleEquipLocalSave = StringUtility.Contact("RoleEquipLocalSave", PlayerDatas.Instance.baseData.PlayerID);
+ StrengthAttrShift_RecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "StrengthAttrShift");
+ if(LocalSave.GetIntArray(RoleEquipLocalSave) != null)
+ {
+ LocalSavePlaceArray = LocalSave.GetIntArray(RoleEquipLocalSave).ToList();
+ }
+ else
+ {
+ LocalSavePlaceArray = null;
+ }
+
+ PlayerDatas.Instance.PlayerDataRefreshInfoEvent += UpdatePlayerLv;
+ UpdatePlayerLv(PlayerDataRefresh.LV);
}
public override void UnInit()
@@ -596,6 +613,112 @@
#endregion
+ #region 鐜╁瑁呭鐗规畩閫昏緫
+ public int fairyRedPointLvlimt { get; private set; }
+ public int wingsRedpointLvlimt { get; private set; }
+ public int fairyGetPathId { get; private set; }
+ public Dictionary<int, int> wingsGetPathIdDict { get; private set;}
+ public void ParseConfig()
+ {
+ FuncConfigConfig funcConfig = Config.Instance.Get<FuncConfigConfig>("WingYuPeiHQTJ");
+ fairyRedPointLvlimt = int.Parse(funcConfig.Numerical1);
+ wingsRedpointLvlimt = int.Parse(funcConfig.Numerical2);
+ fairyGetPathId = int.Parse(funcConfig.Numerical3);
+ wingsGetPathIdDict = ConfigParse.GetDic<int, int>(funcConfig.Numerical4);
+ }
+
+ public int GetRoleEquipPathId(int equipPlace)
+ {
+ int playerJob = PlayerDatas.Instance.baseData.Job;
+ switch ((RoleEquipType)equipPlace)
+ {
+ case RoleEquipType.retFairyCan:
+ case RoleEquipType.retFairyCan2:
+ return fairyGetPathId;
+ case RoleEquipType.retWing:
+ if(wingsGetPathIdDict.ContainsKey(playerJob))
+ {
+ return wingsGetPathIdDict[playerJob];
+ }
+ break;
+ }
+ return 0;
+ }
+
+ private void UpdatePlayerLv(PlayerDataRefresh type)
+ {
+ if (type != PlayerDataRefresh.LV) return;
+ for(int i = 1; i < 13; i++)
+ {
+ CheckRoleEquipByPlace((RoleEquipType)i);
+ }
+ UpdateRoleEquipRed();
+ }
+
+ public bool IsShowAddEquipByPlace(int equipPlace)
+ {
+ switch ((RoleEquipType)equipPlace)
+ {
+ case RoleEquipType.retFairyCan:
+ case RoleEquipType.retFairyCan2:
+ if(PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt)
+ {
+ return true;
+ }
+ break;
+ case RoleEquipType.retWing:
+ if (PlayerDatas.Instance.baseData.LV >= wingsRedpointLvlimt)
+ {
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ public void CheckRoleEquipByPlace(RoleEquipType equipType)
+ {
+ ItemModel itemModel = GetItemModelByIndex(PackType.rptEquip,(int)equipType);
+ switch (equipType)
+ {
+ case RoleEquipType.retFairyCan:
+ case RoleEquipType.retFairyCan2:
+ if (PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt && itemModel != null)
+ {
+ SetRoleEquipLocalSave((int)equipType);
+ }
+ break;
+ case RoleEquipType.retWing:
+ if (PlayerDatas.Instance.baseData.LV >= wingsRedpointLvlimt && itemModel != null)
+ {
+ SetRoleEquipLocalSave((int)equipType);
+ }
+ break;
+
+ }
+ }
+
+ public void SetRoleEquipLocalSave(int equipPlace,bool isRedState = false)
+ {
+ if (isRedState && roleEquipRedDict[equipPlace].state == RedPointState.None) return;
+
+ if(LocalSavePlaceArray != null)
+ {
+ if(!LocalSavePlaceArray.Contains(equipPlace))
+ {
+ LocalSavePlaceArray.Add(equipPlace);
+ LocalSave.SetIntArray(RoleEquipLocalSave, LocalSavePlaceArray.ToArray());
+ }
+ }
+ else
+ {
+ LocalSavePlaceArray = new List<int>();
+ LocalSavePlaceArray.Add(equipPlace);
+ LocalSave.SetIntArray(RoleEquipLocalSave, LocalSavePlaceArray.ToArray());
+ }
+ }
+ #endregion
+
private void GetItemEventCtrl(ItemModel itemModel)
{
if (showDropItem)
@@ -765,6 +888,91 @@
}
#region 绾㈢偣閫昏緫鍒ゆ柇
+ private Dictionary<int, Redpoint> roleEquipRedDict = new Dictionary<int, Redpoint>();
+ public void SetRoleEquipRedpoint()
+ {
+ roleEquipRedDict.Clear();
+ for (int i = 1; i < 13; i++)
+ {
+ int redKey = 102011003 + i;
+ Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_BagFuncKey, redKey);
+ roleEquipRedDict.Add(i,redpoint);
+ }
+ }
+
+ public void UpdateRoleEquipRed()
+ {
+ foreach(var key in roleEquipRedDict.Keys)
+ {
+ ItemModel itemModel = GetItemModelByIndex(PackType.rptEquip,key);
+ switch ((RoleEquipType)key)
+ {
+ case RoleEquipType.retFairyCan:
+ if (PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt && !TryGetRoleEquipLocalSave(key)
+ && itemModel == null && roleEquipRedDict[(int)RoleEquipType.retFairyCan2].state == RedPointState.None)
+ {
+ roleEquipRedDict[key].state = RedPointState.Simple;
+ }
+ else
+ {
+ roleEquipRedDict[key].state = RedPointState.None;
+ }
+ break;
+ case RoleEquipType.retFairyCan2:
+ if (PlayerDatas.Instance.baseData.LV >= fairyRedPointLvlimt && !TryGetRoleEquipLocalSave(key)
+ && itemModel == null && roleEquipRedDict[(int)RoleEquipType.retFairyCan].state == RedPointState.None)
+ {
+ roleEquipRedDict[key].state = RedPointState.Simple;
+ }
+ else
+ {
+ roleEquipRedDict[key].state = RedPointState.None;
+ }
+ break;
+ case RoleEquipType.retWing:
+ if (PlayerDatas.Instance.baseData.LV >= wingsRedpointLvlimt && !TryGetRoleEquipLocalSave(key)
+ && itemModel == null)
+ {
+ roleEquipRedDict[key].state = RedPointState.Simple;
+ }
+ else
+ {
+ roleEquipRedDict[key].state = RedPointState.None;
+ }
+ break;
+ default:
+ roleEquipRedDict[key].state = RedPointState.None;
+ break;
+ }
+ }
+ }
+
+ private bool TryGetRoleEquipLocalSave(int equipPlace)
+ {
+ if(LocalSavePlaceArray != null)
+ {
+ for(int i = 0; i < LocalSavePlaceArray.Count; i++)
+ {
+ if(equipPlace == 9 || equipPlace == 10)
+ {
+ if (LocalSavePlaceArray[i] == 9 || LocalSavePlaceArray[i] == 10)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (LocalSavePlaceArray[i] == equipPlace)
+ {
+ return true;
+ }
+ }
+
+ }
+ }
+ return false;
+ }
+
public const int ITEMPACK_REDKEY = 102011003;
public Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_BagFuncKey, ITEMPACK_REDKEY);
private void RedPointPackCtrl(PackType type)
@@ -962,6 +1170,15 @@
}
}
+
+ public event Action RefreshBagEvent;
+ public void RefreshBagInfo()
+ {
+ if(RefreshBagEvent != null)
+ {
+ RefreshBagEvent();
+ }
+ }
#endregion
public void SetJumpToOneKeySell(Transform parent)
--
Gitblit v1.8.0