2022-12-24 23:28:21 -05:00
|
|
|
using Content.Shared.Damage;
|
|
|
|
|
using Robust.Shared.Audio;
|
2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2022-07-09 13:46:11 +10:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2020-07-02 23:24:27 +02:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
namespace Content.Shared.Projectiles;
|
|
|
|
|
|
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
|
|
|
public sealed partial class ProjectileComponent : Component
|
2020-07-02 23:24:27 +02:00
|
|
|
{
|
2023-05-14 13:15:18 +10:00
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("impactEffect", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
|
|
|
public string? ImpactEffect;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// User that shot this projectile.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("shooter"), AutoNetworkedField] public EntityUid Shooter;
|
2022-07-09 13:46:11 +10:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Weapon used to shoot.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("weapon"), AutoNetworkedField]
|
|
|
|
|
public EntityUid Weapon;
|
2020-07-02 23:24:27 +02:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
[DataField("ignoreShooter"), AutoNetworkedField]
|
|
|
|
|
public bool IgnoreShooter = true;
|
2022-12-24 23:28:21 -05:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
[DataField("damage", required: true)] [ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public DamageSpecifier Damage = new();
|
2022-12-24 23:28:21 -05:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
[DataField("deleteOnCollide")]
|
|
|
|
|
public bool DeleteOnCollide = true;
|
2022-12-24 23:28:21 -05:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
[DataField("ignoreResistances")]
|
|
|
|
|
public bool IgnoreResistances = false;
|
2022-12-24 23:28:21 -05:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
// Get that juicy FPS hit sound
|
|
|
|
|
[DataField("soundHit")] public SoundSpecifier? SoundHit;
|
2022-12-24 23:28:21 -05:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
[DataField("soundForce")]
|
|
|
|
|
public bool ForceSound = false;
|
2022-12-24 23:28:21 -05:00
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
public bool DamagedEntity;
|
2020-07-02 23:24:27 +02:00
|
|
|
}
|