private void onRewardConsumed(Player player, Reward drop)
 {
     if (drop.isWrappedInsideChest())
     {
         for (int i = 0; i < this.m_heroStats.Count; i++)
         {
             HeroStats stats = this.m_heroStats[i];
             if (ConfigMeta.IsMysteryChest(drop.ChestType))
             {
                 stats.SilverChestsOpened++;
             }
             else if (drop.ChestType == App.Binder.ConfigMeta.MISSION_BIG_PRIZE_CHEST_TYPE)
             {
                 stats.MissionBigPrizesOpened++;
             }
             else
             {
                 stats.GoldChestsOpened++;
             }
             string item = drop.ChestType.ToString();
             if (!stats.EncounteredChestTypes.Contains(item))
             {
                 stats.EncounteredChestTypes.Add(item);
             }
         }
     }
 }
Ejemplo n.º 2
0
        public LootTable getLootTableForChestType(ChestType chestType, [Optional, DefaultParameterValue(0)] int rollNo)
        {
            if (chestType == ChestType.RewardBoxMulti)
            {
                switch (rollNo)
                {
                case 0:
                    return(this.MegaboxSlot1LootTable);

                case 1:
                    return(this.MegaboxSlot2LootTable);

                case 2:
                    return(this.MegaboxSlot3LootTable);
                }
                return(this.MegaboxSlot1LootTable);
            }
            if (chestType == ChestType.MysterySpecialOffer)
            {
                ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
                if ((activeDungeon != null) && (activeDungeon.ActiveTournament != null))
                {
                    return(this.ChestLootTables[ChestType.MysterySpecialOffer_BossHunt]);
                }
            }
            if (ConfigMeta.IsBossChest(chestType))
            {
                return(this.prepareDynamicChestTable(chestType));
            }
            return(this.ChestLootTables[chestType]);
        }
 public override string VisitConfig([NotNull] LogstashconfigParser.ConfigContext context)
 {
     //初始化配置对象
     Config         = new ConfigMeta();
     Config.Plugins = new Dictionary <string, IList <Plugin> >();
     return(base.VisitConfig(context));
 }
Ejemplo n.º 4
0
 private void onDropLootTableRolled(LootTable lootTable, Vector3 worldPos, Reward drop)
 {
     if (ConfigMeta.IsRetirementChest(drop.ChestType))
     {
         GameLogic.Binder.GameState.Player.Notifiers.HeroRetirementsInspected = false;
     }
 }
Ejemplo n.º 5
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);
        }