2022-01-13 09:53:50 -05:00
|
|
|
using Content.Server.GameTicking.Rules;
|
2023-08-30 21:46:11 -07:00
|
|
|
using Content.Shared.Mind;
|
|
|
|
|
using Content.Shared.Objectives.Interfaces;
|
2022-01-13 09:53:50 -05:00
|
|
|
|
|
|
|
|
namespace Content.Server.Objectives.Requirements
|
|
|
|
|
{
|
|
|
|
|
[DataDefinition]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class MultipleTraitorsRequirement : IObjectiveRequirement
|
2022-01-13 09:53:50 -05:00
|
|
|
{
|
|
|
|
|
[DataField("traitors")]
|
2023-08-22 18:14:33 -07:00
|
|
|
private int _requiredTraitors = 2;
|
2022-01-13 09:53:50 -05:00
|
|
|
|
2023-08-28 16:53:24 -07:00
|
|
|
public bool CanBeAssigned(EntityUid mindId, MindComponent mind)
|
2022-01-13 09:53:50 -05:00
|
|
|
{
|
2023-08-28 16:53:24 -07:00
|
|
|
return EntitySystem.Get<TraitorRuleSystem>().GetOtherTraitorMindsAliveAndConnected(mind).Count >= _requiredTraitors;
|
2022-01-13 09:53:50 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|