using Content.Shared.Damage;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Projectiles;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ProjectileComponent : Component
{
///
/// The angle of the fired projectile.
///
[DataField, AutoNetworkedField]
public Angle Angle;
///
/// The effect that appears when a projectile collides with an entity.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId? ImpactEffect;
///
/// User that shot this projectile.
///
[DataField, AutoNetworkedField]
public EntityUid? Shooter;
///
/// Weapon used to shoot.
///
[DataField, AutoNetworkedField]
public EntityUid? Weapon;
///
/// The projectile spawns inside the shooter most of the time, this prevents entities from shooting themselves.
///
[DataField, AutoNetworkedField]
public bool IgnoreShooter = true;
///
/// The amount of damage the projectile will do.
///
[DataField(required: true)] [ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier Damage = new();
///
/// If the projectile should be deleted on collision.
///
[DataField]
public bool DeleteOnCollide = true;
///
/// Ignore all damage resistances the target has.
///
[DataField]
public bool IgnoreResistances = false;
///
/// Get that juicy FPS hit sound.
///
[DataField]
public SoundSpecifier? SoundHit;
///
/// Force the projectiles sound to play rather than potentially playing the entity's sound.
///
[DataField]
public bool ForceSound = false;
///
/// Whether this projectile will only collide with entities if it was shot from a gun (if is not null).
///
[DataField]
public bool OnlyCollideWhenShot = false;
///
/// If true, the projectile has hit enough targets and should no longer interact with further collisions pending deletion.
///
[DataField]
public bool ProjectileSpent;
///
/// When a projectile has this threshold set, it will continue to penetrate entities until the damage dealt reaches this threshold.
///
[DataField]
public FixedPoint2 PenetrationThreshold = FixedPoint2.Zero;
///
/// If set, the projectile will not penetrate objects that lack the ability to take these damage types.
///
[DataField]
public List? PenetrationDamageTypeRequirement;
///
/// Tracks the amount of damage dealt for penetration purposes.
///
[DataField]
public FixedPoint2 PenetrationAmount = FixedPoint2.Zero;
}