mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Exception now meows when an error occurs
* tweaks
* Add to real mouse
* 1984 😔
* Sussy entity effect
* Comment
* More errors
* Other fixes
* opps
* fixes
* cleanup
* Cleanup
* Remove saving last message
* runtime as well!
* Make logger private, clean up error has occured to boolean instead of string
* Add auto pause and time offset serializer
* Properly block accent when speaking (sometimes)
* Add package
* Fix
* Review
* fix
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using Content.Shared.Dataset;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Server.RuntimeFun;
|
|
|
|
/// <summary>
|
|
/// Entities with this component will speak from a dataset everytime an error occurs in an interval.
|
|
/// </summary>
|
|
[RegisterComponent, AutoGenerateComponentPause]
|
|
public sealed partial class SpeakOnExceptionComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Minimum time between error speech events.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan SpeechCooldown = TimeSpan.FromMinutes(1);
|
|
|
|
/// <summary>
|
|
/// The chance to speak without an accent.
|
|
/// </summary>
|
|
[DataField]
|
|
public float ChanceSpeakNoAccent = 0.005f;
|
|
|
|
/// <summary>
|
|
/// Localized dataset used when speaking.
|
|
/// </summary>
|
|
[DataField]
|
|
public ProtoId<LocalizedDatasetPrototype> Dataset = "ExceptionSpeechDataset";
|
|
|
|
/// <summary>
|
|
/// The next time the entity can say another error.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
|
|
public TimeSpan? NextTimeCanSpeak;
|
|
|
|
/// <summary>
|
|
/// If this component is currently trying to block accents from working.
|
|
/// </summary>
|
|
public bool BlockAccent;
|
|
}
|