Beispiel #1
0
        public static int CalculateLvWithExp(float exp, StorageDataItemBase equipToPowerUp)
        {
            List <EquipmentLevelMetaData> itemList = EquipmentLevelMetaDataReader.GetItemList();
            int   expType  = equipToPowerUp.GetExpType();
            int   maxLevel = equipToPowerUp.GetMaxLevel();
            float num3     = exp + equipToPowerUp.exp;
            int   level    = equipToPowerUp.level;

            while ((num3 > 0f) && (level < maxLevel))
            {
                int num5 = itemList[level - 1].expList[expType];
                if (num5 > num3)
                {
                    return(level);
                }
                num3 -= num5;
                level++;
            }
            return(level);
        }