From 6ab9ca6bd0474e3d7e6001f9505588e786b9316f Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:08:10 +0300 Subject: [PATCH] yupiiii (#391) --- .../_CP14/Shuttles/CP14ExpeditionSystem.cs | 17 +++++++++++++++-- Content.Shared/CCVar/CCVars.cs | 14 ++++++++++---- Resources/ConfigPresets/Build/development.toml | 5 ++++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Content.Server/_CP14/Shuttles/CP14ExpeditionSystem.cs b/Content.Server/_CP14/Shuttles/CP14ExpeditionSystem.cs index 3ed4f482fa..1a01215286 100644 --- a/Content.Server/_CP14/Shuttles/CP14ExpeditionSystem.cs +++ b/Content.Server/_CP14/Shuttles/CP14ExpeditionSystem.cs @@ -29,6 +29,11 @@ public sealed class CP14ExpeditionSystem : EntitySystem /// public float ArrivalTime { get; private set; } + /// + /// If enabled then spawns players on an expedition ship. + /// + public bool Enabled { get; private set; } + public override void Initialize() { base.Initialize(); @@ -38,12 +43,17 @@ public sealed class CP14ExpeditionSystem : EntitySystem SubscribeLocalEvent(OnExpeditionShipLanded); ArrivalTime = _cfgManager.GetCVar(CCVars.CP14ExpeditionArrivalTime); - _cfgManager.OnValueChanged(CCVars.CP14ExpeditionArrivalTime, time => ArrivalTime = time, true); - } + Enabled = _cfgManager.GetCVar(CCVars.CP14ExpeditionShip); + _cfgManager.OnValueChanged(CCVars.CP14ExpeditionArrivalTime, time => ArrivalTime = time, true); + _cfgManager.OnValueChanged(CCVars.CP14ExpeditionShip, value => Enabled = value, true); + } private void OnPostInitSetupExpeditionShip(Entity station, ref StationPostInitEvent args) { + if (!Enabled) + return; + if (!Deleted(station.Comp.Shuttle)) return; @@ -97,6 +107,9 @@ public sealed class CP14ExpeditionSystem : EntitySystem public void HandlePlayerSpawning(PlayerSpawningEvent ev) { + if (!Enabled) + return; + if (ev.SpawnResult != null) return; diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 2d472219a6..e59c3ac34d 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -11,11 +11,17 @@ namespace Content.Shared.CCVar public sealed class CCVars : CVars { #region CP14 - + /// + /// how long does it take to fly an expedition ship to an expedition point? + /// public static readonly CVarDef CP14ExpeditionArrivalTime = CVarDef.Create("cp14.arrival_time", 180f, CVar.SERVERONLY); - + /// + /// is the expedition ship's system enabled? + /// + public static readonly CVarDef CP14ExpeditionShip = + CVarDef.Create("cp14.arrivals_ship", true, CVar.SERVERONLY); #endregion /* * Server @@ -1473,7 +1479,7 @@ namespace Content.Shared.CCVar /// Whether the arrivals shuttle is enabled. /// public static readonly CVarDef ArrivalsShuttles = - CVarDef.Create("shuttle.arrivals", true, CVar.SERVERONLY); + CVarDef.Create("shuttle.arrivals", false, CVar.SERVERONLY); //CP14 arrivals disabled /// /// The map to use for the arrivals station. @@ -1600,7 +1606,7 @@ namespace Content.Shared.CCVar /// Whether the emergency shuttle is enabled or should the round just end. /// public static readonly CVarDef EmergencyShuttleEnabled = - CVarDef.Create("shuttle.emergency", true, CVar.SERVERONLY); + CVarDef.Create("shuttle.emergency", false, CVar.SERVERONLY); //CP14 Emergency disabled /// /// The percentage of time passed from the initial call to when the shuttle can no longer be recalled. diff --git a/Resources/ConfigPresets/Build/development.toml b/Resources/ConfigPresets/Build/development.toml index a1900dbaa2..8fb5165ba0 100644 --- a/Resources/ConfigPresets/Build/development.toml +++ b/Resources/ConfigPresets/Build/development.toml @@ -1,4 +1,7 @@ -[game] +[cp14] +arrivals_ship = false + +[game] # Straight in-game baby lobbyenabled = false # Dev map for faster loading & convenience