* Add data field for id card microwave behaviour (#28087) * Move replacement chance from ReplacementAccentComponent to ReplacementAccentPrototype (#28049) Move replacement chance to ReplacementAccentPrototype * Resolves Bible summon message being sent to all users (#28104) * Changed PopupEntity overload used to ensure message is only sent to user * Updated uid for PopupEntity call * Updating _popupSystem.PopupEntity call in AttemptSummon * Random book story generator refactor (#28082) * Randomized book overhaul * Fix prototype names * Improved setting paper content * Praise Ratvar * Fix activatable UI popup message spam (#28123) Fixed activatable UI popup message spam * Modify battery assert to avoid floating point errors (#28007) * Update component query benchmarks (#27967) * Add more component query benchmarks. * Rename benchmark * Use non-generic `TryComp()` for metadata & transform (#28133) * sleeper agent appear later into the round and only once (#28160) --------- Co-authored-by: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Co-authored-by: lzk <124214523+lzk228@users.noreply.github.com> Co-authored-by: double_b <40827162+benjamin-burges@users.noreply.github.com> Co-authored-by: Tayrtahn <tayrtahn@gmail.com> Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Co-authored-by: Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Server.Speech.Components
|
|
{
|
|
[Prototype("accent")]
|
|
public sealed partial class ReplacementAccentPrototype : IPrototype
|
|
{
|
|
[ViewVariables]
|
|
[IdDataField]
|
|
public string ID { get; private set; } = default!;
|
|
|
|
/// <summary>
|
|
/// If this array is non-null, the full text of anything said will be randomly replaced with one of these words.
|
|
/// </summary>
|
|
[DataField("fullReplacements")]
|
|
public string[]? FullReplacements;
|
|
|
|
/// <summary>
|
|
/// If this dictionary is non-null and <see cref="FullReplacements"/> is null, any keys surrounded by spaces
|
|
/// (words) will be replaced by the value, attempting to intelligently keep capitalization.
|
|
/// </summary>
|
|
[DataField("wordReplacements")]
|
|
public Dictionary<string, string>? WordReplacements;
|
|
|
|
/// <summary>
|
|
/// Allows you to substitute words, not always, but with some chance
|
|
/// </summary>
|
|
[DataField]
|
|
public float ReplacementChance = 1f;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Replaces full sentences or words within sentences with new strings.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class ReplacementAccentComponent : Component
|
|
{
|
|
[DataField("accent", customTypeSerializer: typeof(PrototypeIdSerializer<ReplacementAccentPrototype>), required: true)]
|
|
public string Accent = default!;
|
|
|
|
}
|
|
}
|