using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Flash.Components;
///
/// Allows this entity to flash someone by using it or melee attacking with it.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedFlashSystem))]
public sealed partial class FlashComponent : Component
{
///
/// Flash the area around the entity when used in hand?
///
[DataField, AutoNetworkedField]
public bool FlashOnUse = true;
///
/// Flash the target when melee attacking them?
///
[DataField, AutoNetworkedField]
public bool FlashOnMelee = true;
///
/// Time the Flash will be visually flashing after use.
/// For the actual interaction delay use UseDelayComponent.
/// These two times should be the same.
///
[DataField, AutoNetworkedField]
public TimeSpan FlashingTime = TimeSpan.FromSeconds(4);
///
/// For how long the target will lose vision when melee attacked with the flash.
///
[DataField, AutoNetworkedField]
public TimeSpan MeleeDuration = TimeSpan.FromSeconds(5);
///
/// For how long the target will lose vision when used in hand.
///
[DataField, AutoNetworkedField]
public TimeSpan AoeFlashDuration = TimeSpan.FromSeconds(2);
///
/// How long a target is stunned when a melee flash is used.
/// If null, melee flashes will not stun at all.
///
[DataField, AutoNetworkedField]
public TimeSpan? MeleeStunDuration = TimeSpan.FromSeconds(1.5);
///
/// Range of the flash when using it.
///
[DataField, AutoNetworkedField]
public float Range = 7f;
///
/// Movement speed multiplier for slowing down the target while they are flashed.
///
[DataField, AutoNetworkedField]
public float SlowTo = 0.5f;
///
/// The sound to play when flashing.
///
[DataField, AutoNetworkedField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Weapons/flash.ogg")
{
Params = AudioParams.Default.WithVolume(1f).WithMaxDistance(3f)
};
///
/// The probability of sucessfully flashing someone.
///
[DataField, AutoNetworkedField]
public float Probability = 1f;
}