| | |
| | | public event Action vipKillNPCTreasureEvent;
|
| | | public event Action<int> treasureLevelProgressUpdateEvent;
|
| | | public event Action<int> treasureStageUpEvent;
|
| | | public event Action<int> treasurePrivilegeUpdateEvent;
|
| | | public event Action<int> humanTreasureStateChangeEvent;
|
| | | public event Action<int> treasureSelectSoulChangeEvent;
|
| | |
|
| | | bool m_WaitOpenDetailsWin = false;
|
| | | public bool waitOpenDetailsWin {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int m_SelectSoul = 0;
|
| | | public int selectSoul
|
| | | {
|
| | | get { return m_SelectSoul; }
|
| | | set
|
| | | {
|
| | | m_SelectSoul = value;
|
| | | if (treasureSelectSoulChangeEvent != null)
|
| | | {
|
| | | treasureSelectSoulChangeEvent(value);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int gotoSoul { get; set; }
|
| | |
|
| | | int m_SelectedStage = 0;
|
| | | public int selectedStage {
|
| | |
| | | Dictionary<int, Treasure> treasures = new Dictionary<int, Treasure>();
|
| | | Dictionary<TreasureCategory, List<int>> treasureCategory = new Dictionary<TreasureCategory, List<int>>();
|
| | | Dictionary<int, int> treasureMapDict = new Dictionary<int, int>();
|
| | | Dictionary<int, TreasureSpecialData> treasurePrivilegeDict = new Dictionary<int, TreasureSpecialData>();
|
| | | Dictionary<int, int> treasureAchievementDict = new Dictionary<int, int>();
|
| | | List<int> eightFurnacesAchievements = new List<int>();
|
| | | List<int> m_CacheGotAchievements = new List<int>();
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFunctionStateChange;
|
| | | packageModel.RefreshItemCountAct += OnPackageItemChange;
|
| | | WindowCenter.Instance.windowAfterOpenEvent += OnWindowOpen;
|
| | | PlayerStrengthengDatas.RefreshEquipUpgradLvAct += RefreshEquipSTRLv;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFunctionStateChange;
|
| | | packageModel.RefreshItemCountAct -= OnPackageItemChange;
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= OnWindowOpen;
|
| | | PlayerStrengthengDatas.RefreshEquipUpgradLvAct -= RefreshEquipSTRLv;
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | | {
|
| | | var humanTreasure = treasure as HumanTreasure;
|
| | | humanTreasure.humanState = HumanTreasureState.Locked;
|
| | | treasure.specialData.presentFinishCount = 0;
|
| | | treasure.specialData.presentGetCount = 0;
|
| | | treasure.specialData.itemGet = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | UpdateAchievementRedpoints();
|
| | | UpdateCastSoulRedpoints();
|
| | | UpdateSkillLevelUpRedpoints();
|
| | | UpdatePrivileges();
|
| | | }
|
| | |
|
| | | private bool needDisplayReguluLevelUp = false;
|
| | |
| | | UpdateSkillLevelUpRedpoints();
|
| | | }
|
| | | }
|
| | |
|
| | | if (_type == PackType.rptEquip)
|
| | | {
|
| | | UpdateTreasurePrivilegeStrenthen();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFunctionStateChange(int _functionId)
|
| | |
| | | }
|
| | | UpdateCastSoulRedpoint(treasure.id);
|
| | | UpdateAchievementRedpoint(treasure.id);
|
| | | if (treasure.IsMaxStage())
|
| | | {
|
| | | UpdatePrivilege(treasure.id);
|
| | | }
|
| | | if (serverInited && _up && treasureStageUpEvent != null)
|
| | | {
|
| | | treasureStageUpEvent(treasure.id);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateTreasurePrivilege(HA353_tagMCMWPrivilegeDataInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.Count; i++)
|
| | | {
|
| | | var _data = package.InfoList[i];
|
| | | if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (treasurePrivilegeDict.ContainsKey((int)_data.PriID))
|
| | | {
|
| | | var _specialData = treasurePrivilegeDict[(int)_data.PriID];
|
| | | _specialData.presentFinishCount = (int)_data.GotValue;
|
| | | _specialData.presentGetCount = (int)_data.CurValue;
|
| | | _specialData.itemGet = _data.ItemAwardState == 1;
|
| | | var _list = treasureCategory[TreasureCategory.Human];
|
| | | var _index = _list.FindIndex((x) =>
|
| | | {
|
| | | var treasure = treasures[x];
|
| | | return (int)treasure.specialData.type == _data.PriID;
|
| | | });
|
| | | if (_index != -1)
|
| | | {
|
| | | UpdatePrivilege(_list[_index]);
|
| | | }
|
| | | }
|
| | | if (treasurePrivilegeUpdateEvent != null)
|
| | | {
|
| | | treasurePrivilegeUpdateEvent((int)_data.PriID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateTreasurePrivilege(HA317_tagMCAllEquipAttrActiveInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.ActiveInfo.Length; i++)
|
| | | {
|
| | | var _data = package.ActiveInfo[i];
|
| | | if (_data.Type == 0)
|
| | | {
|
| | | if (treasurePrivilegeDict.ContainsKey((int)TreasurePrivilege.StrengthenAdd))
|
| | | {
|
| | | var _specialData = treasurePrivilegeDict[(int)TreasurePrivilege.StrengthenAdd];
|
| | | _specialData.presentFinishCount = (int)_data.Cnt;
|
| | | var _list = treasureCategory[TreasureCategory.Human];
|
| | | var _index = _list.FindIndex((x) =>
|
| | | {
|
| | | var treasure = treasures[x];
|
| | | return treasure.specialData.type == TreasurePrivilege.StrengthenAdd;
|
| | | });
|
| | | if (_index != -1)
|
| | | {
|
| | | UpdatePrivilege(_list[_index]);
|
| | | }
|
| | | }
|
| | | if (treasurePrivilegeUpdateEvent != null)
|
| | | {
|
| | | treasurePrivilegeUpdateEvent((int)TreasurePrivilege.StrengthenAdd);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshEquipSTRLv(int _index)
|
| | | {
|
| | | UpdateTreasurePrivilegeStrenthen();
|
| | | }
|
| | |
|
| | | public void UpdateTreasurePrivilegeStrenthen()
|
| | | {
|
| | | var _list = treasureCategory[TreasureCategory.Human];
|
| | | var _index = _list.FindIndex((x) =>
|
| | | {
|
| | | var treasure = treasures[x];
|
| | | return treasure.specialData.type == TreasurePrivilege.StrengthenAdd;
|
| | | });
|
| | | if (_index != -1)
|
| | | {
|
| | | UpdatePrivilege(_list[_index]);
|
| | | if (treasurePrivilegeUpdateEvent != null)
|
| | | {
|
| | | treasurePrivilegeUpdateEvent((int)TreasurePrivilege.StrengthenAdd);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdatePrivileges()
|
| | | {
|
| | | var list = treasureCategory[TreasureCategory.Human];
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | UpdatePrivilege(list[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsGetTreasurePrivilege(TreasurePrivilege type)
|
| | | {
|
| | | var list = treasureCategory[TreasureCategory.Human];
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | Treasure treasure;
|
| | | if (TryGetTreasure(list[i], out treasure)
|
| | | && treasure.specialData.type == type && treasure.IsMaxStage())
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void UpdatePrivilege(int _id)
|
| | | {
|
| | | if (treasures.ContainsKey(_id))
|
| | | {
|
| | | var treasure = treasures[_id];
|
| | | if (treasure.state != TreasureState.Collected || !treasure.IsMaxStage())
|
| | | {
|
| | | if (treasure.specialData.privilegeRedpoint != null)
|
| | | {
|
| | | treasure.specialData.privilegeRedpoint.state = RedPointState.None;
|
| | | }
|
| | | return;
|
| | | }
|
| | | treasure.specialData.UpdateState();
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetPrivilegeValue(int _privilegeId)
|
| | | {
|
| | | if (treasurePrivilegeDict.ContainsKey(_privilegeId))
|
| | | {
|
| | | var _list = GetTreasureCategory(TreasureCategory.Human);
|
| | | Treasure _treasure = null;
|
| | | var _index = _list.FindIndex((x) =>
|
| | | {
|
| | | if (TryGetTreasure(x, out _treasure))
|
| | | {
|
| | | return _treasure.unLockPrivilege == _privilegeId;
|
| | | }
|
| | | return false;
|
| | | });
|
| | | if (_index != -1 && _treasure.IsMaxStage())
|
| | | {
|
| | | var _specialData = treasurePrivilegeDict[_privilegeId];
|
| | | return _specialData.GetPrivilegeValue();
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void HumanTreasureStateChange(int _id)
|
| | |
| | | if (TryGetTreasure(config.MWID, out treasure))
|
| | | {
|
| | | treasure.UpdateTreasureStage(config);
|
| | | if (treasure.specialData != null)
|
| | | {
|
| | | treasurePrivilegeDict.Add((int)treasure.specialData.type, treasure.specialData);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|