Esempio n. 1
0
 public bool MoveNext()
 {
     this.$PC = -1;
     if (((this.$PC == 0) && !PlayerView.Binder.MenuSystem.InTransition) && !PlayerView.Binder.TransitionSystem.InCriticalTransition)
     {
         this.< player > __0    = GameLogic.Binder.GameState.Player;
         this.< trigChest > __1 = this.< player > __0.getFirstUnclaimedRetirementTriggerChest();
         if (this.< trigChest > __1 != null)
         {
             if (this.< trigChest > __1.getTotalTokenAmount() <= 0.0)
             {
                 this.< trigChest > __1.addResourceDrop(ResourceType.Token, 100.0);
             }
         }
         else
         {
             Reward item = new Reward();
             item.ChestType = ChestType.RetirementTrigger;
             List <double> list = new List <double>();
             list.Add(100.0);
             item.TokenDrops = list;
             this.< player > __0.UnclaimedRewards.Add(item);
         }
         PlayerView.Binder.TransitionSystem.retire();
     }
Esempio n. 2
0
        private static void PlayerMigrate_v5_to_v6(Player player)
        {
            Reward reward = player.getFirstUnclaimedRetirementTriggerChest();

            if (reward != null)
            {
                reward.FrenzyPotions = 1 + (player.LastCompletedFloor / 60);
            }
            player.rerollRetirementRandomSeed();
        }
Esempio n. 3
0
        private static void PlayerMigrate_v8_to_v9(Player player)
        {
            Reward reward = player.getFirstUnclaimedRetirementTriggerChest();

            if (reward != null)
            {
                for (int i = 0; i < reward.FrenzyPotions; i++)
                {
                    Reward reward3 = new Reward();
                    reward3.ChestType     = ChestType.RewardBoxCommon;
                    reward3.FrenzyPotions = 1;
                    Reward item = reward3;
                    player.UnclaimedRewards.Add(item);
                }
                reward.FrenzyPotions = 0;
            }
        }
        public static void ExecuteStatic()
        {
            Player            player          = GameLogic.Binder.GameState.Player;
            CharacterInstance activeCharacter = player.ActiveCharacter;

            if (player.getFirstUnclaimedRetirementTriggerChest() == null)
            {
                Reward reward2 = new Reward();
                reward2.ChestType = ChestType.RetirementTrigger;
                List <double> list = new List <double>();
                list.Add(App.Binder.ConfigMeta.RetirementTokenReward(activeCharacter, 50));
                reward2.TokenDrops = list;
                Reward item = reward2;
                player.UnclaimedRewards.Add(item);
            }
            CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossAdditionalDropLootTable, player, player.ActiveCharacter.PhysicsBody.Transform.position, CharacterType.UNSPECIFIED, ChestType.RewardBoxCommon.ToString(), ChestType.NONE);
        }
Esempio n. 5
0
        public void awardBossRewards(ActiveDungeon ad, GameLogic.CharacterType killedBossType, bool wildBoss)
        {
            ad.VisualizableBossRewards = new ActiveDungeon.BossRewards();
            CharacterInstance primaryPlayerCharacter = ad.PrimaryPlayerCharacter;
            Player            owningPlayer           = primaryPlayerCharacter.OwningPlayer;
            int    floor          = ad.Floor;
            double baseCoinReward = App.Binder.ConfigMeta.BossCoinDropCurve(floor, owningPlayer.BossTrain.Active);
            double num3           = owningPlayer.calculateStandardCoinRoll(baseCoinReward, killedBossType, 1);

            ad.VisualizableBossRewards.CoinDropCount = UnityEngine.Random.Range(3, 7);
            ad.VisualizableBossRewards.CoinsPerDrop  = num3 / ((double)ad.VisualizableBossRewards.CoinDropCount);
            bool   isHighestFloor = ad.Floor == owningPlayer.getHighestFloorReached();
            double num4           = App.Binder.ConfigMeta.XpFromBossKill(ad.Floor, isHighestFloor) / ((double)ad.VisualizableBossRewards.CoinDropCount);
            float  num5           = primaryPlayerCharacter.getCharacterTypeXpModifier(killedBossType) + primaryPlayerCharacter.UniversalXpBonus(true);

            num4 += num4 * num5;
            ad.VisualizableBossRewards.XpPerDrop = num4;
            bool flag2 = !ad.hasDungeonModifier(DungeonModifierType.MonsterNoCoins);

            for (int i = 0; i < ad.VisualizableBossRewards.CoinDropCount; i++)
            {
                if (flag2)
                {
                    Vector3?nullable = null;
                    CmdGainResources.ExecuteStatic(owningPlayer, ResourceType.Coin, ad.VisualizableBossRewards.CoinsPerDrop, true, "TRACKING_ID_GAMEPLAY_LOOT_GAIN", nullable);
                }
                Vector3?worldPt = null;
                CmdGainResources.ExecuteStatic(owningPlayer, ResourceType.Xp, ad.VisualizableBossRewards.XpPerDrop, true, string.Empty, worldPt);
            }
            bool flag3 = false;

            if (!wildBoss)
            {
                flag3 = this.grantRetirementTriggerChestIfAllowed();
            }
            if (!wildBoss && owningPlayer.canRetire())
            {
                Reward reward = owningPlayer.getFirstUnclaimedRetirementTriggerChest();
                ad.VisualizableBossRewards.Tokens = App.Binder.ConfigMeta.RetirementTokenReward(primaryPlayerCharacter, ad.Floor);
                reward.TokenDrops.Add(ad.VisualizableBossRewards.Tokens);
                if (App.Binder.ConfigMeta.BossShouldDropFrenzyPotionAtFloor(ad.Floor))
                {
                    ad.VisualizableBossRewards.FrenzyPotions = 1;
                    reward.FrenzyPotions += ad.VisualizableBossRewards.FrenzyPotions;
                }
            }
            if ((wildBoss || owningPlayer.hasRetired()) || !flag3)
            {
                ad.VisualizableBossRewards.MainDrops.Add(CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossDropLootTable, owningPlayer, Vector3.zero, killedBossType, null, ChestType.NONE));
                int num7 = owningPlayer.CumulativeRetiredHeroStats.BossesBeat + owningPlayer.ActiveCharacter.HeroStats.BossesBeat;
                if ((owningPlayer.getPerkInstanceCount(PerkType.ChesterChestDrop) > 0) && ((((float)num7) % Mathf.Floor(ConfigPerks.GetBestModifier(PerkType.ChesterChestDrop))) == 0f))
                {
                    ad.VisualizableBossRewards.MainDrops.Add(CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossDropLootTable, owningPlayer, Vector3.zero, killedBossType, null, ChestType.ChesterChest));
                }
            }
            if ((!wildBoss && owningPlayer.canRetire()) && ConfigMeta.BOSS_ADDITIONAL_DROPS_ENABLED)
            {
                if (flag3 && !owningPlayer.hasRetired())
                {
                    Reward item = CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossAdditionalDropLootTable, owningPlayer, Vector3.zero, killedBossType, ChestType.RewardBoxCommon.ToString(), ChestType.NONE);
                    item.clearContent();
                    item.ShopEntryId = "CoinBundleSmall";
                    double num8 = App.Binder.ConfigMeta.CoinBundleSize(owningPlayer, item.ShopEntryId, 0.0);
                    item.CoinDrops.Add(num8);
                    ad.VisualizableBossRewards.RiggedRewards.Add(item);
                }
                else if (App.Binder.ConfigMeta.BossShouldDropRewardBoxAtFloor(ad.Floor))
                {
                    ad.VisualizableBossRewards.AdditionalDrop = CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossAdditionalDropLootTable, owningPlayer, Vector3.zero, killedBossType, null, ChestType.NONE);
                }
            }
        }
Esempio n. 6
0
        public bool grantRetirementTriggerChestIfAllowed()
        {
            Player player = GameLogic.Binder.GameState.Player;

            if ((((player.getLastCompletedFloor(false) + 1) >= App.Binder.ConfigMeta.RETIREMENT_MIN_FLOOR) && (player.getFirstUnclaimedRetirementTriggerChest() == null)) && !player.Tournaments.hasTournamentSelected())
            {
                Reward reward2 = new Reward();
                reward2.ChestType = ChestType.RetirementTrigger;
                Reward item = reward2;
                player.UnclaimedRewards.Add(item);
                return(true);
            }
            return(false);
        }