diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 1d277f0cdf..246081a5e0 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -18,7 +18,6 @@ using Content.Server.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Server.Tabletop; using Content.Server.Tabletop.Components; -using Content.Server.Terminator.Systems; using Content.Shared.Administration; using Content.Shared.Administration.Components; using Content.Shared.Body.Components; @@ -76,7 +75,6 @@ public sealed partial class AdminVerbSystem [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly TabletopSystem _tabletopSystem = default!; - [Dependency] private readonly TerminatorSystem _terminator = default!; [Dependency] private readonly VomitSystem _vomitSystem = default!; [Dependency] private readonly WeldableSystem _weldableSystem = default!; [Dependency] private readonly SharedContentEyeSystem _eyeSystem = default!; diff --git a/Content.Server/Objectives/Components/PickRandomHeadComponent.cs b/Content.Server/Objectives/Components/PickRandomHeadComponent.cs index c2f82fb6c5..38ed252264 100644 --- a/Content.Server/Objectives/Components/PickRandomHeadComponent.cs +++ b/Content.Server/Objectives/Components/PickRandomHeadComponent.cs @@ -1,12 +1,8 @@ -using Content.Server.Objectives.Systems; - namespace Content.Server.Objectives.Components; /// /// Sets the target for to a random head. /// If there are no heads it will fallback to any person. /// -[RegisterComponent, Access(typeof(KillPersonConditionSystem))] -public sealed partial class PickRandomHeadComponent : Component -{ -} +[RegisterComponent] +public sealed partial class PickRandomHeadComponent : Component; diff --git a/Content.Server/Objectives/Components/PickRandomPersonComponent.cs b/Content.Server/Objectives/Components/PickRandomPersonComponent.cs index 7913a95426..c67d6da47b 100644 --- a/Content.Server/Objectives/Components/PickRandomPersonComponent.cs +++ b/Content.Server/Objectives/Components/PickRandomPersonComponent.cs @@ -1,11 +1,9 @@ -using Content.Server.Objectives.Systems; - namespace Content.Server.Objectives.Components; /// /// Sets the target for to a random person. /// -[RegisterComponent, Access(typeof(KillPersonConditionSystem))] +[RegisterComponent] public sealed partial class PickRandomPersonComponent : Component { /// diff --git a/Content.Server/Objectives/Components/PickSpecificPersonComponent.cs b/Content.Server/Objectives/Components/PickSpecificPersonComponent.cs new file mode 100644 index 0000000000..03a482fc7b --- /dev/null +++ b/Content.Server/Objectives/Components/PickSpecificPersonComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Server.Objectives.Components; + +/// +/// Sets this objective's target to the one given in , if the entity has it. +/// This component needs to be added to objective entity itself. +/// +[RegisterComponent] +public sealed partial class PickSpecificPersonComponent : Component; diff --git a/Content.Server/Objectives/Components/RandomTraitorAliveComponent.cs b/Content.Server/Objectives/Components/RandomTraitorAliveComponent.cs index fd37d0d2c8..1c45cb45d5 100644 --- a/Content.Server/Objectives/Components/RandomTraitorAliveComponent.cs +++ b/Content.Server/Objectives/Components/RandomTraitorAliveComponent.cs @@ -1,11 +1,7 @@ -using Content.Server.Objectives.Systems; - namespace Content.Server.Objectives.Components; /// /// Sets the target for to a random traitor. /// -[RegisterComponent, Access(typeof(KeepAliveConditionSystem))] -public sealed partial class RandomTraitorAliveComponent : Component -{ -} +[RegisterComponent] +public sealed partial class RandomTraitorAliveComponent : Component; diff --git a/Content.Server/Objectives/Components/RandomTraitorProgressComponent.cs b/Content.Server/Objectives/Components/RandomTraitorProgressComponent.cs index c05ac0d3ef..f2da9778eb 100644 --- a/Content.Server/Objectives/Components/RandomTraitorProgressComponent.cs +++ b/Content.Server/Objectives/Components/RandomTraitorProgressComponent.cs @@ -1,11 +1,7 @@ -using Content.Server.Objectives.Systems; - namespace Content.Server.Objectives.Components; /// /// Sets the target for to a random traitor. /// -[RegisterComponent, Access(typeof(HelpProgressConditionSystem))] -public sealed partial class RandomTraitorProgressComponent : Component -{ -} +[RegisterComponent] +public sealed partial class RandomTraitorProgressComponent : Component; diff --git a/Content.Server/Objectives/Components/TargetOverrideComponent.cs b/Content.Server/Objectives/Components/TargetOverrideComponent.cs new file mode 100644 index 0000000000..faa402012c --- /dev/null +++ b/Content.Server/Objectives/Components/TargetOverrideComponent.cs @@ -0,0 +1,16 @@ +namespace Content.Server.Objectives.Components; + +/// +/// Sets a target objective to a specific target when receiving it. +/// The objective entity needs to have . +/// This component needs to be added to entity receiving the objective. +/// +[RegisterComponent] +public sealed partial class TargetOverrideComponent : Component +{ + /// + /// The entity that should be targeted. + /// + [DataField] + public EntityUid? Target; +} diff --git a/Content.Server/Objectives/Components/TerminatorTargetOverrideComponent.cs b/Content.Server/Objectives/Components/TerminatorTargetOverrideComponent.cs deleted file mode 100644 index c66ff55f05..0000000000 --- a/Content.Server/Objectives/Components/TerminatorTargetOverrideComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Content.Server.Objectives.Systems; - -namespace Content.Server.Objectives.Components; - -/// -/// Sets this objective's target to the exterminator's target override, if it has one. -/// If not it will be random. -/// -[RegisterComponent, Access(typeof(TerminatorTargetOverrideSystem))] -public sealed partial class TerminatorTargetOverrideComponent : Component -{ -} diff --git a/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs b/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs index 7639e69bfd..1816896ecc 100644 --- a/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs +++ b/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs @@ -1,31 +1,23 @@ -using Content.Server.GameTicking.Rules; using Content.Server.Objectives.Components; using Content.Shared.Mind; using Content.Shared.Objectives.Components; using Content.Shared.Objectives.Systems; -using Content.Shared.Roles.Jobs; -using Robust.Shared.Random; -using System.Linq; namespace Content.Server.Objectives.Systems; /// -/// Handles help progress condition logic and picking random help targets. +/// Handles help progress condition logic. /// public sealed class HelpProgressConditionSystem : EntitySystem { - [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedObjectivesSystem _objectives = default!; [Dependency] private readonly TargetObjectiveSystem _target = default!; - [Dependency] private readonly TraitorRuleSystem _traitorRule = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGetProgress); - - SubscribeLocalEvent(OnTraitorAssigned); } private void OnGetProgress(EntityUid uid, HelpProgressConditionComponent comp, ref ObjectiveGetProgressEvent args) @@ -36,55 +28,6 @@ public sealed class HelpProgressConditionSystem : EntitySystem args.Progress = GetProgress(target.Value); } - private void OnTraitorAssigned(EntityUid uid, RandomTraitorProgressComponent comp, ref ObjectiveAssignedEvent args) - { - // invalid prototype - if (!TryComp(uid, out var target)) - { - args.Cancelled = true; - return; - } - - var traitors = _traitorRule.GetOtherTraitorMindsAliveAndConnected(args.Mind).ToHashSet(); - - // cant help anyone who is tasked with helping: - // 1. thats boring - // 2. no cyclic progress dependencies!!! - foreach (var traitor in traitors) - { - // TODO: replace this with TryComp(traitor) or something when objectives are moved out of mind - if (!TryComp(traitor.Id, out var mind)) - continue; - - foreach (var objective in mind.Objectives) - { - if (HasComp(objective)) - traitors.RemoveWhere(x => x.Mind == mind); - } - } - - // Can't have multiple objectives to help/save the same person - foreach (var objective in args.Mind.Objectives) - { - if (HasComp(objective) || HasComp(objective)) - { - if (TryComp(objective, out var help)) - { - traitors.RemoveWhere(x => x.Id == help.Target); - } - } - } - - // no more helpable traitors - if (traitors.Count == 0) - { - args.Cancelled = true; - return; - } - - _target.SetTarget(uid, _random.Pick(traitors).Id, target); - } - private float GetProgress(EntityUid target) { var total = 0f; // how much progress they have diff --git a/Content.Server/Objectives/Systems/KeepAliveCondition.cs b/Content.Server/Objectives/Systems/KeepAliveCondition.cs index fad8aa6d18..f68227e861 100644 --- a/Content.Server/Objectives/Systems/KeepAliveCondition.cs +++ b/Content.Server/Objectives/Systems/KeepAliveCondition.cs @@ -1,30 +1,22 @@ using Content.Server.Objectives.Components; -using Content.Server.GameTicking.Rules; using Content.Shared.Mind; using Content.Shared.Objectives.Components; -using Content.Shared.Roles.Jobs; -using Robust.Shared.Random; -using System.Linq; namespace Content.Server.Objectives.Systems; /// -/// Handles keep alive condition logic and picking random traitors to keep alive. +/// Handles keep alive condition logic. /// public sealed class KeepAliveConditionSystem : EntitySystem { - [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedMindSystem _mind = default!; [Dependency] private readonly TargetObjectiveSystem _target = default!; - [Dependency] private readonly TraitorRuleSystem _traitorRule = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGetProgress); - - SubscribeLocalEvent(OnAssigned); } private void OnGetProgress(EntityUid uid, KeepAliveConditionComponent comp, ref ObjectiveGetProgressEvent args) @@ -35,39 +27,6 @@ public sealed class KeepAliveConditionSystem : EntitySystem args.Progress = GetProgress(target.Value); } - private void OnAssigned(EntityUid uid, RandomTraitorAliveComponent comp, ref ObjectiveAssignedEvent args) - { - // invalid prototype - if (!TryComp(uid, out var target)) - { - args.Cancelled = true; - return; - } - - var traitors = _traitorRule.GetOtherTraitorMindsAliveAndConnected(args.Mind).ToHashSet(); - - // Can't have multiple objectives to help/save the same person - foreach (var objective in args.Mind.Objectives) - { - if (HasComp(objective) || HasComp(objective)) - { - if (TryComp(objective, out var help)) - { - traitors.RemoveWhere(x => x.Id == help.Target); - } - } - } - - // You are the first/only traitor. - if (traitors.Count == 0) - { - args.Cancelled = true; - return; - } - - _target.SetTarget(uid, _random.Pick(traitors).Id, target); - } - private float GetProgress(EntityUid target) { if (!TryComp(target, out var mind)) diff --git a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs index 2c48bebe11..45ad68e28b 100644 --- a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs +++ b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs @@ -1,16 +1,9 @@ -using System.Linq; using Content.Server.Objectives.Components; -using Content.Server.Revolutionary.Components; using Content.Server.Shuttles.Systems; using Content.Shared.CCVar; using Content.Shared.Mind; using Content.Shared.Objectives.Components; -using Content.Shared.Roles; // DeltaV -using Content.Shared.Roles.Jobs; // DeltaV using Robust.Shared.Configuration; -using Robust.Shared.Prototypes; // DeltaV -using Robust.Shared.Random; -using System.Linq; namespace Content.Server.Objectives.Systems; @@ -21,10 +14,7 @@ public sealed class KillPersonConditionSystem : EntitySystem { [Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!; [Dependency] private readonly IConfigurationManager _config = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; // DeltaV - [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedMindSystem _mind = default!; - [Dependency] private readonly SharedRoleSystem _role = default!; // DeltaV [Dependency] private readonly TargetObjectiveSystem _target = default!; public override void Initialize() @@ -32,8 +22,6 @@ public sealed class KillPersonConditionSystem : EntitySystem base.Initialize(); SubscribeLocalEvent(OnGetProgress); - SubscribeLocalEvent(OnPersonAssigned); - SubscribeLocalEvent(OnHeadAssigned); } private void OnGetProgress(EntityUid uid, KillPersonConditionComponent comp, ref ObjectiveGetProgressEvent args) @@ -44,85 +32,6 @@ public sealed class KillPersonConditionSystem : EntitySystem args.Progress = GetProgress(target.Value, comp.RequireDead); } - private void OnPersonAssigned(Entity ent, ref ObjectiveAssignedEvent args) - { - AssignRandomTarget(ent, ref args, _ => true, ent.Comp.OnlyChoosableJobs); // DeltaV: pass onlyJobs - } - - private void OnHeadAssigned(Entity ent, ref ObjectiveAssignedEvent args) - { - AssignRandomTarget(ent, ref args, mindId => - TryComp(mindId, out var mind) && - mind.OwnedEntity is { } ownedEnt && - HasComp(ownedEnt)); - } - - // DeltaV: added onlyJobs - private void AssignRandomTarget(EntityUid uid, ref ObjectiveAssignedEvent args, Predicate filter, bool onlyJobs = true, bool fallbackToAny = true) - { - // invalid prototype - if (!TryComp(uid, out var target)) - { - args.Cancelled = true; - return; - } - - // target already assigned - if (target.Target != null) - return; - - // Get all alive humans, filter out any with TargetObjectiveImmuneComponent - var allHumans = _mind.GetAliveHumans(args.MindId) - .Where(mindId => - { - if (!TryComp(mindId, out var mindComp) || mindComp.OwnedEntity == null) - return false; - return !HasComp(mindComp.OwnedEntity.Value); - }) - .ToList(); - - // Begin DeltaV Additions: Only target people with jobs - if (onlyJobs) - { - allHumans.RemoveAll(mindId => !( - _role.MindHasRole((mindId.Owner, mindId.Comp), out var role) && - role?.Comp1.JobPrototype is {} jobId && - _proto.Index(jobId).SetPreference)); - } - // End DeltaV Additions - - // Can't have multiple objectives to kill the same person - foreach (var objective in args.Mind.Objectives) - { - if (HasComp(objective) && TryComp(objective, out var kill)) - { - allHumans.RemoveAll(x => x.Owner == kill.Target); - } - } - - // Filter out targets based on the filter - var filteredHumans = allHumans.Where(mind => filter(mind)).ToList(); - - // There's no humans and we can't fall back to any other target - if (filteredHumans.Count == 0 && !fallbackToAny) - { - args.Cancelled = true; - return; - } - - // Pick between humans matching our filter or fall back to all humans alive - var selectedHumans = filteredHumans.Count > 0 ? filteredHumans : allHumans; - - // Still no valid targets even after the fallback - if (selectedHumans.Count == 0) - { - args.Cancelled = true; - return; - } - - _target.SetTarget(uid, _random.Pick(selectedHumans), target); - } - private float GetProgress(EntityUid target, bool requireDead) { // deleted or gibbed or something, counts as dead diff --git a/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs b/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs new file mode 100644 index 0000000000..511692bbc4 --- /dev/null +++ b/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs @@ -0,0 +1,231 @@ +using Content.Server.Objectives.Components; +using Content.Shared.Mind; +using Content.Shared.Objectives.Components; +using Content.Shared.Roles; // DeltaV +using Content.Shared.Roles.Jobs; // DeltaV +using Content.Server.GameTicking.Rules; +using Content.Server.Revolutionary.Components; +using Robust.Shared.Prototypes; // DeltaV +using Robust.Shared.Random; +using System.Linq; + +namespace Content.Server.Objectives.Systems; + +/// +/// Handles assinging a target to an objective entity with using different components. +/// These can be combined with condition components for objective completions in order to create a variety of objectives. +/// +public sealed class PickObjectiveTargetSystem : EntitySystem +{ + [Dependency] private readonly TargetObjectiveSystem _target = default!; + [Dependency] private readonly SharedMindSystem _mind = default!; + [Dependency] private readonly SharedRoleSystem _role = default!; // DeltaV + [Dependency] private readonly IPrototypeManager _proto = default!; // DeltaV + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly TraitorRuleSystem _traitorRule = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnSpecificPersonAssigned); + SubscribeLocalEvent(OnRandomPersonAssigned); + SubscribeLocalEvent(OnRandomHeadAssigned); + + SubscribeLocalEvent(OnRandomTraitorProgressAssigned); + SubscribeLocalEvent(OnRandomTraitorAliveAssigned); + } + + private void OnSpecificPersonAssigned(Entity ent, ref ObjectiveAssignedEvent args) + { + // invalid objective prototype + if (!TryComp(ent.Owner, out var target)) + { + args.Cancelled = true; + return; + } + + // target already assigned + if (target.Target != null) + return; + + if (args.Mind.OwnedEntity == null) + { + args.Cancelled = true; + return; + } + + var user = args.Mind.OwnedEntity.Value; + if (!TryComp(user, out var targetComp) || targetComp.Target == null) + { + args.Cancelled = true; + return; + } + + _target.SetTarget(ent.Owner, targetComp.Target.Value); + } + + private void OnRandomPersonAssigned(Entity ent, ref ObjectiveAssignedEvent args) + { + // Begin DeltaV Changes - replaced copy pasta with this + Predicate pred = ent.Comp.OnlyChoosableJobs + ? mindId => + _role.MindHasRole(mindId, out var role) && + role?.Comp1.JobPrototype is {} jobId && + _proto.Index(jobId).SetPreference + : _ => true; + AssignRandomTarget(ent, ref args, pred); + // End DeltaV Changes - replaced copy pasta with this + } + + private void OnRandomHeadAssigned(Entity ent, ref ObjectiveAssignedEvent args) + { + // Begin DeltaV Changes - replaced copy pasta with this + AssignRandomTarget(ent, ref args, mindId => + TryComp(mindId, out var mind) && + mind.OwnedEntity is { } ownedEnt && + HasComp(ownedEnt)); + // End DeltaV Changes - replaced copy pasta with this + } + + /// + /// DeltaV - Common code deduplicated from above functions. + /// Filters all alive humans and picks a target from them. + /// + private void AssignRandomTarget(EntityUid uid, ref ObjectiveAssignedEvent args, Predicate filter, bool fallbackToAny = true) + { + // invalid prototype + if (!TryComp(uid, out var target)) + { + args.Cancelled = true; + return; + } + + // target already assigned + if (target.Target != null) + return; + + // Get all alive humans, filter out any with TargetObjectiveImmuneComponent + var allHumans = _mind.GetAliveHumans(args.MindId) + .Where(mindId => + { + if (!TryComp(mindId, out var mindComp) || mindComp.OwnedEntity == null) + return false; + return !HasComp(mindComp.OwnedEntity.Value); + }) + .ToList(); + + // Can't have multiple objectives to kill the same person + foreach (var objective in args.Mind.Objectives) + { + if (HasComp(objective) && TryComp(objective, out var kill)) + { + allHumans.RemoveAll(x => x.Owner == kill.Target); + } + } + + // Filter out targets based on the filter + var filteredHumans = allHumans.Where(mind => filter(mind)).ToList(); + + // There's no humans and we can't fall back to any other target + if (filteredHumans.Count == 0 && !fallbackToAny) + { + args.Cancelled = true; + return; + } + + // Pick between humans matching our filter or fall back to all humans alive + var selectedHumans = filteredHumans.Count > 0 ? filteredHumans : allHumans; + + // Still no valid targets even after the fallback + if (selectedHumans.Count == 0) + { + args.Cancelled = true; + return; + } + + _target.SetTarget(uid, _random.Pick(selectedHumans), target); + } + + private void OnRandomTraitorProgressAssigned(Entity ent, ref ObjectiveAssignedEvent args) + { + // invalid prototype + if (!TryComp(ent.Owner, out var target)) + { + args.Cancelled = true; + return; + } + + var traitors = _traitorRule.GetOtherTraitorMindsAliveAndConnected(args.Mind).ToHashSet(); + + // cant help anyone who is tasked with helping: + // 1. thats boring + // 2. no cyclic progress dependencies!!! + foreach (var traitor in traitors) + { + // TODO: replace this with TryComp(traitor) or something when objectives are moved out of mind + if (!TryComp(traitor.Id, out var mind)) + continue; + + foreach (var objective in mind.Objectives) + { + if (HasComp(objective)) + traitors.RemoveWhere(x => x.Mind == mind); + } + } + + // Can't have multiple objectives to help/save the same person + foreach (var objective in args.Mind.Objectives) + { + if (HasComp(objective) || HasComp(objective)) + { + if (TryComp(objective, out var help)) + { + traitors.RemoveWhere(x => x.Id == help.Target); + } + } + } + + // no more helpable traitors + if (traitors.Count == 0) + { + args.Cancelled = true; + return; + } + + _target.SetTarget(ent.Owner, _random.Pick(traitors).Id, target); + } + + private void OnRandomTraitorAliveAssigned(Entity ent, ref ObjectiveAssignedEvent args) + { + // invalid prototype + if (!TryComp(ent.Owner, out var target)) + { + args.Cancelled = true; + return; + } + + var traitors = _traitorRule.GetOtherTraitorMindsAliveAndConnected(args.Mind).ToHashSet(); + + // Can't have multiple objectives to help/save the same person + foreach (var objective in args.Mind.Objectives) + { + if (HasComp(objective) || HasComp(objective)) + { + if (TryComp(objective, out var help)) + { + traitors.RemoveWhere(x => x.Id == help.Target); + } + } + } + + // You are the first/only traitor. + if (traitors.Count == 0) + { + args.Cancelled = true; + return; + } + + _target.SetTarget(ent.Owner, _random.Pick(traitors).Id, target); + } +} diff --git a/Content.Server/Objectives/Systems/TerminatorTargetOverrideSystem.cs b/Content.Server/Objectives/Systems/TerminatorTargetOverrideSystem.cs deleted file mode 100644 index 0a81c2810e..0000000000 --- a/Content.Server/Objectives/Systems/TerminatorTargetOverrideSystem.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Content.Server.Objectives.Components; -using Content.Server.Terminator.Components; -using Content.Shared.Mind; -using Content.Shared.Objectives.Components; - -namespace Content.Server.Objectives.Systems; - -/// -/// Handles copying the exterminator's target override to this objective. -/// -public sealed class TerminatorTargetOverrideSystem : EntitySystem -{ - [Dependency] private readonly TargetObjectiveSystem _target = default!; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnAssigned); - } - - private void OnAssigned(EntityUid uid, TerminatorTargetOverrideComponent comp, ref ObjectiveAssignedEvent args) - { - if (args.Mind.OwnedEntity == null) - { - args.Cancelled = true; - return; - } - - var user = args.Mind.OwnedEntity.Value; - if (!TryComp(user, out var terminator)) - { - args.Cancelled = true; - return; - } - - // this exterminator has a target override so set its objective target accordingly - if (terminator.Target != null) - _target.SetTarget(uid, terminator.Target.Value); - } -} diff --git a/Content.Server/Terminator/Components/TerminatorComponent.cs b/Content.Server/Terminator/Components/TerminatorComponent.cs deleted file mode 100644 index 9427f95eed..0000000000 --- a/Content.Server/Terminator/Components/TerminatorComponent.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Content.Server.Terminator.Systems; -using Robust.Shared.Prototypes; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; - -namespace Content.Server.Terminator.Components; - -/// -/// Main terminator component, handles the target, if any, and objectives. -/// -[RegisterComponent, Access(typeof(TerminatorSystem))] -public sealed partial class TerminatorComponent : Component -{ - /// - /// Used to force the terminate objective's target. - /// If null it will be a random person. - /// - [DataField("target")] - public EntityUid? Target; -} diff --git a/Content.Server/Terminator/Systems/TerminatorSystem.cs b/Content.Server/Terminator/Systems/TerminatorSystem.cs deleted file mode 100644 index 987f02dd6a..0000000000 --- a/Content.Server/Terminator/Systems/TerminatorSystem.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Content.Server.Body.Components; -using Content.Server.Ghost.Roles.Events; -using Content.Server.Roles; -using Content.Server.Terminator.Components; -using Content.Shared.Roles; -using Robust.Shared.Map; - -namespace Content.Server.Terminator.Systems; - -/// -/// DeltaV - this is just used for paradox anomaly upstream doesnt use it anymore. -/// -public sealed class TerminatorSystem : EntitySystem -{ - public void SetTarget(Entity ent, EntityUid mindId) - { - ent.Comp ??= EnsureComp(ent); - ent.Comp.Target = mindId; - } -} diff --git a/Content.Server/_DV/StationEvents/Events/ParadoxClonerRule.cs b/Content.Server/_DV/StationEvents/Events/ParadoxClonerRule.cs index 446e10ed92..5de0562b49 100644 --- a/Content.Server/_DV/StationEvents/Events/ParadoxClonerRule.cs +++ b/Content.Server/_DV/StationEvents/Events/ParadoxClonerRule.cs @@ -5,7 +5,7 @@ using Content.Server.Psionics; using Content.Server.Station.Systems; using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Events; -using Content.Server.Terminator.Systems; +using Content.Server.Objectives.Components; using Content.Shared.Cloning; using Content.Shared.Humanoid; using Content.Shared.Humanoid.Prototypes; @@ -23,7 +23,7 @@ namespace Content.Server.StationEvents.Events; /// /// Creates clones of random players to make into selected antags. -/// 90% of the actual antag's work is done by exterminator (rip) since its a reskin. +/// 90% of the actual antag's work is done by TargetOverrideComponent. /// public sealed class ParadoxClonerRule : StationEventSystem { @@ -36,7 +36,6 @@ public sealed class ParadoxClonerRule : StationEventSystem(spawned).Target = mindId; // guaranteed psionic power var psi = EnsureComp(spawned); diff --git a/Resources/Prototypes/_DV/Objectives/paradox_anomaly.yml b/Resources/Prototypes/_DV/Objectives/paradox_anomaly.yml index b929d5cfda..626fe97ec9 100644 --- a/Resources/Prototypes/_DV/Objectives/paradox_anomaly.yml +++ b/Resources/Prototypes/_DV/Objectives/paradox_anomaly.yml @@ -23,7 +23,7 @@ state: icon - type: TargetObjective title: objective-paradox-anomaly-kill-title - - type: TerminatorTargetOverride + - type: PickSpecificPerson - type: KillPersonCondition requireDead: true @@ -38,7 +38,7 @@ state: folder-white - type: TargetObjective title: objective-paradox-anomaly-friend-title - - type: TerminatorTargetOverride + - type: PickSpecificPerson - type: KeepAliveCondition - type: entity