예제 #1
0
        private bool GetEquipmentShardUIInfoForCurrentItem(out int currentShardAmount, out int increasedShardAmount, out int shardsNeededForLevel, out bool showLevel, out EquipmentVO equipmentVoToDisplay)
        {
            currentShardAmount   = 0;
            increasedShardAmount = 0;
            shardsNeededForLevel = 0;
            equipmentVoToDisplay = null;
            showLevel            = false;
            CrateSupplyVO crateSupply = this.currentCrateItem.CrateSupply;

            if (crateSupply.Type != SupplyType.Shard)
            {
                return(false);
            }
            EquipmentVO equipment = this.currentCrateItem.Equipment;

            if (equipment == null)
            {
                return(false);
            }
            EquipmentUpgradeCatalog equipmentUpgradeCatalog = Service.EquipmentUpgradeCatalog;
            string equipmentID = equipment.EquipmentID;
            int    num         = (!this.shardsOriginal.ContainsKey(equipmentID)) ? 0 : this.shardsOriginal[equipmentID];

            currentShardAmount = num;
            RewardVO reward         = Service.InventoryCrateRewardController.GenerateRewardFromSupply(crateSupply, this.hq);
            int      shardsRewarded = RewardUtils.GetShardsRewarded(reward);
            int      num2           = num + shardsRewarded;

            increasedShardAmount = num2;
            EquipmentVO equipmentVO = equipment;

            showLevel = true;
            if (this.equipmentOriginal.ContainsKey(equipmentID))
            {
                int num3  = this.equipmentOriginal[equipmentID];
                int level = Mathf.Min(num3 + 1, equipmentUpgradeCatalog.GetMaxLevel(equipmentID).Lvl);
                equipmentVoToDisplay = equipmentUpgradeCatalog.GetByLevel(equipment, num3);
                equipmentVO          = equipmentUpgradeCatalog.GetByLevel(equipmentVoToDisplay, level);
            }
            else
            {
                equipmentVoToDisplay = equipmentUpgradeCatalog.GetMinLevel(equipmentVO.EquipmentID);
                equipmentVO          = equipmentVoToDisplay;
                showLevel            = false;
            }
            shardsNeededForLevel = equipmentVO.UpgradeShards;
            return(true);
        }