diff --git a/Content.Server/DeltaV/Objectives/Components/TeachLessonConditionComponent.cs b/Content.Server/DeltaV/Objectives/Components/TeachLessonConditionComponent.cs deleted file mode 100644 index d6c57129d5..0000000000 --- a/Content.Server/DeltaV/Objectives/Components/TeachLessonConditionComponent.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Content.Server.DeltaV.Objectives.Systems; -using Content.Server.Objectives.Components; - -namespace Content.Server.DeltaV.Objectives.Components; - -/// -/// Requires that a target dies once and only once. -/// Depends on to function. -/// -[RegisterComponent, Access(typeof(TeachLessonConditionSystem))] -public sealed partial class TeachLessonConditionComponent : Component -{ - /// - /// How close the assassin must be to the person "Being given a lesson", to ensure that the kill is reasonably - /// something that could be the assassin's doing. This way the objective isn't resolved by the target getting killed - /// by a space tick while on expedition. - /// - [DataField] - public float MaxDistance = 30f; -} diff --git a/Content.Server/DeltaV/Objectives/Systems/TeachLessonConditionSystem.cs b/Content.Server/DeltaV/Objectives/Systems/TeachLessonConditionSystem.cs deleted file mode 100644 index 4beff20fef..0000000000 --- a/Content.Server/DeltaV/Objectives/Systems/TeachLessonConditionSystem.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Content.Server.DeltaV.Objectives.Components; -using Content.Server.Objectives.Components; -using Content.Server.Objectives.Systems; -using Content.Shared.Mind.Components; -using Content.Shared.Mobs; - -namespace Content.Server.DeltaV.Objectives.Systems; - -/// -/// Handles teach a lesson condition logic, does not assign target. -/// -public sealed class TeachLessonConditionSystem : EntitySystem -{ - [Dependency] private readonly CodeConditionSystem _codeCondition = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnMobStateChanged); - } - - private void OnMobStateChanged(MobStateChangedEvent args) - { - if (args.NewMobState != MobState.Critical || args.OldMobState >= args.NewMobState - || !TryComp(args.Target, out var mc) || mc.OriginalMind is not { } mindId) - return; - - // If the attacker actually has the objective, we can just skip any enumeration outright. - if (args.Origin is not null - && HasComp(args.Origin) - && TryComp(args.Origin, out var targetComp) - && targetComp.Target == mindId) - { - _codeCondition.SetCompleted(args.Origin!.Value); - return; - } - - // Get all TeachLessonConditionComponent entities - var query = EntityQueryEnumerator(); - - while (query.MoveNext(out var ent, out var conditionComp, out var targetObjective)) - { - // Check if this objective's target matches the entity that died - if (targetObjective.Target != mindId) - continue; - - var userWorldPos = _transform.GetWorldPosition(ent); - var targetWorldPos = _transform.GetWorldPosition(args.Target); - - var distance = (userWorldPos - targetWorldPos).Length(); - if (distance > conditionComp.MaxDistance - || Transform(ent).MapID != Transform(args.Target).MapID) - continue; - - _codeCondition.SetCompleted(ent); - } - } -} diff --git a/Resources/Prototypes/DeltaV/Objectives/traitor.yml b/Resources/Prototypes/DeltaV/Objectives/traitor.yml index 9af5b36ab8..828142cdfa 100644 --- a/Resources/Prototypes/DeltaV/Objectives/traitor.yml +++ b/Resources/Prototypes/DeltaV/Objectives/traitor.yml @@ -33,36 +33,3 @@ stealGroup: RubberStampNotary verifyMapExistence: true owner: job-name-clerk - -# teach lesson -- type: entity - abstract: true - parent: BaseTargetObjective - id: BaseTeachLessonObjective - components: - - type: Objective - unique: false - icon: - sprite: Objects/Weapons/Melee/baseball_bat.rsi # WWDP - state: icon - - type: TeachLessonCondition - - type: CodeCondition - - type: ObjectiveBlacklistRequirement - blacklist: - components: - - KillPersonCondition # WWDP no Teach & Kill the same person - - SocialObjective - -- type: entity - parent: [BaseTraitorObjective, BaseTeachLessonObjective] - id: TeachLessonRandomPersonObjective - description: Kill them, and show everyone we mean business. They only need to die once. - components: - - type: Objective - description: objective-condition-teach-person-description # WWDP Localization, title is done in TargetObjective - difficulty: 1.75 - unique: false - - type: TargetObjective - title: objective-condition-teach-person-title - - type: PickRandomPerson - - type: TeachLessonCondition diff --git a/Resources/Prototypes/Objectives/objectiveGroups.yml b/Resources/Prototypes/Objectives/objectiveGroups.yml index aadab6e424..0612b75522 100644 --- a/Resources/Prototypes/Objectives/objectiveGroups.yml +++ b/Resources/Prototypes/Objectives/objectiveGroups.yml @@ -33,7 +33,6 @@ id: TraitorObjectiveGroupKill weights: KillRandomPersonObjective: 1 - TeachLessonRandomPersonObjective: 0.25 KillRandomHeadObjective: 0.25 - type: weightedRandom