#nullable enable
using System.Collections.Generic;
using Content.IntegrationTests.Tests.Interaction;
+using Content.Shared.Movement.Components;
using Content.Shared.Slippery;
using Content.Shared.Stunnable;
using Robust.Shared.GameObjects;
var sys = SEntMan.System<SlipTestSystem>();
await SpawnTarget("TrashBananaPeel");
+ var modifier = Comp<MovementSpeedModifierComponent>(Player).SprintSpeedModifier;
+ Assert.That(modifier, Is.EqualTo(1), "Player is not moving at full speed.");
+
// Player is to the left of the banana peel and has not slipped.
#pragma warning disable NUnit2045
Assert.That(Delta(), Is.GreaterThan(0.5f));
[AutoNetworkedField]
public float ActualDecayRate;
- // Thirst
- [ViewVariables(VVAccess.ReadOnly)]
- [AutoNetworkedField]
+ [DataField, AutoNetworkedField]
public ThirstThreshold CurrentThirstThreshold;
- [ViewVariables(VVAccess.ReadOnly)]
- [AutoNetworkedField]
+ [DataField, AutoNetworkedField]
public ThirstThreshold LastThirstThreshold;
[ViewVariables(VVAccess.ReadWrite)]
/// </summary>
[DataField("nextUpdateTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
- public TimeSpan NextUpdateTime;
+ public TimeSpan NextUpdateTime = TimeSpan.MaxValue;
/// <summary>
/// The time between each update.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
- [AutoNetworkedField]
+ [DataField, AutoNetworkedField]
public TimeSpan UpdateRate = TimeSpan.FromSeconds(1);
[DataField("thresholds")]
component.LastThirstThreshold = ThirstThreshold.Okay; // TODO: Potentially change this -> Used Okay because no effects.
// TODO: Check all thresholds make sense and throw if they don't.
UpdateEffects(uid, component);
+
+ TryComp(uid, out MovementSpeedModifierComponent? moveMod);
+ _movement.RefreshMovementSpeedModifiers(uid, moveMod);
}
private void OnRefreshMovespeed(EntityUid uid, ThirstComponent component, RefreshMovementSpeedModifiersEvent args)
thirst.CurrentThirstThreshold = calculatedThirstThreshold;
UpdateEffects(uid, thirst);
- Dirty(uid, thirst);
}
}