TriggerOnMeleeHit and more (#39826)

Co-authored-by: iaada <iaada@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
āda
2025-08-31 13:54:15 -05:00
committed by GitHub
parent 0ba5d036a2
commit 5d25cae33d
4 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Trigger.Components.Triggers;
/// <summary>
/// Triggers when this entity is swung as a melee weapon and hits at least one target.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class TriggerOnMeleeHitComponent : BaseTriggerOnXComponent
{
/// <summary>
/// If true, this trigger will activate individually for each entity hit.
/// If false, this trigger will always activate only once.
/// </summary>
[DataField, AutoNetworkedField]
public bool TriggerEveryHit;
/// <summary>
/// If true, the "user" of the trigger is the entity hit by the melee.
/// If false, user is the entity which attacked with the melee weapon.
/// </summary>
/// <remarks>If TriggerEveryHit is false, the user is randomly chosen from hit entities.</remarks>
[DataField, AutoNetworkedField]
public bool TargetIsUser;
}