change stun to lying
This commit is contained in:
@@ -1,24 +1,20 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Server.Speech.EntitySystems;
|
|
||||||
using Content.Server.Stunnable;
|
|
||||||
using Content.Shared._White.Mood;
|
using Content.Shared._White.Mood;
|
||||||
using Content.Shared.Damage.Systems;
|
using Content.Shared.Damage.Systems;
|
||||||
using Content.Shared.Drunk;
|
using Content.Shared.Drunk;
|
||||||
|
using Content.Shared.Standing;
|
||||||
using Content.Shared.StatusEffect;
|
using Content.Shared.StatusEffect;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Timer = Robust.Shared.Timing.Timer;
|
using Timer = Robust.Shared.Timing.Timer;
|
||||||
|
|
||||||
namespace Content.Server._White.Chemistry;
|
namespace Content.Shared._White.Chemistry;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This handles system?
|
|
||||||
/// </summary>
|
|
||||||
public sealed class NarcoticEffect : EntitySystem
|
public sealed class NarcoticEffect : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly StunSystem _stun = default!;
|
|
||||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
|
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
|
||||||
[Dependency] private readonly StaminaSystem _stamina = default!;
|
[Dependency] private readonly StaminaSystem _stamina = default!;
|
||||||
|
[Dependency] private readonly StandingStateSystem _standingStateSystem = default!;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -43,6 +39,9 @@ public sealed class NarcoticEffect : EntitySystem
|
|||||||
|
|
||||||
private void Effects(EntityUid uid, NarcoticEffectComponent component, int index)
|
private void Effects(EntityUid uid, NarcoticEffectComponent component, int index)
|
||||||
{
|
{
|
||||||
|
if(!TryComp<StandingStateComponent>(uid, out var standingComp))
|
||||||
|
return;
|
||||||
|
|
||||||
RaiseLocalEvent(uid, new MoodEffectEvent("Stimulator"));
|
RaiseLocalEvent(uid, new MoodEffectEvent("Stimulator"));
|
||||||
CancellationToken token = component.CancelTokenSource.Token;
|
CancellationToken token = component.CancelTokenSource.Token;
|
||||||
|
|
||||||
@@ -63,12 +62,12 @@ public sealed class NarcoticEffect : EntitySystem
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NarcoticEffects.StunAndShake when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp):
|
case NarcoticEffects.StunAndShake when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp):
|
||||||
Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token);
|
Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
|
||||||
_statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp);
|
_statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NarcoticEffects.Stun:
|
case NarcoticEffects.Stun:
|
||||||
Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token);
|
Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NarcoticEffects.TremorAndShake:
|
case NarcoticEffects.TremorAndShake:
|
||||||
@@ -85,7 +84,7 @@ public sealed class NarcoticEffect : EntitySystem
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NarcoticEffects.StunAndShake:
|
case NarcoticEffects.StunAndShake:
|
||||||
Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token);
|
Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token);
|
||||||
_statusEffectsSystem.TryAddStatusEffect<DrunkComponent>(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp);
|
_statusEffectsSystem.TryAddStatusEffect<DrunkComponent>(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Server._White.Chemistry;
|
namespace Content.Shared._White.Chemistry;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is used for...
|
/// This is used for...
|
||||||
@@ -9,9 +9,6 @@ namespace Content.Server._White.Chemistry;
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public sealed partial class NarcoticEffectComponent : Component
|
public sealed partial class NarcoticEffectComponent : Component
|
||||||
{
|
{
|
||||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
|
||||||
public float StunTime = 0.7f;
|
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||||
public CancellationTokenSource CancelTokenSource = new();
|
public CancellationTokenSource CancelTokenSource = new();
|
||||||
|
|
||||||
Reference in New Issue
Block a user