]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Cryptobolin and make it use NewStatusEffectSystem. (#40675)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Tue, 14 Oct 2025 02:18:53 +0000 (19:18 -0700)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 02:18:53 +0000 (02:18 +0000)
* Push

* Mercury too I guess???

* Update comment

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Server/Speech/EntitySystems/ScrambledAccentSystem.cs
Content.Server/Speech/EntitySystems/SlurredSystem.cs
Resources/Prototypes/Entities/StatusEffects/speech.yml
Resources/Prototypes/Reagents/elements.yml
Resources/Prototypes/Reagents/medicine.yml

index d685edc38bba888bdd625cb8df6fb15e556c2dc4..2f67bfad08f8c90e4990cf79425ebcb03790af34 100644 (file)
@@ -2,6 +2,7 @@ using System.Linq;
 using System.Text.RegularExpressions;
 using Content.Server.Speech.Components;
 using Content.Shared.Speech;
+using Content.Shared.StatusEffectNew;
 using Robust.Shared.Random;
 
 namespace Content.Server.Speech.EntitySystems
@@ -15,6 +16,7 @@ namespace Content.Server.Speech.EntitySystems
         public override void Initialize()
         {
             SubscribeLocalEvent<ScrambledAccentComponent, AccentGetEvent>(OnAccent);
+            SubscribeLocalEvent<ScrambledAccentComponent, StatusEffectRelayedEvent<AccentGetEvent>>(OnAccentRelayed);
         }
 
         public string Accentuate(string message)
@@ -41,9 +43,14 @@ namespace Content.Server.Speech.EntitySystems
             return msg;
         }
 
-        private void OnAccent(EntityUid uid, ScrambledAccentComponent component, AccentGetEvent args)
+        private void OnAccent(Entity<ScrambledAccentComponent> entity, ref AccentGetEvent args)
         {
             args.Message = Accentuate(args.Message);
         }
+
+        private void OnAccentRelayed(Entity<ScrambledAccentComponent> entity, ref StatusEffectRelayedEvent<AccentGetEvent> args)
+        {
+            args.Args.Message = Accentuate(args.Args.Message);
+        }
     }
 }
index 8690079de1d0047527553ff32c0110b005e314aa..c4db77c14b5cf8283750119360143c6c13f735e2 100644 (file)
@@ -23,11 +23,12 @@ public sealed class SlurredSystem : SharedSlurredSystem
     }
 
     /// <summary>
-    ///     Slur chance scales with "drunkeness", which is just measured using the time remaining on the status effect.
+    ///     Slur chance scales with the time remaining on any status effect with the SlurredAccentComponent.
+    ///     Typically, this is equivalent to "drunkenness" on the DrunkStatusEffect
     /// </summary>
     private float GetProbabilityScale(EntityUid uid)
     {
-        if (!_status.TryGetMaxTime<DrunkStatusEffectComponent>(uid, out var time))
+        if (!_status.TryGetMaxTime<SlurredAccentComponent>(uid, out var time))
             return 0;
 
         // This is a magic number. Why this value? No clue it was made 3 years before I refactored this.
index 17e533b1a81e9669bc160a6cdabcab6ddbf08224..1fe13c4626a429f934765ff387ed60727dc3a902 100644 (file)
   name: slurred
   components:
   - type: SlurredAccent
+
+# Causes words your be to scrambled. Who?
+- type: entity
+  parent: SpeechStatusEffectBase
+  id: StatusEffectScrambled
+  name: scrambled
+  components:
+  - type: ScrambledAccent
index 27e27be503564b3c8c3fce37095bc89c281a32da..401fdfd2eb6201a5b4df401b27378609b7eb2130 100644 (file)
         damage:
           types:
             Poison: 1
-      - !type:GenericStatusEffect
-        key: Stutter
-        component: ScrambledAccent
+      - !type:ModifyStatusEffect
+        effectProto: StatusEffectScrambled
+        type: Update
 
 - type: reagent
   id: Potassium
index d81ec12b3da37135ce5d723276211b46b03912d6..998f508b61af910da2f03b9ba0929cd779f130ef 100644 (file)
   metabolisms:
     Medicine:
       effects:
-      - !type:GenericStatusEffect
-        key: Stutter
-        component: ScrambledAccent
       - !type:ModifyStatusEffect
-        effectProto: StatusEffectSlurred
+        effectProto: StatusEffectScrambled
+        type: Update
+      - !type:ModifyStatusEffect
+        effectProto: StatusEffectWoozy
         time: 20.0
 
 - type: reagent