Files
OldThink/Content.Shared/Projectiles/ProjectileComponent.cs

86 lines
2.4 KiB
C#
Raw Permalink Normal View History

using Content.Shared.Damage;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
2022-07-09 13:46:11 +10:00
using Robust.Shared.Prototypes;
2020-07-02 23:24:27 +02:00
namespace Content.Shared.Projectiles;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ProjectileComponent : Component
2020-07-02 23:24:27 +02:00
{
/// <summary>
/// The effect that appears when a projectile collides with an entity.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId? ImpactEffect;
/// <summary>
/// User that shot this projectile.
/// </summary>
[DataField, AutoNetworkedField]
2023-09-22 02:45:21 -07:00
public EntityUid? Shooter;
2022-07-09 13:46:11 +10:00
/// <summary>
/// Weapon used to shoot.
/// </summary>
[DataField, AutoNetworkedField]
2023-09-22 02:45:21 -07:00
public EntityUid? Weapon;
2020-07-02 23:24:27 +02:00
/// <summary>
/// Entity being targeted by crosshair.
/// </summary>
[AutoNetworkedField]
public EntityUid? Target;
[DataField, AutoNetworkedField]
public bool IgnoreTarget;
/// <summary>
/// The projectile spawns inside the shooter most of the time, this prevents entities from shooting themselves.
/// </summary>
[DataField, AutoNetworkedField]
public bool IgnoreShooter = true;
/// <summary>
/// The amount of damage the projectile will do.
/// </summary>
[DataField(required: true)] [ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier Damage = new();
/// <summary>
/// If the projectile should be deleted on collision.
/// </summary>
[DataField]
public bool DeleteOnCollide = true;
/// <summary>
/// Ignore all damage resistances the target has.
/// </summary>
[DataField]
public bool IgnoreResistances = false;
/// <summary>
/// Get that juicy FPS hit sound.
/// </summary>
[DataField]
public SoundSpecifier? SoundHit;
/// <summary>
/// Force the projectiles sound to play rather than potentially playing the entity's sound.
/// </summary>
[DataField]
public bool ForceSound = false;
2023-09-22 02:45:21 -07:00
/// <summary>
/// Whether this projectile will only collide with entities if it was shot from a gun (if <see cref="Weapon"/> is not null).
2023-09-22 02:45:21 -07:00
/// </summary>
[DataField]
2023-09-22 02:45:21 -07:00
public bool OnlyCollideWhenShot = false;
/// <summary>
/// Whether this projectile has already damaged an entity.
/// </summary>
[DataField]
public bool DamagedEntity;
2020-07-02 23:24:27 +02:00
}