Exemple #1
0
    public void SetPetInfo(int petId, int obtain_star, int decompose_star, bool exist, bool replace, string petName)
    {
        Pet pet = DataReader <Pet> .Get(petId);

        if (pet != null)
        {
            PetObtainUIView.Instance.SetBackground(pet.petType);
            this.PetName = PetManager.GetPetName(pet, obtain_star);
            this.PetStar = PetManager.GetPetQualityIcon(obtain_star);
            if (exist)
            {
                this.ShowTip = true;
                if (!replace)
                {
                    this.TipName = string.Format(GameDataUtils.GetChineseContent(500116, false), petName, PetManager.GetReturnFragment(pet, decompose_star));
                }
                else
                {
                    this.TipName = string.Format(GameDataUtils.GetChineseContent(500117, false), petName, PetManager.GetReturnFragment(pet, decompose_star));
                }
            }
            else
            {
                this.ShowTip = false;
            }
        }
    }
Exemple #2
0
    private void ShowAsPet(AwardInfo ai)
    {
        Items items = DataReader <Items> .Get(ai.itemId);

        int    level          = items.level;
        int    decompose_star = items.level;
        bool   replace        = false;
        string petName        = string.Empty;

        if (ai.hadFlag)
        {
            if (decompose_star > ai.petOldStar)
            {
                replace        = true;
                petName        = PetManager.GetPetName(ai.petCfgId, decompose_star);
                decompose_star = ai.petOldStar;
            }
            else
            {
                replace = false;
                petName = PetManager.GetPetName(ai.petCfgId, ai.petOldStar);
            }
        }
        PetManager.Instance.JustObtainPetNty(ai.petCfgId, level, decompose_star, ai.hadFlag, replace, petName, delegate
        {
            Pet pet = DataReader <Pet> .Get(ai.petCfgId);
            if (!ai.hadFlag)
            {
                Transform transform = ItemShow.ShowItem(this.tmp, ai.itemId, (long)ai.itemCount, false, null, 2001).get_transform();
                if (ai.petCfgId > 0)
                {
                    TeShuChongWu teShuChongWu = DataReader <TeShuChongWu> .Get(ai.petCfgId);
                    if (teShuChongWu != null)
                    {
                        this.FxIdList.Add(FXSpineManager.Instance.PlaySpine(teShuChongWu.effectId, transform, "LuckDrawResult", 3001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None));
                    }
                }
            }
            else
            {
                Transform transform = ItemShow.ShowItem(this.tmp, pet.fragmentId, (long)PetManager.GetReturnFragment(pet, decompose_star), false, null, 2001).get_transform();
            }
            TimerHeap.AddTimer(1000u, 0, delegate
            {
                this.ShowIcon();
            });
        });
    }
    public void RefreshActivatedPet(PetInfo petInfo, OOPetChooseUnit dataUnit)
    {
        if (dataUnit == null)
        {
            return;
        }
        Pet pet = DataReader <Pet> .Get(petInfo.petId);

        if (pet == null)
        {
            return;
        }
        dataUnit.PetUID          = petInfo.id;
        dataUnit.PetId           = petInfo.petId;
        dataUnit.BadgeTip        = PetManager.Instance.CheckPetBadge(petInfo);
        dataUnit.PetUpgradeLevel = petInfo.star;
        dataUnit.PetIconHSV      = 0;
        dataUnit.BattleFighting  = petInfo.publicBaseInfo.simpleInfo.Fighting;
        dataUnit.Level           = "Lv" + petInfo.lv;
        dataUnit.PetName         = PetManager.GetPetName(pet, false);
        dataUnit.InFormation     = PetManager.Instance.IsInFormation(petInfo.id);
        if (pet != null && pet.needFragment.get_Count() > 0)
        {
            int num = petInfo.star + 1;
            if (num <= pet.needFragment.get_Count())
            {
                long num2 = BackpackManager.Instance.OnGetGoodCount(pet.fragmentId);
                dataUnit.MatNum = num2 + "/" + pet.needFragment.get_Item(num - 1);
                if (num2 >= (long)pet.needFragment.get_Item(num - 1))
                {
                    dataUnit.PetStatus = OOPetChooseUnit.Status.HaveActivation_StarEnough;
                }
                else
                {
                    dataUnit.PetStatus = OOPetChooseUnit.Status.HaveActivation_StarNoEnough;
                }
            }
            else
            {
                dataUnit.PetStatus = OOPetChooseUnit.Status.HaveActivation_StarTop;
            }
        }
    }
    private void RefreshNotActivatedPet(int petId, OOPetChooseUnit dataUnit)
    {
        if (dataUnit == null)
        {
            return;
        }
        Pet pet = DataReader <Pet> .Get(petId);

        if (pet != null && pet.needFragment.get_Count() > 0)
        {
            dataUnit.PetUID          = 0L;
            dataUnit.PetId           = petId;
            dataUnit.BadgeTip        = false;
            dataUnit.PetUpgradeLevel = pet.initStar;
            dataUnit.Level           = string.Empty;
            dataUnit.PetName         = PetManager.GetPetName(pet, false);
            dataUnit.InFormation     = false;
            dataUnit.BattleFighting  = 0L;
            dataUnit.PetIconHSV      = 6;
            dataUnit.PetStatus       = OOPetChooseUnit.Status.NoActivation;
            dataUnit.MatNum          = GameDataUtils.GetChineseContent(pet.getTip, false);
        }
    }