2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Movement.Components;
|
2021-11-07 22:17:35 -07:00
|
|
|
using Content.Shared.Movement.EntitySystems;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Nutrition.Components;
|
2020-06-24 02:21:20 +02:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Client.Nutrition.Components
|
2020-06-24 02:21:20 +02:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class ThirstComponent : SharedThirstComponent
|
2020-06-24 02:21:20 +02:00
|
|
|
{
|
|
|
|
|
private ThirstThreshold _currentThirstThreshold;
|
|
|
|
|
public override ThirstThreshold CurrentThirstThreshold => _currentThirstThreshold;
|
|
|
|
|
|
|
|
|
|
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
|
|
|
|
{
|
2020-11-26 14:33:31 +01:00
|
|
|
base.HandleComponentState(curState, nextState);
|
|
|
|
|
|
|
|
|
|
if (curState is not ThirstComponentState thirst)
|
2020-06-24 02:21:20 +02:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_currentThirstThreshold = thirst.CurrentThreshold;
|
|
|
|
|
|
2021-12-07 21:54:00 +11:00
|
|
|
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(Owner);
|
2020-06-24 02:21:20 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|