[NEW STATUS SYSTEM] Drunkenness, Stuttering, Slurred Speech, and Bloodloss (#38678)
* The only commit that matters * I had to stop playing with my cat to push this change * Yaml removal * Proper drunk status effect and remove shitcode * Review changes * whoops * Whoops x2 * Update master fix merge conflicts * Fix merge conflicts * Dunk Component kill * MORE RELAYS * Holy fucking breaking changes * Ough * 46 file diff * Fix bad commits * Erm what the test fail? * Fix those last two * Merge conflicts * Me when I fix the merge conflicts --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d737e39a98
commit
6b73d320b9
@@ -3,14 +3,13 @@ using System.Text.RegularExpressions;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Shared.Speech;
|
||||
using Content.Shared.Speech.EntitySystems;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Speech.EntitySystems
|
||||
{
|
||||
public sealed class StutteringSystem : SharedStutteringSystem
|
||||
{
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
// Regex of characters to stutter.
|
||||
@@ -20,19 +19,36 @@ namespace Content.Server.Speech.EntitySystems
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<StutteringAccentComponent, AccentGetEvent>(OnAccent);
|
||||
|
||||
SubscribeLocalEvent<StutteringAccentComponent, StatusEffectRelayedEvent<AccentGetEvent>>(OnAccent);
|
||||
}
|
||||
|
||||
public override void DoStutter(EntityUid uid, TimeSpan time, bool refresh, StatusEffectsComponent? status = null)
|
||||
public override void DoStutter(EntityUid uid, TimeSpan time, bool refresh)
|
||||
{
|
||||
if (!Resolve(uid, ref status, false))
|
||||
return;
|
||||
|
||||
_statusEffectsSystem.TryAddStatusEffect<StutteringAccentComponent>(uid, StutterKey, time, refresh, status);
|
||||
if (refresh)
|
||||
Status.TryUpdateStatusEffectDuration(uid, Stuttering, time);
|
||||
else
|
||||
Status.TryAddStatusEffectDuration(uid, Stuttering, time);
|
||||
}
|
||||
|
||||
private void OnAccent(EntityUid uid, StutteringAccentComponent component, AccentGetEvent args)
|
||||
public override void DoRemoveStutterTime(EntityUid uid, TimeSpan timeRemoved)
|
||||
{
|
||||
args.Message = Accentuate(args.Message, component);
|
||||
Status.TryAddTime(uid, Stuttering, -timeRemoved);
|
||||
}
|
||||
|
||||
public override void DoRemoveStutter(EntityUid uid)
|
||||
{
|
||||
Status.TryRemoveStatusEffect(uid, Stuttering);
|
||||
}
|
||||
|
||||
private void OnAccent(Entity<StutteringAccentComponent> entity, ref AccentGetEvent args)
|
||||
{
|
||||
args.Message = Accentuate(args.Message, entity.Comp);
|
||||
}
|
||||
|
||||
private void OnAccent(Entity<StutteringAccentComponent> entity, ref StatusEffectRelayedEvent<AccentGetEvent> args)
|
||||
{
|
||||
args.Args.Message = Accentuate(args.Args.Message, entity.Comp);
|
||||
}
|
||||
|
||||
public string Accentuate(string message, StutteringAccentComponent component)
|
||||
|
||||
Reference in New Issue
Block a user