예제 #1
0
    public void Update()
    {
        hyper.Run();
        auto.Run();
        dysonSphere.Run();
        challenge.Run();
        upgrades.RunUpgradesUI();
        upgrades.RunUpgrades();
        prestige.Run();
        research.Run();
        pollution.Run();
        infuse.Run();
        mastery.Run();
        achievement.Run();
        kuaka.UpdateKuaka();
        flame.UpdateFlame();

        if (data.isKuakaCoinUnlocked)
        {
            kuakaButton.gameObject.SetActive(true);
        }
        else
        {
            kuakaButton.gameObject.SetActive(false);
        }

        if (data.isBHBUnlocked)
        {
            BHB.Run();
        }

        if (data.hasPrestiged)
        {
            broken.Run();
        }
        if (data.frameRateType == 0)
        {
            Application.targetFrameRate = 60;
        }
        else if (data.frameRateType == 1)
        {
            Application.targetFrameRate = 30;
        }
        else if (data.frameRateType == 2)
        {
            Application.targetFrameRate = 15;
        }

        if (data.hasMastered && data.superConductors >= 1e5 && !data.issacraficesUnlocked)
        {
            data.issacraficesUnlocked = true;
        }

        transformersText.text    = data.hasPrestiged ? $"{Methods.NotationMethod(data.transformers, "F2")} Transformers" : "Not Discovered Yet";
        superConductorsText.text = data.hasMastered ? $"{Methods.NotationMethod(data.superConductors, "F2")} Super Conductors" : "Not Discovered Yet";
        powerText.text           = "Power: " + Methods.NotationMethod(data.power, y: "F0");
        powerPerSecText.text     = $"{Methods.NotationMethod(TotalPowerPerSecond(), "F0")} Power/s";
        quarkText.text           = data.amps <= 0 ? "Not Discovered Yet" : $"{Methods.NotationMethod(data.amps, "F2")} Amps";
        quarkBoostText.text      = data.amps <= 0 ? "?????" : $"Amp Boost: Power/s * {Methods.NotationMethod(challenge.QuarkBoost(), "F2")}";

        if (data.hasPrestiged)
        {
            infusionButton.gameObject.SetActive(true);
        }
        else
        {
            infusionButton.gameObject.SetActive(false);
        }

        if (data.hasMastered)
        {
            megaButton.gameObject.SetActive(true);
        }
        else
        {
            megaButton.gameObject.SetActive(false);
        }

        if (data.hasPrestiged || data.hasMastered)
        {
            PMButton.gameObject.SetActive(true);
        }
        else
        {
            PMButton.gameObject.SetActive(false);
        }

        if (data.isChallengesUnlocked)
        {
            challengeButton.gameObject.SetActive(true);
        }
        else
        {
            challengeButton.gameObject.SetActive(false);
        }

        if (data.hasPrestiged)
        {
            repairButton.gameObject.SetActive(true);
        }
        else
        {
            repairButton.gameObject.SetActive(false);
        }

        if (data.power > 1e38 && data.isChallengesUnlocked && data.isKuakaCoinUnlocked && !data.isHyperUnlocked)
        {
            data.isHyperUnlocked = true;
        }

        if (data.isHyperUnlocked)
        {
            hyperButton.gameObject.SetActive(true);
        }
        else
        {
            hyperButton.gameObject.SetActive(false);
        }

        if (data.issacraficesUnlocked)
        {
            switchButton.gameObject.SetActive(true);
        }
        else
        {
            switchButton.gameObject.SetActive(false);
        }

        if (data.isBHBUnlocked)
        {
            BHBButton.gameObject.SetActive(true);
        }
        else
        {
            BHBButton.gameObject.SetActive(false);
        }

        if (data.isAutoUnlocked)
        {
            autoButton.gameObject.SetActive(true);
        }
        else
        {
            autoButton.gameObject.SetActive(false);
        }

        data.power          += TotalPowerPerSecond() * Time.deltaTime;
        data.powerCollected += TotalPowerPerSecond() * Time.deltaTime;

        saveTimerText.text  = saveTimer < 12 ? $"{Methods.NotationMethod(15 - saveTimer, "F2")} Safe To Quit" : $"{Methods.NotationMethod(15 - saveTimer, "F2")} Not Safe To Quit";
        saveTimerText.color = saveTimer < 12 ? Color.green : Color.red;

        ionSaveTimerText.text  = saveTimer < 12 ? $"{Methods.NotationMethod(15 - saveTimer, "F2")} Safe To Quit" : $"{Methods.NotationMethod(15 - saveTimer, "F2")} Not Safe To Quit";
        ionSaveTimerText.color = saveTimer < 12 ? Color.green : Color.red;

        if (data.power < 10)
        {
            data.power = 10;
        }
        if (data.powerCollected < data.power)
        {
            data.powerCollected = data.power;
        }

        if (data.power == NaN)
        {
            data.power = 10;
        }

        if (!data.isKuakaCoinUnlocked)
        {
            data.isAchievement10Locked = true;
        }
        if (!data.isKuakaCoinUnlocked)
        {
            data.isAchievement11Locked = true;
        }

        if (data.power > 1e12 && data.hasPrestiged)
        {
            data.isChallengesUnlocked = true;
        }

        if (data.sacraficeULevel3 > 0 && !data.isChallenge3Active)
        {
            data.transformers += (data.transformers * 0.0001) * Time.deltaTime;
        }

        if (data.hasMastered && data.superConductors >= 1e38)
        {
            data.issacraficesUnlocked = true;
        }

        if (data.isHyperCompleted9)
        {
            data.isBHBUnlocked = true;
        }

        if (data.power >= 1e68 && !data.isAutoUnlocked)
        {
            data.isAutoUnlocked = true;
        }

        if (data.power != NaN && data.transformers != NaN && data.superConductors != NaN && data.currentPollution != NaN)
        {
            saveTimer += Time.deltaTime;
        }

        if (!(saveTimer >= 15))
        {
            return;
        }
        Save();
        data.offlineProgressCheck = true;
        saveTimer = 0;
    }
예제 #2
0
파일: Program.cs 프로젝트: aschweiz/tangra3
        static void Main(string[] args)
        {
            Trace.WriteLine(string.Format("Starting Tangra v{0}", ((AssemblyFileVersionAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true)[0]).Version));

            //Debugger.Launch();
            //DebugContext.DebugSubPixelMeasurements = true;

            PlatformID platform = Environment.OSVersion.Platform;

            if (platform != PlatformID.MacOSX && platform != PlatformID.Unix &&
                platform != PlatformID.Win32Windows && platform != PlatformID.Win32NT && platform != PlatformID.Win32S)
            {
                // NOTE: Show a warning message that this may be unsupported or untested platform
            }

            #region Make sure the settings are not forgotten between application version updates
            System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
            Version appVersion           = a.GetName().Version;
            string  appVersionString     = appVersion.ToString();

            try
            {
                if (Properties.Settings.Default.ApplicationVersion != appVersion.ToString())
                {
                    Properties.Settings.Default.Upgrade();
                    Properties.Settings.Default.ApplicationVersion = appVersionString;
                    Properties.Settings.Default.Save();
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
            }
            #endregion

            var manager = new AutomationManager(args);
            if (manager.IsAutomationCommand)
            {
                ConsoleHelper.InitConsoleHandles();

                try
                {
                    manager.Run();
                }
                finally
                {
                    ConsoleHelper.ReleaseConsoleHandles();
                }

                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;

            bool fatalError = false;
            try
            {
                CheckUnmanagedLibraries();
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    string.Concat(ex.GetType(), ": ", ex.Message, "\r\n\r\n", ex.StackTrace),
                    "Tangra 3 Startup Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                fatalError = true;
            }

            if (!fatalError)
            {
                if (!ExecuteNonUICommandLineActions())
                {
                    Application.Run(new frmMain());
                }
                else
                {
                    Application.Exit();
                }
            }
        }