]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Accents Event to Shared (#38948)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Sat, 12 Jul 2025 20:52:51 +0000 (13:52 -0700)
committerGitHub <noreply@github.com>
Sat, 12 Jul 2025 20:52:51 +0000 (22:52 +0200)
* 27 file diff

* 27 file diff 2

* Apply suggestions from code review

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
27 files changed:
Content.Server/Speech/AccentSystem.cs
Content.Server/Speech/EntitySystems/BackwardsAccentSystem.cs
Content.Server/Speech/EntitySystems/BarkAccentSystem.cs
Content.Server/Speech/EntitySystems/BleatingAccentSystem.cs
Content.Server/Speech/EntitySystems/DamagedSiliconAccentSystem.cs
Content.Server/Speech/EntitySystems/FrenchAccentSystem.cs
Content.Server/Speech/EntitySystems/FrontalLispSystem.cs
Content.Server/Speech/EntitySystems/GermanAccentSystem.cs
Content.Server/Speech/EntitySystems/LizardAccentSystem.cs
Content.Server/Speech/EntitySystems/MobsterAccentSystem.cs
Content.Server/Speech/EntitySystems/MonkeyAccentSystem.cs
Content.Server/Speech/EntitySystems/MothAccentSystem.cs
Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs
Content.Server/Speech/EntitySystems/OwOAccentSystem.cs
Content.Server/Speech/EntitySystems/ParrotAccentSystem.cs
Content.Server/Speech/EntitySystems/PirateAccentSystem.cs
Content.Server/Speech/EntitySystems/RatvarianLanguageSystem.cs
Content.Server/Speech/EntitySystems/ReplacementAccentSystem.cs
Content.Server/Speech/EntitySystems/RussianAccentSystem.cs
Content.Server/Speech/EntitySystems/ScrambledAccentSystem.cs
Content.Server/Speech/EntitySystems/SkeletonAccentSystem.cs
Content.Server/Speech/EntitySystems/SlowAccentSystem.cs
Content.Server/Speech/EntitySystems/SlurredSystem.cs
Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs
Content.Server/Speech/EntitySystems/SpanishAccentSystem.cs
Content.Server/Speech/EntitySystems/StutteringSystem.cs
Content.Shared/Speech/AccentEvent.cs [new file with mode: 0644]

index 7e29f02caece20ea5b09a592df913672df56473c..e413dd52f8ae1b0ead31c2baf4aa8d2c304be72e 100644 (file)
@@ -1,44 +1,23 @@
 using System.Text.RegularExpressions;
-using Content.Server.Chat;
 using Content.Server.Chat.Systems;
+using Content.Shared.Speech;
 
-namespace Content.Server.Speech
-{
-    public sealed class AccentSystem : EntitySystem
-    {
-        public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?‽])(?![\.!\?‽])", RegexOptions.Compiled);
-
-        public override void Initialize()
-        {
-            SubscribeLocalEvent<TransformSpeechEvent>(AccentHandler);
-        }
+namespace Content.Server.Speech;
 
-        private void AccentHandler(TransformSpeechEvent args)
-        {
-            var accentEvent = new AccentGetEvent(args.Sender, args.Message);
+public sealed class AccentSystem : EntitySystem
+{
+    public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?‽])(?![\.!\?‽])", RegexOptions.Compiled);
 
-            RaiseLocalEvent(args.Sender, accentEvent, true);
-            args.Message = accentEvent.Message;
-        }
+    public override void Initialize()
+    {
+        SubscribeLocalEvent<TransformSpeechEvent>(AccentHandler);
     }
 
-    public sealed class AccentGetEvent : EntityEventArgs
+    private void AccentHandler(TransformSpeechEvent args)
     {
-        /// <summary>
-        ///     The entity to apply the accent to.
-        /// </summary>
-        public EntityUid Entity { get; }
-
-        /// <summary>
-        ///     The message to apply the accent transformation to.
-        ///     Modify this to apply the accent.
-        /// </summary>
-        public string Message { get; set; }
+        var accentEvent = new AccentGetEvent(args.Sender, args.Message);
 
-        public AccentGetEvent(EntityUid entity, string message)
-        {
-            Entity = entity;
-            Message = message;
-        }
+        RaiseLocalEvent(args.Sender, accentEvent, true);
+        args.Message = accentEvent.Message;
     }
 }
index db69c869954cb01b9444a5eb4156c093fdc52a0d..cad96e7d0404f9d42f1b1590274cd7c465106bf3 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems
 {
index a6e5b68ffc85f11fda6dfee690eaba65d2313537..927b1259adbd89015ec04769a253579f3253f7ef 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems
index 903377477e78b9903cbe26d01cba79f9f47c565e..8dc358a4b49af362c2c7b2d561c4810a9a9aea39 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 47f36cafc4244ebbadd880f6cfd8ae17a2c4a5c9..d4a37a07cd61241e3b5c54ada52be91e5f464b32 100644 (file)
@@ -4,6 +4,7 @@ using Content.Server.PowerCell;
 using Content.Shared.Speech.Components;
 using Content.Shared.Damage;
 using Content.Shared.FixedPoint;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems;
index 1b7c46e13a0d467ee6bb9b14db00f0b827042e8c..caefe3ef2d64648518945e99f625ba24a51e587f 100644 (file)
@@ -1,5 +1,6 @@
-using Content.Server.Speech.Components;
 using System.Text.RegularExpressions;
+using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
@@ -32,7 +33,7 @@ public sealed class FrenchAccentSystem : EntitySystem
 
         // spaces out ! ? : and ;.
         msg = RegexSpacePunctuation.Replace(msg, " $&");
-        
+
         // replaces th with 'z or 's depending on the case
         foreach (Match match in RegexTh.Matches(msg))
         {
index 1508a8b2d4342b7886a1f5e68dce4da29cb2a9e8..b3f5ff53dc8251e56e6b9932f336c1dc021a0c93 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 1973d38afb69c4b8d9d165cd356d63153eb2749a..94a5606178bd5e925cee1510276f0cd6079ff06f 100644 (file)
@@ -1,7 +1,8 @@
 using System.Text;
+using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
-using System.Text.RegularExpressions;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 81a57cb848cddfd97538e31ae238a953f3a47c65..48a4a4630cfaff36084bc4ca09d88c629a440969 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 5906bf3ed492e5380d9091d8b0521884d8707120..6048db5eb2d93e2f15119d454aad8676de074faa 100644 (file)
@@ -1,6 +1,7 @@
 using System.Linq;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems;
index f2813d8245c970df227e81771237edbf654ef933..0f42d933246fdbf130c2a409a781f13ab7c6199e 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems;
index 84b79d4ce98b6576762bee939747a88960a82f2b..3bf46459ace24cb8363bf9e43d41fd2f8d8e2daf 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 57469a25aae9dc0bed30b106c0b9b5bd3faf1001..27679c913467e6840cc4aab91e01c9e9f886fa54 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.Chat.Systems;
 using Content.Server.Speech.Components;
 using Content.Shared.Chat.Prototypes;
+using Content.Shared.Speech;
 using Content.Shared.Speech.Components;
 using Robust.Shared.Prototypes;
 
index 2b3d5aa3d491e1edc85261d6cef3d2499b618105..ff930e524abd248814dfe1c2e02bc55673280352 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems
index ae8fe522b9b41a4dd21ae50671d98f6ff374fef4..9bd3be25aee4af197b30fd797cb584225378ca57 100644 (file)
@@ -1,6 +1,7 @@
 using System.Linq;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems;
index 84298cbf01a668f8149e8bf7b4cf045639404d7e..ff2c5913e01b0677af8ecfe8b446621a8a45946c 100644 (file)
@@ -1,5 +1,6 @@
 using System.Linq;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 using System.Text.RegularExpressions;
 
index 508f85aac274cab3dbcfc3394c48622b323773ed..39b040b75f0b56330de838acbcb37c0477c37621 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text;
 using System.Text.RegularExpressions;
+using Content.Shared.Speech;
 using Content.Shared.Speech.Components;
 using Content.Shared.Speech.EntitySystems;
 using Content.Shared.StatusEffect;
index 656a72b3f97d1165980fd91c86cc46cbbf6b165b..5b215e9bea8ab9d2b08de536fdb54307ea68b0fd 100644 (file)
@@ -2,6 +2,7 @@ using System.Linq;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
 using Content.Server.Speech.Prototypes;
+using Content.Shared.Speech;
 using JetBrains.Annotations;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index 49aab38e2b75472afe6eef1e5c77f16a9e47a2a1..5c49ecbde7c853bddb8e81e1d0bfd00ca3f61de6 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 8a61c0ea500fb0f6b241d45fe6c4ff6b1ab0ae81..d685edc38bba888bdd625cb8df6fb15e556c2dc4 100644 (file)
@@ -1,6 +1,7 @@
 using System.Linq;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems
index 1b773f1a5ac132d03ac7ee67f7db0ec989e41783..73d8c0665e03b2732590b393057750e21fff0982 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems;
index 5a94b0a4d6eb502d5ce73f8845c65b75f0f684cd..0a4ac02f3fe19324507d46bba831e73b4f84f114 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index fbfe72f17f6fbd3142e6171e9e1681e595a364b8..5ac1ba037f21238ab16eb3f9862803c1be693a6d 100644 (file)
@@ -1,6 +1,7 @@
 using System.Text;
 using Content.Server.Speech.Components;
 using Content.Shared.Drunk;
+using Content.Shared.Speech;
 using Content.Shared.Speech.EntitySystems;
 using Content.Shared.StatusEffect;
 using Robust.Shared.Prototypes;
index c1f8a0be30bee0fda40ef8b2c3e7136e03f8470a..6bf64ccabd21a03e10ea2c7b1e743506b99a09e8 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems;
 
index 08642014c90cafaae6454dc926775d1ea187623e..cf0c7dfcd2e82f9e407ba4423ac62275701591fd 100644 (file)
@@ -1,5 +1,6 @@
 using System.Text;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 
 namespace Content.Server.Speech.EntitySystems
 {
index d6e3c0b749a83fe3d1a5578431e4cdab8c921002..f47bff3523f4f4b46ccf6106484c71dc841563f0 100644 (file)
@@ -1,6 +1,7 @@
 using System.Text;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
+using Content.Shared.Speech;
 using Content.Shared.Speech.EntitySystems;
 using Content.Shared.StatusEffect;
 using Robust.Shared.Random;
diff --git a/Content.Shared/Speech/AccentEvent.cs b/Content.Shared/Speech/AccentEvent.cs
new file mode 100644 (file)
index 0000000..9b90709
--- /dev/null
@@ -0,0 +1,21 @@
+namespace Content.Shared.Speech;
+
+public sealed class AccentGetEvent : EntityEventArgs
+{
+    /// <summary>
+    ///     The entity to apply the accent to.
+    /// </summary>
+    public EntityUid Entity { get; }
+
+    /// <summary>
+    ///     The message to apply the accent transformation to.
+    ///     Modify this to apply the accent.
+    /// </summary>
+    public string Message { get; set; }
+
+    public AccentGetEvent(EntityUid entity, string message)
+    {
+        Entity = entity;
+        Message = message;
+    }
+}