[tweak] accent adaptation
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Content.Server.Speech.Components;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Speech.EntitySystems;
|
||||
|
||||
public sealed class LizardAccentSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -26,6 +29,60 @@ public sealed class LizardAccentSystem : EntitySystem
|
||||
// eckS
|
||||
message = Regex.Replace(message, @"\bX([\-|r|R]|\b)", "ECKS$1");
|
||||
|
||||
|
||||
//WD-EDIT
|
||||
|
||||
// c => ссс
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"с+",
|
||||
_random.Pick(new List<string>() { "сс", "ссс" })
|
||||
);
|
||||
// С => CCC
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"С+",
|
||||
_random.Pick(new List<string>() { "Сс", "Ссс" })
|
||||
);
|
||||
// з => ссс
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"з+",
|
||||
_random.Pick(new List<string>() { "сс", "ссс" })
|
||||
);
|
||||
// З => CCC
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"З+",
|
||||
_random.Pick(new List<string>() { "Сс", "Ссс" })
|
||||
);
|
||||
// ш => шшш
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"ш+",
|
||||
_random.Pick(new List<string>() { "шш", "шшш" })
|
||||
);
|
||||
// Ш => ШШШ
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"Ш+",
|
||||
_random.Pick(new List<string>() { "Шш", "Шшш" })
|
||||
);
|
||||
// ч => щщщ
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"ч+",
|
||||
_random.Pick(new List<string>() { "щщ", "щщщ" })
|
||||
);
|
||||
// Ч => ЩЩЩ
|
||||
message = Regex.Replace(
|
||||
message,
|
||||
"Ч+",
|
||||
_random.Pick(new List<string>() { "Щщ", "Щщщ" })
|
||||
);
|
||||
|
||||
//WD-EDIT
|
||||
|
||||
args.Message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,23 +28,23 @@ public sealed class MonkeyAccentSystem : EntitySystem
|
||||
{
|
||||
foreach (var _ in word)
|
||||
{
|
||||
accentedMessage.Append('O');
|
||||
accentedMessage.Append('У'); //WD-EDIT
|
||||
}
|
||||
|
||||
if (_random.NextDouble() >= 0.3)
|
||||
accentedMessage.Append('K');
|
||||
accentedMessage.Append('К'); //WD-EDIT
|
||||
}
|
||||
else
|
||||
accentedMessage.Append('O');
|
||||
accentedMessage.Append('У'); //WD-EDIT
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var _ in word)
|
||||
{
|
||||
if (_random.NextDouble() >= 0.8)
|
||||
accentedMessage.Append('H');
|
||||
accentedMessage.Append('Г'); //WD-EDIT
|
||||
else
|
||||
accentedMessage.Append('A');
|
||||
accentedMessage.Append('А'); //WD-EDIT
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,12 +8,17 @@ namespace Content.Server.Speech.EntitySystems
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
private static readonly IReadOnlyList<string> Faces = new List<string>{
|
||||
" (・`ω´・)", " ;;w;;", " owo", " UwU", " >w<", " ^w^"
|
||||
//WD-EDIT
|
||||
" (`ω´)", " ;;w;;", " owo", " UwU", " >w<", " ^w^"
|
||||
//WD-EDIT
|
||||
}.AsReadOnly();
|
||||
|
||||
private static readonly IReadOnlyDictionary<string, string> SpecialWords = new Dictionary<string, string>()
|
||||
{
|
||||
{ "you", "wu" },
|
||||
//WD-EDIT
|
||||
{ "ты", "ти" }
|
||||
//WD-EDIT
|
||||
};
|
||||
|
||||
public override void Initialize()
|
||||
@@ -30,7 +35,12 @@ namespace Content.Server.Speech.EntitySystems
|
||||
|
||||
return message.Replace("!", _random.Pick(Faces))
|
||||
.Replace("r", "w").Replace("R", "W")
|
||||
.Replace("l", "w").Replace("L", "W");
|
||||
.Replace("l", "w").Replace("L", "W")
|
||||
|
||||
//WD-EDIT
|
||||
.Replace("р", "в").Replace("Р", "В")
|
||||
.Replace("л", "в").Replace("Л", "В");
|
||||
//WD-EDIT
|
||||
}
|
||||
|
||||
private void OnAccent(EntityUid uid, OwOAccentComponent component, AccentGetEvent args)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.Speech.EntitySystems
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
// Regex of characters to stutter.
|
||||
private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz]",
|
||||
private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz-б-вд-к-лмн-прст]", // WD-EDIT
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public override void Initialize()
|
||||
|
||||
@@ -78,17 +78,17 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem
|
||||
|
||||
if (listing.Count == 0)
|
||||
{
|
||||
GeneralStationRecordConsoleState state = new(null, null, null, console.Filter);
|
||||
GeneralStationRecordConsoleState state = new(null, null, null, console!.Filter);
|
||||
SetStateForInterface(uid, state);
|
||||
return;
|
||||
}
|
||||
else if (listing.Count == 1)
|
||||
{
|
||||
console.ActiveKey = listing.Keys.First();
|
||||
console!.ActiveKey = listing.Keys.First();
|
||||
}
|
||||
|
||||
GeneralStationRecord? record = null;
|
||||
if (console.ActiveKey != null)
|
||||
if (console!.ActiveKey != null)
|
||||
{
|
||||
_stationRecordsSystem.TryGetRecord(owningStation.Value, _stationRecordsSystem.Convert(console.ActiveKey.Value), out record,
|
||||
stationRecordsComponent);
|
||||
|
||||
@@ -10,7 +10,11 @@ namespace Content.Shared.Localizations
|
||||
[Dependency] private readonly ILocalizationManager _loc = default!;
|
||||
|
||||
// If you want to change your codebase's language, do it here.
|
||||
|
||||
// WD-EDIT
|
||||
private const string Culture = "ru-RU";
|
||||
|
||||
// WD-EDIT
|
||||
private const string FallbackCulture = "en-US";
|
||||
|
||||
/// <summary>
|
||||
@@ -27,12 +31,18 @@ namespace Content.Shared.Localizations
|
||||
public void Initialize()
|
||||
{
|
||||
var culture = new CultureInfo(Culture);
|
||||
|
||||
// WD-EDIT
|
||||
var fallbackCulture = new CultureInfo(FallbackCulture);
|
||||
|
||||
|
||||
_loc.LoadCulture(culture);
|
||||
|
||||
// WD-EDIT
|
||||
_loc.LoadCulture(fallbackCulture);
|
||||
_loc.SetFallbackCluture(fallbackCulture);
|
||||
// WD-EDIT
|
||||
|
||||
_loc.AddFunction(culture, "PRESSURE", FormatPressure);
|
||||
_loc.AddFunction(culture, "POWERWATTS", FormatPowerWatts);
|
||||
_loc.AddFunction(culture, "POWERJOULES", FormatPowerJoules);
|
||||
|
||||
Reference in New Issue
Block a user