Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cat accent Trait #2151

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Content.Server/_NF/Speech/Components/CatAccentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Server._NF.Speech.EntitySystems;

namespace Content.Server._NF.Speech.Components;

[RegisterComponent]
[Access(typeof(CatAccentSystem))]
public sealed partial class CatAccentComponent : Component
{ }
49 changes: 49 additions & 0 deletions Content.Server/_NF/Speech/EntitySystems/CatAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Content.Server._NF.Speech.Components;
using Content.Server.Speech;
using Robust.Shared.Random;
using Content.Server.Speech.EntitySystems;
using System.Text.RegularExpressions;

namespace Content.Server._NF.Speech.EntitySystems;

public sealed class CatAccentSystem : EntitySystem
{
private static readonly Regex RegexEr = new(@"(\w*[^pPfF])er\b", RegexOptions.IgnoreCase); // Words ending in "er"
private static readonly Regex RegexErn = new(@"\b(\w*ern)\b", RegexOptions.IgnoreCase); // Words ending in "ern"
private static readonly Regex RegexOr = new(@"\b(\w*or)\b", RegexOptions.IgnoreCase); // Words ending in "or"
private static readonly Regex RegexR = new(@"r", RegexOptions.IgnoreCase); // Regex to match 'r'

[Dependency] private readonly ReplacementAccentSystem _replacement = default!;
[Dependency] private readonly IRobustRandom _random = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CatAccentComponent, AccentGetEvent>(OnAccent);
}

private void OnAccent(EntityUid uid, CatAccentComponent component, AccentGetEvent args)
{
var message = args.Message;

message = _replacement.ApplyReplacements(message, "cat_accent");
message = RegexErn.Replace(message, "$ewn"); // replace words ending with "ern" -> "ewn"
message = RegexOr.Replace(message, "$ow"); // replace words ending with "or" -> "ow"

// Replace 'r' with 'rrr' or 'w' based on random chance, while preserving case
message = RegexR.Replace(message, match =>
{
// Check if the matched character is uppercase
if (char.IsUpper(match.Value[0]))
{
return _random.Prob(0.5f) ? "RRR" : "W"; // Uppercase replacement
}
else
{
return _random.Prob(0.5f) ? "rrr" : "w"; // Lowercase replacement
}
});

args.Message = message;
}
}
202 changes: 202 additions & 0 deletions Resources/Locale/en-US/_NF/accent/cat_accent.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
accent-cat-words-1 = Howdy
accent-cat-words-2 = Hello
accent-cat-words-3 = Hey
accent-cat-words-4 = Yes
accent-cat-words-5 = No
accent-cat-words-6 = Okay
accent-cat-words-7 = Please
accent-cat-words-8 = Friend
accent-cat-words-9 = You
accent-cat-words-10 = Me
accent-cat-words-11 = Now
accent-cat-words-12 = Bye
accent-cat-words-13 = Stop
accent-cat-words-14 = Wait
accent-cat-words-15 = Good
accent-cat-words-16 = Bad
accent-cat-words-17 = Thank you
accent-cat-words-18 = Wow
accent-cat-words-19 = Help
accent-cat-words-20 = Oops
accent-cat-words-21 = Sullivan
accent-cat-words-22 = Dog
accent-cat-words-23 = Fish
accent-cat-words-24 = Food
accent-cat-words-25 = Water
accent-cat-words-26 = Happy
accent-cat-words-27 = Sad
accent-cat-words-28 = Love
accent-cat-words-29 = Play
accent-cat-words-30 = Sleep
accent-cat-words-31 = Run
accent-cat-words-32 = Jump
accent-cat-words-33 = Dance
accent-cat-words-34 = Sing
accent-cat-words-35 = Watch
accent-cat-words-36 = Work
accent-cat-words-37 = Together
accent-cat-words-38 = Always
accent-cat-words-39 = Never
accent-cat-words-40 = Smart
accent-cat-words-41 = Loveable
accent-cat-words-42 = Cute
accent-cat-words-43 = Funny
accent-cat-words-44 = Happy
accent-cat-words-45 = Angry
accent-cat-words-46 = Sad
accent-cat-words-47 = Smart
accent-cat-words-48 = Sneaky
accent-cat-words-49 = Brave
accent-cat-words-50 = Tired
accent-cat-words-51 = Quiet
accent-cat-words-52 = Loud
accent-cat-words-53 = Chill
accent-cat-words-54 = Cool
accent-cat-words-55 = Cranky
accent-cat-words-56 = Sleepy
accent-cat-words-57 = Dream
accent-cat-words-58 = Gift
accent-cat-words-59 = Treat
accent-cat-words-60 = Snack
accent-cat-words-61 = Playful
accent-cat-words-62 = Gentle
accent-cat-words-63 = Clumsy
accent-cat-words-64 = Clever
accent-cat-words-65 = Friendly
accent-cat-words-66 = Shy
accent-cat-words-67 = Bold
accent-cat-words-68 = Sweet
accent-cat-words-69 = Spicy
accent-cat-words-70 = Silly
accent-cat-words-71 = Gloomy
accent-cat-words-72 = Grumpy
accent-cat-words-73 = Smuggler
accent-cat-words-74 = Fluffy
accent-cat-words-75 = Huggable
accent-cat-words-76 = Cuddly
accent-cat-words-77 = Bright
accent-cat-words-78 = Lucky
accent-cat-words-79 = Joyful
accent-cat-words-80 = Creative
accent-cat-words-81 = Happy
accent-cat-words-82 = Angry
accent-cat-words-83 = Sad
accent-cat-words-84 = Excited
accent-cat-words-85 = Bored
accent-cat-words-86 = Tired
accent-cat-words-87 = Witty
accent-cat-words-88 = Sneaky
accent-cat-words-89 = Brave
accent-cat-words-90 = Silly
accent-cat-words-91 = Friendly
accent-cat-words-92 = Curious
accent-cat-words-93 = Nervous
accent-cat-words-94 = Sassy
accent-cat-words-95 = Peaceful
accent-cat-words-96 = Artistic
accent-cat-words-97 = Romantic
accent-cat-words-98 = Adventurous
accent-cat-words-99 = Them
accent-cat-words-100 = Outpost


accent-cat-words-replace-1 = Meowdy
accent-cat-words-replace-2 = Hewwo
accent-cat-words-replace-3 = Mewo
accent-cat-words-replace-4 = Ya
accent-cat-words-replace-5 = Nyo
accent-cat-words-replace-6 = Nyokay
accent-cat-words-replace-7 = Purrlease
accent-cat-words-replace-8 = Furriend
accent-cat-words-replace-9 = Youw
accent-cat-words-replace-10 = Mewself
accent-cat-words-replace-11 = Meow
accent-cat-words-replace-12 = Meow-bye
accent-cat-words-replace-13 = Stop it
accent-cat-words-replace-14 = Wait a meowment
accent-cat-words-replace-15 = Purrfect
accent-cat-words-replace-16 = Pawful
accent-cat-words-replace-17 = Nyank you
accent-cat-words-replace-18 = Meow-wow
accent-cat-words-replace-19 = Hisselp
accent-cat-words-replace-20 = Uh-oh-mew
accent-cat-words-replace-21 = Sullinyan
accent-cat-words-replace-22 = Doggo
accent-cat-words-replace-23 = Fishy
accent-cat-words-replace-24 = Noms
accent-cat-words-replace-25 = Meowter
accent-cat-words-replace-26 = Purrfect
accent-cat-words-replace-27 = Nyansad
accent-cat-words-replace-28 = Nyolove
accent-cat-words-replace-29 = Purrlay
accent-cat-words-replace-30 = Naps
accent-cat-words-replace-31 = Meow-wun
accent-cat-words-replace-32 = Nyump
accent-cat-words-replace-33 = Purrdance
accent-cat-words-replace-34 = Neko sing
accent-cat-words-replace-35 = Meowtch
accent-cat-words-replace-36 = Nyawork
accent-cat-words-replace-37 = Togethews
accent-cat-words-replace-38 = Nyalways
accent-cat-words-replace-39 = Nyenever
accent-cat-words-replace-40 = Smuwt
accent-cat-words-replace-41 = Lovable
accent-cat-words-replace-42 = Kawaii
accent-cat-words-replace-43 = Meowny
accent-cat-words-replace-44 = Purrfectly
accent-cat-words-replace-45 = Meowgry
accent-cat-words-replace-46 = Nyansad
accent-cat-words-replace-47 = Purrsmart
accent-cat-words-replace-48 = Sneaksy
accent-cat-words-replace-49 = Braffy
accent-cat-words-replace-50 = Nyired
accent-cat-words-replace-51 = Nyquiet
accent-cat-words-replace-52 = Loudny
accent-cat-words-replace-53 = Chillax
accent-cat-words-replace-54 = Coolny
accent-cat-words-replace-55 = Cranky
accent-cat-words-replace-56 = Sleapy
accent-cat-words-replace-57 = Dreamy
accent-cat-words-replace-58 = Gifty
accent-cat-words-replace-59 = Treated
accent-cat-words-replace-60 = Nyack
accent-cat-words-replace-61 = Playny
accent-cat-words-replace-62 = Purrgentle
accent-cat-words-replace-63 = Clumsynyan
accent-cat-words-replace-64 = Clevernyan
accent-cat-words-replace-65 = Furriendly
accent-cat-words-replace-66 = Shynyan
accent-cat-words-replace-67 = Boldny
accent-cat-words-replace-68 = Sweetny
accent-cat-words-replace-69 = Spicynyan
accent-cat-words-replace-70 = Sillynya
accent-cat-words-replace-71 = Gloomy
accent-cat-words-replace-72 = Grumpynyan
accent-cat-words-replace-73 = Smuwgler
accent-cat-words-replace-74 = Fluffynya
accent-cat-words-replace-75 = Huggles
accent-cat-words-replace-76 = Cuddlypaws
accent-cat-words-replace-77 = Brightny
accent-cat-words-replace-78 = Luckynya
accent-cat-words-replace-79 = Joyny
accent-cat-words-replace-80 = Creativny
accent-cat-words-replace-81 = Nyaappy
accent-cat-words-replace-82 = Meowgry
accent-cat-words-replace-83 = Nyansad
accent-cat-words-replace-84 = Nyaexcited
accent-cat-words-replace-85 = Bore-nyan
accent-cat-words-replace-86 = Nyired
accent-cat-words-replace-87 = Wittynya
accent-cat-words-replace-88 = Sneaky
accent-cat-words-replace-89 = Bravepaw
accent-cat-words-replace-90 = Sillypaws
accent-cat-words-replace-91 = Furrriend
accent-cat-words-replace-92 = Curiousnyan
accent-cat-words-replace-93 = Nervousnyan
accent-cat-words-replace-94 = Sassynyan
accent-cat-words-replace-95 = Peacefurr
accent-cat-words-replace-96 = Artisny
accent-cat-words-replace-97 = Romantnyan
accent-cat-words-replace-98 = Advennyture
accent-cat-words-replace-99 = Nyem
accent-cat-words-replace-100 = Catpost
5 changes: 4 additions & 1 deletion Resources/Locale/en-US/_NF/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ trait-stinky-in-range-self = Something smells foul!
trait-goblin-accent-name = Goblin cant
trait-goblin-accent-desc = You speak in secret language many find annoying and not that secretive.

trait-cat-accent-name = Cat Talk
trait-cat-accent-desc = You speak the langue of REDACTED, you must be crazy to understand it.

trait-pious-name = Pious
trait-pious-desc = You are in touch with the gods, but your vows keep you from striking in anger.

Expand All @@ -20,4 +23,4 @@ trait-clumsy-desc = You are very clumsy! Certain actions, like shooting, are mor

# These traits are bound to be replaced with a slider, but they live here for now.
trait-tall-name = Tall
trait-short-name = Short
trait-short-name = Short
104 changes: 104 additions & 0 deletions Resources/Prototypes/_NF/Accents/word_replacements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -777,3 +777,107 @@
accent-streetpunk-replaced-341: accent-streetpunk-replacement-341
accent-streetpunk-replaced-342: accent-streetpunk-replacement-342
accent-streetpunk-replaced-343: accent-streetpunk-replacement-343

- type: accent
id: cat_accent
wordReplacements:
accent-cat-words-1: accent-cat-words-replace-1
accent-cat-words-2: accent-cat-words-replace-2
accent-cat-words-3: accent-cat-words-replace-3
accent-cat-words-4: accent-cat-words-replace-4
accent-cat-words-5: accent-cat-words-replace-5
accent-cat-words-6: accent-cat-words-replace-6
accent-cat-words-7: accent-cat-words-replace-7
accent-cat-words-8: accent-cat-words-replace-8
accent-cat-words-9: accent-cat-words-replace-9
accent-cat-words-10: accent-cat-words-replace-10
accent-cat-words-11: accent-cat-words-replace-11
accent-cat-words-12: accent-cat-words-replace-12
accent-cat-words-13: accent-cat-words-replace-13
accent-cat-words-14: accent-cat-words-replace-14
accent-cat-words-15: accent-cat-words-replace-15
accent-cat-words-16: accent-cat-words-replace-16
accent-cat-words-17: accent-cat-words-replace-17
accent-cat-words-18: accent-cat-words-replace-18
accent-cat-words-19: accent-cat-words-replace-19
accent-cat-words-20: accent-cat-words-replace-20
accent-cat-words-21: accent-cat-words-replace-21
accent-cat-words-22: accent-cat-words-replace-22
accent-cat-words-23: accent-cat-words-replace-23
accent-cat-words-24: accent-cat-words-replace-24
accent-cat-words-25: accent-cat-words-replace-25
accent-cat-words-26: accent-cat-words-replace-26
accent-cat-words-27: accent-cat-words-replace-27
accent-cat-words-28: accent-cat-words-replace-28
accent-cat-words-29: accent-cat-words-replace-29
accent-cat-words-30: accent-cat-words-replace-30
accent-cat-words-31: accent-cat-words-replace-31
accent-cat-words-32: accent-cat-words-replace-32
accent-cat-words-33: accent-cat-words-replace-33
accent-cat-words-34: accent-cat-words-replace-34
accent-cat-words-35: accent-cat-words-replace-35
accent-cat-words-36: accent-cat-words-replace-36
accent-cat-words-37: accent-cat-words-replace-37
accent-cat-words-38: accent-cat-words-replace-38
accent-cat-words-39: accent-cat-words-replace-39
accent-cat-words-40: accent-cat-words-replace-40
accent-cat-words-41: accent-cat-words-replace-41
accent-cat-words-42: accent-cat-words-replace-42
accent-cat-words-43: accent-cat-words-replace-43
accent-cat-words-44: accent-cat-words-replace-44
accent-cat-words-45: accent-cat-words-replace-45
accent-cat-words-46: accent-cat-words-replace-46
accent-cat-words-47: accent-cat-words-replace-47
accent-cat-words-48: accent-cat-words-replace-48
accent-cat-words-49: accent-cat-words-replace-49
accent-cat-words-50: accent-cat-words-replace-50
accent-cat-words-51: accent-cat-words-replace-51
accent-cat-words-52: accent-cat-words-replace-52
accent-cat-words-53: accent-cat-words-replace-53
accent-cat-words-54: accent-cat-words-replace-54
accent-cat-words-55: accent-cat-words-replace-55
accent-cat-words-56: accent-cat-words-replace-56
accent-cat-words-57: accent-cat-words-replace-57
accent-cat-words-58: accent-cat-words-replace-58
accent-cat-words-59: accent-cat-words-replace-59
accent-cat-words-60: accent-cat-words-replace-60
accent-cat-words-61: accent-cat-words-replace-61
accent-cat-words-62: accent-cat-words-replace-62
accent-cat-words-63: accent-cat-words-replace-63
accent-cat-words-64: accent-cat-words-replace-64
accent-cat-words-65: accent-cat-words-replace-65
accent-cat-words-66: accent-cat-words-replace-66
accent-cat-words-67: accent-cat-words-replace-67
accent-cat-words-68: accent-cat-words-replace-68
accent-cat-words-69: accent-cat-words-replace-69
accent-cat-words-70: accent-cat-words-replace-70
accent-cat-words-71: accent-cat-words-replace-71
accent-cat-words-72: accent-cat-words-replace-72
accent-cat-words-73: accent-cat-words-replace-73
accent-cat-words-74: accent-cat-words-replace-74
accent-cat-words-75: accent-cat-words-replace-75
accent-cat-words-76: accent-cat-words-replace-76
accent-cat-words-77: accent-cat-words-replace-77
accent-cat-words-78: accent-cat-words-replace-78
accent-cat-words-79: accent-cat-words-replace-79
accent-cat-words-80: accent-cat-words-replace-80
accent-cat-words-81: accent-cat-words-replace-81
accent-cat-words-82: accent-cat-words-replace-82
accent-cat-words-83: accent-cat-words-replace-83
accent-cat-words-84: accent-cat-words-replace-84
accent-cat-words-85: accent-cat-words-replace-85
accent-cat-words-86: accent-cat-words-replace-86
accent-cat-words-87: accent-cat-words-replace-87
accent-cat-words-88: accent-cat-words-replace-88
accent-cat-words-89: accent-cat-words-replace-89
accent-cat-words-90: accent-cat-words-replace-90
accent-cat-words-91: accent-cat-words-replace-91
accent-cat-words-92: accent-cat-words-replace-92
accent-cat-words-93: accent-cat-words-replace-93
accent-cat-words-94: accent-cat-words-replace-94
accent-cat-words-95: accent-cat-words-replace-95
accent-cat-words-96: accent-cat-words-replace-96
accent-cat-words-97: accent-cat-words-replace-97
accent-cat-words-98: accent-cat-words-replace-98
accent-cat-words-99: accent-cat-words-replace-99
accent-cat-words-100: accent-cat-words-replace-100
9 changes: 9 additions & 0 deletions Resources/Prototypes/_NF/Traits/speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@
cost: 2
components:
- type: GoblinAccent

- type: trait
id: CatAccent
name: trait-cat-accent-name
description: trait-cat-accent-desc
category: SpeechTraits
cost: 2
components:
- type: CatAccent
Loading