| | |
| | |
|
| | | public int PetStoneItemId = 0;//用来记录坐骑魂石的ID
|
| | |
|
| | | public bool IsOk = false;
|
| | | public bool isServerPrepare { get; private set; }
|
| | | private int PetDanExp = 0;//灵宠丹经验
|
| | | public List<int> ListEffectSkill = new List<int>();
|
| | | PackModel _playerPack;
|
| | |
| | | public Dictionary<int, string> petLvNameDict { get; private set; }
|
| | | public int curPetId { get; set; }
|
| | | public int petUpgradeToolId { get; set; }
|
| | | public int autoActivePetId { get; private set; }
|
| | |
|
| | | public event Action PlayerLoginOkData;
|
| | | private Dictionary<int, int> DicDefaultPet = new Dictionary<int, int>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | funcConfig = FuncConfigConfig.Get("AutoActivePetHorse");
|
| | | autoActivePetId = int.Parse(funcConfig.Numerical1);
|
| | |
|
| | | var configs = PetInfoConfig.GetValues();
|
| | | foreach (var config in configs)
|
| | | {
|
| | |
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | Wait = true;
|
| | | IsOk = false;
|
| | | isServerPrepare = false;
|
| | | _TagPetItem.Clear();
|
| | | _DicPetBack.Clear();
|
| | | PetNow = 0;
|
| | |
| | | {
|
| | | OnItemRefreshEvent(singPack.type, index, singPack.GetAllItems()[index].itemId);
|
| | | }
|
| | | IsOk = true;
|
| | | isServerPrepare = true;
|
| | | if (PlayerLoginOkData != null)
|
| | | {
|
| | | PlayerLoginOkData();
|
| | |
| | |
|
| | | }
|
| | | }
|
| | | private void OnFuncStateChange(int obj)
|
| | |
|
| | | private void OnFuncStateChange(int funcId)
|
| | | {
|
| | | if (obj == 6)
|
| | | if (funcId == (int)FuncOpenEnum.Pet)
|
| | | {
|
| | | PetStoneRed();
|
| | | PetActivateRedPoint();
|
| | | GetCultivateRedPoint();
|
| | |
|
| | | if (isServerPrepare && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Pet))
|
| | | {
|
| | | Clock.AlarmAfter(0.5f, () =>
|
| | | {
|
| | | TryAutoActivePet();
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void TryAutoActivePet()
|
| | | {
|
| | | var petConfig = PetInfoConfig.Get(autoActivePetId);
|
| | | if (petConfig != null)
|
| | | {
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, petConfig.UnLockNeedItemID);
|
| | | if (itemCount >= petConfig.UnLockNeedItemCnt)
|
| | | {
|
| | | SendBreakPetLockQuest(autoActivePetId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | _petBack.ItemPlace = petIndex;//宠物位置索引
|
| | | _DicPetBack.Add(petId, _petBack);
|
| | | if (Event_H0704Add != null && IsOk)
|
| | | if (Event_H0704Add != null && isServerPrepare)
|
| | | {
|
| | | Event_H0704Add();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | _DicPetBack[petId].ItemPlace = petIndex;
|
| | | if (Event_H0704Update != null && IsOk)
|
| | | if (Event_H0704Update != null && isServerPrepare)
|
| | | {
|
| | | Event_H0704Update(petId);
|
| | | }
|
| | | if (_DicPetBack[petId].PetStatus == 1)
|
| | | {
|
| | | PetNow = petId;
|
| | | if (Event_SpiritPetPlay != null && IsOk)
|
| | | if (Event_SpiritPetPlay != null && isServerPrepare)
|
| | | {
|
| | | Event_SpiritPetPlay(petState);
|
| | |
|