Skip to content

Commit

Permalink
Merge branch 'master' into Stasis
Browse files Browse the repository at this point in the history
  • Loading branch information
dustylens committed Jul 18, 2024
2 parents 787402b + 57feb8d commit 1f0e48b
Show file tree
Hide file tree
Showing 33 changed files with 3,994 additions and 9,259 deletions.
12 changes: 11 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
"Client"
],
"preLaunchTask": "build"
},
// Frontier begin
{
"name": "Server/Client (Release)",
"configurations": [
"Server",
"Client"
],
"preLaunchTask": "build-release"
}
// Frontier end
]
}
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@
},
"problemMatcher": "$msCompile"
},
// Frontier begin
{
"label": "build-release",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"--configuration=Release", // Build in release mode. Note: --, not /. /configuration doesn't work, because Microsoft.
"/property:GenerateFullPaths=true", // Ask dotnet build to generate full paths for file names.
"/consoleloggerparameters:NoSummary" // Do not generate summary otherwise it leads to duplicate errors in Problems panel
],
"group": {
"kind": "build"
},
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
// Frontier end
{
"label": "build-yaml-linter",
"command": "dotnet",
Expand Down
52 changes: 40 additions & 12 deletions Content.Server/_NF/Speech/EntitySystems/GoblinAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,59 @@
using Content.Server._NF.Speech.Components;
using Content.Server.Speech;
using Content.Server.Speech.EntitySystems;
using System.Text.RegularExpressions;

namespace Content.Server._NF.Speech.EntitySystems;

// The whole code is a copy of SouthernAccentSystem by UBlueberry (https://github.com/UBlueberry)
public sealed class GoblinAccentSystem : EntitySystem
{
private static readonly Regex RegexIng = new(@"(in)g\b", RegexOptions.IgnoreCase);
private static readonly Regex RegexAnd = new(@"\b(an)d\b", RegexOptions.IgnoreCase);
private static readonly Regex RegexEr = new(@"([^\WpPfF])er\b"); // Keep "er", "per", "Per", "fer" and "Fer"
private static readonly Regex RegexErUpper = new(@"([^\WpPfF])ER\b"); // Keep "ER", "PER" and "FER"
private static readonly Regex RegexTwoLetterEr = new(@"(\w\w)er\b"); // Replace "..XXer", e.g. "super"->"supah"
private static readonly Regex RegexTwoLetterErUpper = new(@"(\w\w)ER\b"); // Replace "..XXER", e.g. "SUPER"->"SUPAH"
private static readonly Regex RegexErs = new(@"(\w)ers\b"); // Replace "..XXers", e.g. "fixers"->"fixas"
private static readonly Regex RegexErsUpper = new(@"(\w)ERS\b"); // Replace "..XXers", e.g. "fixers"->"fixas"
private static readonly Regex RegexTt = new(@"([aeiouy])tt", RegexOptions.IgnoreCase);
private static readonly Regex RegexOf = new(@"\b(o)f\b", RegexOptions.IgnoreCase);
private static readonly Regex RegexThe = new(@"\bthe\b");
private static readonly Regex RegexTheUpper = new(@"\bTHE\b");
private static readonly Regex RegexH = new(@"\bh", RegexOptions.IgnoreCase);
private static readonly Regex RegexSelf = new(@"self\b");
private static readonly Regex RegexSelfUpper = new(@"SELF\b");

[Dependency] private readonly ReplacementAccentSystem _replacement = default!;

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

SubscribeLocalEvent<GoblinAccentComponent, AccentGetEvent>(OnAccentGet);
SubscribeLocalEvent<GoblinAccentComponent, AccentGetEvent>(OnAccent);
}

// converts left word when typed into the right word. For example typing you becomes ye.
public string Accentuate(string message, GoblinAccentComponent component)
private void OnAccent(EntityUid uid, GoblinAccentComponent component, AccentGetEvent args)
{
var msg = message;
var message = args.Message;

msg = _replacement.ApplyReplacements(msg, "goblin");
return msg;
}
message = _replacement.ApplyReplacements(message, "goblin_accent");

private void OnAccentGet(EntityUid uid, GoblinAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message, component);
message = RegexIng.Replace(message, "$1'"); //ing->in', ING->IN'
message = RegexAnd.Replace(message, "$1'"); //and->an', AND->AN'
message = RegexEr.Replace(message, "$1ah");
message = RegexErUpper.Replace(message, "$1AH");
message = RegexTwoLetterEr.Replace(message, "$1ah");
message = RegexTwoLetterErUpper.Replace(message, "$1AH");
message = RegexErs.Replace(message, "$1as");
message = RegexErsUpper.Replace(message, "$1AS");
message = RegexTt.Replace(message, "$1'");
message = RegexH.Replace(message, "'");
message = RegexSelf.Replace(message, "sewf");
message = RegexSelfUpper.Replace(message, "SEWF");
message = RegexOf.Replace(message, "$1'"); //of->o', OF->O'
message = RegexThe.Replace(message, "da");
message = RegexTheUpper.Replace(message, "DA");

args.Message = message;
}
}
};
31 changes: 31 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5663,3 +5663,34 @@ Entries:
message: '@mrscratch added Novalite C1 rifle chambered in .20 round.'
id: 5116
time: '2024-07-13T21:00:10.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Made goblin accent a bit thicker.
- type: Fix
message: >-
Non-goblin characters with Goblin Cant now speak the same way as
goblins.
id: 5117
time: '2024-07-14T23:42:59.0000000+00:00'
- author: ErhardSteinhauer
changes:
- type: Tweak
message: 'Updated SLI Gourd: gutted kitchen, bar, salvage, added guidebook entry.'
id: 5118
time: '2024-07-15T00:00:53.0000000+00:00'
- author: dvir01
changes:
- type: Remove
message: >-
Removed older ships waiting for reworks (Anchor, CourserX, Rosebud,
Condor, Esquire, Knuckleverse, Metastable, Mission, Pulse, Stratos,
WaveShot)
id: 5119
time: '2024-07-15T00:02:07.0000000+00:00'
- author: arimah
changes:
- type: Tweak
message: The SBB Ceres now runs on uranium instead of plasma.
id: 5120
time: '2024-07-18T22:06:20.0000000+00:00'
Loading

0 comments on commit 1f0e48b

Please sign in to comment.