| | |
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
| | | }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | PlayerPetDatas petModel { get { return ModelCenter.Instance.GetModel<PlayerPetDatas>(); } }
|
| | | PlayerMountDatas mountModel { get { return ModelCenter.Instance.GetModel<PlayerMountDatas>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | playerPack.RefreshItemSumUseCntAct -= RefreshItemUsce;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= StoveUpgradAfterClose;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshRealm;
|
| | | PlayerPetDatas.Event_H0704Add -= AddPetEvent;
|
| | | PlayerMountDatas.Event_MountHA301A -= AddMountEvent;
|
| | |
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | | {
|
| | |
|
| | |
| | | CheckRecycleStoreRed();
|
| | | }
|
| | |
|
| | | private void AddMountEvent(int _HorseID)
|
| | | {
|
| | | CheckMakerDandrugCondition();
|
| | | }
|
| | |
|
| | | private void AddPetEvent()
|
| | | {
|
| | | CheckMakerDandrugCondition();
|
| | | }
|
| | |
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | CheckMakerDandrugCondition();
|
| | |
| | | WindowCenter.Instance.windowAfterCloseEvent += StoveUpgradAfterClose;
|
| | | playerPack.ItemCntReduceAct += RefreshDanReduce;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshRealm;
|
| | | PlayerPetDatas.Event_H0704Add += AddPetEvent;
|
| | | PlayerMountDatas.Event_MountHA301A += AddMountEvent;
|
| | |
|
| | | }
|
| | |
|
| | | public void RefreshAddSpecMat(AlchemySpecConfig alchemySpecModel)
|
| | |
| | |
|
| | | if (alchemyModellist == null || !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.BlastFurnace)) return;
|
| | |
|
| | |
|
| | | for (int i = alchemyModellist.Count - 1; i > -1; i--)
|
| | | {
|
| | | if (StoveLV >= alchemyModellist[i].BlastFurnaceLV)
|
| | | {
|
| | | if (IsSpecMatEnough(alchemyModellist[i]) && IsNormalMatEnough(alchemyModellist[i])
|
| | | && !CheckIsHavePetOrMount(alchemyModellist[i]))
|
| | | {
|
| | | danDrugRedPointlist[i].state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | for (int i = alchemyModellist.Count - 1; i > -1; i--)
|
| | | {
|
| | | if (StoveLV >= alchemyModellist[i].BlastFurnaceLV)
|
| | |
| | |
|
| | | }
|
| | |
|
| | | private bool CheckIsHavePetOrMount(AlchemyConfig alchemyConfig)
|
| | | {
|
| | | if (alchemyConfig == null) return true;
|
| | |
|
| | | Dictionary<int, List<int>> specDrugDict = null;
|
| | | IsSpecMatEnough(alchemyConfig,out specDrugDict);
|
| | |
|
| | | foreach(var key in specDrugDict.Keys)
|
| | | {
|
| | | List<int> idlist = specDrugDict[key];
|
| | | for (int i = 0; i < idlist.Count; i++)
|
| | | {
|
| | | if (tipsModel.unlockPetDict.ContainsKey(idlist[i]))
|
| | | {
|
| | | PetInfoConfig petInfo = tipsModel.unlockPetDict[idlist[i]];
|
| | | var petmodel = ModelCenter.Instance.GetModel<PlayerPetDatas>();
|
| | | if (!petmodel._DicPetBack.ContainsKey(petInfo.ID))
|
| | | {
|
| | | return false;
|
| | | } |
| | | }
|
| | |
|
| | | if (tipsModel.unlockMountDict.ContainsKey(idlist[i]))
|
| | | {
|
| | | HorseConfig horseConfig = tipsModel.unlockMountDict[idlist[i]];
|
| | | var mountModel = ModelCenter.Instance.GetModel<PlayerMountDatas>();
|
| | | if (!mountModel._DicHorse.ContainsKey(horseConfig.HorseID))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool IsSpecMatEnough(AlchemyConfig alchemyConfig)
|
| | | {
|
| | | if (alchemyConfig == null) return false;
|
| | |
| | | return isEnough;
|
| | | }
|
| | |
|
| | | public bool IsSpecMatEnough(AlchemyConfig alchemyConfig,out Dictionary<int,List<int>> specDurgDict)
|
| | | {
|
| | | specDurgDict = new Dictionary<int, List<int>>();
|
| | | if (alchemyConfig == null) return false;
|
| | |
|
| | | if (alchemyConfig.SpecialItem == null || alchemyConfig.SpecialItem.Length < 1) return false;
|
| | |
|
| | | bool isEnough = false;
|
| | | for (int i = 0; i < alchemyConfig.SpecialItem.Length; i++)
|
| | | {
|
| | | AlchemySpecConfig specConfig = Config.Instance.Get<AlchemySpecConfig>(alchemyConfig.SpecialItem[i]);
|
| | | int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, specConfig.SpecialMaterialD);
|
| | | if (haveCnt >= specConfig.SpecialMateriaNUM)
|
| | | {
|
| | | isEnough = true;
|
| | | List<int> specIdlist = GetPreviewSpecMakeDruglist(specConfig).Keys.ToList();
|
| | | specDurgDict.Add(specConfig.SpecialMaterialD,specIdlist);
|
| | | }
|
| | | }
|
| | | return isEnough;
|
| | | }
|
| | |
|
| | | public bool IsNormalMatEnough(AlchemyConfig alchemyConfig)
|
| | | {
|
| | | if (alchemyConfig == null) return false;
|