Adds new disease! Tongue Twister. Also new scrambled accent. (#9393)
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Content.Server.Speech.Components
|
||||||
|
{
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class ScrambledAccentComponent : Component
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
46
Content.Server/Speech/EntitySystems/ScrambledAccentSystem.cs
Normal file
46
Content.Server/Speech/EntitySystems/ScrambledAccentSystem.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Content.Server.Speech.Components;
|
||||||
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
|
namespace Content.Server.Speech.EntitySystems
|
||||||
|
{
|
||||||
|
public sealed class ScrambledAccentSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
SubscribeLocalEvent<ScrambledAccentComponent, AccentGetEvent>(OnAccent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Accentuate(string message)
|
||||||
|
{
|
||||||
|
var words = message.ToLower().Split();
|
||||||
|
|
||||||
|
if (words.Length < 2)
|
||||||
|
{
|
||||||
|
var pick = _random.Next(1, 8);
|
||||||
|
// If they try to weasel out of it by saying one word at a time we give them this.
|
||||||
|
return Loc.GetString($"accent-scrambled-words-{pick}");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Scramble the words
|
||||||
|
var scrambled = words.OrderBy(x => _random.Next()).ToArray();
|
||||||
|
|
||||||
|
var msg = String.Join(" ", scrambled);
|
||||||
|
|
||||||
|
//First letter should be capital
|
||||||
|
msg = msg[0].ToString().ToUpper() + msg.Remove(0, 1);
|
||||||
|
|
||||||
|
//Capitalize lone i's
|
||||||
|
msg = Regex.Replace(msg, @"(?<=\ )i(?=[\ \.\?]|$)", "I");
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAccent(EntityUid uid, ScrambledAccentComponent component, AccentGetEvent args)
|
||||||
|
{
|
||||||
|
args.Message = Accentuate(args.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
Resources/Locale/en-US/accent/scrambled.ftl
Normal file
7
Resources/Locale/en-US/accent/scrambled.ftl
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
accent-scrambled-words-1 = Who?,
|
||||||
|
accent-scrambled-words-2 = What?,
|
||||||
|
accent-scrambled-words-3 = When?,
|
||||||
|
accent-scrambled-words-4 = Where?,
|
||||||
|
accent-scrambled-words-5 = Why!,
|
||||||
|
accent-scrambled-words-6 = How?,
|
||||||
|
accent-scrambled-words-7 = Me!,
|
||||||
@@ -10,3 +10,4 @@ disease-eaten-inside = You feel like you're being eaten from the inside.
|
|||||||
disease-banana-compulsion = You really want to eat some bananas.
|
disease-banana-compulsion = You really want to eat some bananas.
|
||||||
disease-beat-chest-compulsion = {CAPITALIZE(THE($person))} beats {POSS-ADJ($person)} chest.
|
disease-beat-chest-compulsion = {CAPITALIZE(THE($person))} beats {POSS-ADJ($person)} chest.
|
||||||
disease-vomit = {CAPITALIZE(THE($person))} vomits.
|
disease-vomit = {CAPITALIZE(THE($person))} vomits.
|
||||||
|
disease-think = You feel like you can't think straight.
|
||||||
|
|||||||
@@ -220,3 +220,24 @@
|
|||||||
min: 420 ## Reachable with a flamer
|
min: 420 ## Reachable with a flamer
|
||||||
- !type:DiseaseReagentCure
|
- !type:DiseaseReagentCure
|
||||||
reagent: Theobromine
|
reagent: Theobromine
|
||||||
|
|
||||||
|
- type: disease
|
||||||
|
id: TongueTwister
|
||||||
|
name: Tongue Twister
|
||||||
|
cureResist: 0.1
|
||||||
|
effects:
|
||||||
|
- !type:DiseaseGenericStatusEffect
|
||||||
|
key: Stutter
|
||||||
|
component: ScrambledAccent
|
||||||
|
- !type:DiseaseSnough
|
||||||
|
probability: 0.01
|
||||||
|
snoughSound:
|
||||||
|
collection: Sneezes
|
||||||
|
- !type:DiseaseSnough
|
||||||
|
probability: 0.02
|
||||||
|
snoughMessage: disease-think
|
||||||
|
cures:
|
||||||
|
- !type:DiseaseBedrestCure
|
||||||
|
maxLength: 30
|
||||||
|
- !type:DiseaseJustWaitCure
|
||||||
|
maxLength: 400
|
||||||
|
|||||||
Reference in New Issue
Block a user