diff --git a/Content.Client/Speech/EntitySystems/RatvarianLanguageSystem.cs b/Content.Client/Speech/EntitySystems/RatvarianLanguageSystem.cs new file mode 100644 index 0000000000..f24194a597 --- /dev/null +++ b/Content.Client/Speech/EntitySystems/RatvarianLanguageSystem.cs @@ -0,0 +1,8 @@ +using Content.Shared.Speech.EntitySystems; + +namespace Content.Client.Speech.EntitySystems; + +public sealed class RatvarianLanguageSystem : SharedRatvarianLanguageSystem +{ + +} diff --git a/Content.Server/Speech/EntitySystems/RatvarianLanguageSystem.cs b/Content.Server/Speech/EntitySystems/RatvarianLanguageSystem.cs new file mode 100644 index 0000000000..84d9220f39 --- /dev/null +++ b/Content.Server/Speech/EntitySystems/RatvarianLanguageSystem.cs @@ -0,0 +1,115 @@ +using System.Text; +using System.Text.RegularExpressions; +using Content.Shared.Speech.Components; +using Content.Shared.Speech.EntitySystems; +using Content.Shared.StatusEffect; + +namespace Content.Server.Speech.EntitySystems; + +public sealed class RatvarianLanguageSystem : SharedRatvarianLanguageSystem +{ + [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; + private const string RatvarianKey = "RatvarianLanguage"; + + // This is the word of Ratvar and those who speak it shall abide by His rules: + /* + * Any time the word "of" occurs, it's linked to the previous word by a hyphen: "I am-of Ratvar" + * Any time "th", followed by any two letters occurs, you add a grave (`) between those two letters: "Thi`s" + * In the same vein, any time "ti" followed by one letter occurs, you add a grave (`) between "i" and the letter: "Ti`me" + * Wherever "te" or "et" appear and there is another letter next to the "e", add a hyphen between "e" and the letter: "M-etal/Greate-r" + * Where "gua" appears, add a hyphen between "gu" and "a": "Gu-ard" + * Where the word "and" appears it's linked to all surrounding words by hyphens: "Sword-and-shield" + * Where the word "to" appears, it's linked to the following word by a hyphen: "to-use" + * Where the word "my" appears, it's linked to the following word by a hyphen: "my-light" + * Any Ratvarian proper noun is not translated: Ratvar, Nezbere, Sevtug, Nzcrentr and Inath-neq + * This only applies if they're being used as a proper noun: armorer/Nezbere + */ + + private static Regex THPattern = new Regex(@"th\w\B", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static Regex ETPattern = new Regex(@"\Bet", RegexOptions.Compiled); + private static Regex TEPattern = new Regex(@"te\B",RegexOptions.Compiled); + private static Regex OFPattern = new Regex(@"(\s)(of)"); + private static Regex TIPattern = new Regex(@"ti\B", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static Regex GUAPattern = new Regex(@"(gu)(a)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static Regex ANDPattern = new Regex(@"\b(\s)(and)(\s)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static Regex TOMYPattern = new Regex(@"(to|my)\s", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static Regex ProperNouns = new Regex(@"(ratvar)|(nezbere)|(sevtuq)|(nzcrentr)|(inath-neq)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + + public override void Initialize() + { + // Activate before other modifications so translation works properly + SubscribeLocalEvent(OnAccent, before: new[] {typeof(SharedSlurredSystem), typeof(SharedStutteringSystem)}); + } + + public override void DoRatvarian(EntityUid uid, TimeSpan time, bool refresh, StatusEffectsComponent? status = null) + { + if (!Resolve(uid, ref status, false)) + return; + + _statusEffects.TryAddStatusEffect(uid, RatvarianKey, time, refresh, status); + } + + private void OnAccent(EntityUid uid, RatvarianLanguageComponent component, AccentGetEvent args) + { + args.Message = Translate(args.Message); + } + + private string Translate(string message) + { + var ruleTranslation = message; + var finalMessage = new StringBuilder(); + var newWord = new StringBuilder(); + + ruleTranslation = THPattern.Replace(ruleTranslation, "$&`"); + ruleTranslation = TEPattern.Replace(ruleTranslation, "$&-"); + ruleTranslation = ETPattern.Replace(ruleTranslation, "-$&"); + ruleTranslation = OFPattern.Replace(ruleTranslation, "-$2"); + ruleTranslation = TIPattern.Replace(ruleTranslation, "$&`"); + ruleTranslation = GUAPattern.Replace(ruleTranslation, "$1-$2"); + ruleTranslation = ANDPattern.Replace(ruleTranslation, "-$2-"); + ruleTranslation = TOMYPattern.Replace(ruleTranslation, "$1-"); + + var temp = ruleTranslation.Split(' '); + + foreach (var word in temp) + { + newWord.Clear(); + + if (ProperNouns.IsMatch(word)) + newWord.Append(word); + + else + { + for (int i = 0; i < word.Length; i++) + { + var letter = word[i]; + + if (letter >= 97 && letter <= 122) + { + var letterRot = letter + 13; + + if (letterRot > 122) + letterRot -= 26; + + newWord.Append((char) letterRot); + } + else if (letter >= 65 && letter <= 90) + { + var letterRot = letter + 13; + + if (letterRot > 90) + letterRot -= 26; + + newWord.Append((char) letterRot); + } + else + { + newWord.Append(word[i]); + } + } + } + finalMessage.Append(newWord + " "); + } + return finalMessage.ToString().Trim(); + } +} diff --git a/Content.Shared/Drunk/DrunkSystem.cs b/Content.Shared/Drunk/DrunkSystem.cs index 4fb91f7213..3085e78485 100644 --- a/Content.Shared/Drunk/DrunkSystem.cs +++ b/Content.Shared/Drunk/DrunkSystem.cs @@ -18,7 +18,9 @@ public abstract class SharedDrunkSystem : EntitySystem return; if (applySlur) + { _slurredSystem.DoSlur(uid, TimeSpan.FromSeconds(boozePower), status); + } if (TryComp(uid, out var trait)) boozePower *= trait.BoozeStrengthMultiplier; diff --git a/Content.Shared/Speech/Components/RatvarianLanguageComponent.cs b/Content.Shared/Speech/Components/RatvarianLanguageComponent.cs new file mode 100644 index 0000000000..161abd760e --- /dev/null +++ b/Content.Shared/Speech/Components/RatvarianLanguageComponent.cs @@ -0,0 +1,8 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Speech.Components; +[RegisterComponent, NetworkedComponent] +public sealed class RatvarianLanguageComponent : Component +{ + +} diff --git a/Content.Shared/Speech/EntitySystems/SharedRatvarianLanguageSystem.cs b/Content.Shared/Speech/EntitySystems/SharedRatvarianLanguageSystem.cs new file mode 100644 index 0000000000..9564bfd901 --- /dev/null +++ b/Content.Shared/Speech/EntitySystems/SharedRatvarianLanguageSystem.cs @@ -0,0 +1,10 @@ +using Content.Shared.StatusEffect; + +namespace Content.Shared.Speech.EntitySystems; + +public abstract class SharedRatvarianLanguageSystem : EntitySystem +{ + public virtual void DoRatvarian(EntityUid uid, TimeSpan time, bool refresh, StatusEffectsComponent? status = null) + { + } +} diff --git a/Resources/Audio/Magic/Cults/ClockCult/attributions.yml b/Resources/Audio/Magic/Cults/ClockCult/attributions.yml new file mode 100644 index 0000000000..dae32f0ae2 --- /dev/null +++ b/Resources/Audio/Magic/Cults/ClockCult/attributions.yml @@ -0,0 +1,4 @@ +- files: ["steam_woosh.ogg"] + license: "CC-BY-SA-3.0" + copyright: "Taken from Citadel Station" + source: "https://github.com/Citadel-Station-13/Citadel-Station-13/commit/e575bd66854786eb9455eae6954d976cf13c66ea" \ No newline at end of file diff --git a/Resources/Audio/Magic/Cults/ClockCult/steam_whoosh.ogg b/Resources/Audio/Magic/Cults/ClockCult/steam_whoosh.ogg new file mode 100644 index 0000000000..21c7975c08 Binary files /dev/null and b/Resources/Audio/Magic/Cults/ClockCult/steam_whoosh.ogg differ diff --git a/Resources/Locale/en-US/flavors/flavor-profiles.ftl b/Resources/Locale/en-US/flavors/flavor-profiles.ftl index 15ef40d378..fa2467cfbf 100644 --- a/Resources/Locale/en-US/flavors/flavor-profiles.ftl +++ b/Resources/Locale/en-US/flavors/flavor-profiles.ftl @@ -165,6 +165,7 @@ flavor-complex-atomic-cola = like hoarding bottle caps flavor-complex-cuba-libre = like spiked cola flavor-complex-gin-tonic = like spiked lemon-lime soda flavor-complex-screwdriver = like spiked orange juice +flavor-complex-cogchamp = like brass ### This is exactly what pilk tastes like. I'm not even joking. I might've been a little drunk though flavor-complex-pilk = like sweet milk diff --git a/Resources/Locale/en-US/reagents/meta/consumable/drink/alcohol.ftl b/Resources/Locale/en-US/reagents/meta/consumable/drink/alcohol.ftl index 13ec0ef3be..9b6029234c 100644 --- a/Resources/Locale/en-US/reagents/meta/consumable/drink/alcohol.ftl +++ b/Resources/Locale/en-US/reagents/meta/consumable/drink/alcohol.ftl @@ -205,6 +205,9 @@ reagent-desc-sbiten = A spicy Vodka! Might be a little hot for the little guys! reagent-name-screwdriver-cocktail = screwdriver reagent-desc-screwdriver-cocktail = Vodka, mixed with plain ol' orange juice. The result is surprisingly delicious. +reagent-name-cogchamp = cogchamp +reagent-desc-cogchamp = Not even Ratvar's Four Generals could withstand this! Qevax Jryy! + reagent-name-silencer = silencer reagent-desc-silencer = A drink from Mime Heaven. diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 5f080adb30..7ed1493642 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -77,6 +77,7 @@ - Electrocution - Drunk - SlurredSpeech + - RatvarianLanguage - PressureImmunity - Muted - ForcedSleep diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml index 1e355ec798..e8e62f3cce 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml @@ -1611,6 +1611,23 @@ - type: Sprite sprite: Objects/Consumable/Drinks/screwdriverglass.rsi +- type: entity + parent: DrinkGlassBase + id: DrinkCogChampBase + name: cogchamp glass + description: This mix of Cognac, Screwdriver and Welding Fuel will have you seeing His light surely! + components: + - type: SolutionContainerManager + solutions: + drink: + maxVol: 30 + reagents: + - ReagentId: CogChamp + Quantity: 30 + - type: Drink + - type: Sprite + sprite: Objects/Consumable/Drinks/cogchamp.rsi + - type: entity parent: DrinkGlassBase id: DrinkSuiDreamGlass diff --git a/Resources/Prototypes/Flavors/flavors.yml b/Resources/Prototypes/Flavors/flavors.yml index c820b9f01a..2ce6ed1779 100644 --- a/Resources/Prototypes/Flavors/flavors.yml +++ b/Resources/Prototypes/Flavors/flavors.yml @@ -484,6 +484,11 @@ flavorType: Complex description: flavor-complex-cola +- type: flavor + id: cogchamp + flavorType: Complex + description: flavor-complex-cogchamp + - type: flavor id: vodka flavorType: Complex diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml index 9998353d6b..f2b1cdd317 100644 --- a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml +++ b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml @@ -1127,6 +1127,29 @@ reagent: Ethanol amount: 0.15 +- type: reagent + id: CogChamp + name: reagent-name-cogchamp + parent: BaseAlcohol + desc: reagent-desc-cogchamp + physicalDesc: reagent-physical-desc-ground-brass + flavor: cogchamp + color: "#B5A642" + metamorphicSprite: + sprite: Objects/Consumable/Drinks/cogchamp.rsi + state: icon + metabolisms: + Drink: + effects: + - !type:GenericStatusEffect + key: RatvarianLanguage + component: RatvarianLanguage + - !type:SatiateThirst + factor: 2 + - !type:AdjustReagent + reagent: Ethanol + amount: 0.15 + - type: reagent id: Silencer name: reagent-name-silencer diff --git a/Resources/Prototypes/Recipes/Reactions/drinks.yml b/Resources/Prototypes/Recipes/Reactions/drinks.yml index 80c0ffdcaf..40380ff8ca 100644 --- a/Resources/Prototypes/Recipes/Reactions/drinks.yml +++ b/Resources/Prototypes/Recipes/Reactions/drinks.yml @@ -76,6 +76,20 @@ products: B52: 3 +- type: reaction + id: CogChamp + reactants: + Cognac: + amount: 1 + ScrewdriverCocktail: + amount: 1 + WeldingFuel: + amount: 1 + products: + CogChamp: 3 + sound: + path: /Audio/Magic/Cults/ClockCult/steam_whoosh.ogg + - type: reaction id: Barefoot reactants: diff --git a/Resources/Prototypes/status_effects.yml b/Resources/Prototypes/status_effects.yml index b149243ed3..b909baa0eb 100644 --- a/Resources/Prototypes/status_effects.yml +++ b/Resources/Prototypes/status_effects.yml @@ -53,3 +53,6 @@ - type: statusEffect id: Pacified #cannot attack + +- type: statusEffect + id: RatvarianLanguage #Praise him diff --git a/Resources/Textures/Objects/Consumable/Drinks/cogchamp.rsi/icon.png b/Resources/Textures/Objects/Consumable/Drinks/cogchamp.rsi/icon.png new file mode 100644 index 0000000000..687e9b38c8 Binary files /dev/null and b/Resources/Textures/Objects/Consumable/Drinks/cogchamp.rsi/icon.png differ diff --git a/Resources/Textures/Objects/Consumable/Drinks/cogchamp.rsi/meta.json b/Resources/Textures/Objects/Consumable/Drinks/cogchamp.rsi/meta.json new file mode 100644 index 0000000000..dce4fff86e --- /dev/null +++ b/Resources/Textures/Objects/Consumable/Drinks/cogchamp.rsi/meta.json @@ -0,0 +1,22 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Made by keronshb for Citadel Station at: https://github.com/Citadel-Station-13/Citadel-Station-13/commit/c790478a3d6e8a2846e658c3dc6c5164737e4b42", + "states": [ + { + "name": "icon", + "delays": [ + [ + 0.6, + 0.3, + 0.3, + 0.3 + ] + ] + } + ] +}