2019-10-31 02:37:22 +11:00
|
|
|
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;
|
2020-07-23 01:40:31 +02:00
|
|
|
|
|
|
|
|
public abstract void ChangeStatusEffect(StatusEffect effect, string icon, ValueTuple<TimeSpan, TimeSpan>? cooldown);
|
2019-10-31 02:37:22 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public class StatusEffectComponentState : ComponentState
|
|
|
|
|
{
|
2020-06-12 16:22:36 +02:00
|
|
|
public Dictionary<StatusEffect, StatusEffectStatus> StatusEffects;
|
2019-10-31 02:37:22 +11:00
|
|
|
|
2020-06-12 16:22:36 +02:00
|
|
|
public StatusEffectComponentState(Dictionary<StatusEffect, StatusEffectStatus> statusEffects) : base(ContentNetIDs.STATUSEFFECTS)
|
2019-10-31 02:37:22 +11:00
|
|
|
{
|
|
|
|
|
StatusEffects = statusEffects;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-25 15:52:24 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// A message that calls the click interaction on a status effect
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public class ClickStatusMessage : ComponentMessage
|
|
|
|
|
{
|
|
|
|
|
public readonly StatusEffect Effect;
|
|
|
|
|
|
|
|
|
|
public ClickStatusMessage(StatusEffect effect)
|
|
|
|
|
{
|
|
|
|
|
Directed = true;
|
|
|
|
|
Effect = effect;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-12 16:22:36 +02:00
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public struct StatusEffectStatus
|
|
|
|
|
{
|
|
|
|
|
public string Icon;
|
|
|
|
|
public ValueTuple<TimeSpan, TimeSpan>? Cooldown;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-31 02:37:22 +11:00
|
|
|
// Each status effect is assumed to be unique
|
|
|
|
|
public enum StatusEffect
|
|
|
|
|
{
|
|
|
|
|
Health,
|
2019-11-12 08:20:03 +11:00
|
|
|
Hunger,
|
|
|
|
|
Thirst,
|
2020-08-07 16:23:16 +02:00
|
|
|
Pressure,
|
2020-05-14 17:26:08 +02:00
|
|
|
Stun,
|
2020-06-25 15:52:24 +02:00
|
|
|
Buckled,
|
2020-07-27 00:54:32 +02:00
|
|
|
Piloting,
|
|
|
|
|
Pulling,
|
|
|
|
|
Pulled
|
2019-10-31 02:37:22 +11:00
|
|
|
}
|
|
|
|
|
}
|