Files
tbd-station-14/Content.Shared/NPC/Components/NpcFactionMemberComponent.cs
lzk 2a6b7dbaf9 Add ability to add additional friendly and hostile factions in prototypes (#29636)
* Make friendly and hostile factions in NpcFactionMemberComponent datafiels

* :trollface:

* :trollface:
2024-07-02 09:32:21 -04:00

41 lines
1.2 KiB
C#

using Content.Shared.NPC.Prototypes;
using Content.Shared.NPC.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.NPC.Components;
[RegisterComponent, NetworkedComponent, Access(typeof(NpcFactionSystem))]
public sealed partial class NpcFactionMemberComponent : Component
{
/// <summary>
/// Factions this entity is a part of.
/// </summary>
[DataField]
public HashSet<ProtoId<NpcFactionPrototype>> Factions = new();
/// <summary>
/// Cached friendly factions.
/// </summary>
[ViewVariables]
public readonly HashSet<ProtoId<NpcFactionPrototype>> FriendlyFactions = new();
/// <summary>
/// Cached hostile factions.
/// </summary>
[ViewVariables]
public readonly HashSet<ProtoId<NpcFactionPrototype>> HostileFactions = new();
/// <summary>
/// Used to add friendly factions in prototypes.
/// </summary>
[DataField, ViewVariables]
public HashSet<ProtoId<NpcFactionPrototype>>? AddFriendlyFactions;
/// <summary>
/// Used to add hostile factions in prototypes.
/// </summary>
[DataField, ViewVariables]
public HashSet<ProtoId<NpcFactionPrototype>>? AddHostileFactions;
}