Improve comic cult evac behavior (#4083)
* Achoo! * Bless you * Unfuck comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
54fc1fef39
commit
b84fd39e95
|
|
@ -18,6 +18,7 @@ using Content.Server.Station.Components;
|
|||
using Content.Server.Station.Events;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared._DV.CustomObjectiveSummary; // DeltaV
|
||||
using Content.Server._DV.Shuttles.Events; // DeltaV
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Database;
|
||||
|
|
@ -441,6 +442,8 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
|||
_consoleAccumulator = _configManager.GetCVar(CCVars.EmergencyShuttleDockTime);
|
||||
EmergencyShuttleArrived = true;
|
||||
|
||||
RaiseLocalEvent(new EvacShuttleDockedEvent()); // DeltaV
|
||||
|
||||
var query = AllEntityQuery<StationEmergencyShuttleComponent>();
|
||||
|
||||
var dockResults = new List<ShuttleDockResult>();
|
||||
|
|
|
|||
|
|
@ -87,4 +87,5 @@ public enum FinaleState : byte
|
|||
ReadyFinale,
|
||||
ActiveFinale,
|
||||
Victory,
|
||||
Unreachable,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using Content.Server._DV.CosmicCult.Components;
|
||||
using Content.Server.RoundEnd;
|
||||
using Content.Server.Shuttles.Systems;
|
||||
using Content.Shared._DV.CosmicCult;
|
||||
using Content.Shared._DV.CosmicCult.Components;
|
||||
using Content.Shared.Audio;
|
||||
|
|
@ -12,6 +14,9 @@ namespace Content.Server._DV.CosmicCult;
|
|||
|
||||
public sealed partial class CosmicCultSystem : SharedCosmicCultSystem
|
||||
{
|
||||
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
|
||||
[Dependency] private readonly EmergencyShuttleSystem _evac = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Used to calculate when the finale song should start playing
|
||||
/// </summary>
|
||||
|
|
@ -37,7 +42,7 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem
|
|||
_doAfter.TryStartDoAfter(doargs);
|
||||
args.Handled = true;
|
||||
}
|
||||
else if (EntityIsCultist(args.User) && !args.Handled && !ent.Comp.Occupied && !ent.Comp.FinaleActive && ent.Comp.CurrentState != FinaleState.Unavailable)
|
||||
else if (EntityIsCultist(args.User) && !args.Handled && !ent.Comp.Occupied && !ent.Comp.FinaleActive && ent.Comp.CurrentState == FinaleState.ReadyFinale)
|
||||
{
|
||||
ent.Comp.Occupied = true;
|
||||
var doargs = new DoAfterArgs(EntityManager, args.User, ent.Comp.InteractionTime, new StartFinaleDoAfterEvent(), ent, ent)
|
||||
|
|
@ -98,6 +103,8 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem
|
|||
|
||||
Dirty(uid, monument);
|
||||
_ui.SetUiState(uid.Owner, MonumentKey.Key, new MonumentBuiState(monument));
|
||||
|
||||
if (!_evac.EmergencyShuttleArrived && _roundEnd.IsRoundEndRequested()) _roundEnd.CancelRoundEndCountdown(checkCooldown: false);
|
||||
}
|
||||
|
||||
private void OnFinaleCancelDoAfter(Entity<CosmicFinaleComponent> uid, ref CancelFinaleDoAfterEvent args)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ using Content.Shared._DV.CCVars;
|
|||
using Content.Shared._DV.CosmicCult;
|
||||
using Content.Shared._DV.CosmicCult.Components;
|
||||
using Content.Shared._DV.CosmicCult.Prototypes;
|
||||
using Content.Shared._DV.CustomObjectiveSummary;
|
||||
using Content.Server._DV.Shuttles.Events;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Interaction;
|
||||
|
|
@ -53,7 +53,7 @@ public sealed class MonumentSystem : SharedMonumentSystem
|
|||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<EvacShuttleLeftEvent>(OnShuttleEvac); // for no more finale once the evac shuttle leaves
|
||||
SubscribeLocalEvent<EvacShuttleDockedEvent>(OnEvacDocked); // for no more finale once the evac shuttle docks
|
||||
SubscribeLocalEvent<MonumentComponent, InteractUsingEvent>(OnInfuseHeldEntropy);
|
||||
SubscribeLocalEvent<MonumentComponent, ActivateInWorldEvent>(OnInfuseEntropy);
|
||||
}
|
||||
|
|
@ -125,23 +125,12 @@ public sealed class MonumentSystem : SharedMonumentSystem
|
|||
/// <summary>
|
||||
/// on shuttle evac, disable the monument's UI, disable it from being activated, and stop the finale music if it was playing
|
||||
/// </summary>
|
||||
private void OnShuttleEvac(EvacShuttleLeftEvent args)
|
||||
private void OnEvacDocked(EvacShuttleDockedEvent args)
|
||||
{
|
||||
var evacQuery = EntityQueryEnumerator<MonumentComponent, CosmicFinaleComponent>();
|
||||
while (evacQuery.MoveNext(out var ent, out var monuComp, out var finaleComp))
|
||||
{
|
||||
Disable((ent, monuComp));
|
||||
finaleComp.Occupied = true;
|
||||
_sound.StopStationEventMusic(ent, StationEventMusicType.CosmicCult);
|
||||
if (TryComp<ActivatableUIComponent>(ent, out var uiComp))
|
||||
{
|
||||
if (TryComp<UserInterfaceComponent>(ent, out var uiComp2)) //close the UI for everyone who has it open
|
||||
{
|
||||
_ui.CloseUi((ent, uiComp2), MonumentKey.Key);
|
||||
}
|
||||
|
||||
uiComp.Key = null; //kazne called this the laziest way to disable a UI ever
|
||||
}
|
||||
finaleComp.CurrentState = FinaleState.Unreachable;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
namespace Content.Server._DV.Shuttles.Events;
|
||||
|
||||
/// <summary>
|
||||
/// DeltaV event for when the evac shuttle docks with the station.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class EvacShuttleDockedEvent : EventArgs;
|
||||
Loading…
Reference in New Issue