| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Text.RegularExpressions; |
| | | using UnityEngine; |
| | | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Text.RegularExpressions;
|
| | | using UnityEngine;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class PetBackpack//宠物背包
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | #region 发送服务端请求 |
| | | #region 发送服务端请求
|
| | | public void SendPetSwitchQuest(int petIndex)
|
| | | {
|
| | | C1603_tagCPetStateChange tag_Cpet = new C1603_tagCPetStateChange();
|
| | |
| | | _tagCA704.UseItemCnt = (ushort)number;
|
| | | GameNetSystem.Instance.SendInfo(_tagCA704);
|
| | | }
|
| | | #endregion |
| | | #endregion
|
| | |
|
| | |
|
| | | private void OnItemRefreshEvent(PackType type, int index, int id)
|
| | |
| | | DeblockingRedPoint.Add(petID, redPointMountStare1);//解锁按钮
|
| | | int RedPoint_Mountkey2 = RedPoint_Mountkey1 * 10 + type;
|
| | | Redpoint redPointMountStare2 = new Redpoint(RedPoint_Mountkey, RedPoint_Mountkey2);
|
| | | //CultivateRedPoint.Add(petID, redPointMountStare2);
|
| | | CultivateRedPoint.Add(petID, redPointMountStare2);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | public void GetCultivateRedPoint()//灵宠培养红点
|
| | | {
|
| | | //foreach (var key in CultivateRedPoint.Keys)
|
| | | //{
|
| | | // CultivateRedPoint[key].state = RedPointState.None;
|
| | | //}
|
| | | //if (!FuncOpen.Instance.IsFuncOpen(6))
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //if (_DicPetBack.Count <= 0)
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | //int GetPetId = 0;
|
| | | //int petLv = 100;
|
| | | //int itemCount = playerPack.GetItemCountByID(PackType.Item, 4151);
|
| | | //List<int> ListInt = new List<int>();
|
| | | //for (int i = 0; i < Sortpet.Count; i++)
|
| | | //{
|
| | | // int petID = Sortpet[i].ID;
|
| | | // int MaxLv = PetInfoConfig.Get(petID).MaxRank;
|
| | | // if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < MaxLv)
|
| | | // {
|
| | | // int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
|
| | | // int NeedExp = _NeedExp - _DicPetBack[petID].petExp;
|
| | | // int NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
|
| | | // if (itemCount >= NeedNumber)
|
| | | // {
|
| | | // ListInt.Add(petID);
|
| | | // }
|
| | | // }
|
| | | //}
|
| | | foreach (var key in CultivateRedPoint.Keys)
|
| | | {
|
| | | CultivateRedPoint[key].state = RedPointState.None;
|
| | | }
|
| | | if (!FuncOpen.Instance.IsFuncOpen(6))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (_DicPetBack.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | int GetPetId = 0;
|
| | | int petLv = 100;
|
| | | int itemCount = playerPack.GetItemCountByID(PackType.Item, 4151);
|
| | | List<int> ListInt = new List<int>();
|
| | | for (int i = 0; i < Sortpet.Count; i++)
|
| | | {
|
| | | int petID = Sortpet[i].ID;
|
| | | int MaxLv = PetInfoConfig.Get(petID).MaxRank;
|
| | | if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < MaxLv)
|
| | | {
|
| | | int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
|
| | | int NeedExp = _NeedExp - _DicPetBack[petID].petExp;
|
| | | int NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
|
| | | if (itemCount >= NeedNumber)
|
| | | {
|
| | | ListInt.Add(petID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //foreach (var key in _DicPetBack.Keys)//因为有成就任务限制所有 第一只坐骑红点逻辑特殊写
|
| | | //{
|
| | | // if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
|
| | | // && itemCount > 0 && CultivateRedPoint.ContainsKey(key))
|
| | | // {
|
| | | // CultivateRedPoint[key].state = RedPointState.Simple;
|
| | | // return;
|
| | | // }
|
| | | //}
|
| | | //List<int> IntListSkill = new List<int>();
|
| | | //for (int i = 0; i < ListInt.Count; i++)//选择出升级灵宠等级最低且有技能未解锁的且经验最接近
|
| | | //{
|
| | | // if (_DicPetBack.ContainsKey(ListInt[i]))
|
| | | // {
|
| | | // var PetConfig = PetInfoConfig.Get(ListInt[i]);
|
| | | // if (PetConfig == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // int[] SkillUnLockInt = PetConfig.SkillUnLock;
|
| | | // int SkillLvMax = SkillUnLockInt[(SkillUnLockInt.Length - 1)];
|
| | | // if (_DicPetBack[(ListInt[i])].PetClass < SkillLvMax)
|
| | | // {
|
| | | // IntListSkill.Add((ListInt[i]));
|
| | | // }
|
| | | // }
|
| | | //}
|
| | | //int SkillPetId = GetRedPointPetID(IntListSkill);
|
| | | //if (SkillPetId != 0 && CultivateRedPoint.ContainsKey(SkillPetId))
|
| | | //{
|
| | | // CultivateRedPoint[SkillPetId].state = RedPointState.Simple;
|
| | | // return;
|
| | | //}
|
| | | foreach (var key in _DicPetBack.Keys)//因为有成就任务限制所有 第一只坐骑红点逻辑特殊写
|
| | | {
|
| | | if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
|
| | | && itemCount > 0 && CultivateRedPoint.ContainsKey(key))
|
| | | {
|
| | | CultivateRedPoint[key].state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | | List<int> IntListSkill = new List<int>();
|
| | | for (int i = 0; i < ListInt.Count; i++)//选择出升级灵宠等级最低且有技能未解锁的且经验最接近
|
| | | {
|
| | | if (_DicPetBack.ContainsKey(ListInt[i]))
|
| | | {
|
| | | var PetConfig = PetInfoConfig.Get(ListInt[i]);
|
| | | if (PetConfig == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | int[] SkillUnLockInt = PetConfig.SkillUnLock;
|
| | | int SkillLvMax = SkillUnLockInt[(SkillUnLockInt.Length - 1)];
|
| | | if (_DicPetBack[(ListInt[i])].PetClass < SkillLvMax)
|
| | | {
|
| | | IntListSkill.Add((ListInt[i]));
|
| | | }
|
| | | }
|
| | | }
|
| | | int SkillPetId = GetRedPointPetID(IntListSkill);
|
| | | if (SkillPetId != 0 && CultivateRedPoint.ContainsKey(SkillPetId))
|
| | | {
|
| | | CultivateRedPoint[SkillPetId].state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | //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 (GetPetId != 0 && CultivateRedPoint.ContainsKey(GetPetId))
|
| | | //{
|
| | | // CultivateRedPoint[GetPetId].state = RedPointState.Simple;
|
| | | // return;
|
| | | //}
|
| | | 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 (GetPetId != 0 && CultivateRedPoint.ContainsKey(GetPetId))
|
| | | {
|
| | | CultivateRedPoint[GetPetId].state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | | #region 预览宠物碎片属性 |
| | | #region 预览宠物碎片属性
|
| | | Dictionary<int, int> petAttrDict = new Dictionary<int, int>();
|
| | | public Dictionary<int, int> GetPetAttrAddDict(int petCode)
|
| | | {
|
| | |
| | | petAttrDict.Add(24, allAtkAdd);
|
| | | return petAttrDict;
|
| | | }
|
| | | #endregion |
| | | #endregion
|
| | |
|
| | | #region 技能整合 |
| | | #region 技能整合
|
| | | public ICollection<int> GetPetTotalSkills()
|
| | | {
|
| | | return petSkills.Keys;
|
| | |
| | | }
|
| | | return 0;
|
| | | }
|
| | | #endregion |
| | | |
| | | #endregion
|
| | |
|
| | | public bool IsPetMaxLevel(int petId)
|
| | | {
|
| | | if (_DicPetBack.ContainsKey(petId))
|
| | |
| | | return _DicPetBack[petId].PetClass >= config.MaxRank;
|
| | | }
|
| | | return false;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | public bool IsPetUnlock(int petId)
|
| | | {
|
| | | return _DicPetBack.ContainsKey(petId);
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | public int GetPetHorseEffect(int id,int skinIndex)
|
| | | {
|
| | | var petHorseAwaking = LuaUtility.Global.Get<IPetHorseAwaking>("PetHorseAwakingModel");
|
| | |
| | | {
|
| | | var petHorseAwaking = LuaUtility.Global.Get<IPetHorseAwaking>("PetHorseAwakingModel");
|
| | | return petHorseAwaking.GetPetHorseEffectNode(id, skinIndex);
|
| | | } |
| | | }
|
| | | }
|
| | | } |
| | | }
|