mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* guardian popup fixes * actually use the entityqueries * finish a thought challenge - difficulty impossible * curse of fildrance * can't believe he's done this
67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared.Guardian.Components;
|
|
|
|
/// <summary>
|
|
/// Given to guardians to monitor their link with the host.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent]
|
|
[AutoGenerateComponentState, AutoGenerateComponentPause]
|
|
public sealed partial class GuardianComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The guardian host entity.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public EntityUid? Host;
|
|
|
|
/// <summary>
|
|
/// Percentage of damage reflected from the guardian to the host.
|
|
/// </summary>
|
|
[DataField]
|
|
public float DamageShare { get; set; } = 0.65f;
|
|
|
|
/// <summary>
|
|
/// Maximum distance the guardian can travel before it's forced to recall, use YAML to set.
|
|
/// </summary>
|
|
[DataField]
|
|
public float DistanceAllowed { get; set; } = 5f;
|
|
|
|
/// <summary>
|
|
/// If the guardian is currently manifested.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool GuardianLoose;
|
|
|
|
/// <summary>
|
|
/// Popup shown to the host when their guardian takes damage.
|
|
/// </summary>
|
|
[DataField]
|
|
public LocId GuardianDamagePopup = "guardian-entity-taking-damage";
|
|
|
|
/// <summary>
|
|
/// Sound played when the guardian enters critical state.
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier CriticalSound = new SoundPathSpecifier("/Audio/Effects/guardian_warn.ogg");
|
|
|
|
/// <summary>
|
|
/// Sound played when the guardian dies.
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier DeathSound = new SoundPathSpecifier("/Audio/Voice/Human/malescream_guardian.ogg", AudioParams.Default.WithVariation(0.2f));
|
|
|
|
/// <summary>
|
|
/// The last time that the entity received an attack popup.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
|
|
public TimeSpan LastAttackPopupTime;
|
|
|
|
/// <summary>
|
|
/// The delay between showing popups to the guardian when trying to attack its host.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan AttackPopupDelay = TimeSpan.FromSeconds(1);
|
|
}
|