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;
}
}
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems
{
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
using Robust.Shared.Random;
namespace Content.Server.Speech.EntitySystems
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
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;
-using Content.Server.Speech.Components;
using System.Text.RegularExpressions;
+using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
// spaces out ! ? : and ;.
msg = RegexSpacePunctuation.Replace(msg, " $&");
-
+
// replaces th with 'z or 's depending on the case
foreach (Match match in RegexTh.Matches(msg))
{
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
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;
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
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;
using System.Text;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
using Robust.Shared.Random;
namespace Content.Server.Speech.EntitySystems;
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
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;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
using Robust.Shared.Random;
namespace Content.Server.Speech.EntitySystems
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;
using System.Linq;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
using Robust.Shared.Random;
using System.Text.RegularExpressions;
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;
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;
using System.Text;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
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
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
using Robust.Shared.Random;
namespace Content.Server.Speech.EntitySystems;
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
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;
using System.Text.RegularExpressions;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems;
using System.Text;
using Content.Server.Speech.Components;
+using Content.Shared.Speech;
namespace Content.Server.Speech.EntitySystems
{
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;
--- /dev/null
+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;
+ }
+}