using Content.Shared.Damage;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Projectiles;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
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;
///
/// How much time after being shot the projectile can collide with the shooter.
///
///
/// Since projectiles spawn inside the shooter,
/// they have to ignore the shooter for a little while while they fly away.
///
[DataField, AutoNetworkedField]
public TimeSpan DelayToAcknowledgeShooter = TimeSpan.FromSeconds(1);
///
/// Time from which after the projectile can hit the shooter.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan? WhenToStopIgnoringShooter;
///
/// 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;
}