Esempio n. 1
0
        private static bool CheckMaterialNum(GameWebAPI.RespDataMA_GetMonsterMS.MonsterM monsterM, List <HaveSoulData> almightyHsdL)
        {
            List <GameWebAPI.RespDataMA_GetMonsterEvolutionM.Evolution> monsterVersionUpList = ClassSingleton <EvolutionData> .Instance.GetMonsterVersionUpList(monsterM.monsterId);

            int  monsterEvolutionMaterialId = monsterVersionUpList[0].monsterEvolutionMaterialId;
            bool result = true;

            GameWebAPI.MonsterEvolutionMaterialMaster.Material evolutionMaterial = EvolutionMaterialData.GetEvolutionMaterial(monsterEvolutionMaterialId);
            for (int i = 1; i <= 7; i++)
            {
                string assetValue = evolutionMaterial.GetAssetValue(i);
                string assetNum   = evolutionMaterial.GetAssetNum(i);
                int    num        = assetNum.ToInt32();
                GameWebAPI.UserSoulData userSoulDataBySID = VersionUpMaterialData.GetUserSoulDataBySID(assetValue);
                int num2 = userSoulDataBySID.num.ToInt32();
                if (num > num2)
                {
                    HaveSoulData haveSoulData = null;
                    bool         flag         = VersionUpMaterialData.CanChangeToAlmighty(almightyHsdL, assetValue, num, ref haveSoulData);
                    if (!flag)
                    {
                        result = false;
                        break;
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
        public bool CheckMaterialNum(int evolutionMaterialId)
        {
            bool result = true;

            GameWebAPI.MonsterEvolutionMaterialMaster.Material evolutionMaterial = EvolutionMaterialData.GetEvolutionMaterial(evolutionMaterialId);
            for (int i = 1; i <= 7; i++)
            {
                string assetValue = evolutionMaterial.GetAssetValue(i);
                string assetNum   = evolutionMaterial.GetAssetNum(i);
                int    num        = assetNum.ToInt32();
                GameWebAPI.UserSoulData userSoulDataBySID = this.GetUserSoulDataBySID(assetValue);
                int num2 = userSoulDataBySID.num.ToInt32();
                if (num > num2)
                {
                    result = false;
                    break;
                }
            }
            return(result);
        }
 public static GameWebAPI.MonsterEvolutionMaterialMaster.Material GetEvolutionMaterial(string monsterEvolutionMaterialId)
 {
     return(EvolutionMaterialData.GetEvolutionMaterial(int.Parse(monsterEvolutionMaterialId)));
 }
Esempio n. 4
0
        private void GetEvolutionDataList(MonsterData md, List <GameWebAPI.RespDataMA_GetMonsterEvolutionM.Evolution> memS, ref List <EvolutionData.MonsterEvolveData> medList)
        {
            for (int i = 0; i < memS.Count; i++)
            {
                EvolutionData.MonsterEvolveData monsterEvolveData = new EvolutionData.MonsterEvolveData();
                monsterEvolveData.md      = md;
                monsterEvolveData.md_next = MonsterDataMng.Instance().CreateMonsterDataByMID(memS[i].nextMonsterId);
                monsterEvolveData.mem     = memS[i];
                GameWebAPI.MonsterEvolutionMaterialMaster.Material evolutionMaterial = EvolutionMaterialData.GetEvolutionMaterial(memS[i].monsterEvolutionMaterialId);
                monsterEvolveData.itemList = new List <EvolutionData.MonsterEvolveItem>();
                for (int j = 1; j <= 7; j++)
                {
                    EvolutionData.MonsterEvolveItem monsterEvolveItem = new EvolutionData.MonsterEvolveItem();
                    string assetCategoryId = evolutionMaterial.GetAssetCategoryId(j);
                    string assetValue      = evolutionMaterial.GetAssetValue(j);
                    string assetNum        = evolutionMaterial.GetAssetNum(j);
                    if (assetCategoryId == ConstValue.EVOLVE_ITEM_MONS.ToString())
                    {
                        monsterEvolveItem.catId    = ConstValue.EVOLVE_ITEM_MONS;
                        monsterEvolveItem.need_num = int.Parse(assetNum);
                        List <MonsterData> monsterList = ClassSingleton <MonsterUserDataMng> .Instance.GetMonsterList(assetValue);

                        monsterEvolveItem.haveNum = monsterList.Count;
                        monsterEvolveData.itemList.Add(monsterEvolveItem);
                    }
                    else if (assetCategoryId == ConstValue.EVOLVE_ITEM_SOUL.ToString())
                    {
                        monsterEvolveItem.catId    = ConstValue.EVOLVE_ITEM_SOUL;
                        monsterEvolveItem.need_num = int.Parse(assetNum);
                        monsterEvolveItem.sd_item  = this.GetUserSoulDataBySID(assetValue);
                        monsterEvolveItem.haveNum  = int.Parse(monsterEvolveItem.sd_item.num);
                        monsterEvolveData.itemList.Add(monsterEvolveItem);
                    }
                }
                medList.Add(monsterEvolveData);
            }
        }