diff --git a/Content.Server/Goobstation/Speech/EntitySystems/VulgarAccentSystem.cs b/Content.Server/Goobstation/Speech/EntitySystems/VulgarAccentSystem.cs new file mode 100644 index 00000000000..479ea74d9fb --- /dev/null +++ b/Content.Server/Goobstation/Speech/EntitySystems/VulgarAccentSystem.cs @@ -0,0 +1,51 @@ +// CREATED BY Goldminermac +// https://github.com/space-wizards/space-station-14/pull/31149 +// LICENSED UNDER THE MIT LICENSE +// SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +using Content.Shared.Speech.Components; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; +using System.Text; + +namespace Content.Server.Speech.EntitySystems; + +public sealed class VulgarAccentSystem : EntitySystem +{ + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly ReplacementAccentSystem _replacement = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAccentGet); + } + + public string Accentuate(string message, VulgarAccentComponent component) + { + string[] messageWords = message.Split(" "); + + for (int i = 0; i < messageWords.Length; i++) + { + //Every word has a percentage chance to be replaced by a random swear word from the component's array. + if (_random.Prob(component.SwearProb)) + { + if (!_prototypeManager.TryIndex(component.Pack, out var messagePack)) + return message; + + + string swearWord = _loc.GetString(_random.Pick(messagePack.Values)); + messageWords[i] = swearWord; + } + } + + return string.Join(" ", messageWords); + } + + public void OnAccentGet(EntityUid uid, VulgarAccentComponent component, AccentGetEvent args) + { + args.Message = Accentuate(args.Message, component); + } +} diff --git a/Content.Shared/Goobstation/Speech/Components/VulgarAccentComponent.cs b/Content.Shared/Goobstation/Speech/Components/VulgarAccentComponent.cs new file mode 100644 index 00000000000..366fb04d81e --- /dev/null +++ b/Content.Shared/Goobstation/Speech/Components/VulgarAccentComponent.cs @@ -0,0 +1,19 @@ +// CREATED BY Goldminermac +// https://github.com/space-wizards/space-station-14/pull/31149 +// LICENSED UNDER THE MIT LICENSE +// SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +using Robust.Shared.GameStates; +using Content.Shared.Dataset; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Speech.Components; + +[RegisterComponent, NetworkedComponent] +public sealed partial class VulgarAccentComponent : Component +{ + [DataField] + public ProtoId Pack = "SwearWords"; + + [DataField] + public float SwearProb = 0.5f; +} diff --git a/Resources/Locale/en-US/Goobstation/accent/vulgar.ftl b/Resources/Locale/en-US/Goobstation/accent/vulgar.ftl new file mode 100644 index 00000000000..4092b4bb422 --- /dev/null +++ b/Resources/Locale/en-US/Goobstation/accent/vulgar.ftl @@ -0,0 +1,13 @@ +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +accent-vulgar-words-1 = CRAP +accent-vulgar-words-2 = SHIT +accent-vulgar-words-3 = DAMN +accent-vulgar-words-4 = DAMN IT +accent-vulgar-words-5 = BASTARD +accent-vulgar-words-6 = SON OF A SKUB +accent-vulgar-words-7 = PIECE OF SHIT +accent-vulgar-words-8 = NIMWIT +accent-vulgar-words-9 = SKUB diff --git a/Resources/Locale/en-US/Goobstation/flavor/flavors.ftl b/Resources/Locale/en-US/Goobstation/flavor/flavors.ftl index 85100fbbe60..81ec2216f1b 100644 --- a/Resources/Locale/en-US/Goobstation/flavor/flavors.ftl +++ b/Resources/Locale/en-US/Goobstation/flavor/flavors.ftl @@ -1,2 +1,4 @@ flavor-base-futuristic = futuristic flavor-complex-cherry = like cherry + +flavor-base-offensive = offensive diff --git a/Resources/Locale/en-US/Goobstation/reagents/meta/fun.ftl b/Resources/Locale/en-US/Goobstation/reagents/meta/fun.ftl index 529a21fa8a0..5fc39d94939 100644 --- a/Resources/Locale/en-US/Goobstation/reagents/meta/fun.ftl +++ b/Resources/Locale/en-US/Goobstation/reagents/meta/fun.ftl @@ -1,3 +1,11 @@ reagent-name-tranquility = tranquility reagent-desc-tranquility = You feel oddly calm... reagent-popup-tranquility = You feel oddly calm... + +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +reagent-name-profanol = profanol +reagent-desc-profanol = A chemical compound known to make people compulsively swear. A ruiner of countless family reunions and funerals. +# END OF MIT-LICENSED CODE diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 4ee5aa9a9d4..8b7f4160079 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -135,6 +135,7 @@ - Flashed - RadiationProtection - Drowsiness + - Vulgarity # Goobstation - add Profanol - type: Body prototype: Human requiredLegs: 2 diff --git a/Resources/Prototypes/Goobstation/Datasets/swear_words.yml b/Resources/Prototypes/Goobstation/Datasets/swear_words.yml new file mode 100644 index 00000000000..3770fd332c7 --- /dev/null +++ b/Resources/Prototypes/Goobstation/Datasets/swear_words.yml @@ -0,0 +1,9 @@ +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +- type: localizedDataset + id: SwearWords + values: + prefix: accent-vulgar-words- + count: 9 diff --git a/Resources/Prototypes/Goobstation/Flavors/flavors.yml b/Resources/Prototypes/Goobstation/Flavors/flavors.yml index f3b523f833e..1c645081001 100644 --- a/Resources/Prototypes/Goobstation/Flavors/flavors.yml +++ b/Resources/Prototypes/Goobstation/Flavors/flavors.yml @@ -8,3 +8,13 @@ id: cherry flavorType: Complex description: flavor-complex-cherry + +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +- type: flavor + id: offensive + flavorType: Base + description: flavor-base-offensive +# END OF MIT-LICENSED CODE diff --git a/Resources/Prototypes/Goobstation/Reagents/fun.yml b/Resources/Prototypes/Goobstation/Reagents/fun.yml index c5cc4417974..7b4933c686c 100644 --- a/Resources/Prototypes/Goobstation/Reagents/fun.yml +++ b/Resources/Prototypes/Goobstation/Reagents/fun.yml @@ -31,3 +31,25 @@ conditions: - !type:ReagentThreshold min: 25 + +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +- type: reagent + id: Profanol + name: reagent-name-profanol + group: Toxins + desc: reagent-desc-profanol + physicalDesc: reagent-physical-desc-pungent + flavor: offensive + color: "#BF5E5E" + slippery: true + metabolisms: + Poison: + metabolismRate: 0.10 + effects: + - !type:GenericStatusEffect + key: Vulgarity + component: VulgarAccent +# END OF MIT-LICENSED CODE diff --git a/Resources/Prototypes/Goobstation/Recipes/Reactions/fun.yml b/Resources/Prototypes/Goobstation/Recipes/Reactions/fun.yml index 6c0a118ddcf..7c4be7dbb6a 100644 --- a/Resources/Prototypes/Goobstation/Recipes/Reactions/fun.yml +++ b/Resources/Prototypes/Goobstation/Recipes/Reactions/fun.yml @@ -11,4 +11,24 @@ amount: 20 effects: - !type:CreateEntityReactionEffect - entity: SoapHomemadeBanana \ No newline at end of file + entity: SoapHomemadeBanana + +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +- type: reaction + id: Profanol + impact: Low + quantized: true + minTemp: 300 + reactants: + THC: + amount: 3 + Ethanol: + amount: 3 + Mercury: + amount: 2 + products: + Profanol: 10 +# END OF MIT-LICENSED CODE diff --git a/Resources/Prototypes/Goobstation/status_effects.yml b/Resources/Prototypes/Goobstation/status_effects.yml index 1a3d7677bf0..c08d2cc4c12 100644 --- a/Resources/Prototypes/Goobstation/status_effects.yml +++ b/Resources/Prototypes/Goobstation/status_effects.yml @@ -2,3 +2,11 @@ id: Stasis alert: Stasis alwaysAllowed: true + +# CREATED BY Goldminermac +# https://github.com/space-wizards/space-station-14/pull/31149 +# LICENSED UNDER THE MIT LICENSE +# SEE README.MD AND LICENSE.TXT IN THE ROOT OF THIS REPOSITORY FOR MORE INFORMATION +- type: statusEffect + id: Vulgarity +# END OF MIT-LICENSED CODE