diff --git a/Content.Server/Chat/Systems/ChatSystem.Emote.cs b/Content.Server/Chat/Systems/ChatSystem.Emote.cs index 8bba76dadda..bd1b944db30 100644 --- a/Content.Server/Chat/Systems/ChatSystem.Emote.cs +++ b/Content.Server/Chat/Systems/ChatSystem.Emote.cs @@ -1,4 +1,5 @@ using System.Collections.Frozen; +using System.Linq; using Content.Shared.Chat.Prototypes; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -9,6 +10,7 @@ namespace Content.Server.Chat.Systems; public partial class ChatSystem { private FrozenDictionary _wordEmoteDict = FrozenDictionary.Empty; + private IReadOnlyList Punctuation { get; } = new List { ",", ".", "!", "?", "-", "~", "'", "\"", }; protected override void OnPrototypeReload(PrototypesReloadedEventArgs obj) { @@ -150,6 +152,10 @@ public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype? proto, string private void TryEmoteChatInput(EntityUid uid, string textInput) { var actionLower = textInput.ToLower(); + // Replace ending punctuation with nothing + if (Punctuation.Any(punctuation => actionLower.EndsWith(punctuation))) + actionLower = actionLower.Remove(actionLower.Length - 1); + if (!_wordEmoteDict.TryGetValue(actionLower, out var emote)) return; diff --git a/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml b/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml index 270470e702d..29f75d0d509 100644 --- a/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml +++ b/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml @@ -1,198 +1,64 @@ - type: emote id: HarpyRing category: Vocal - chatMessages: [rings.] + chatMessages: [ rings ] chatTriggers: - - ring - - ring. - - ring! - - ring? - rings - - rings. - - rings! - - rings? - - ringing - - ringing. - - ringing! - - ringing? - - ringed - - ringed. - - ringed! - - ringed? - - rang - - rang. - - rang! - - rang? - type: emote id: HarpyPew category: Vocal - chatMessages: [pews.] + chatMessages: [ pews ] chatTriggers: - - pew - - pew. - - pew! - - pew? - pews - - pews. - - pews! - - pews? - - pewpew - - pewpew. - - pewpew! - - pewpew? + - pewpews - type: emote id: HarpyBang category: Vocal - chatMessages: [bangs.] + chatMessages: [ bangs ] chatTriggers: - - bang - - bang. - - bang! - - bang? - bangs - - bangs. - - bangs! - - bangs? - - banging - - banging. - - banging! - - banging? - - banged - - banged. - - banged! - - banged? - type: emote id: HarpyRev category: Vocal - chatMessages: [revs.] + chatMessages: [ revs ] chatTriggers: - - rev - - rev. - - rev! - - rev? - revs - - revs. - - revs! - - revs? - - revving - - revving. - - revving! - - revving? - - revved - - revved. - - revved! - - revved? - type: emote id: HarpyCaw category: Vocal - chatMessages: [caws.] + chatMessages: [ caws ] chatTriggers: - - caw - - caw. - - caw! - - caw? - caws - - caws. - - caws! - - caws? - - cawing - - cawing. - - cawing! - - cawing? - - cawed - - cawed. - - cawed! - - cawed? #Vulpkanin - type: emote id: Bark category: Vocal - chatMessages: [barks.] + chatMessages: [ barks ] chatTriggers: - - bark - - bark. - - bark! - - bark? - barks - - barks. - - barks! - - barks? - - barked - - barked. - - barked! - - barked? - - barking - - barking. - - barking! - - barking? - type: emote id: Snarl category: Vocal - chatMessages: [snarls.] + chatMessages: [ snarls ] chatTriggers: - - snarl - - snarl. - - snarl! - - snarl? - snarls - - snarls. - - snarls! - - snarls? - - snarled - - snarled. - - snarled! - - snarled? - - snarling - - snarling. - - snarling! - - snarling? - type: emote id: Whine category: Vocal - chatMessages: [whines.] + chatMessages: [ whines ] chatTriggers: - - whine - - whine. - - whine! - - whine? - whines - - whines. - - whines! - - whines? - - whined - - whined. - - whined! - - whined? - - whining - - whining. - - whining! - - whining? - type: emote id: Howl category: Vocal - chatMessages: [howls.] + chatMessages: [ howls ] chatTriggers: - - howl - - howl. - - howl! - - howl? - howls - - howls. - - howls! - - howls? - - howling - - howling. - - howling! - - howling? - - howled - - howled. - - howling! - - howling? diff --git a/Resources/Prototypes/Nyanotrasen/Voice/speech_emotes.yml b/Resources/Prototypes/Nyanotrasen/Voice/speech_emotes.yml index 697a925d896..fa471f3d705 100644 --- a/Resources/Prototypes/Nyanotrasen/Voice/speech_emotes.yml +++ b/Resources/Prototypes/Nyanotrasen/Voice/speech_emotes.yml @@ -2,72 +2,37 @@ - type: emote id: Hiss category: Vocal - chatMessages: [hisses.] + chatMessages: [ hisses ] chatTriggers: - - hiss. - - hisses. - - hisses! - - hissing. - - hissed. + - hisses - type: emote id: Meow category: Vocal - chatMessages: [meows.] + chatMessages: [ meows ] chatTriggers: - - meow. - - meow! - - meows. - - meows~ - - meows! - - meowing. - - meowed. - - miau. - - miaus. - - miaus! - - nya. - - nyas. - - nyas! - - mraow. - - mraow! - - mraow~ - - mraows. - - mraows! - - mraows~ + - meows + - miaus + - nyas + - mraows - type: emote id: Mew category: Vocal - chatMessages: [mews.] + chatMessages: [ mews ] chatTriggers: - - mew. - - mew! - - mew~ - - mews. - - mews! - - mews~ - - mewing. - - mewed. + - mews - type: emote id: Growl category: Vocal - chatMessages: [growls.] + chatMessages: [ growls ] chatTriggers: - - growl. - - growls. - - growls! - - growling. - - growled. + - growls - type: emote id: Purr category: Vocal - chatMessages: [purrs.] + chatMessages: [ purrs ] chatTriggers: - - purr. - - purrs. - - purrs~ - - purrs! - - purring. - - purred. + - purrs diff --git a/Resources/Prototypes/Voice/disease_emotes.yml b/Resources/Prototypes/Voice/disease_emotes.yml index af93025cae0..7845fd3e6d2 100644 --- a/Resources/Prototypes/Voice/disease_emotes.yml +++ b/Resources/Prototypes/Voice/disease_emotes.yml @@ -1,45 +1,43 @@ - type: emote id: Sneeze category: Vocal - chatMessages: [sneezes] - + chatMessages: [ sneezes ] + - type: emote id: Cough category: Vocal - chatMessages: [coughs] + chatMessages: [ coughs ] chatTriggers: - - cough - coughs - type: emote id: CatMeow category: Vocal - chatMessages: [meows] + chatMessages: [ meows ] - type: emote id: CatHisses category: Vocal - chatMessages: [hisses] + chatMessages: [ hisses ] - type: emote id: MonkeyScreeches category: Vocal - chatMessages: [screeches] + chatMessages: [ screeches ] - type: emote id: RobotBeep category: Vocal - chatMessages: [beeps] + chatMessages: [ beeps ] - type: emote id: Yawn category: Vocal - chatMessages: [yawns] + chatMessages: [ yawns ] chatTriggers: - - yawn - yawns - type: emote id: Snore category: Vocal - chatMessages: [snores] + chatMessages: [ snores ] diff --git a/Resources/Prototypes/Voice/speech_emotes.yml b/Resources/Prototypes/Voice/speech_emotes.yml index 0003780099a..6c94294e2be 100644 --- a/Resources/Prototypes/Voice/speech_emotes.yml +++ b/Resources/Prototypes/Voice/speech_emotes.yml @@ -2,244 +2,107 @@ - type: emote id: Scream category: Vocal - chatMessages: [screams!] + chatMessages: [ screams ] chatTriggers: - - scream - screams - - screams. - - screams! - - screaming - - screamed - - shriek - shrieks - - shrieks. - - shrieks! - - shrieking - - shrieked - - screech - screeches - - screeches. - - screeches! - - screeching - - screeched - - yell - yells - - yells. - - yells! - - yelled - - yelling - type: emote id: Laugh category: Vocal - chatMessages: [laughs] + chatMessages: [ laughs ] chatTriggers: - - laugh - laughs - - laughs. - - laughs! - - laughing - - laughed - - chuckle - chuckles - - chuckles. - - chuckles! - - chuckled - - chuckling - - giggle - giggles - - giggles. - - giggles! - - giggling - - giggled - - chortle - - chortle. - - chortle! - chortles - - chortles. - - chortles! - - chortling - - chortling. - - chortling! - type: emote id: Honk category: Vocal - chatMessages: [honks] + chatMessages: [ honks ] chatTriggers: - - honk - - honk. - - honk! - honks - - honks. - - honks! - - honked - - honked. - - honked! - - honking - - honking. - - honking! - type: emote id: Sigh category: Vocal - chatMessages: [sighs] + chatMessages: [ sighs ] chatTriggers: - - sigh - sighs - - sighed - - sigh. - - sighs. - - sighed. - type: emote id: Whistle category: Vocal - chatMessages: [whistle] + chatMessages: [ whistles ] chatTriggers: - - whistle - - whistle. - - whistle! - whistles - - whistles. - - whistles! - - whistleblowing - - whistleblowing. - - whistleblowing! - type: emote id: Crying category: Vocal - chatMessages: [crying] + chatMessages: [ cries ] chatTriggers: - - cry - - cry. - - cry! - - crying - - crying. - - crying! - cries - - cries. - - cries! - - sob - - sob. - sobs - - sobs. - - sobs! - - sobbing - - sobbing. - - sobbing! - type: emote id: Squish category: Vocal - chatMessages: [squishing] + chatMessages: [ squishes ] chatTriggers: - - squish - - squish. - - squish! - - squishing - - squishing. - - squishing! - squishes - - squishes. - - squishes! - type: emote id: Chitter category: Vocal - chatMessages: [chitters.] + chatMessages: [ chitters ] chatTriggers: - - chitter - - chitter. - - chitter! - chitters - - chitters. - - chitters! - - chittered - - chittered. - - chittered! - type: emote id: Squeak category: Vocal - chatMessages: [squeaks.] + chatMessages: [ squeaks ] chatTriggers: - - squeak - - squeak. - - squeak! - squeaks - - squeaks. - - squeaks! - - squeaked - - squeaked. - - squeaked! - type: emote id: Click category: Vocal - chatMessages: [click.] + chatMessages: [ clicks ] chatTriggers: - - click - - click. - - click! - - click? - clicks - - clicks. - - clicks! - - clicks? - - clicked - - clicked. - - clicked! - - clicked? - - clicking - - clicking. - - clicking! - - clicking? # hand emotes - type: emote id: Clap category: Hands - chatMessages: [claps!] + chatMessages: [ claps ] chatTriggers: - - clap - claps - - claps. - - claps! - - clapping - - clapped - type: emote id: Snap category: Hands - chatMessages: [snaps fingers] # snaps <{THEIR($ent)}> fingers? + chatMessages: [ snaps ] # snaps <{THEIR($ent)}> fingers? chatTriggers: - - snap - snaps - - snapping - - snapped - - snap fingers - snaps fingers - - snaps fingers. - - snaps fingers! + - snaps his fingers + - snaps her fingers - snaps their fingers - - snaps their fingers. - - snaps their fingers! - - snapping fingers - - snapped fingers + - snaps its fingers + - snaps its' fingers - type: emote id: Salute category: Hands - chatMessages: [Salute] + chatMessages: [ salutes ] chatTriggers: - - salute - - salute. - - salute! - salutes - - salutes. - - salutes! - type: emote id: DefaultDeathgasp @@ -250,135 +113,47 @@ - type: emote id: Buzz category: Vocal - chatMessages: [buzz!] + chatMessages: [ buzzes ] chatTriggers: - - buzzing - - buzzing! - - buzzing. - - buzz - - buzz. - - buzz! - - buzzed - - buzzed. - - buzzed! - buzzes - - buzzes. - - buzzes! - type: emote id: Weh category: Vocal - chatMessages: [Wehs!] + chatMessages: [ wehs ] - type: emote id: Chirp category: Vocal - chatMessages: [chirps!] + chatMessages: [ chirps ] chatTriggers: - - chirp - - chirp. - - chirp! - - chirp? - chirps - - chirps. - - chirps! - - chirps? - - chirped - - chirped. - - chirped! - - chirped? - - chirping - - chirping. - - chirping! - - chirping? # Machine Emotes - type: emote id: Beep category: Vocal - chatMessages: [beeps.] + chatMessages: [ beeps ] chatTriggers: - - beep - - beep! - - beep. - beeps - - beeps. - - beeps! - - beeped - - beeped. - - beeped! - - beeping - - beeping. - - beeping! - type: emote id: Chime category: Vocal - chatMessages: [chimes.] + chatMessages: [ chimes ] chatTriggers: - - chime - - chime. - - chime! - chimes - - chimes. - - chimes! - - chimed - - chimed. - - chimed! - - chiming - - chiming, - - chiming! - type: emote id: Buzz-Two category: Vocal - chatMessages: [buzzesTwice.] + chatMessages: [ "buzzes twice" ] chatTriggers: - - buzztwice - - buzztwice. - - buzztwice! - - buzzstwice - - buzzstwice. - - buzzstwice! - - buzzestwice - - buzzestwice. - - buzzestwice! - - buzzingtwice - - buzzingtwice. - - buzzingtwice! - - buzzedtwice - - buzzedtwice. - - buzzedtwice! - - buzz twice - - buzz twice. - - buzz twice! - - buzzs twice - - buzzs twice. - - buzzs twice! - buzzes twice - - buzzes twice. - - buzzes twice! - - buzzing twice - - buzzing twice. - - buzzing twice! - - buzzed twice - - buzzed twice. - - buzzed twice! - type: emote id: Ping category: Vocal - chatMessages: [pings.] + chatMessages: [ pings ] chatTriggers: - - ping - - ping. - - ping! - pings - - pings. - - pings! - - pinged - - pinged. - - pinged! - - pinging - - pinging. - - pinging! diff --git a/Resources/Prototypes/Voice/tail_emotes.yml b/Resources/Prototypes/Voice/tail_emotes.yml index 610a2ea8015..be6064b652a 100644 --- a/Resources/Prototypes/Voice/tail_emotes.yml +++ b/Resources/Prototypes/Voice/tail_emotes.yml @@ -2,13 +2,9 @@ id: WagTail chatMessages: [wags tail] chatTriggers: - - wag - - wag. - - wags - - wags. - - wagging - - wagging. - - wag tail - - wag tail. - wags tail - - wags tail. + - wags his tail + - wags her tail + - wags their tail + - wags its tail + - wags its' tail