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

French Accent #21430

Merged
merged 27 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7f74a92
French Accent
brainfood1183 Nov 4, 2023
0d45788
due to standard beret used by sec senior role, added new french beret…
brainfood1183 Nov 4, 2023
9392e66
bread is now baguette
brainfood1183 Nov 4, 2023
09b9659
removed some words and added spacing for punctuation
brainfood1183 Nov 4, 2023
30cf86d
changed to ! ? : ;
brainfood1183 Nov 4, 2023
69f1abb
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Nov 5, 2023
0c48c5d
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Nov 26, 2023
3ccd796
removed many of the replacement words.
brainfood1183 Nov 26, 2023
bb21875
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Dec 2, 2023
13a440b
removed more words, removed french accent from traits.
brainfood1183 Dec 2, 2023
df688bc
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Jan 5, 2024
fdb5277
removed more words.
brainfood1183 Jan 5, 2024
80ef2ef
Merge branch 'master' into nadastlanguage
brainfood1183 Jan 14, 2024
648cd42
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Jan 20, 2024
60848ef
removed word replacements.
brainfood1183 Jan 20, 2024
2323f80
fix restock crate price error.
brainfood1183 Jan 20, 2024
5c2f942
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Jan 22, 2024
163bf26
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Jan 27, 2024
ceaf555
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Feb 4, 2024
1914de5
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Feb 12, 2024
0b493d5
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Feb 13, 2024
837ca8a
Merge branch 'space-wizards:master' into nadastlanguage
brainfood1183 Feb 14, 2024
1586d8f
fixes
brainfood1183 Feb 14, 2024
ae1d71f
Don't add a blank space
Partmedia Feb 14, 2024
fedae4d
Update FrenchAccentSystem.cs
Partmedia Feb 14, 2024
c585f35
remove hamster wearable sprite.
brainfood1183 Feb 14, 2024
6d665bb
Merge branch 'nadastlanguage' of https://github.com/brainfood1183/spa…
brainfood1183 Feb 14, 2024
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/Speech/Components/FrenchAccentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Server.Speech.EntitySystems;

namespace Content.Server.Speech.Components;

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

namespace Content.Server.Speech.EntitySystems;

public sealed class FrenchAccentSystem : EntitySystem
{
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<FrenchAccentComponent, AccentGetEvent>(OnAccentGet);
}

// converts left word when typed into the right word. For example typing you becomes ye.
brainfood1183 marked this conversation as resolved.
Show resolved Hide resolved
public string Accentuate(string message, FrenchAccentComponent component)
{
var msg = message;

msg = _replacement.ApplyReplacements(msg, "french");

// replaces th with dz
msg = Regex.Replace(msg, @"th", "'z", RegexOptions.IgnoreCase);

// removes the letter h from the start of words.
msg = Regex.Replace(msg, @"(?<!\w)[h]", "'", RegexOptions.IgnoreCase);

// spaces out ! ? : and ;.
msg = Regex.Replace(msg, @"(?<=\w\w)!(?!\w)", " !", RegexOptions.IgnoreCase);
msg = Regex.Replace(msg, @"(?<=\w\w)[?](?!\w)", " ?", RegexOptions.IgnoreCase);
msg = Regex.Replace(msg, @"(?<=\w\w)[;](?!\w)", " ;", RegexOptions.IgnoreCase);
msg = Regex.Replace(msg, @"(?<=\w\w)[:](?!\w)", " :", RegexOptions.IgnoreCase);

return msg;
}

private void OnAccentGet(EntityUid uid, FrenchAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message, component);
}
}
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ trait-unrevivable-desc = You are unable to be revived by defibrillators.
trait-pirate-accent-name = Pirate Accent
trait-pirate-accent-desc = You can't stop speaking like a pirate!

trait-french-accent-name = French Accent
trait-french-accent-desc = You like to throw random french words into your english out of protest.
brainfood1183 marked this conversation as resolved.
Show resolved Hide resolved

trait-accentless-name = Accentless
trait-accentless-desc = You don't have the accent that your species would usually have

Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Accents/word_replacements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,4 @@
chatsan-word-40: chatsan-replacement-etcetera
chatsan-word-41: chatsan-replacement-41
chatsan-word-42: chatsan-replacement-42

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
ClothingOuterSanta: 2
ClothingHeadHatSkub: 2
ClothingOuterSkub: 2
ClothingHeadHatBeretFrench: 2
ClothingOuterSuitChicken: 2
ClothingHeadHatChickenhead: 2
ClothingOuterSuitMonkey: 2
Expand Down
18 changes: 18 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Head/hats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
- HamsterWearable
- WhitelistChameleon

- type: entity
parent: ClothingHeadBase
id: ClothingHeadHatBeretFrench
name: french beret
description: A french beret, viva la France.
brainfood1183 marked this conversation as resolved.
Show resolved Hide resolved
components:
- type: Sprite
sprite: Clothing/Head/Hats/beret_french.rsi
- type: Clothing
sprite: Clothing/Head/Hats/beret_french.rsi
- type: AddAccentClothing
accent: FrenchAccent
- type: Tag
tags:
- ClothMade
- HamsterWearable
- WhitelistChameleon

- type: entity
parent: ClothingHeadBase
id: ClothingHeadHatBeretSecurity
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Roles/Jobs/Civilian/mime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- !type:AddComponentSpecial
components:
- type: MimePowers
- type: FrenchAccent

- type: startingGear
id: MimeGear
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions Resources/Textures/Clothing/Head/Hats/beret_french.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/4f6190e2895e09116663ef282d3ce1d8b35c032e",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "equipped-HELMET",
"directions": 4
},
{
"name": "equipped-HELMET-hamster",
"directions": 4
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}
Loading