少年修仙传客户端代码仓库
client_linchunjie
2018-11-23 6dbf827fa655caec79b030e497191c85eda28a07
System/Pet/PlayerPetDatas.cs
@@ -244,7 +244,7 @@
        {
            allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
        }
      //  var allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
        //  var allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
        foreach (var config in allPetConfigs)
        {
            if (!DeblockingRedPoint.ContainsKey(config.ID))
@@ -275,7 +275,7 @@
        {
            return;
        }
       // var configs = Config.Instance.GetAllValues<PetInfoConfig>();
        // var configs = Config.Instance.GetAllValues<PetInfoConfig>();
        if (allPetConfigs.Count <= 0)
        {
            allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
@@ -328,25 +328,25 @@
            return;
        }
        int GetPetId = 0;
        int petLv = 0;
        int NeedExp = 99999999;
        int NeedNumber = 0;//所需要的经验丹
        int petLv = 100;
        int itemCount = playerPack.GetItemCountByID(PackType.rptItem, 4151);
        List<int> ListInt = new List<int>();
        for (int i = 0; i < Sortpet.Count; i++)
        {
            int petID = Sortpet[i].ID;
            if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < Config.Instance.Get<PetInfoConfig>(petID).MaxRank)
            int MaxLv = Config.Instance.Get<PetInfoConfig>(petID).MaxRank;
            if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < MaxLv)
            {
                int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
                if (_NeedExp - _DicPetBack[petID].petExp < NeedExp)
                int NeedExp = _NeedExp - _DicPetBack[petID].petExp;
                int NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
                if (itemCount>= NeedNumber)
                {
                    NeedExp = _NeedExp - _DicPetBack[petID].petExp;
                    petLv = _DicPetBack[petID].PetClass;
                    GetPetId = petID;
                    NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
                    ListInt.Add(petID);
                }
            }
        }
        int itemCount = playerPack.GetItemCountByID(PackType.rptItem, 4151);
        foreach (var key in _DicPetBack.Keys)//因为有成就任务限制所有 第一只坐骑红点逻辑特殊写
        {
            if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
@@ -356,8 +356,18 @@
                return;
            }
        }
        PetInfoConfig petinfo = Config.Instance.Get<PetInfoConfig>(GetPetId);
        if (CultivateRedPoint.ContainsKey(GetPetId) && itemCount >= NeedNumber && petinfo.MaxRank > petLv)
        for (int i = 0; i < ListInt.Count; i++)
        {
            if (_DicPetBack.ContainsKey(ListInt[i]))
            {
                if (_DicPetBack[(ListInt[i])].PetClass < petLv)
                {
                    petLv = _DicPetBack[(ListInt[i])].PetClass;
                    GetPetId = (ListInt[i]);
                }
            }
        }
        if (CultivateRedPoint.ContainsKey(GetPetId))
        {
            CultivateRedPoint[GetPetId].state = RedPointState.Simple;
            return;