using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Bible.Components; /// /// This lets you summon a mob or item with an alternative verb on the item /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause] [Access(typeof(BibleSystem))] public sealed partial class SummonableComponent : Component { /// /// Default sound to play when entity is summoned. /// private static readonly ProtoId DefaultSummonSound = new("Summon"); /// /// Sound to play when entity is summoned. /// [DataField] public SoundSpecifier SummonSound = new SoundCollectionSpecifier(DefaultSummonSound, AudioParams.Default.AddVolume(-4f)); /// /// Used for a special item only the Chaplain can summon. Usually a mob, but supports regular items too. /// [DataField("summonEntity")] public EntProtoId? SummonEntityPrototype; /// /// The summon action for component to use. /// [DataField("summonAction")] public EntProtoId SummonActionPrototype = "ActionBibleSummon"; /// /// The specific creature this summoned, if the SpecialItemPrototype has a mobstate. /// [ViewVariables, AutoNetworkedField] public EntityUid? SummonedEntity = null; /// /// The created summon action. /// [DataField, AutoNetworkedField] public EntityUid? SummonActionEntity; /// /// Whether or not user must have . /// [DataField] public bool RequiresBibleUser = true; /// /// Whether or not summoning is allowed at the moment. /// [ViewVariables, AutoNetworkedField] public bool CanSummon = true; /// /// Loc string for the summon alt-verb text. /// [DataField] public string SummonVerbText = "bible-summon-verb"; /// /// Loc string shown when a summon has been requested and is awaiting a soul. /// [DataField] public string SummonRequestedText = "bible-summon-requested"; /// /// Loc string shown when the familiar has respawned and is ready to summon again. /// [DataField] public string SummonRespawnReadyText = "bible-summon-respawn-ready"; /// /// Cooldown before being able to summon a new entity. /// [DataField] public TimeSpan RespawnCooldown = TimeSpan.FromSeconds(180); /// /// Time after which summoning will be allowed. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField] public TimeSpan RespawnTime = TimeSpan.Zero; }