Exemplo n.º 1
0
 public void copyFrom(Reward another)
 {
     this.ChestType      = another.ChestType;
     this.CoinDrops      = new List <double>(another.CoinDrops);
     this.DiamondDrops   = new List <double>(another.DiamondDrops);
     this.TokenDrops     = new List <double>(another.TokenDrops);
     this.Boost          = another.Boost;
     this.Skill          = another.Skill;
     this.ItemDrops      = new List <ItemInstance>(another.ItemDrops);
     this.RunestoneDrops = new List <string>(another.RunestoneDrops);
     this.CrownDrops     = new List <double>(another.CrownDrops);
     if (another.RunestoneAtIndexConvertedIntoTokens != null)
     {
         this.RunestoneAtIndexConvertedIntoTokens = new List <int>(another.RunestoneAtIndexConvertedIntoTokens);
     }
     this.ShopEntryId             = another.ShopEntryId;
     this.Revives                 = another.Revives;
     this.Sprite                  = another.Sprite;
     this.FrenzyPotions           = another.FrenzyPotions;
     this.DustDrops               = new List <double>(another.DustDrops);
     this.ShopEntryDrops          = new List <string>(another.ShopEntryDrops);
     this.XpPotions               = another.XpPotions;
     this.BossPotions             = another.BossPotions;
     this.Pets                    = new List <PetReward>(another.Pets);
     this.MegaBoxes               = another.MegaBoxes;
     this.RewardSource            = another.RewardSource;
     this.RewardSourceId          = another.RewardSourceId;
     this.ChestTypeVisualOverride = another.ChestTypeVisualOverride;
     this.TournamentUpgradeReward = another.TournamentUpgradeReward;
 }
Exemplo n.º 2
0
        public void addShopEntryDrop(Player player, string shopEntryId, [Optional, DefaultParameterValue(false)] bool applyMysteryChestDiminisher)
        {
            double            num;
            CharacterInstance activeCharacter = player.ActiveCharacter;
            ShopEntry         shopEntry       = ConfigShops.GetShopEntry(shopEntryId);

            this.ShopEntryDrops.Add(shopEntryId);
            if (string.IsNullOrEmpty(this.ShopEntryId))
            {
                this.ShopEntryId = shopEntryId;
            }
            switch (shopEntry.Type)
            {
            case ShopEntryType.CoinBundle:
            {
                if (!applyMysteryChestDiminisher)
                {
                    num = ConfigShops.CalculateCoinBundleSize(player, shopEntry.Id, 1);
                    break;
                }
                ConfigMeta configMeta  = App.Binder.ConfigMeta;
                double     numUpgrades = player.getMysteryCoinOfferMultiplier(shopEntryId);
                num = configMeta.CoinBundleSize(activeCharacter.HighestLevelItemOwnedAtFloorStart, player, shopEntryId, numUpgrades, 0.0);
                break;
            }

            case ShopEntryType.IapDiamonds:
            case ShopEntryType.IapStarterBundle:
            case ShopEntryType.SpecialChest:
            case ShopEntryType.RewardBox:
                return;

            case ShopEntryType.Boost:
                this.Boost = shopEntry.Boost;
                return;

            case ShopEntryType.MysteryItem:
            {
                ItemInstance item = ConfigShops.CreateNewMysteryItemInstance(player, shopEntry.Id);
                this.ItemDrops.Add(item);
                return;
            }

            case ShopEntryType.TokenBundle:
                MathUtil.DistributeValuesIntoChunksInt((int)ConfigShops.CalculateTokenBundleSize(player, shopEntry.Id), shopEntry.NumBursts, ref this.TokenDrops);
                return;

            case ShopEntryType.ReviveBundle:
                this.Revives = (int)ConfigShops.CalculateReviveBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.FrenzyBundle:
                this.FrenzyPotions = (int)ConfigShops.CalculateFrenzyBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.DustBundle:
                MathUtil.DistributeValuesIntoChunksInt((int)ConfigShops.CalculateDustBundleSize(activeCharacter, shopEntry.Id), shopEntry.NumBursts, ref this.DustDrops);
                return;

            case ShopEntryType.DiamondBundle:
                MathUtil.DistributeValuesIntoChunksInt((int)ConfigShops.CalculateDiamondBundleSize(player, shopEntry.Id), shopEntry.NumBursts, ref this.DiamondDrops);
                return;

            case ShopEntryType.XpBundle:
                this.XpPotions = (int)ConfigShops.CalculateXpBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.BossBundle:
                this.BossPotions = (int)ConfigShops.CalculateBossBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.PetBundle:
            {
                string    str     = CmdRollPetBundleLootTable.ExecuteStatic(App.Binder.ConfigLootTables.PetBundleLootTables[shopEntry.Id], player);
                int       num6    = ConfigShops.CalculatePetBundleSize(player, shopEntry.Id);
                PetReward reward3 = new PetReward();
                reward3.PetId  = str;
                reward3.Amount = num6;
                this.Pets.Add(reward3);
                return;
            }

            case ShopEntryType.PetBox:
            {
                this.ChestType = shopEntry.ChestType;
                Reward reward = new Reward();
                CmdRollChestLootTable.ExecuteStatic(shopEntry.ChestType, player, false, ref reward, null);
                this.Pets.AddRange(reward.Pets);
                return;
            }

            case ShopEntryType.MegaBoxBundle:
                this.MegaBoxes = (int)ConfigShops.CalculateMegaBoxBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.LootBox:
            {
                Reward reward2 = new Reward();
                CmdRollChestLootTable.ExecuteStatic(shopEntry.ChestType, player, false, ref reward2, null);
                this.copyFrom(reward2);
                this.ChestType = shopEntry.ChestType;
                return;
            }

            default:
                return;
            }
            MathUtil.DistributeValuesIntoChunksDouble(num, shopEntry.NumBursts, ref this.CoinDrops);
        }