Files
tbd-station-14/Content.Shared/GameObjects/Components/Mobs/SharedStatusEffectsComponent.cs
metalgearsloth de148fc98f Add hunger and thirst (#363)
* Add hunger and thirst

Based on the SS13 systems.
Food (Nutriment) / Drink -> Stomach -> Hunger / Thirst

* Cleanup rebase

* Cleanup stuff that was prototyped

* Address feedback

Still need to add a statuseffects system in a separate branch

* More cleanup on nutrition

Fix Remie's feedback and also damage tick.

* Re-implement nutrition with master

* Updated to use the StatusEffectsUI update
* Removed all clientside components as they only receive the UI updates now
* Implemented PR feedback
* Had to make a slight adjustment to the chemistry SolutionComponent given it doesn't have an Owner, same with Solution

Still TODO:
* Metabolisation effects
* Change drink contents to alcohol / wine etc.
* Add items to the dispensers
* For transparent containers use RecalculateColor

Could probably genericise DrinkFoodContainer as well to be a temporary item dispenser

* Fix broken bottle parent
2019-11-11 22:20:03 +01:00

39 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Mobs
{
/// <summary>
/// Handles the icons on the right side of the screen.
/// Should only be used for player-controlled entities
/// </summary>
public abstract class SharedStatusEffectsComponent : Component
{
public override string Name => "StatusEffectsUI";
public override uint? NetID => ContentNetIDs.STATUSEFFECTS;
public sealed override Type StateType => typeof(StatusEffectComponentState);
}
[Serializable, NetSerializable]
public class StatusEffectComponentState : ComponentState
{
public Dictionary<StatusEffect, string> StatusEffects;
public StatusEffectComponentState(Dictionary<StatusEffect, string> statusEffects) : base(ContentNetIDs.STATUSEFFECTS)
{
StatusEffects = statusEffects;
}
}
// Each status effect is assumed to be unique
public enum StatusEffect
{
Health,
Hunger,
Thirst,
}
}