| | |
| | | {
|
| | | 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))
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | // var configs = Config.Instance.GetAllValues<PetInfoConfig>();
|
| | | // var configs = Config.Instance.GetAllValues<PetInfoConfig>();
|
| | | if (allPetConfigs.Count <= 0)
|
| | | {
|
| | | allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
|
| | |
| | | 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
|
| | |
| | | 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;
|