Files
wwdpublic/Content.Shared/Projectiles/EmbeddableProjectileComponent.cs
Spatison 2a10c02eb5 No spead merge (#475)
* Revert "[GoobPort] WIZ REAL (#465)"

This reverts commit 091a8ff433.

* fix local
2025-04-26 10:50:32 +03:00

85 lines
2.8 KiB
C#

using Content.Shared._Shitmed.Targeting;
using System.Numerics;
using Content.Shared.Damage;
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.GameStates;
namespace Content.Shared.Projectiles;
/// <summary>
/// Embeds this entity inside of the hit target.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmbeddableProjectileComponent : Component
{
/// <summary>
/// Minimum speed of the projectile to embed.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public float MinimumSpeed = 5f;
/// <summary>
/// Delete the entity on embedded removal?
/// Does nothing if there's no RemovalTime.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public bool DeleteOnRemove;
/// <summary>
/// How long it takes to remove the embedded object.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public float? RemovalTime = 5f;
/// <summary>
/// Whether this entity will embed when thrown, or only when shot as a projectile.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public bool EmbedOnThrow = true;
/// <summary>
/// How far into the entity should we offset (0 is wherever we collided).
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public Vector2 Offset = Vector2.Zero;
/// <summary>
/// Sound to play after embedding into a hit target.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public SoundSpecifier? Sound;
/// <summary>
/// The entity this embeddable is attached to.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public EntityUid? Target = null;
/// <summary>
/// The body part of the target this embeddable is attached to.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public TargetBodyPart? TargetBodyPart = null;
/// <summary>
/// How much time before this entity automatically falls off? (0 is never)
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public float AutoRemoveDuration = 40f;
/// <summary>
/// The time when this entity automatically falls off after being attached.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
public TimeSpan? AutoRemoveTime = null;
// WD EDIT START
[DataField]
public DamageSpecifier Damage = new();
[DataField]
public bool PreventCollide;
// WD EDIT END
}