少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-09 a667f31aa45073784e126482a5b69ed93eedc68f
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
1个文件已修改
93 ■■■■■ 已修改文件
System/BlastFurnace/BlastFurnaceModel.cs 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/BlastFurnaceModel.cs
@@ -40,6 +40,9 @@
    {
        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()
    {
@@ -91,8 +94,11 @@
        playerPack.RefreshItemSumUseCntAct -= RefreshItemUsce;
        WindowCenter.Instance.windowAfterCloseEvent -= StoveUpgradAfterClose;
        PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshRealm;
        PlayerPetDatas.Event_H0704Add -= AddPetEvent;
        PlayerMountDatas.Event_MountHA301A -= AddMountEvent;
    }
    public void OnAfterPlayerDataInitialize()
    {
        
@@ -106,6 +112,17 @@
        CheckRecycleStoreRed();
    }
    private void AddMountEvent(int _HorseID)
    {
        CheckMakerDandrugCondition();
    }
    private void AddPetEvent()
    {
        CheckMakerDandrugCondition();
    }
    public void OnPlayerLoginOk()
    {
        CheckMakerDandrugCondition();
@@ -117,6 +134,9 @@
        WindowCenter.Instance.windowAfterCloseEvent += StoveUpgradAfterClose;
        playerPack.ItemCntReduceAct += RefreshDanReduce;
        PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshRealm;
        PlayerPetDatas.Event_H0704Add += AddPetEvent;
        PlayerMountDatas.Event_MountHA301A += AddMountEvent;
    }
    public void RefreshAddSpecMat(AlchemySpecConfig alchemySpecModel)
@@ -828,6 +848,20 @@
        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)
@@ -857,6 +891,43 @@
    }
    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;
@@ -876,6 +947,28 @@
        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;