Пример #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();
     }
Пример #2
0
 public void fillReward(Player player, ref Reward reward)
 {
     if (!string.IsNullOrEmpty(this.RewardShopEntryId))
     {
         reward.addShopEntryDrop(player, this.RewardShopEntryId, false);
     }
     if (this.RewardDiamonds > 0.0)
     {
         reward.addResourceDrop(ResourceType.Diamond, this.RewardDiamonds);
     }
 }
Пример #3
0
        private static void PlayerMigrate_v3_to_v4(Player player)
        {
            for (int i = 0; i < player.CumulativeRetiredHeroStats.EncounteredChestTypes.Count; i++)
            {
                if (player.CumulativeRetiredHeroStats.EncounteredChestTypes[i] == ChestType.Wooden001.ToString())
                {
                    player.CumulativeRetiredHeroStats.EncounteredChestTypes[i] = ChestType.Basic001.ToString();
                }
            }
            for (int j = 0; j < player.UnclaimedRewards.Count; j++)
            {
                if (player.UnclaimedRewards[j].ChestType == ChestType.Wooden001)
                {
                    player.UnclaimedRewards[j].ChestType = ChestType.Basic001;
                }
            }
            for (int k = 0; k < player.CharacterInstances.Count; k++)
            {
                CharacterInstance instance = player.CharacterInstances[k];
                for (int num4 = 0; num4 < instance.HeroStats.EncounteredChestTypes.Count; num4++)
                {
                    if (instance.HeroStats.EncounteredChestTypes[num4] == ChestType.Wooden001.ToString())
                    {
                        instance.HeroStats.EncounteredChestTypes[num4] = ChestType.Basic001.ToString();
                    }
                }
            }
            for (int m = 0; m < player.Vendor.Inventory.Count; m++)
            {
                if (player.Vendor.Inventory[m].PrerolledChestType == ChestType.Wooden001)
                {
                    player.Vendor.Inventory[m].PrerolledChestType = ChestType.Basic001;
                }
            }
            if (player.CompletedTutorials.Contains("CTUT001"))
            {
                player.SocialData.HeroNamingCount = 1;
            }
            int num6 = 0;

            for (int n = player.Runestones.RunestoneInstances.Count - 1; n >= 0; n--)
            {
                RunestoneInstance           instance2     = player.Runestones.RunestoneInstances[n];
                ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(instance2.Id);
                num6 += ConfigRunestones.RUNESTONE_UPDATE_V3_RARITY_TO_V4_GEM_REWARD[runestoneData.Rarity];
                if (runestoneData.LinkedToSkill == SkillType.NONE)
                {
                    player.Runestones.RunestoneInstances.RemoveAt(n);
                }
                else
                {
                    instance2.InspectedByPlayer = false;
                }
            }
            if (num6 > 0)
            {
                Reward item = new Reward();
                item.ChestType = ChestType.RunestoneUpdateReward;
                item.addResourceDrop(ResourceType.Diamond, (double)num6);
                player.UnclaimedUpdateRewards.Add(item);
            }
            player.ActiveCharacter.Inventory.FrenzyPotions = player.UnusedFrenzyPotions;
            player.ActiveCharacter.Inventory.RevivePotions = player.UnusedFreeRevives;
        }