2019-09-26 22:32:32 +02:00
|
|
|
using Content.Shared.GameObjects.Components.Mobs;
|
2019-06-30 00:01:41 +02:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameObjects.Components.Mobs
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Stores whether an entity is in "combat mode"
|
|
|
|
|
/// This is used to differentiate between regular item interactions or
|
|
|
|
|
/// using *everything* as a weapon.
|
|
|
|
|
/// </summary>
|
2019-07-31 15:02:36 +02:00
|
|
|
[RegisterComponent]
|
2019-09-26 22:32:32 +02:00
|
|
|
public sealed class CombatModeComponent : SharedCombatModeComponent
|
2019-06-30 00:01:41 +02:00
|
|
|
{
|
2019-09-26 22:32:32 +02:00
|
|
|
private bool _isInCombatMode;
|
|
|
|
|
private TargetingZone _activeZone;
|
2019-06-30 00:01:41 +02:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2019-09-26 22:32:32 +02:00
|
|
|
public bool IsInCombatMode
|
|
|
|
|
{
|
|
|
|
|
get => _isInCombatMode;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_isInCombatMode = value;
|
|
|
|
|
Dirty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public TargetingZone ActiveZone
|
|
|
|
|
{
|
|
|
|
|
get => _activeZone;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_activeZone = value;
|
|
|
|
|
Dirty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ComponentState GetComponentState()
|
|
|
|
|
{
|
|
|
|
|
return new CombatModeComponentState(IsInCombatMode, ActiveZone);
|
|
|
|
|
}
|
2019-06-30 00:01:41 +02:00
|
|
|
}
|
|
|
|
|
}
|