private void OnConsoleCommandEntered(string command)
        {
            if (command.Equals("weather"))
            {
                isWeatherEnabled = !isWeatherEnabled;

                if (!isWeatherEnabled)
                {
                    WeatherManager.main.debugLightningEnabled     = false;
                    WeatherManager.main.debugPrecipitationEnabled = false;
                    WeatherManager.main.debugWindEnabled          = false;
                    GameModeUtils.ActivateCheat(GameModeOption.NoCold);
                }
                else
                {
                    WeatherManager.main.debugLightningEnabled     = true;
                    WeatherManager.main.debugPrecipitationEnabled = true;
                    WeatherManager.main.debugWindEnabled          = true;
                    GameModeUtils.DeactivateCheat(GameModeOption.NoCold);
                }
            }

            UpdateButtonsState();
            Debug.Log(command);
        }
        public static void Postfix(Player __instance)
        {
            if (Main.config.NoAggression)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoAggression);
            }

            if (Main.config.NoBlueprints)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoBlueprints);
            }

            if (Main.config.NoCost)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoCost);
            }

            if (Main.config.NoEnergy)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoEnergy);
            }

            if (Main.config.NoOxygen)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoOxygen);
            }

            if (Main.config.NoPressure)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoPressure);
            }

            if (Main.config.NoRadiation)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoRadiation);
            }
#if BZ
            if (Main.config.NoCold)
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoCold);
            }
#endif
        }
Ejemplo n.º 3
0
        private void ToggleCheat(ToggleChangedEventArgs e)
        {
            if (Player.main != null)
            {
                if (Enum.TryParse(e.Id, out GameModeOption option))
                {
                    if (e.Value)
                    {
                        GameModeUtils.ActivateCheat(option);
                    }
                    else
                    {
                        GameModeUtils.DeactivateCheat(option);
                    }
                }
                else if (NoCostConsoleCommand.main != null)
                {
                    switch (e.Id)
                    {
                    case "FastBuild":
                        NoCostConsoleCommand.main.fastBuildCheat = e.Value;
                        break;

                    case "FastGrow":
                        NoCostConsoleCommand.main.fastGrowCheat = e.Value;
                        break;

                    case "FastHatch":
                        NoCostConsoleCommand.main.fastHatchCheat = e.Value;
                        break;

                    case "FastScan":
                        NoCostConsoleCommand.main.fastScanCheat = e.Value;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public static void Postfix()
        {
            if (Main.config.NoAggression && !GameModeUtils.IsCheatActive(GameModeOption.NoAggression))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoAggression);
            }

            if (Main.config.NoBlueprints && !GameModeUtils.IsCheatActive(GameModeOption.NoBlueprints))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoBlueprints);
            }

            if (Main.config.NoCost && !GameModeUtils.IsCheatActive(GameModeOption.NoCost))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoCost);
            }

            if (Main.config.NoEnergy && !GameModeUtils.IsCheatActive(GameModeOption.NoEnergy))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoEnergy);
            }

            if (Main.config.NoOxygen && !GameModeUtils.IsCheatActive(GameModeOption.NoOxygen))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoOxygen);
            }

            if (Main.config.NoPressure && !GameModeUtils.IsCheatActive(GameModeOption.NoPressure))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoPressure);
            }

            if (Main.config.NoRadiation && !GameModeUtils.IsCheatActive(GameModeOption.NoRadiation))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoRadiation);
            }
#if BZ
            if (Main.config.NoCold && !GameModeUtils.IsCheatActive(GameModeOption.NoCold))
            {
                GameModeUtils.ActivateCheat(GameModeOption.NoCold);
            }
#endif

            if (NoCostConsoleCommand.main != null)
            {
                if (Main.config.FastBuild)
                {
                    NoCostConsoleCommand.main.fastBuildCheat = true;
                }

                if (Main.config.FastGrow)
                {
                    NoCostConsoleCommand.main.fastGrowCheat = true;
                }

                if (Main.config.FastHatch)
                {
                    NoCostConsoleCommand.main.fastHatchCheat = true;
                }

                if (Main.config.FastScan)
                {
                    NoCostConsoleCommand.main.fastScanCheat = true;
                }
            }
        }