fish-station/Content.Shared/Actions/EntityTargetActionComponent.cs
Vigers Ray 99a2aa9c4d Merge remote-tracking branch 'space-wizards/master'
# Conflicts:
#	Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml
#	Resources/Prototypes/ai_factions.yml
#	Resources/Textures/Clothing/Head/Hardsuits/paramedhelm.rsi/meta.json
#	Resources/Textures/Clothing/Head/Helmets/paramedhelm.rsi/icon.png
#	Resources/Textures/Clothing/Head/Helmets/paramedhelm.rsi/inhand-left.png
#	Resources/Textures/Clothing/Head/Helmets/paramedhelm.rsi/inhand-right.png
#	Resources/Textures/Clothing/OuterClothing/Hardsuits/paramed.rsi/meta.json
2025-02-14 00:55:00 +03:00

55 lines
1.9 KiB
C#

using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Actions;
/// <summary>
/// Used on action entities to define an action that triggers when targeting an entity.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class EntityTargetActionComponent : BaseTargetActionComponent
{
public override BaseActionEvent? BaseEvent => Event;
/// <summary>
/// The local-event to raise when this action is performed.
/// </summary>
[DataField("event")]
[NonSerialized]
public EntityTargetActionEvent? Event;
/// <summary>
/// Determines which entities are valid targets for this action.
/// </summary>
/// <remarks>No whitelist check when null.</remarks>
[DataField("whitelist")] public EntityWhitelist? Whitelist;
/// <summary>
/// Determines which entities are NOT valid targets for this action.
/// </summary>
/// <remarks>No blacklist check when null.</remarks>
[DataField] public EntityWhitelist? Blacklist;
/// <summary>
/// Whether this action considers the user as a valid target entity when using this action.
/// </summary>
[DataField("canTargetSelf")] public bool CanTargetSelf = true;
}
[Serializable, NetSerializable]
public sealed class EntityTargetActionComponentState : BaseActionComponentState
{
public EntityWhitelist? Whitelist;
public EntityWhitelist? Blacklist;
public bool CanTargetSelf;
public bool IgnoreContainer; // Sunrise-Edit
public EntityTargetActionComponentState(EntityTargetActionComponent component, IEntityManager entManager) : base(component, entManager)
{
Whitelist = component.Whitelist;
Blacklist = component.Blacklist;
CanTargetSelf = component.CanTargetSelf;
IgnoreContainer = component.IgnoreContainer; // Sunrise-Edit
}
}