Esempio n. 1
0
        /// <summary>
        ///     计算基础属性
        /// </summary>
        private static uint CupBaseProperty(PPet pet, string des)
        {
            string[]          values   = des.Substring(1, des.Length - 2).Split(',');
            uint              init     = uint.Parse(values[0]);
            uint              levelAdd = uint.Parse(values[1]);
            SysPetEvolutionVo starVo   = BaseDataMgr.instance.GetDataById <SysPetEvolutionVo>((uint)pet.star);
            float             result   = (init + levelAdd * (pet.lvl - 1)) * starVo.grow / 10000f;

            return((uint)result);
        }
Esempio n. 2
0
        private void SetPetProperty(PPet pet)
        {
            PetVo             petVo  = Singleton <PetMode> .Instance.PetVos[pet.id];
            SysPetEvolutionVo petEvo = BaseDataMgr.instance.GetDataById <SysPetEvolutionVo>(pet.star);

            NGUITools.FindInChild <UILabel>(propetyObj, "growvalue").text   = (petEvo.grow / 10000f).ToString();
            NGUITools.FindInChild <UILabel>(propetyObj, "hpvalue").text     = petVo.Hp.ToString();
            NGUITools.FindInChild <UILabel>(propetyObj, "attackvalue").text = petVo.AttPMax.ToString();
            NGUITools.FindInChild <UILabel>(propetyObj, "pdvalue").text     = petVo.DefP.ToString();
            NGUITools.FindInChild <UILabel>(propetyObj, "mdvalue").text     = petVo.DefM.ToString();
            NGUITools.FindInChild <UILabel>(propetyObj, "decvalue").text    = petVo.HurtRe.ToString();

            SysPet         spet  = BaseDataMgr.instance.GetDataById <SysPet>(pet.petId);
            SysSkillBaseVo skill = BaseDataMgr.instance.GetDataById <SysSkillBaseVo>((uint)spet.unique_skill);

            NGUITools.FindInChild <UILabel>(propetyObj, "des").text             = "天赋技能:" + skill.desc;
            NGUITools.FindInChild <UILabel>(gameObject, "info/fightvalue").text = petVo.fight.ToString();
        }
Esempio n. 3
0
        //初始化宠物相关的配置信息
        public static void InitConfig()
        {
            string[] skill1 = { "生命之心", "生命之源", "生命之泉", "生命强化" };
            string[] skill2 = { "铜皮铁骨", "神圣之盾", "光明圣盾", "物理屏障" };
            string[] skill3 = { "魔法抵抗", "魔法护盾", "魔力屏障", "英勇抵抗" };
            string[] skill4 = { "战斗之心", "战斗之源", "战斗之泉", "攻击强化" };

            skillName[0] = skill1;
            skillName[1] = skill2;
            skillName[2] = skill3;
            skillName[3] = skill4;

            SysPets = new List <SysPet>();
            //第一次处理
            foreach (SysPet pet in BaseDataMgr.instance.GetDicByType <SysPet>().Values)
            {
                SysPets.Add(pet);

                //计算各类型数量
                AllNum++;
                if (pet.type == Type_Attack)
                {
                    AttackNum++;
                }
                else if (pet.type == Type_Control)
                {
                    ControlNum++;
                }
                else if (pet.type == Type_Help)
                {
                    HelpNum++;
                }
            }

            for (uint i = 1; i <= 5; i++)
            {
                SysPetEvolutionVo evo = BaseDataMgr.instance.GetDataById <SysPetEvolutionVo>(i);
                StartGrow[i - 1] = evo.grow;

                if (i > 1)
                {
                    starStoneNum[i - 1] = evo.number - BaseDataMgr.instance.GetDataById <SysPetEvolutionVo>(i - 1).number;
                }
                else
                {
                    starStoneNum[i - 1] = evo.number;
                }
            }

            //宠物装备配置表
            int[][] equipConfig1 = new int[14][];
            int[][] equipConfig2 = new int[14][];
            int[][] equipConfig3 = new int[14][];

            PetEquipConfig[0] = equipConfig1;
            PetEquipConfig[1] = equipConfig2;
            PetEquipConfig[2] = equipConfig3;

            foreach (SysPetAdvancedVo petEquip in BaseDataMgr.instance.GetDicByType <SysPetAdvancedVo>().Values)
            {
                int[] equip = new int[6];
                equip[0] = petEquip.equip_1;
                equip[1] = petEquip.equip_2;
                equip[2] = petEquip.equip_3;
                equip[3] = petEquip.equip_4;
                equip[4] = petEquip.equip_5;
                equip[5] = petEquip.equip_6;

                PetEquipConfig[petEquip.type - 1][petEquip.advanced - 1] = equip;
                GradeAdd[petEquip.type * petEquip.advanced - 1]          = petEquip;
            }
        }