mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
* Init testing * copyright * oops * Tracking the embed entity uid * testing stuff for gradual injection * work * weh * god save me * bleh * Yippee! * Again * Mini syringe ammo * cleaning up * mini syringes have a texture for fill amount * -3 cool points :( * hitboxes * init cleanup * much needed fixes * Fixes (cherry picked from commit 62f5a31c4abcaaca09af84f591cbe727e6fcb7cb)
85 lines
2.5 KiB
C#
85 lines
2.5 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>
|
|
[DataField, AutoNetworkedField]
|
|
public float MinimumSpeed = 5f;
|
|
|
|
/// <summary>
|
|
/// Delete the entity on embedded removal?
|
|
/// Does nothing if there's no RemovalTime.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool DeleteOnRemove;
|
|
|
|
/// <summary>
|
|
/// How long it takes to remove the embedded object.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public float? RemovalTime = 5f;
|
|
|
|
/// <summary>
|
|
/// Whether this entity will embed when thrown, or only when shot as a projectile.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool EmbedOnThrow = true;
|
|
|
|
/// <summary>
|
|
/// How far into the entity should we offset (0 is wherever we collided).
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public Vector2 Offset = Vector2.Zero;
|
|
|
|
/// <summary>
|
|
/// Sound to play after embedding into a hit target.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public SoundSpecifier? Sound;
|
|
|
|
/// <summary>
|
|
/// Uid of the entity the projectile is embed into.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public EntityUid? EmbeddedIntoUid;
|
|
|
|
/// <summary>
|
|
/// How much time before this entity automatically falls off? (0 is never)
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public float AutoRemoveDuration = 40f;
|
|
|
|
/// <summary>
|
|
/// The time when this entity automatically falls off after being attached.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
|
public TimeSpan? AutoRemoveTime = null;
|
|
|
|
/// <summary>
|
|
/// The body part of the target this embeddable is attached to.
|
|
/// </summary>
|
|
[ViewVariables, AutoNetworkedField]
|
|
public TargetBodyPart? TargetBodyPart = null;
|
|
|
|
// WD EDIT START
|
|
[DataField]
|
|
public DamageSpecifier Damage = new();
|
|
|
|
[DataField]
|
|
public bool PreventCollide;
|
|
// WD EDIT END
|
|
}
|