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
public override void Initialize()
{
SubscribeLocalEvent<ScrambledAccentComponent, AccentGetEvent>(OnAccent);
+ SubscribeLocalEvent<ScrambledAccentComponent, StatusEffectRelayedEvent<AccentGetEvent>>(OnAccentRelayed);
}
public string Accentuate(string message)
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);
+ }
}
}
}
/// <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.
name: slurred
components:
- type: SlurredAccent
+
+# Causes words your be to scrambled. Who?
+- type: entity
+ parent: SpeechStatusEffectBase
+ id: StatusEffectScrambled
+ name: scrambled
+ components:
+ - type: ScrambledAccent
damage:
types:
Poison: 1
- - !type:GenericStatusEffect
- key: Stutter
- component: ScrambledAccent
+ - !type:ModifyStatusEffect
+ effectProto: StatusEffectScrambled
+ type: Update
- type: reagent
id: Potassium
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