Revert "Return of warops" (#3807)
Revert "Return of warops (#3561)"
This reverts commit ac1604d0bc.
This commit is contained in:
parent
7e28ec2455
commit
b94cf51f0e
|
|
@ -1,4 +1,3 @@
|
||||||
using Content.Server._DV.Antag; // DeltaV
|
|
||||||
using Content.Server.RoundEnd;
|
using Content.Server.RoundEnd;
|
||||||
using Content.Shared.Dataset;
|
using Content.Shared.Dataset;
|
||||||
using Content.Shared.NPC.Prototypes;
|
using Content.Shared.NPC.Prototypes;
|
||||||
|
|
@ -9,7 +8,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||||
|
|
||||||
namespace Content.Server.GameTicking.Rules.Components;
|
namespace Content.Server.GameTicking.Rules.Components;
|
||||||
|
|
||||||
[RegisterComponent, Access(typeof(NukeopsRuleSystem), typeof(NukieOperationSystem))] // DeltaV - Auto war declare
|
[RegisterComponent, Access(typeof(NukeopsRuleSystem))]
|
||||||
public sealed partial class NukeopsRuleComponent : Component
|
public sealed partial class NukeopsRuleComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -404,7 +404,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||||
return WarConditionStatus.YesWar;
|
return WarConditionStatus.YesWar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DistributeExtraTc(Entity<NukeopsRuleComponent> nukieRule) // DeltaV - Public so our war can work
|
private void DistributeExtraTc(Entity<NukeopsRuleComponent> nukieRule)
|
||||||
{
|
{
|
||||||
var enumerator = EntityQueryEnumerator<StoreComponent>();
|
var enumerator = EntityQueryEnumerator<StoreComponent>();
|
||||||
while (enumerator.MoveNext(out var uid, out var component))
|
while (enumerator.MoveNext(out var uid, out var component))
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
namespace Content.Server._DV.Antag;
|
|
||||||
|
|
||||||
[RegisterComponent, Access(typeof(NukieOperationSystem)), AutoGenerateComponentPause]
|
|
||||||
public sealed partial class NukieAutoWarComponent : Component
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Automatically calls war after set time.
|
|
||||||
/// </summary>
|
|
||||||
[DataField, AutoPausedField]
|
|
||||||
public TimeSpan AutoWarCallTime;
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +1,20 @@
|
||||||
using Content.Server.Antag;
|
using Content.Server.Antag;
|
||||||
using Content.Server.Chat.Systems;
|
|
||||||
using Content.Server.GameTicking.Rules;
|
|
||||||
using Content.Server.GameTicking.Rules.Components;
|
|
||||||
using Content.Server.Objectives;
|
using Content.Server.Objectives;
|
||||||
using Content.Shared._DV.FeedbackOverwatch;
|
using Content.Shared._DV.FeedbackOverwatch;
|
||||||
using Content.Shared.Mind;
|
using Content.Shared.Mind;
|
||||||
using Content.Shared.Random.Helpers;
|
using Content.Shared.Random.Helpers;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Timing;
|
|
||||||
|
|
||||||
namespace Content.Server._DV.Antag;
|
namespace Content.Server._DV.Antag;
|
||||||
|
|
||||||
public sealed class NukieOperationSystem : EntitySystem
|
public sealed class NukieOperationSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ChatSystem _chat = default!;
|
|
||||||
[Dependency] private readonly IGameTiming _time = default!;
|
|
||||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
[Dependency] private readonly NukeopsRuleSystem _nukeops = default!;
|
|
||||||
[Dependency] private readonly ObjectivesSystem _objectives = default!;
|
|
||||||
[Dependency] private readonly SharedFeedbackOverwatchSystem _feedback = default!;
|
|
||||||
[Dependency] private readonly SharedMindSystem _mind = default!;
|
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||||
|
[Dependency] private readonly ObjectivesSystem _objectives = default!;
|
||||||
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||||
|
[Dependency] private readonly SharedFeedbackOverwatchSystem _feedback = default!;
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
@ -32,29 +23,6 @@ public sealed class NukieOperationSystem : EntitySystem
|
||||||
SubscribeLocalEvent<GetNukeCodePaperWriting>(OnNukeCodePaperWritingEvent);
|
SubscribeLocalEvent<GetNukeCodePaperWriting>(OnNukeCodePaperWritingEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This runs the automatic war declaration, distributes TC, and makes sure it only happens when it's not hostage ops.
|
|
||||||
/// </summary>
|
|
||||||
public override void Update(float frameTime)
|
|
||||||
{
|
|
||||||
base.Update(frameTime);
|
|
||||||
|
|
||||||
var query = EntityQueryEnumerator<NukieAutoWarComponent>();
|
|
||||||
while (query.MoveNext(out var uid, out var comp))
|
|
||||||
{
|
|
||||||
if (_time.CurTime < comp.AutoWarCallTime)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
RemCompDeferred<NukieAutoWarComponent>(uid);
|
|
||||||
var nukeops = Comp<NukeopsRuleComponent>(uid);
|
|
||||||
nukeops.WarDeclaredTime = _time.CurTime;
|
|
||||||
_nukeops.DistributeExtraTc((uid, nukeops));
|
|
||||||
_chat.DispatchGlobalAnnouncement(Loc.GetString("nuke-ops-auto-war-message"),
|
|
||||||
Loc.GetString("chat-manager-sender-announcement"),
|
|
||||||
true, new SoundPathSpecifier("/Audio/Announcements/war.ogg"), Color.DarkRed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnAntagSelected(Entity<NukieOperationComponent> ent, ref AfterAntagEntitySelectedEvent args)
|
private void OnAntagSelected(Entity<NukieOperationComponent> ent, ref AfterAntagEntitySelectedEvent args)
|
||||||
{
|
{
|
||||||
// Yes this is bad, but I couldn't easily find an event that would work.
|
// Yes this is bad, but I couldn't easily find an event that would work.
|
||||||
|
|
@ -86,11 +54,6 @@ public sealed class NukieOperationSystem : EntitySystem
|
||||||
if (objectiveProto.Id == "KidnapHeadsObjective")
|
if (objectiveProto.Id == "KidnapHeadsObjective")
|
||||||
_feedback.SendPopupMind(mindId, "NukieHostageRoundStartPopup");
|
_feedback.SendPopupMind(mindId, "NukieHostageRoundStartPopup");
|
||||||
}
|
}
|
||||||
if (chosenOp.AutoWarAfter is { } duration)
|
|
||||||
{
|
|
||||||
var autoWar = EnsureComp<NukieAutoWarComponent>(ent);
|
|
||||||
autoWar.AutoWarCallTime = _time.CurTime + duration;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnNukeCodePaperWritingEvent(ref GetNukeCodePaperWriting ev)
|
private void OnNukeCodePaperWritingEvent(ref GetNukeCodePaperWriting ev)
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,4 @@ public sealed partial class NukieOperationPrototype : IPrototype
|
||||||
|
|
||||||
[DataField]
|
[DataField]
|
||||||
public LocId? NukeCodePaperOverride;
|
public LocId? NukeCodePaperOverride;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If non-null, calls war after the given duration
|
|
||||||
/// </summary>
|
|
||||||
[DataField]
|
|
||||||
public TimeSpan? AutoWarAfter;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
# Played when war is automatically called
|
|
||||||
|
|
||||||
nuke-ops-auto-war-message = Our intelligence indicates that a hostile boarding party is enroute to your location.
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
id: NukieOperations
|
id: NukieOperations
|
||||||
weights:
|
weights:
|
||||||
NukieOperationDestroyStation: 1
|
NukieOperationDestroyStation: 1
|
||||||
NukieOperationDestroyStationWar: 1
|
|
||||||
# NukieOperationKidnapHeads: 1
|
# NukieOperationKidnapHeads: 1
|
||||||
|
|
||||||
- type: nukieOperation
|
- type: nukieOperation
|
||||||
|
|
@ -12,12 +11,6 @@
|
||||||
operationObjectives:
|
operationObjectives:
|
||||||
- NukeStationObjective
|
- NukeStationObjective
|
||||||
|
|
||||||
- type: nukieOperation
|
|
||||||
id: NukieOperationDestroyStationWar
|
|
||||||
autoWarAfter: 120
|
|
||||||
operationObjectives:
|
|
||||||
- NukeStationObjective
|
|
||||||
|
|
||||||
- type: nukieOperation
|
- type: nukieOperation
|
||||||
id: NukieOperationKidnapHeads
|
id: NukieOperationKidnapHeads
|
||||||
operationObjectives:
|
operationObjectives:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue