Пример #1
0
 private void Init()
 {
     if (this.IsInitialized || !SteamManager.Initialized || App.State == null)
     {
         return;
     }
     Log.Info("Steam Init!");
     this.m_GameID = new CGameID(SteamUtils.GetAppID());
     SteamHelper.InitSteamId();
     this.CheckForResult = true;
     App.InitialLeaderboardSubmit();
     this.IsInitialized = true;
 }
Пример #2
0
        public static void CheckAchievements()
        {
            if (App.State == null || App.State.Ext.ImportedSaveFromKongToSteam || App.IsTimeTooOldForSteam || SteamHelper.IsQuitting || !SteamManager.Initialized)
            {
                return;
            }
            SteamHelper.Achievement_t[] achievements = SteamHelper.m_Achievements;
            for (int i = 0; i < achievements.Length; i++)
            {
                SteamHelper.Achievement_t achievement_t = achievements[i];
                if (!achievement_t.m_bAchieved)
                {
                    switch (achievement_t.m_eAchievementID)
                    {
                    case SteamAndroidAchievement.LightCreator:
                        if (App.State.Statistic.HighestGodDefeated > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.UniverseCreator:
                        if (App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Universe).Count > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.FirstMonument:
                        if (App.State.Statistic.MonumentsCreated > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.BaalSlayer:
                        if (App.State.Statistic.HighestGodDefeated > 27)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.BestBurger:
                        if (App.State.AllFights.FirstOrDefault((Fight x) => x.TypeEnum == Fight.FightType.big_food).Level > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.QueenSlayer:
                        if (App.State.AllFights.FirstOrDefault((Fight x) => x.TypeEnum == Fight.FightType.monster_queen).Level > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.SlayerOfCreator:
                        if (App.State.Statistic.CreatorBeaten)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.DivinestBeing:
                    {
                        bool flag = true;
                        foreach (GeneratorUpgrade current in App.State.Generator.Upgrades)
                        {
                            if (current.Level < 33)
                            {
                                flag = false;
                            }
                        }
                        if (flag)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;
                    }

                    case SteamAndroidAchievement.EternalRebirther:
                        if (App.State.Statistic.TotalRebirths > 99)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.PetLover:
                        if (App.State.Statistic.TotalPetGrowth > 30000)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.MasterOfTBS:
                        if (App.State.Statistic.TBSScore > 1000)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.SlayerOfUltimate:
                        if (App.State.HomePlanet.UltimateBeings.FirstOrDefault((UltimateBeing x) => x.Tier == 1).TimesDefeated > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.ITRTG:
                        if (App.State.HomePlanet.UltimateBeings.FirstOrDefault((UltimateBeing x) => x.Tier == 5).TimesDefeated > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.PlanetEaterV2:
                        if (App.State.HomePlanet.UltimateBeingsV2.FirstOrDefault((UltimateBeingV2 x) => x.Tier == 1).TimesDefeated > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.ITRTGV2:
                        if (App.State.HomePlanet.UltimateBeingsV2.FirstOrDefault((UltimateBeingV2 x) => x.Tier == 5).TimesDefeated > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.UUC:
                        if (App.State.Statistic.UniverseChallengesFinished > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.TAC:
                        if (App.State.Statistic.AchievementChallengesFinished > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.UBC:
                        if (App.State.Statistic.UltimateBaalChallengesFinished > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.UAC:
                        if (App.State.Statistic.ArtyChallengesFinished > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.OnekC:
                        if (App.State.Statistic.OnekChallengesFinished > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;

                    case SteamAndroidAchievement.DRC:
                        if (App.State.Statistic.DoubleRebirthChallengesFinished > 0)
                        {
                            SteamHelper.UnlockAchievement(achievement_t);
                        }
                        break;
                    }
                }
            }
        }