make objectives use yml defined mind filters (#36030)

* add MindHasRole whitelist overload

* add mind filters framework

* add different mind filters and pools

* update traitor stuff to use mind filters

* line

* don't duplicate kill objectives

* g

* gs

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
This commit is contained in:
deltanedas
2025-08-08 16:58:46 +01:00
committed by GitHub
parent 1374ceea47
commit 1d21e13360
17 changed files with 362 additions and 173 deletions

View File

@@ -1,7 +1,26 @@
using Content.Server.Objectives.Systems;
using Content.Shared.Mind.Filters;
namespace Content.Server.Objectives.Components;
/// <summary>
/// Sets the target for <see cref="TargetObjectiveComponent"/> to a random person.
/// Sets the target for <see cref="TargetObjectiveComponent"/> to a random person from a pool and filters.
/// </summary>
[RegisterComponent]
public sealed partial class PickRandomPersonComponent : Component;
/// <remarks>
/// Don't copy paste this for a new objective, if you need a new filter just make a new filter and set it in YAML.
/// </remarks>
[RegisterComponent, Access(typeof(PickObjectiveTargetSystem))]
public sealed partial class PickRandomPersonComponent : Component
{
/// <summary>
/// A pool to pick potential targets from.
/// </summary>
[DataField]
public IMindPool Pool = new AliveHumansPool();
/// <summary>
/// Filters to apply to <see cref="Pool"/>.
/// </summary>
[DataField]
public List<MindFilter> Filters = new();
}