using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Guardian.Components;
///
/// Given to guardians to monitor their link with the host.
///
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class GuardianComponent : Component
{
///
/// The guardian host entity.
///
[DataField, AutoNetworkedField]
public EntityUid? Host;
///
/// Percentage of damage reflected from the guardian to the host.
///
[DataField]
public float DamageShare { get; set; } = 0.65f;
///
/// Maximum distance the guardian can travel before it's forced to recall, use YAML to set.
///
[DataField]
public float DistanceAllowed { get; set; } = 5f;
///
/// If the guardian is currently manifested.
///
[DataField, AutoNetworkedField]
public bool GuardianLoose;
///
/// Popup shown to the host when their guardian takes damage.
///
[DataField]
public LocId GuardianDamagePopup = "guardian-entity-taking-damage";
///
/// Sound played when the guardian enters critical state.
///
[DataField]
public SoundSpecifier CriticalSound = new SoundPathSpecifier("/Audio/Effects/guardian_warn.ogg");
///
/// Sound played when the guardian dies.
///
[DataField]
public SoundSpecifier DeathSound = new SoundPathSpecifier("/Audio/Voice/Human/malescream_guardian.ogg", AudioParams.Default.WithVariation(0.2f));
///
/// The last time that the entity received an attack popup.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan LastAttackPopupTime;
///
/// The delay between showing popups to the guardian when trying to attack its host.
///
[DataField]
public TimeSpan AttackPopupDelay = TimeSpan.FromSeconds(1);
}