using Content.Server.Antag; using Content.Shared.Random; using Robust.Shared.Prototypes; namespace Content.Server.Antag.Components; /// /// Gives antags selected by this rule a random list of objectives. /// [RegisterComponent, Access(typeof(AntagRandomObjectivesSystem))] public sealed partial class AntagRandomObjectivesComponent : Component { /// /// Each set of objectives to add. /// [DataField(required: true)] public List Sets = new(); /// /// If the total difficulty of the currently given objectives exceeds, no more will be given. /// [DataField(required: true)] public float MaxDifficulty; } /// /// A set of objectives to try picking. /// Difficulty is checked over all sets, but each set has its own probability and pick count. /// [DataRecord] public partial record struct AntagObjectiveSet() { /// /// The grouping used by the objective system to pick random objectives. /// First a group is picked from these, then an objective from that group. /// [DataField(required: true)] public ProtoId Groups = string.Empty; /// /// Probability of this set being used. /// [DataField] public float Prob = 1f; /// /// Number of times to try picking objectives from this set. /// Even if there is enough difficulty remaining, no more will be given after this. /// [DataField] public int MaxPicks = 20; }