From 015bb02e867a06305eb81af38e4c1c30fff54a26 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 23 Jan 2024 10:16:21 +0300 Subject: [PATCH] Oops --- .../Conditions/KillDepartmentCondition.cs | 106 ------------------ .../Catalog/Fills/Items/briefcases.yml | 1 - 2 files changed, 107 deletions(-) delete mode 100644 Content.Server/Objectives/Conditions/KillDepartmentCondition.cs diff --git a/Content.Server/Objectives/Conditions/KillDepartmentCondition.cs b/Content.Server/Objectives/Conditions/KillDepartmentCondition.cs deleted file mode 100644 index 21c4373bb8..0000000000 --- a/Content.Server/Objectives/Conditions/KillDepartmentCondition.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.Linq; -using Content.Server.Mind; -using Content.Server.Mind.Components; -using Content.Server.Objectives.Interfaces; -using Content.Server.Roles; -using Content.Shared.Mobs.Components; -using Content.Shared.Mobs.Systems; -using Content.Shared.Roles; -using Robust.Shared.Prototypes; -using Robust.Shared.Utility; - -namespace Content.Server.Objectives.Conditions; - -public abstract class KillDepartmentCondition : IObjectiveCondition -{ - private IEntityManager EntityManager => IoCManager.Resolve(); - private IPrototypeManager PrototypeManager => IoCManager.Resolve(); - private MobStateSystem MobStateSystem => EntityManager.EntitySysManager.GetEntitySystem(); - private MindSystem MindSystem => EntityManager.EntitySysManager.GetEntitySystem(); - - protected abstract string TitleHeader { get; } - public abstract IObjectiveCondition GetAssigned(Mind.Mind mind); - - protected List? Targets; - - protected List GetTargets(Mind.Mind mind, string department) - { - var dep = PrototypeManager.Index(department); - var allMinds = EntityManager.EntityQuery(true).Where(mc => - { - var entity = mc.Mind?.OwnedEntity; - - if (entity == default || mc.Mind == mind) - return false; - - var isTargetJob = mc.Mind?.AllRoles.OfType().Any(job => dep.Roles.Contains(job.Prototype.ID)); - - if (isTargetJob is false) - return false; - - return EntityManager.TryGetComponent(entity, out MobStateComponent? mobState) && - MobStateSystem.IsAlive(entity.Value, mobState); - - }).Select(mc => mc.Mind).ToList(); - - return allMinds; - } - - public string Title - { - get - { - var title = TitleHeader; - if (Targets == null) - return title; - - foreach (var target in Targets) - { - if (target?.OwnedEntity is { Valid: true } owned) - { - title += $"\n - {EntityManager.GetComponent(owned).EntityName}, " + - $"{target?.CurrentJob?.Name ?? "Unknown"}"; - } - } - - return title; - } - } - - public string Description => Loc.GetString("objective-condition-department-description"); - - public SpriteSpecifier Icon => new SpriteSpecifier.Rsi(new ("Objects/Weapons/Guns/Pistols/viper.rsi"), "icon"); - - public float Progress - { - get - { - if (Targets == null) - return 1f; - - var deadTargetsCount = Targets.Count(target => target != null && MindSystem.IsCharacterDeadIc(target)); - - return Math.Min(1f / Targets.Count * deadTargetsCount, 1f); - } - } - - public float Difficulty => 5f; - public bool Equals(IObjectiveCondition? other) - { - return other is KillDepartmentCondition kdc && Equals(Targets, kdc.Targets); - } - - public override bool Equals(object? obj) - { - if (ReferenceEquals(null, obj)) - return false; - if (ReferenceEquals(this, obj)) - return true; - return obj.GetType() == GetType() && Equals((KillDepartmentCondition) obj); - } - - public override int GetHashCode() - { - return Targets?.GetHashCode() ?? 0; - } -} diff --git a/Resources/Prototypes/Catalog/Fills/Items/briefcases.yml b/Resources/Prototypes/Catalog/Fills/Items/briefcases.yml index bc792f22bf..d4e12be0da 100644 --- a/Resources/Prototypes/Catalog/Fills/Items/briefcases.yml +++ b/Resources/Prototypes/Catalog/Fills/Items/briefcases.yml @@ -27,7 +27,6 @@ - id: MagazineBoxAntiMateriel - id: ClothingNeckTieRed - id: ClothingUniformJumpsuitLawyerBlack - - id: ClothingHandsGlovesCombat # WD edit - id: ClothingShoesBootsLaceup - type: entity