Exemplo n.º 1
0
 public void SetPetLife(PetInfo Info, LifeEnvironment Environment)
 {
     if (Info == null)
     {
         return;
     }
 }
Exemplo n.º 2
0
 private void Init(ItemInfo info, int num)
 {
     if (info.Type != 3 || info.SubType != 0)
     {
         global::Debug.LogErrorFormat("Use reward type error {0}", new object[]
         {
             (EItemType)info.Type
         });
         base.gameObject.SetActive(false);
         return;
     }
     this.itemInfo = info;
     this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
     if (this.petInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("PetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
         });
         base.gameObject.SetActive(false);
         return;
     }
     UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject);
     uISprite.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = this.petInfo.Icon;
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.petInfo.Quality), this.itemInfo.Name, num);
 }
Exemplo n.º 3
0
    protected override List <string> OnBuildPreloadAssets(List <string> assets = null)
    {
        base.OnBuildPreloadAssets(assets);

        PropItemInfo weaponInfo = ConfigManager.Get <PropItemInfo>(moduleLabyrinth.sneakPlayerDetail.fashion.weapon);

        LoadStateMachineEffect(assets, weaponInfo.subType, weaponInfo.ID, 0, 1);  // @TODO: 尽管现在性别绑定到职业了,但逻辑上必须使用性别
        LoadAllBuffAsset(assets);

        // enermy model
        var model = ConfigManager.Get <CreatureInfo>(moduleLabyrinth.lastSneakPlayer.GetProto());

        if (model)
        {
            assets.AddRange(model.models);
        }
        //添加装备和时装
        assets.AddRange(CharacterEquip.GetEquipAssets(moduleLabyrinth.sneakPlayerDetail.fashion));
        assets.AddRange(CharacterEquip.GetAnimatorAssets(moduleLabyrinth.sneakPlayerDetail.fashion));

        var pet = moduleLabyrinth.lastSneakPlayer.pet;

        if (pet != null && pet.itemId > 0)
        {
            var petInfo = PetInfo.Create(pet);
            if (petInfo != null)
            {
                Module_Battle.BuildPetPreloadAssets(assets, petInfo);
            }
        }

        assets.AddRange(FillLabyrithBuffAsset());
        return(assets);
    }
Exemplo n.º 4
0
    public static List <int> GetTalentIds(int petId, int effect)
    {
        List <int> list   = new List <int>();
        PetInfo    onePet = PetEvoGlobal.GetOnePet(petId);

        if (onePet == null || onePet.petTalents == null)
        {
            return(list);
        }
        using (List <PetTalent> .Enumerator enumerator = onePet.petTalents.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                PetTalent     current          = enumerator.get_Current();
                ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(current.talentId);
                if (chongWuTianFuRow != null)
                {
                    if (chongWuTianFuRow.effect == effect)
                    {
                        list.Add(current.talentId);
                    }
                }
            }
        }
        return(list);
    }
        public RunLogger(string _project, List <RunInfo> _runInfoList, PetInfo _petInfo = null)
        {
            generalInfo = new GeneralInfo()
            {
                project = _project
            };
            runInfoList = _runInfoList;
            petInfo     = _petInfo;

            if (runInfoList != null)
            {
                DateTime startTime = DateTime.MaxValue, endTime = DateTime.MinValue;
                foreach (RunInfo runInfo in runInfoList)
                {
                    runInfo.runId = Guid.NewGuid().ToString();
                    if (runInfo.duration.GetEndTime_dt() != Duration.defaultEndTime && runInfo.duration.GetEndTime_dt() > endTime)
                    {
                        endTime = runInfo.duration.GetEndTime_dt();
                    }
                    if (runInfo.duration.GetStartTime_dt() != Duration.defaultStartTime && runInfo.duration.GetStartTime_dt() < startTime)
                    {
                        startTime = runInfo.duration.GetStartTime_dt();
                    }
                }
                generalInfo.duration = new Duration(startTime, endTime);
            }
        }
Exemplo n.º 6
0
 public void Init(ItemInfo info, int num, bool showValue, bool showTips)
 {
     this.itemInfo = info;
     this.count = num;
     this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
     if (this.petInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("PetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
         });
         base.gameObject.SetActive(false);
         return;
     }
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
     UISprite uISprite = GameUITools.FindUISprite("icon", base.gameObject);
     uISprite.spriteName = this.petInfo.Icon;
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     if (showValue)
     {
         uILabel.text = this.count.ToString();
     }
     else
     {
         uILabel.gameObject.SetActive(false);
     }
     if (showTips)
     {
         UIEventListener expr_FD = UIEventListener.Get(base.gameObject);
         expr_FD.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_FD.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick));
     }
 }
    private void RefreshDes()
    {
        MinePetInfo  minePetInfo  = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.Find((MinePetInfo a) => a.blockId == this.blockID);
        BlockInfo    blockInfo    = ElementInstanceManager.Instance.m_elementCopyLoginPush.activateBlocks.Find((BlockInfo a) => a.blockId == this.blockID);
        YKuangJingKu yKuangJingKu = DataReader <YKuangJingKu> .Get(blockInfo.incidentTypeId);

        this.TextMineName.set_text(yKuangJingKu.holdName);
        string text = GameDataUtils.GetChineseContent(502311, false);

        text = text.Replace("{s1}", yKuangJingKu.itemAddTime.get_Item(0).ToString());
        Debug.LogError(string.Concat(new object[]
        {
            ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.get_Count(),
            "===============",
            this.blockID,
            "============",
            minePetInfo
        }));
        int num = 0;

        if (minePetInfo != null)
        {
            PetInfo petInfo = PetManager.Instance.GetPetInfo(minePetInfo.petId);
            if (DataReader <Pet> .Get(petInfo.petId).element == yKuangJingKu.petType)
            {
                num = yKuangJingKu.petStar.get_Item(petInfo.star - 1);
            }
        }
        this.TextProduce.set_text((yKuangJingKu.itemAddTime.get_Item(0) + num).ToString() + GameDataUtils.GetChineseContent(502318, false));
        Debug.LogError("data.item[0]  " + yKuangJingKu.item.get_Item(0));
        ResourceManager.SetSprite(this.ImageMineProduce, GameDataUtils.GetIcon(DataReader <Items> .Get(yKuangJingKu.item.get_Item(0)).icon));
        ResourceManager.SetSprite(this.ImageMineIcon, GameDataUtils.GetIcon(yKuangJingKu.icon));
    }
Exemplo n.º 8
0
    private void ChooseIsInstance(GameObject sender)
    {
        if (this.mMode != PetSelectUI.Mode.Instance)
        {
            return;
        }
        PetID component = sender.GetComponent <PetID>();

        if (component == null)
        {
            return;
        }
        string[]   array       = sender.get_name().Split("_".ToCharArray());
        int        num         = int.Parse(array[1]);
        GameObject gameObject  = sender.get_transform().FindChild("ImageSelect").get_gameObject();
        PetInfo    petInfoById = PetManager.Instance.GetPetInfoById(num);

        if (petInfoById == null)
        {
            Debug.LogError("宠物不存在, petId = " + num);
            return;
        }
        Pet pet = DataReader <Pet> .Get(num);

        if (pet.fightRoleLv > EntityWorld.Instance.EntSelf.Lv)
        {
            string text = GameDataUtils.GetChineseContent(510112, false);
            text = text.Replace("{s1}", pet.fightRoleLv.ToString());
            UIManagerControl.Instance.ShowToastText(text);
            return;
        }
        if (gameObject.get_activeSelf())
        {
            component.ShowSelect(false);
            component.ShowLimit(PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(petInfoById.petId));
            for (int i = 0; i < this.listPetsSelected.get_Count(); i++)
            {
                if (this.listPetsSelected.get_Item(i) == petInfoById.id)
                {
                    this.listPetsSelected.RemoveAt(i);
                    break;
                }
            }
        }
        else
        {
            if (this.listPetsSelected.get_Count() == this.m_maxPetsCount)
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(505132, false));
                return;
            }
            if (PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(petInfoById.petId))
            {
                InstanceManagerUI.ShowLimitMessage();
                return;
            }
            component.ShowSelect(true);
            this.listPetsSelected.Add(petInfoById.id);
        }
    }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         string title = Request["title"];
         string type  = Request["type"];
         var    file  = Request.Files[0];
         string path  = "/Admin/Img/News/" + Guid.NewGuid().ToString().ToLower() + ".jpg";
         file.SaveAs(Server.MapPath(path));
         PetInfo nmodel = new PetInfo()
         {
             Det        = title,
             PetTypeID  = Convert.ToInt32(type),
             CreateTime = DateTime.Now,
             ImgUrl     = path,
             Count      = 0,
             IsDelete   = false,
             UserInfoID = ((NET55.PetBlog.Server.Model.UserInfo)Session["admin"]).ID,
         };
         var db = MyContext.Create();
         db.PetInfo.Add(nmodel); //添加
         db.SaveChanges();       //改变数据库
         //跳转页面
         Response.Redirect("/Admin/Page/PetManager.aspx");
     }
 }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var db = MyContext.Create();

            if (IsPostBack)
            {
                int pId = Convert.ToInt32(Request["pId"]);
                //查询
                PetInfo model = db.PetInfo.FirstOrDefault(p => p.ID == pId);
                model.Det       = Request["title"];
                model.PetTypeID = Convert.ToInt32(Request["type"]);
                if (!string.IsNullOrEmpty(Request.Files[0].FileName))
                {
                    //上传文件
                    var    file = Request.Files[0];
                    string path = "/Admin/Img/" + Guid.NewGuid().ToString().ToLower() + ".jpg";
                    file.SaveAs(Server.MapPath(path));
                    model.ImgUrl = path;
                }
                //修改
                db.Entry(model).State = System.Data.EntityState.Modified;
                //改变数据库
                db.SaveChanges();
                Response.Redirect("./PetManager.aspx");
            }
            else
            {
                //用户编号ID
                int id = Convert.ToInt32(Request["id"]);
                pmodel = db.PetInfo.FirstOrDefault(u => u.ID == id);
            }
        }
Exemplo n.º 11
0
    public static List <string> BuildPlayerSimplePreloadAssets(PRoleSummary info, List <string> assets = null)
    {
        if (assets == null)
        {
            assets = new List <string>();
        }

        // Player model
        var model = ConfigManager.Get <CreatureInfo>(info.proto);

        if (model)
        {
            assets.Add(model.models[0]);
        }

        var w = WeaponInfo.GetWeapon(0, info.fashion.weapon);

        // Player weapons
        BuildWeaponSimplePreloadAssets(info.proto, info.gender, w.weaponID, w.weaponItemId, assets);

        // Equipments
        assets.AddRange(CharacterEquip.GetEquipAssets(info.fashion));

        if (info.pet == null || info.pet.itemId == 0)
        {
            return(assets);
        }

        var rPet = PetInfo.Create(info.pet);

        BuildPetSimplePreloadAssets(rPet, assets, 2);

        return(assets);
    }
Exemplo n.º 12
0
 public void Refresh(PetInfo petInfo, int curPetCount, int needPetCount)
 {
     this.mItemInfo = null;
     this.mPetInfo = petInfo;
     this.mLopetInfo = null;
     this.IsEnough = (curPetCount >= needPetCount);
     if (petInfo != null)
     {
         this.mIcon.gameObject.SetActive(true);
         this.mQualityMask.gameObject.SetActive(true);
         this.mIcon.spriteName = petInfo.Icon;
         this.mQualityMask.spriteName = Tools.GetItemQualityIcon(petInfo.Quality);
     }
     else
     {
         this.mIcon.gameObject.SetActive(false);
         this.mQualityMask.gameObject.SetActive(false);
     }
     this.mSb.Remove(0, this.mSb.Length);
     if (curPetCount < needPetCount)
     {
         this.mSb.Append("[ff0000]");
     }
     else
     {
         this.mSb.Append("[ffffff]");
     }
     this.mSb.Append(curPetCount).Append("[-]/").Append(needPetCount);
     this.mNum.text = this.mSb.ToString();
 }
Exemplo n.º 13
0
 public void Refresh(ItemInfo itemInfo, bool isMask)
 {
     this.mPetInfo = null;
     this.mItemInfo = itemInfo;
     this.mIsActive = isMask;
     this.Refresh();
 }
    private void SetPetItems(PetFormationUnit pfu, int indexFormation)
    {
        List <PetInfo> pets = RoleShowUIViewModel.Instance.GetPets(indexFormation);

        if (pets == null || pets.get_Count() == 0)
        {
            for (int i = 0; i < 3; i++)
            {
                pfu.pets.get_Item(i).SetItem(null, null, false);
            }
        }
        else
        {
            for (int j = 0; j < 3; j++)
            {
                if (j < pets.get_Count())
                {
                    PetInfo petInfo = pets.get_Item(j);
                    Pet     dataPet = DataReader <Pet> .Get(petInfo.petId);

                    pfu.pets.get_Item(j).SetItem(petInfo, dataPet, false);
                }
                else
                {
                    pfu.pets.get_Item(j).SetItem(null, null, false);
                }
            }
        }
    }
Exemplo n.º 15
0
 public PetDataEx(PetData data, PetInfo info)
 {
     this.Data = data;
     this.Info = info;
     this.Relation = 0;
     this.socketSlot = -1;
 }
Exemplo n.º 16
0
    public void GetAttrData(NDAttribute RoleAttr, LifeMCore Core)
    {
        if (RoleAttr == null)
        {
            return;
        }

        PetInfo Info = CmCarbon.GetPetInfo(Core);

        m_AttrType      = Info.m_type;
        m_speed         = RoleAttr.Speed * Info.m_speedpercent * 0.01f;
        m_jumpDistance  = (int)(RoleAttr.JumpDistance * Info.m_jumppercent * 0.01f);
        m_Hp            = (int)(RoleAttr.Hp * Info.m_hppercent * 0.01f);
        m_FullHp        = m_Hp;
        m_phy_attack    = (int)(RoleAttr.PhyAttack * Info.m_phyattackpercent * 0.01f);
        m_phy_defend    = (int)(RoleAttr.PhyDefend * Info.m_phydefendpercent * 0.01f);
        m_phy_crit      = (int)(RoleAttr.PhyCrit * Info.m_phy_critpercent * 0.01f);
        m_magic_attack  = (int)(RoleAttr.MagicAttack * Info.m_magicattackpercent * 0.01f);
        m_magic_defend  = (int)(RoleAttr.MagicDefend * Info.m_phydefendpercent * 0.01f);
        m_magic_crit    = (int)(RoleAttr.MagicCrit * Info.m_magic_critpercent * 0.01f);
        m_PetAttackType = Info.m_attacktype;
        m_PetDamage     = Info.m_damage;
        m_Anger         = Info.m_mp;
        m_FullAnger     = 1000;

        m_TargetImmune = (ImmuneTarget)Info.m_isattack;
        //出生产生的状态
        m_SelfStatus = Info.m_status;
    }
Exemplo n.º 17
0
 public GameUIToolTip CreatePetTooltip(Transform parent, PetInfo petInfo)
 {
     Tools.Assert(parent, "Invalid parent");
     this.mStringBuilder.Remove(0, this.mStringBuilder.Length);
     this.mStringBuilder.Append("Tooltip_").Append(petInfo.ID);
     return this.LoadToolTipPerfab(parent, this.mStringBuilder.ToString());
 }
Exemplo n.º 18
0
 public void SetItem(PetInfo petInfo = null, Pet dataPet = null, bool islimit = false)
 {
     if (petInfo != null)
     {
         ResourceManager.SetSprite(this.m_spImageFrame, PetManager.GetPetFrame01(petInfo.star));
         ResourceManager.SetSprite(this.m_spImageFramePet, PetManager.GetPetFrame02(petInfo.star));
         ResourceManager.SetSprite(this.m_spImageIcon, PetManager.Instance.GetSelfPetIcon2(dataPet));
         if (this.m_spImageQuality != null)
         {
             ResourceManager.SetSprite(this.m_spImageQuality, PetManager.GetPetQualityIcon(petInfo.star));
         }
         if (this.m_lblTextPower != null)
         {
             this.m_lblTextPower.set_text(petInfo.publicBaseInfo.simpleInfo.Fighting.ToString());
         }
         this.m_lblTextName.set_text(GameDataUtils.GetChineseContent(dataPet.name, false));
         this.m_lblTextLV.GetComponent <Text>().set_text("Lv." + petInfo.lv);
         this.ShowHave(true);
         this.ShowLimit(islimit);
     }
     else
     {
         this.ShowHave(false);
     }
 }
    private void ResetPetInfos()
    {
        this.mPetInfos.Clear();
        using (Dictionary <long, PetInfo> .ValueCollection.Enumerator enumerator = PetManager.Instance.MaplistPet.get_Values().GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                PetInfo current = enumerator.get_Current();
                this.mPetInfos.Add(current);
            }
        }
        for (int i = 0; i < this.mPetInfos.get_Count(); i++)
        {
            int num = i;
            for (int j = i + 1; j < this.mPetInfos.get_Count(); j++)
            {
                Pet pet = DataReader <Pet> .Get(this.mPetInfos.get_Item(num).petId);

                Pet pet2 = DataReader <Pet> .Get(this.mPetInfos.get_Item(j).petId);

                if (pet.summonEnergy < pet2.summonEnergy)
                {
                    num = j;
                }
            }
            if (num != i)
            {
                XUtility.ListExchange <PetInfo>(this.mPetInfos, num, i);
            }
        }
    }
Exemplo n.º 20
0
    //装备更换更新方法
    void UpdateEquipShow()
    {
        PetInfo info = PetInfo._petInstance;

        petWeapon.SetInventoryItem(info.petWeaponID);
        petEquip.SetInventoryItem(info.petEquipID);
    }
Exemplo n.º 21
0
    private void CreatEnemyCreature(PMatchInfo info)
    {
        //创建敌人
        ShowCreatureInfo showInfo = ConfigManager.Get <ShowCreatureInfo>(10);
        Vector3_         pos      = new Vector3_(1.3, 0, 0);
        Vector3          rot      = new Vector3(0, -110, 0);

        if (showInfo != null)
        {
            for (int i = 0; i < showInfo.forData.Length; i++)
            {
                if (showInfo.forData[i].index == info.roleProto)
                {
                    pos = showInfo.forData[i].data[0].pos;
                    rot = showInfo.forData[i].data[0].rotation;
                    break;
                }
            }
        }

        var weaponInfo = ConfigManager.Get <PropItemInfo>(info.fashion.weapon);

        if (weaponInfo == null)
        {
            return;
        }

        moduleGlobal.LockUI("", 0.5f);
        Level.PrepareAssets(Module_Battle.BuildPlayerSimplePreloadAssets(info), (r) =>
        {
            if (!r)
            {
                return;
            }

            enemy = moduleHome.CreatePlayer(info, pos, CreatureDirection.BACK);
            enemy.transform.localEulerAngles = rot;
            moduleGlobal.UnLockUI();
        });
        if (info.pet != null && info.pet.itemTypeId != 0)
        {
            var rPet   = PetInfo.Create(info.pet);
            var assets = new List <string>();
            Level.PrepareAssets(Module_Battle.BuildPetSimplePreloadAssets(rPet, assets, 2), b =>
            {
                var rGradeInfo = rPet.UpGradeInfo;
                var show       = ConfigManager.Get <ShowCreatureInfo>(rPet.ID);
                if (show == null)
                {
                    Logger.LogError("没有配置config_showCreatureInfo表。宠物ID = {0}, 没有出生位置信息。宠物模型创建失败", rPet.ID);
                    return;
                }
                var showData = show.GetDataByIndex(0);
                var data     = showData.data.GetValue <ShowCreatureInfo.SizeAndPos>(0);
                enemyPet     = moduleHome.CreatePet(rGradeInfo, pos + data.pos, data.rotation, Level.current.startPos, true, Module_Home.FIGHTING_PET_OBJECT_NAME + "_Enemy");
                enemyPet.transform.localScale      *= data.size;
                enemyPet.transform.localEulerAngles = data.rotation;
            });
        }
    }
Exemplo n.º 22
0
 public static void Init()
 {
     PlayerPetInfo.Info = Globals.Instance.AttDB.PetDict.GetInfo(90000);
     if (PlayerPetInfo.Info == null)
     {
         Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[]
         {
             90000
         });
         return;
     }
     PlayerPetInfo.Info2 = Globals.Instance.AttDB.PetDict.GetInfo(90001);
     if (PlayerPetInfo.Info2 == null)
     {
         Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[]
         {
             90001
         });
         return;
     }
     for (int i = 0; i < PlayerPetInfo.Info2.RelationID.Count; i++)
     {
         PlayerPetInfo.Info.RelationID.Add(PlayerPetInfo.Info2.RelationID[i]);
     }
     PlayerPetInfo.Info2.RelationID.Clear();
     for (int j = 0; j < PlayerPetInfo.Info.RelationID.Count; j++)
     {
         PlayerPetInfo.Info2.RelationID.Add(PlayerPetInfo.Info.RelationID[j]);
     }
     PlayerPetInfo.Info2.TalentID.Clear();
     for (int k = 0; k < PlayerPetInfo.Info.TalentID.Count; k++)
     {
         PlayerPetInfo.Info2.TalentID.Add(PlayerPetInfo.Info.TalentID[k]);
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// 添加宠物
        /// </summary>
        /// <param name="info"></param>
        /// <param name="group"></param>
        /// <param name="account"></param>
        /// <param name="sex"></param>
        /// <param name="nickName"></param>
        public async Task <UserPet> AddPetAsync(PetInfo info, string group, string account, Gender sex, string nickName)
        {
            // 初始化宠物信息
            var pet = new UserPet()
            {
                Account   = account,
                Age       = 1,
                Attack    = info.Attack,
                Enable    = true,
                Face      = info.Face,
                Healthy   = 100,
                Group     = group,
                Intellect = info.Intellect,
                Mood      = 100,
                Quality   = RandQuality(),
                Sex       = sex,
                PetId     = info.Id,
                Name      = info.Name,
                NickName  = nickName
            };

            // 根据品质增长属性值
            IncrementPropByQuality(pet);

            // 添加信息
            PetContext.UserPets.Add(pet);

            // 保存信息
            await PetContext.SaveChangesAsync();

            return(pet);
        }
Exemplo n.º 24
0
    private GameObject GetItem(PetInfo petinfo, Pet dataPet, bool isSelected)
    {
        GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab(WidgetName.PetChooseItem);

        instantiate2Prefab.set_name("Item_" + petinfo.petId);
        PetID component = instantiate2Prefab.GetComponent <PetID>();

        component.petInfo = petinfo;
        instantiate2Prefab.SetActive(true);
        instantiate2Prefab.get_transform().SetParent(this.GridChoosePet.get_transform());
        instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
        instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickPetChoose);
        component.SetItem(dataPet, petinfo);
        component.ShowLimit(PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(petinfo.petId));
        component.ShowSelect(isSelected);
        if (this.mMode != PetSelectUI.Mode.PetTask)
        {
            component.SetRecommend(false);
        }
        else
        {
            component.SetRecommend(PetTaskFormationUIView.Instance.IsRecommend((int)dataPet.id));
        }
        return(instantiate2Prefab);
    }
Exemplo n.º 25
0
    public Creature GetPlayerCreature(int creatureId, PNmlPlayer data)
    {
        CreatureInfo info = ConfigManager.Get <CreatureInfo>(creatureId);
        var          prop = ConfigManager.Get <PropItemInfo>(data.fashion.weapon);

        if (prop)
        {
            info.weaponID     = prop.subType;
            info.weaponItemID = data.fashion.weapon;
        }
        Creature player = Creature.Create(info, Vector3.zero, new Vector3(0f, 90f, 0f), data.roleId.Equals(modulePlayer.roleInfo.roleId), false);

        if (data.pet != null && data.pet.itemTypeId != 0)
        {
            player.pet = PetCreature.Create(player, PetInfo.Create(data.pet), player.position_, player.eulerAngles, false, Module_Home.PET_OBJECT_NAME);
            if (player.pet != null)
            {
                if (!moduleAI.IsStartAI)
                {
                    moduleAI.StartAI();
                }
                player.pet.DisableSkills(true);
                moduleAI.AddPetAI(player.pet);
            }
        }
        return(player);
    }
    private void RefreshPet()
    {
        if (ElementInstanceManager.Instance.GetBlockInfo(this.blockID).isChallenge)
        {
            this.BtnFight.get_gameObject().SetActive(false);
            this.BtnChoosePet.get_gameObject().SetActive(true);
            this.TextDesFight.set_text(GameDataUtils.GetChineseContent(502313, false));
            MinePetInfo minePetInfo = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.Find((MinePetInfo a) => a.blockId == this.blockID);
            if (minePetInfo != null)
            {
                this.PetIcon.get_gameObject().SetActive(true);
                PetInfo petInfo = PetManager.Instance.GetPetInfo(minePetInfo.petId);
                Pet     dataPet = DataReader <Pet> .Get(petInfo.petId);

                ResourceManager.SetSprite(this.PetIcon.FindChild("ImageIcon").GetComponent <Image>(), PetManager.Instance.GetSelfPetIcon2(dataPet));
                ResourceManager.SetSprite(this.PetIcon.FindChild("ImageFrame").GetComponent <Image>(), PetManager.GetPetFrame01(petInfo.star));
                this.BtnOut.get_gameObject().SetActive(true);
            }
            else
            {
                this.PetIcon.get_gameObject().SetActive(false);
                this.BtnOut.get_gameObject().SetActive(false);
            }
        }
        else
        {
            this.TextDesFight.set_text(GameDataUtils.GetChineseContent(502314, false));
            this.BtnChoosePet.get_gameObject().SetActive(false);
            this.BtnOut.get_gameObject().SetActive(false);
            this.BtnFight.get_gameObject().SetActive(true);
        }
    }
Exemplo n.º 27
0
 private void RefreshPet(Transform t, PetInfo rPetInfo)
 {
     if (!t)
     {
         return;
     }
     for (var i = 0; i < t.childCount; i++)
     {
         t.GetChild(i).SafeSetActive(rPetInfo != null);
     }
     if (rPetInfo != null)
     {
         if (rPetInfo.UpGradeInfo != null)
         {
             UIDynamicImage.LoadImage(t.GetComponent <Transform>("sprite"), rPetInfo.UpGradeInfo.halfIcon, null, false);
         }
         Util.SetText(t.GetComponent <Text>("level_img/level_txt"), rPetInfo.Level.ToString());
         var stars = t.GetComponent <Transform>("stars/count");
         if (stars == null)
         {
             return;
         }
         for (var i = 0; i < stars.childCount; i++)
         {
             stars.GetChild(i).SafeSetActive(i < rPetInfo.Star);
         }
     }
 }
Exemplo n.º 28
0
 void Start()
 {
     info      = GetComponent <PetInfo>();
     inventory = GameObject.Find("Pet Manager").GetComponent <Inventory>();
     pet       = inventory.CheckForItem(this.gameObject.name.Remove(this.gameObject.name.IndexOf("(Clone)"), 7));
     info.TryGetStat("Speed", out speed);
 }
Exemplo n.º 29
0
    private void RefreshRight(PetInfo rInfo)
    {
        var gradeInfo = rInfo.GetUpGradeInfo(rInfo.Grade + 1);
        var star      = rInfo.GetStar(rInfo.Grade + 1);

        Util.SetText(rightGradeText, gradeInfo?.CombineGradeName(star));
        SetStar(rightStarGroup, star);

        Util.ClearChildren(rightAttr);
        //创建属性条
        var prevList = rInfo.Attribute;

        var showList = rInfo.GetAttribute(rInfo.Level, rInfo.Grade + 1);

        for (var i = 0; i < showList.Count; i++)
        {
            var t = rightAttr.AddNewChild(rightAttrTemp);
            t.SafeSetActive(true);
            var change = new ItemAttachAttr()
            {
                id    = showList[i].id,
                type  = showList[i].type,
                value = AttributeShowHelper.ValueForShow(showList[i].id, showList[i].value) - AttributeShowHelper.ValueForShow(prevList[i].id, prevList[i].value)
            };
            BindProperty(t, showList[i], change);
        }
    }
Exemplo n.º 30
0
 public override bool Initialize(params object[] p)
 {
     moduleHome.HideOthers(PET_OBJECT_NAME);
     if (base.Initialize())
     {
         SelectPet = null;
         PetInfo defaultPet = null;
         if (p.Length > 0)
         {
             defaultPet = modulePet.GetPet((int)p[0]);
             if (defaultPet != null)
             {
                 OnSelectChange(defaultPet, null);
             }
         }
         petSelectModule.Initalize(Module_Pet.GetAllPet(), defaultPet);
         talkButton?.onClick.AddListener(OnTease);
         fightButton?.onClick.AddListener(OnPetFight);
         restButton?.onClick.AddListener(RestButton);
         skillButton?.onClick.AddListener(() =>
         {
             if (SelectPet == null)
             {
                 Logger.LogError("检测到bug。SelectPet为空!");
                 return;
             }
             moduleGlobal.UpdateSkillTip(SelectPet.GetSkill(), SelectPet.AdditiveLevel, SelectPet.Mood);
         });
     }
     return(true);
 }
Exemplo n.º 31
0
    public void Initalize(List <PetInfo> rList, PetInfo rDefault = null)
    {
        defaultPet = rDefault;
        setDefault = rDefault != null;
        if (dataSource == null)
        {
            dataSource = new DataSource <PetInfo>(rList, scrollView, OnSetData, OnClick);
        }
        else
        {
            dataSource.SetItems(rList);
        }

        if (defaultPet != null)
        {
            SetDefault(null, defaultPet);
        }

        if (null != rDefault)
        {
            for (var i = 0; i < dataSource.count; i++)
            {
                if (dataSource.GetItem(i)?.ID == rDefault.ID)
                {
                    scrollView.currentIndex = i;
                    break;
                }
            }
        }
    }
Exemplo n.º 32
0
    private void SetPetItems(PetFormationUnit pfu, int formationID)
    {
        PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == formationID);

        if (petFormation == null || petFormation.petFormationArr == null || petFormation.petFormationArr.Int64Array == null)
        {
            for (int i = 0; i < 3; i++)
            {
                pfu.pets.get_Item(i).SetItem(null, null, false);
            }
        }
        else
        {
            for (int j = 0; j < petFormation.petFormationArr.Int64Array.get_Count(); j++)
            {
                Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(j);
                PetInfo         petInfo         = PetManager.Instance.GetPetInfo(int64IndexValue.value);
                Pet             dataPet         = DataReader <Pet> .Get(petInfo.petId);

                pfu.pets.get_Item(int64IndexValue.index).SetItem(petInfo, dataPet, PetManager.Instance.IsFormationFromInstance && PetManagerBase.IsPetLimit(dataPet));
            }
            for (int k = 0; k < 3; k++)
            {
                if (k >= petFormation.petFormationArr.Int64Array.get_Count())
                {
                    pfu.pets.get_Item(k).SetItem(null, null, false);
                }
            }
        }
    }
Exemplo n.º 33
0
        public Hashtable AddRandomPet()
        {
            PetDropper.PetDropSettings settings = new PetDropper.PetDropSettings();
            settings.OnGenerateColor();

            settings.OffGeneratePassiveSkill();
            settings.SetPassiveSkill(-1);

            settings.OnGenerateModel();
            settings.OnGenerateActiveSkills();
            settings.OnGenerateDamageType();

            settings.OffSetMastery();
            settings.SetMastery(0);

            settings.OffGenerateRace();
            settings.SetRace((Race)player.GetComponent <RaceableObject>().race);

            PetDropper dropper = new PetDropper();
            PetInfo    info    = dropper.Drop(player.resource.petParameters, settings, player.resource.petSkills, player.resource.petPassiveBonuses);

            player.GetComponent <PetManager>().AddPet(info);
            return(new Hashtable {
                { (int)SPC.ReturnCode, (int)RPCErrorCode.Ok },
                { (int)SPC.Info, info.GetInfo(player.resource) }
            });
        }
Exemplo n.º 34
0
        public override void Compose(Yupi.Protocol.ISender session, PetInfo pet)
        {
            using (ServerMessage message = Pool.GetMessageBuffer(Id))
            {
                message.AppendInteger(pet.Id);
                message.AppendString(pet.Name);
                message.AppendInteger(pet.Level);

                throw new NotImplementedException();

                /*
                 * message.AppendInteger(pet.RaceId);
                 * message.AppendInteger(pet.Race);
                 * message.AppendString(pet.Type == "pet_monster" ? "ffffff" : pet.Color);*/
                /*
                 * message.AppendInteger (pet.Type == "pet_monster" ? 0u : pet.RaceId);
                 *
                 * if (pet.Type == "pet_monster" && pet.MoplaBreed != null) {
                 *  string[] array = pet.MoplaBreed.PlantData.Substring (12).Split (' ');
                 *  string[] array2 = array;
                 *
                 *  foreach (string s in array2)
                 *      message.AppendInteger (int.Parse (s));
                 *
                 *  message.AppendInteger (pet.MoplaBreed.GrowingStatus);
                 *
                 *  return;
                 * }
                 */

                message.AppendInteger(0);
                message.AppendInteger(0);
                session.Send(message);
            }
        }
Exemplo n.º 35
0
    public void ShowAsFail(int petId, int monster_modelId, Action action)
    {
        this.ResetSelf();
        Pet pet = DataReader <Pet> .Get(petId);

        if (pet == null)
        {
            return;
        }
        if (pet.model.get_Count() == 0)
        {
            return;
        }
        PetInfo petInfoById = PetManager.Instance.GetPetInfoById(petId);

        if (petInfoById == null)
        {
            return;
        }
        int pet_modelId = PetManagerBase.GetPlayerPetModel(pet, petInfoById.star);

        this.m_preview01.SetModelWithAction(pet_modelId, "idle", null);
        this.m_preview02.SetModelWithAction(monster_modelId, "idle", null);
        TimerHeap.AddTimer(1000u, 0, delegate
        {
            this.m_preview01.SetModelWithSkill(pet_modelId, PetManager.Instance.GetPetSkill(petId, 1), delegate
            {
                this.IsModel01 = true;
                this.ModelFinish(action);
            });
        });
    }
Exemplo n.º 36
0
    private static int SortCompare(PetInfo AF1, PetInfo AF2)
    {
        int result = 0;

        if (PetSelectUI.Instance.mMode == PetSelectUI.Mode.PetTask)
        {
            if (PetTaskFormationUIView.Instance.IsRecommend(AF1.petId) && !PetTaskFormationUIView.Instance.IsRecommend(AF2.petId))
            {
                return(-1);
            }
            if (!PetTaskFormationUIView.Instance.IsRecommend(AF1.petId) && PetTaskFormationUIView.Instance.IsRecommend(AF2.petId))
            {
                return(1);
            }
        }
        if (AF1.publicBaseInfo.simpleInfo.Fighting > AF2.publicBaseInfo.simpleInfo.Fighting)
        {
            return(-1);
        }
        if (AF1.publicBaseInfo.simpleInfo.Fighting < AF2.publicBaseInfo.simpleInfo.Fighting)
        {
            return(1);
        }
        return(result);
    }
    public void SetUI(MineInfo mineInfo, int index)
    {
        MinePetInfo mpi = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.get_Item(index);

        this.m_blockID = mpi.blockId;
        BlockInfo    blockInfo    = ElementInstanceManager.Instance.m_elementCopyLoginPush.activateBlocks.Find((BlockInfo a) => a.blockId == mpi.blockId);
        YKuangJingKu yKuangJingKu = DataReader <YKuangJingKu> .Get(blockInfo.incidentTypeId);

        this.TextMineName.set_text(yKuangJingKu.holdName);
        ResourceManager.SetSprite(this.ImageProduceIcon, GameDataUtils.GetIcon(DataReader <Items> .Get(yKuangJingKu.item.get_Item(0)).icon));
        PetInfo petInfo = PetManager.Instance.GetPetInfo(mpi.petId);
        int     num     = 0;

        this.TextMineTime.set_text(TimeConverter.ChangeSecsToString(ElementInstanceManager.Instance.GetTimeCal(mineInfo.blockId)));
        if (DataReader <Pet> .Get(petInfo.petId).element == yKuangJingKu.petType)
        {
            num = yKuangJingKu.petStar.get_Item(petInfo.star - 1);
        }
        this.TextProduceValue.set_text((mineInfo.debrisInfos == null || mineInfo.debrisInfos.get_Count() <= 0) ? "0" : mineInfo.debrisInfos.get_Item(0).debrisNum.ToString());
        this.TextProduceNum.set_text((yKuangJingKu.itemAddTime.get_Item(0) + num).ToString() + "/小时");
        ResourceManager.SetSprite(this.ImagePetIcon, PetManager.Instance.GetSelfPetIcon(petInfo.petId));
        ResourceManager.SetSprite(this.ImageMine, GameDataUtils.GetIcon(yKuangJingKu.icon));
        if (mineInfo.debrisInfos.get_Count() == 0)
        {
            ImageColorMgr.SetImageColor(this.BtnGet.get_transform().FindChild("Image").GetComponent <Image>(), true);
            this.BtnGet.set_enabled(false);
        }
        else
        {
            ImageColorMgr.SetImageColor(this.BtnGet.get_transform().FindChild("Image").GetComponent <Image>(), false);
            this.BtnGet.set_enabled(true);
        }
    }
Exemplo n.º 38
0
 public void InitItem(GUISummonCollectionScene baseScene, PetInfo petInfo, bool isPetSet)
 {
     this.SummonItemInfo = petInfo;
     if (petInfo != null)
     {
         this.SummonItemData = Globals.Instance.Player.PetSystem.GetPetByInfoID(this.SummonItemInfo.ID);
     }
     this.CreateObjects();
     this.Refresh();
 }
Exemplo n.º 39
0
 public void Refresh(PetInfo petInfo)
 {
     if (petInfo != null)
     {
         this.SummonItemInfo = petInfo;
         if (petInfo != null)
         {
             this.SummonItemData = Globals.Instance.Player.PetSystem.GetPetByInfoID(this.SummonItemInfo.ID);
         }
         this.Refresh();
     }
 }
Exemplo n.º 40
0
 public void AddAffixPet(PetInfo petInfo)
 {
     int affixEmptyIndex = this.GetAffixEmptyIndex();
     if (affixEmptyIndex != -1)
     {
         this.mReward[affixEmptyIndex] = GameUITools.CreateReward(4, petInfo.ID, 1, this.mMailAffixGoods[affixEmptyIndex], false, true, 36f, -7f, -2000f, 20f, 13f, 7f, 0);
         if (this.mReward[affixEmptyIndex] != null)
         {
             this.mReward[affixEmptyIndex].AddComponent<UIDragScrollView>();
         }
         this.mMailAffixGoods[affixEmptyIndex].gameObject.SetActive(true);
     }
 }
Exemplo n.º 41
0
 public void ShowSummonSkills(PetDataEx petData, PetInfo petInfo = null)
 {
     if (petData != null)
     {
         this.mActiveSkillInfo = petData.GetPlayerSkillInfo();
         if (this.mActiveSkillInfo != null)
         {
             Texture mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
             this.mActiveSkill.mainTexture = mainTexture;
         }
         else
         {
             this.mActiveSkill.mainTexture = null;
         }
     }
     else
     {
         this.mActiveSkill.mainTexture = null;
     }
     if (this.mPassiveSkills[0] != null && petData != null)
     {
         int i = 0;
         for (int j = 0; j < 3; j++)
         {
             this.mPassiveSkillInfos[i] = petData.GetSkillInfo(1 + j);
             if (this.mPassiveSkillInfos[i] != null && this.mPassiveSkillInfos[i].ID != 0)
             {
                 this.mPassiveSkills[i].gameObject.SetActive(true);
                 if (j == 0 || (ulong)petData.Data.Further > (ulong)((long)(j + 1)))
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillIconGreys[i].gameObject.SetActive(false);
                     this.mPassiveSkillIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                 }
                 else
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillIconGreys[i].gameObject.SetActive(true);
                     this.mPassiveSkillIconGreys[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                 }
                 i++;
             }
         }
         while (i < 3)
         {
             this.mPassiveSkillInfos[i] = null;
             this.mPassiveSkills[i].gameObject.SetActive(false);
             i++;
         }
     }
 }
Exemplo n.º 42
0
 public static QuestRewardPet CreateReward(PetInfo info, int num)
 {
     GameObject gameObject = Tools.InstantiateGUIPrefab("GUI/QuestRewardPet");
     if (gameObject != null)
     {
         QuestRewardPet questRewardPet = gameObject.AddComponent<QuestRewardPet>();
         if (questRewardPet != null)
         {
             questRewardPet.Init(info, num);
             return questRewardPet;
         }
     }
     return null;
 }
Exemplo n.º 43
0
 public void Refresh(int petInfoID, bool playWand = false)
 {
     NGUITools.SetActive(this.mUI73, false);
     if (this.petInfo != null && this.petInfo.ID == petInfoID)
     {
         return;
     }
     this.ClearModel();
     if (petInfoID != 0)
     {
         this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(petInfoID);
         this.asyncEntity = ActorManager.CreateUIPet(petInfoID, 0, true, false, this.mSlot, 1f, 0, delegate(GameObject go)
         {
             this.asyncEntity = null;
             this.mModel = go;
             if (go == null)
             {
                 global::Debug.Log(new object[]
                 {
                     "CreateUIPlayer error"
                 });
             }
             else
             {
                 NGUITools.SetLayer(go, LayerDefine.MonsterLayer);
                 Tools.SetMeshRenderQueue(go, 3002);
                 go.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
                 this.mActor = go.GetComponent<UIActorController>();
                 if (this.mActor == null)
                 {
                     this.mActor = go.AddComponent<UIActorController>();
                 }
                 this.mActor.IsPlayer = false;
                 this.mSkinnedRenderers = go.GetComponentsInChildren<Renderer>(true);
                 if (playWand)
                 {
                     this.PlayWandEffect();
                 }
                 this.SetDark(this.colorValue);
                 this.ResetRotation();
             }
         });
     }
     if (this.mUnknow != null)
     {
         this.mUnknow.enabled = (petInfoID == 0);
     }
     this.ResetRotation();
 }
Exemplo n.º 44
0
 public void InitWithBaseScene(GUISummonCollectionScene baseScene, EElementType et, PetInfo[] petInfo)
 {
     this.mBaseScene = baseScene;
     this.mElementType = et;
     for (int i = 0; i < 8; i++)
     {
         if (petInfo.Length > i)
         {
             this.mCollectionPetInfos[i] = petInfo[i];
         }
         else
         {
             this.mCollectionPetInfos[i] = null;
         }
     }
     this.mIsTitle = false;
     this.CreateObjects();
     this.Refresh();
 }
Exemplo n.º 45
0
	public void Open( PetInfo _info)
	{
		Tbl_Pet_Record petRec = AsTableManager.Instance.GetPetRecord( _info.nPetTableIdx);
		if( petRec != null)
		{
			Tbl_PetScript_Record scriptRec = AsTableManager.Instance.GetPetScriptRecord(_info.nPersonality);
			string personality = AsTableManager.Instance.GetTbl_String(scriptRec.PersonName);
			string name = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( _info.szPetName));
			
			string content = AsTableManager.Instance.GetTbl_String( 2218);
			content = string.Format( content, personality, name);
			text_Index.Text = content;
			
			slot1.SetSlotImg( petRec.Icon);
		}
		else
		{
			Debug.LogError( "UIPetPerform:: Open: there is no pet record. id = " + _info.nPetTableIdx);
			Destroy( gameObject);
		}
	}
Exemplo n.º 46
0
 public void Init(int petInfoID, bool showTips)
 {
     this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(petInfoID);
     if (this.petInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("PetDict.GetInfo, ID = {0}", petInfoID)
         });
         return;
     }
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
     UISprite uISprite = GameUITools.FindUISprite("itemIcon", base.gameObject);
     uISprite.spriteName = this.petInfo.Icon;
     if (showTips)
     {
         UIEventListener expr_95 = UIEventListener.Get(base.gameObject);
         expr_95.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_95.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick));
     }
 }
Exemplo n.º 47
0
 private void Init(PetInfo info, int num)
 {
     this.petInfo = info;
     if (this.petInfo == null)
     {
         base.gameObject.SetActive(false);
         return;
     }
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = this.petInfo.Icon;
     UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject);
     uISprite.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     if (num > 1)
     {
         uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.petInfo.Quality), this.petInfo.Name, num);
     }
     else
     {
         uILabel.text = Tools.GetPetName(this.petInfo);
         uILabel.color = Tools.GetItemQualityColor(this.petInfo.Quality);
     }
 }
Exemplo n.º 48
0
 public void Refresh()
 {
     if (this.SummonItemData != null)
     {
         this.SummonItemInfo = this.SummonItemData.Info;
         this.mOwnMask.gameObject.SetActive(false);
         this.mNewMark.gameObject.SetActive(false);
     }
     else
     {
         this.mOwnMask.gameObject.SetActive(true);
         this.mNewMark.gameObject.SetActive(false);
     }
     if (this.SummonItemInfo != null)
     {
         this.mItemGo.SetActive(true);
         this.mSummonQualityMask.spriteName = Tools.GetItemQualityIcon(this.SummonItemInfo.Quality);
         this.mSummonIcon.spriteName = this.SummonItemInfo.Icon;
     }
     else
     {
         this.mItemGo.SetActive(false);
     }
 }
Exemplo n.º 49
0
 public PetViewItemData(PetInfo info)
 {
     this.info = info;
 }
Exemplo n.º 50
0
 public static void ShowThis(PetInfo info)
 {
     if (info == null)
     {
         return;
     }
     ItemInfo fragmentInfo = PetFragment.GetFragmentInfo(info.ID);
     if (fragmentInfo == null)
     {
         global::Debug.LogErrorFormat("PetFragment.GetFragmentInfo error, PetInfo id = {0}", new object[]
         {
             info.ID
         });
         return;
     }
     GameUIPopupManager.GetInstance().PushState(GameUIPopupManager.eSTATE.GUIHowGetPetItemPopUp, false, null, null);
     GameUIPopupManager.GetInstance().GetCurrentPopup().InitPopUp(fragmentInfo);
 }
Exemplo n.º 51
0
 private void AddContents(int tp)
 {
     switch (tp)
     {
     case 1:
     {
         int num = -1;
         PetInfo[] array = null;
         for (int i = 0; i < this.mFirePetInfos.Count; i++)
         {
             if (i / 8 != num)
             {
                 num = i / 8;
                 array = new PetInfo[8];
                 array[0] = this.mFirePetInfos[i];
             }
             else
             {
                 array[i % 8] = this.mFirePetInfos[i];
             }
             if (i % 8 == 7 || i == this.mFirePetInfos.Count - 1)
             {
                 this.AddCollectionContent((EElementType)tp, array);
             }
         }
         break;
     }
     case 2:
     {
         int num2 = -1;
         PetInfo[] array2 = null;
         for (int j = 0; j < this.mWoodPetInfos.Count; j++)
         {
             if (j / 8 != num2)
             {
                 num2 = j / 8;
                 array2 = new PetInfo[8];
                 array2[0] = this.mWoodPetInfos[j];
             }
             else
             {
                 array2[j % 8] = this.mWoodPetInfos[j];
             }
             if (j % 8 == 7 || j == this.mWoodPetInfos.Count - 1)
             {
                 this.AddCollectionContent((EElementType)tp, array2);
             }
         }
         break;
     }
     case 3:
     {
         int num3 = -1;
         PetInfo[] array3 = null;
         for (int k = 0; k < this.mWaterPetInfos.Count; k++)
         {
             if (k / 8 != num3)
             {
                 num3 = k / 8;
                 array3 = new PetInfo[8];
                 array3[0] = this.mWaterPetInfos[k];
             }
             else
             {
                 array3[k % 8] = this.mWaterPetInfos[k];
             }
             if (k % 8 == 7 || k == this.mWaterPetInfos.Count - 1)
             {
                 this.AddCollectionContent((EElementType)tp, array3);
             }
         }
         break;
     }
     case 4:
     {
         int num4 = -1;
         PetInfo[] array4 = null;
         for (int l = 0; l < this.mLightPetInfos.Count; l++)
         {
             if (l / 8 != num4)
             {
                 num4 = l / 8;
                 array4 = new PetInfo[8];
                 array4[0] = this.mLightPetInfos[l];
             }
             else
             {
                 array4[l % 8] = this.mLightPetInfos[l];
             }
             if (l % 8 == 7 || l == this.mLightPetInfos.Count - 1)
             {
                 this.AddCollectionContent((EElementType)tp, array4);
             }
         }
         break;
     }
     case 5:
     {
         int num5 = -1;
         PetInfo[] array5 = null;
         for (int m = 0; m < this.mDarkPetInfos.Count; m++)
         {
             if (m / 8 != num5)
             {
                 num5 = m / 8;
                 array5 = new PetInfo[8];
                 array5[0] = this.mDarkPetInfos[m];
             }
             else
             {
                 array5[m % 8] = this.mDarkPetInfos[m];
             }
             if (m % 8 == 7 || m == this.mDarkPetInfos.Count - 1)
             {
                 this.AddCollectionContent((EElementType)tp, array5);
             }
         }
         break;
     }
     }
 }
Exemplo n.º 52
0
 private void ClearData()
 {
     this.mItemInfo = null;
     this.mPetInfo = null;
     this.mPetData = null;
     this.mRewardData = null;
     this.mFashionInfo = null;
 }
Exemplo n.º 53
0
 private void AddCollectionContent(EElementType tp, PetInfo[] petInfos)
 {
     if (this.mContentOriginal == null)
     {
         this.mContentOriginal = Res.LoadGUI("GUI/collectionContent");
     }
     GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(this.mContentOriginal);
     gameObject.name = this.mContentOriginal.name;
     gameObject.transform.parent = this.mCollectionTable2.gameObject.transform;
     this.mContents.Add(gameObject.transform);
     gameObject.transform.localPosition = Vector3.zero;
     gameObject.transform.localScale = Vector3.one;
     CollectionContent collectionContent = gameObject.AddComponent<CollectionContent>();
     collectionContent.mPriority = this.mBasePriority++;
     collectionContent.InitWithBaseScene(this.mBaseScene, tp, petInfos);
 }
Exemplo n.º 54
0
	public PetAppearData( AsUserEntity _owner, PetInfo _info)
	{
		creationType_ = eCreationType.PET_APPEAR;

		initial_ = false;
		
		owner_ = _owner;
		
		nPetTableIdx_ = _info.nPetTableIdx;
		nPetPersonality_ = _info.nPersonality;
		szPetName_ = _info.szPetName;
		nLevel_ = _info.nLevel;
		nExp_ = _info.nExp;
		sSkill_ = _info.sSkill;
		
		itemIdx_ = _info.itemView.nItemTableIdx;
	}
Exemplo n.º 55
0
 private void RefreshReward()
 {
     if (this.mRewardData == null)
     {
         return;
     }
     if (this.showName)
     {
         this.mName.enabled = true;
         this.mName.color = Tools.GetItemQualityColor(0);
     }
     else
     {
         this.mName.enabled = false;
     }
     if (this.showNum)
     {
         this.mNum.enabled = true;
     }
     else
     {
         this.mNum.enabled = false;
     }
     ERewardType rewardType = (ERewardType)this.mRewardData.RewardType;
     switch (rewardType)
     {
     case ERewardType.EReward_Money:
     case ERewardType.EReward_Diamond:
     case ERewardType.EReward_Energy:
     case ERewardType.EReward_Exp:
     case ERewardType.EReward_GuildRepution:
     case ERewardType.EReward_MagicCrystal:
     case ERewardType.EReward_MagicSoul:
     case ERewardType.EReward_FireDragonScale:
     case ERewardType.EReward_KingMedal:
     case ERewardType.EReward_StarSoul:
     case ERewardType.EReward_Honor:
     case ERewardType.EReward_Emblem:
     case ERewardType.EReward_LopetSoul:
     case ERewardType.EReward_FestivalVoucher:
         this.mQualityMark.spriteName = Tools.GetRewardFrame(rewardType);
         this.mItemIcon.spriteName = Tools.GetRewardIcon(rewardType);
         this.mNum.text = Tools.FormatValue(this.mRewardData.RewardValue1);
         this.mName.text = Tools.GetRewardTypeName(rewardType, 0);
         this.mName.color = Tools.GetRewardNameColor(rewardType);
         break;
     case ERewardType.EReward_Item:
     {
         ItemInfo info = Globals.Instance.AttDB.ItemDict.GetInfo(this.mRewardData.RewardValue1);
         if (info == null)
         {
             global::Debug.LogErrorFormat("ItemDict.GetInfo error, id = {0}", new object[]
             {
                 this.mRewardData.RewardValue1
             });
             return;
         }
         this.mItemInfo = info;
         this.SetType(CommonIconItem.ECIIT.ECIIT_Item);
         this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2);
         break;
     }
     case ERewardType.EReward_Pet:
     {
         PetInfo info2 = Globals.Instance.AttDB.PetDict.GetInfo(this.mRewardData.RewardValue1);
         if (info2 == null)
         {
             global::Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[]
             {
                 this.mRewardData.RewardValue1
             });
             return;
         }
         this.mPetInfo = info2;
         this.SetType(CommonIconItem.ECIIT.ECIIT_Pet);
         this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2);
         break;
     }
     case ERewardType.EReward_Fashion:
     {
         FashionInfo info3 = Globals.Instance.AttDB.FashionDict.GetInfo(this.mRewardData.RewardValue1);
         if (info3 == null)
         {
             global::Debug.LogErrorFormat("FashionDict.GetInfo error, id = {0}", new object[]
             {
                 this.mRewardData.RewardValue1
             });
             return;
         }
         this.mFashionInfo = info3;
         this.SetType(CommonIconItem.ECIIT.ECIIT_Fashion);
         this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2);
         break;
     }
     case ERewardType.EReward_Lopet:
     {
         LopetInfo info4 = Globals.Instance.AttDB.LopetDict.GetInfo(this.mRewardData.RewardValue1);
         if (info4 == null)
         {
             global::Debug.LogErrorFormat("LopetDict.GetInfo error, id = {0}", new object[]
             {
                 this.mRewardData.RewardValue1
             });
             return;
         }
         this.mLopetInfo = info4;
         this.SetType(CommonIconItem.ECIIT.ECIIT_Lopet);
         this.SetNum((!this.showNum) ? 0 : this.mRewardData.RewardValue2);
         break;
     }
     }
 }
Exemplo n.º 56
0
 private void RefreshItem()
 {
     if (this.mItemInfo == null)
     {
         return;
     }
     this.mItemIcon.spriteName = this.mItemInfo.Icon;
     this.mQualityMark.spriteName = Tools.GetItemQualityIcon(this.mItemInfo.Quality);
     if (this.mItemInfo.Type == 3)
     {
         this.mFragmentMask.enabled = true;
         if (this.mItemInfo.SubType == 0)
         {
             this.mPetInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.mItemInfo.Value2);
             if (this.mPetInfo == null)
             {
                 global::Debug.LogErrorFormat("PetDict get info error , ID : {0}", new object[]
                 {
                     this.mItemInfo.Value2
                 });
                 return;
             }
             this.mItemIcon.enabled = false;
             this.mLopetIcon.enabled = false;
             this.mPetIcon.enabled = true;
             this.mPetIcon.spriteName = this.mPetInfo.Icon;
             this.mFragmentMask.spriteName = "frag";
         }
         else if (this.mItemInfo.SubType == 3)
         {
             this.mLopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.mItemInfo.Value2);
             if (this.mLopetInfo == null)
             {
                 global::Debug.LogErrorFormat("LopetDict get info error , ID : {0}", new object[]
                 {
                     this.mItemInfo.Value2
                 });
                 return;
             }
             this.mItemIcon.enabled = false;
             this.mPetIcon.enabled = false;
             this.mLopetIcon.enabled = true;
             this.mLopetIcon.spriteName = this.mLopetInfo.Icon;
             this.mFragmentMask.spriteName = "frag";
         }
         else
         {
             this.mFragmentMask.spriteName = "frag2";
         }
     }
     else
     {
         this.mFragmentMask.enabled = false;
     }
     if (this.showName)
     {
         this.mName.enabled = true;
         this.mName.text = this.mItemInfo.Name;
         this.mName.color = Tools.GetItemQualityColor(this.mItemInfo.Quality);
     }
     else
     {
         this.mName.enabled = false;
     }
     int itemCount = Globals.Instance.Player.ItemSystem.GetItemCount(this.mItemInfo.ID);
     if (this.showNum && itemCount > 0)
     {
         this.mNum.enabled = true;
         this.mNum.text = Tools.FormatValue(itemCount);
     }
     else
     {
         this.mNum.enabled = false;
     }
 }
Exemplo n.º 57
0
 public void Refresh(PetInfo petInfo, bool isMask)
 {
     this.mPetInfo = petInfo;
     this.mIsActive = isMask;
     this.Refresh();
 }
Exemplo n.º 58
0
 private int SortSummonCollection(PetInfo a, PetInfo b)
 {
     if (a == null || b == null)
     {
         return 0;
     }
     if (a.Quality > b.Quality)
     {
         return -1;
     }
     if (a.Quality < b.Quality)
     {
         return 1;
     }
     if (a.ID > b.ID)
     {
         return -1;
     }
     if (a.ID < b.ID)
     {
         return 1;
     }
     return 0;
 }
Exemplo n.º 59
0
 public static ResourceEntity CreateUIPet(PetInfo petInfo, int depth = 0, bool playAction = true, bool canRotate = true, GameObject parent = null, float scale = 1f, int uiType = 0, Action<GameObject> callback = null)
 {
     //ActorManager.<CreateUIPet>c__AnonStoreyB5 <CreateUIPet>c__AnonStoreyB = new ActorManager.<CreateUIPet>c__AnonStoreyB5();
     //<CreateUIPet>c__AnonStoreyB.uiType = uiType;
     //<CreateUIPet>c__AnonStoreyB.callback = callback;
     if (petInfo == null)
     {
         if (callback != null)
         {
             callback(null);
         }
         return null;
     }
     float rotation = 180f;
     float offsetY = petInfo.OffsetYInCard * scale;
     if (uiType == 0)
     {
         scale *= petInfo.ScaleInUI;
     }
     else
     {
         scale *= petInfo.ScaleInCard;
         if (uiType == 2)
         {
             rotation = 170f;
         }
     }
     return ActorManager.CreateUIActorAsync(petInfo.ResLoc, string.Empty, scale, depth, playAction, canRotate, parent, 0, string.Empty, rotation, delegate(GameObject obj)
     {
         if (uiType != 0 && obj != null && offsetY != 0f)
         {
             obj.transform.localPosition = new Vector3(0f, offsetY, 0f);
         }
         if (callback != null)
         {
             callback(obj);
         }
     });
 }
Exemplo n.º 60
0
 public void Refresh(PetInfo info, bool showName = false, bool showNum = false, bool showMinus = false)
 {
     if (this.mPetInfo == info)
     {
         return;
     }
     this.InitBool(showName, showNum, showMinus);
     this.mPetInfo = info;
     this.SetType(CommonIconItem.ECIIT.ECIIT_Pet);
 }