diff --git a/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs b/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs index 2704329d7db..d421666fd29 100644 --- a/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs +++ b/Content.Server/Objectives/Systems/PickObjectiveTargetSystem.cs @@ -1,13 +1,7 @@ +using Content.Server._DV.Objectives.Components; // DeltaV 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; @@ -19,10 +13,6 @@ 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() { @@ -58,6 +48,14 @@ public sealed class PickObjectiveTargetSystem : EntitySystem return; } + // DeltaV - TargetObjectiveImmune + if (HasComp(targetComp.Target)) + { + args.Cancelled = true; + return; + } + // END DeltaV + _target.SetTarget(ent.Owner, targetComp.Target.Value); } @@ -81,6 +79,17 @@ public sealed class PickObjectiveTargetSystem : EntitySystem return; } + // DeltaV - TargetObjectiveImmune + // Pretty much just a back-up check. Ideally, we should have filtered out all the minds + // with this comp with the mind filter TargetObjectiveMindFilter. + if (HasComp(picked)) + { + args.Cancelled = true; + return; + } + // END DeltaV + _target.SetTarget(ent, picked, target); } } + diff --git a/Content.Server/Objectives/Components/TargetObjectiveImmuneComponent.cs b/Content.Server/_DV/Objectives/Components/TargetObjectiveImmuneComponent.cs similarity index 77% rename from Content.Server/Objectives/Components/TargetObjectiveImmuneComponent.cs rename to Content.Server/_DV/Objectives/Components/TargetObjectiveImmuneComponent.cs index 1f2bc961fd0..437db0428b8 100644 --- a/Content.Server/Objectives/Components/TargetObjectiveImmuneComponent.cs +++ b/Content.Server/_DV/Objectives/Components/TargetObjectiveImmuneComponent.cs @@ -1,9 +1,8 @@ -namespace Content.Server.Objectives.Components; + +namespace Content.Server._DV.Objectives.Components; /// /// Use this to mark a player as immune to any target objectives, useful for ghost roles or events. /// [RegisterComponent] -public sealed partial class TargetObjectiveImmuneComponent : Component -{ -} +public sealed partial class TargetObjectiveImmuneComponent : Component; diff --git a/Resources/Prototypes/Objectives/traitor.yml b/Resources/Prototypes/Objectives/traitor.yml index 7f78d2561e3..ed4d76f0d0a 100644 --- a/Resources/Prototypes/Objectives/traitor.yml +++ b/Resources/Prototypes/Objectives/traitor.yml @@ -101,6 +101,7 @@ blacklist: components: - KillPersonCondition + - TargetObjectiveImmune # DeltaV - type: KillPersonCondition requireMaroon: true @@ -127,6 +128,7 @@ blacklist: components: - KillPersonCondition + - TargetObjectiveImmune # DeltaV - type: KillPersonCondition # don't count missing evac as killing as heads are higher profile, so you really need to do the dirty work # if ce flies a shittle to centcom you better find a way onto it @@ -156,6 +158,7 @@ components: - HelpProgressCondition - KeepAliveCondition + - TargetObjectiveImmune # DeltaV - type: entity parent: [BaseTraitorSocialObjective, BaseHelpProgressObjective] @@ -185,6 +188,7 @@ components: - HelpProgressCondition - KeepAliveCondition + - TargetObjectiveImmune # DeltaV # steal diff --git a/Resources/Prototypes/_DV/Objectives/asakim.yml b/Resources/Prototypes/_DV/Objectives/asakim.yml index 5d35de88f33..78ede2ddb03 100644 --- a/Resources/Prototypes/_DV/Objectives/asakim.yml +++ b/Resources/Prototypes/_DV/Objectives/asakim.yml @@ -40,6 +40,7 @@ blacklist: components: - KillPersonCondition + - TargetObjectiveImmune - type: RerollAfterCompletion rerollObjectivePrototype: AsakimKillObjective rerollObjectiveMessage: objective-condition-asakim-terminate-reroll-message diff --git a/Resources/Prototypes/_DV/Objectives/menaceskeleton.yml b/Resources/Prototypes/_DV/Objectives/menaceskeleton.yml index f81377bee00..078174cff3e 100644 --- a/Resources/Prototypes/_DV/Objectives/menaceskeleton.yml +++ b/Resources/Prototypes/_DV/Objectives/menaceskeleton.yml @@ -42,6 +42,7 @@ blacklist: components: - KillPersonCondition + - TargetObjectiveImmune - type: entity parent: SkeletonBaseObjective diff --git a/Resources/Prototypes/_DV/Objectives/ninja.yml b/Resources/Prototypes/_DV/Objectives/ninja.yml index a35fcc87371..db6b3b91696 100644 --- a/Resources/Prototypes/_DV/Objectives/ninja.yml +++ b/Resources/Prototypes/_DV/Objectives/ninja.yml @@ -24,6 +24,10 @@ whitelist: components: - CommandStaff + - !type:TargetObjectiveMindFilter + blacklist: + components: + - TargetObjectiveImmune - type: entity parent: BaseNinjaTeachLessonObjective @@ -48,6 +52,10 @@ whitelist: components: - CommandStaff + - !type:TargetObjectiveMindFilter + blacklist: + components: + - TargetObjectiveImmune - type: KillPersonCondition requireDead: true diff --git a/Resources/Prototypes/_DV/Objectives/roboneuroticist.yml b/Resources/Prototypes/_DV/Objectives/roboneuroticist.yml index 98efd929aba..b9c02f233a8 100644 --- a/Resources/Prototypes/_DV/Objectives/roboneuroticist.yml +++ b/Resources/Prototypes/_DV/Objectives/roboneuroticist.yml @@ -50,6 +50,10 @@ whitelist: components: - CommandStaff + - !type:TargetObjectiveMindFilter + blacklist: + components: + - TargetObjectiveImmune - type: KillPersonCondition requireDead: true diff --git a/Resources/Prototypes/_DV/Objectives/skia.yml b/Resources/Prototypes/_DV/Objectives/skia.yml index 927e0c4ed2c..6909dbea52c 100644 --- a/Resources/Prototypes/_DV/Objectives/skia.yml +++ b/Resources/Prototypes/_DV/Objectives/skia.yml @@ -25,6 +25,7 @@ blacklist: components: - KillPersonCondition + - TargetObjectiveImmune - type: RerollAfterCompletion rerollObjectivePrototype: SkiaReapObjective rerollObjectiveMessage: objective-condition-reap-soul-reroll-message diff --git a/Resources/Prototypes/_DV/Objectives/traitor.yml b/Resources/Prototypes/_DV/Objectives/traitor.yml index 00e699a1f7c..0fc9bdb9dd1 100644 --- a/Resources/Prototypes/_DV/Objectives/traitor.yml +++ b/Resources/Prototypes/_DV/Objectives/traitor.yml @@ -101,15 +101,12 @@ title: objective-condition-teach-person-title - type: PickRandomPerson filters: - - !type:BodyMindFilter - whitelist: - components: - - CommandStaff # Can't have multiple objectives to kill the same person. - !type:TargetObjectiveMindFilter blacklist: components: - KillPersonCondition + - TargetObjectiveImmune # Kill fellow traitor objective - type: entity diff --git a/Resources/Prototypes/_DV/Objectives/wizard.yml b/Resources/Prototypes/_DV/Objectives/wizard.yml index 748038c7072..9f9076cd3a5 100644 --- a/Resources/Prototypes/_DV/Objectives/wizard.yml +++ b/Resources/Prototypes/_DV/Objectives/wizard.yml @@ -94,6 +94,10 @@ components: - CommandStaff - KillPersonCondition # Should also choose those who have targets on their heads by other antags :3 + - !type:TargetObjectiveMindFilter + blacklist: + components: + - TargetObjectiveImmune - type: entity parent: [BaseWizardObjective, BaseKillObjective] @@ -113,6 +117,7 @@ blacklist: components: - KillPersonCondition + - TargetObjectiveImmune - type: KillPersonCondition requireDead: true