| | |
| | | treasureRefineDict.Clear();
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= RefreshFuncOpenState;
|
| | | playerPack.RefreshItemCountAct -= RefreshMat;
|
| | | playerPack.ItemCntReduceAct -= RefreshDanReduce;
|
| | | playerPack.RefreshItemSumUseCntAct -= RefreshItemUsce;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= StoveUpgradAfterClose;
|
| | |
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | | {
|
| | | playerPack.RefreshItemCountAct += RefreshMat;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += RefreshFuncOpenState;
|
| | | playerPack.RefreshItemSumUseCntAct += RefreshItemUsce;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += StoveUpgradAfterClose;
|
| | | playerPack.ItemCntReduceAct += RefreshDanReduce;
|
| | | }
|
| | |
|
| | | private void RefreshFuncOpenState(int funcId)
|
| | |
| | | /// 得到服务端的炼丹炉数据
|
| | | /// </summary>
|
| | | private int _stovelv = 1;
|
| | | private int preStoveLv = 1;
|
| | | public int StoveLV { get { return _stovelv; } } // 炼丹炉等级
|
| | | private int _stoveExp = 0;
|
| | | public int StoveExp { get { return _stoveExp; } } // 炼丹炉经验
|
| | | public int addExp = 0;
|
| | | public event Action RefreshStoveModelEvent;
|
| | | public int makerItemID { get; private set; }
|
| | |
|
| | | public bool StoveIsUpGrade { get; private set; }
|
| | | public void RefreshBlastFurnaceModel(HA3BF_tagMCPlayerStoveMsg data)
|
| | | {
|
| | | DebugEx.Log("RefreshBlastFurnaceModel");
|
| | |
| | | if(!isFirstGet)
|
| | | {
|
| | | isMakeDan = true;
|
| | | if(preStoveLv < data.StoveLV)
|
| | | {
|
| | | preStoveLv = data.StoveLV;
|
| | | StoveIsUpGrade = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | preStoveLv = data.StoveLV;
|
| | | StoveIsUpGrade = false;
|
| | | }
|
| | | PlayRecycleGuid();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | if(makerItemID == 0 && addExp > 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("RecyclingElixir", addExp);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 判断炼丹炉是否升级
|
| | | /// </summary>
|
| | | private int preStoveLv = 1;
|
| | | public bool IsUpgrade(int stoveLv)
|
| | | {
|
| | | if (preStoveLv >= stoveLv)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | preStoveLv = stoveLv;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | CheckMakerDandrugCondition();
|
| | | CheckRecycleStoreRed();
|
| | | StoveIsUpGrade = false;
|
| | | PlayRecycleGuid();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | private void StoveUpgradAfterClose(Window win)
|
| | | {
|
| | | if (win.name != "StoveUpgradWin") return;
|
| | | StoveIsUpGrade = false;
|
| | | PlayRecycleGuid();
|
| | | }
|
| | |
|
| | |
|
| | | private void RefreshDanReduce(PackType type, int index, int id)
|
| | | {
|
| | | if (type != PackType.rptItem || !playerPack.CheckIsDrugById(id)) return;
|
| | | StoveIsUpGrade = false;
|
| | | PlayRecycleGuid();
|
| | | }
|
| | |
|
| | | public void PlayRecycleGuid()
|
| | | {
|
| | | if (IsRecycleDanDrug() |
| | | && !NewBieCenter.Instance.completeGuidesBuf.Contains(93)
|
| | | && !StoveIsUpGrade)
|
| | | {
|
| | | NewBieCenter.Instance.StartNewBieGuide(93);
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 回收丹药逻辑处理
|