Pinpointer (#5131)
* Add pinpointer sprites * Start working on pinpointer * Updated pinpointer * Working on visuals * Working on a pinpointer and eye rotation * Add client/server pinpointers systems * Minor cleanup * Add distance support * Add nuke tag * Remove redundant flag and add pinpointer to caps locker * Disable rotation of pinpointer * Fixed distance Co-authored-by: Alexander Evgrashin <evgrashin.adl@gmail.com>
This commit is contained in:
54
Content.Shared/Pinpointer/PinpointerComponent.cs
Normal file
54
Content.Shared/Pinpointer/PinpointerComponent.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Shared.Pinpointer
|
||||
{
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent]
|
||||
[Friend(typeof(SharedPinpointerSystem))]
|
||||
public class PinpointerComponent : Component
|
||||
{
|
||||
public override string Name => "Pinpointer";
|
||||
|
||||
[DataField("whitelist")]
|
||||
public EntityWhitelist? Whitelist;
|
||||
|
||||
[DataField("mediumDistance")]
|
||||
public float MediumDistance = 16f;
|
||||
|
||||
[DataField("closeDistance")]
|
||||
public float CloseDistance = 8f;
|
||||
|
||||
[DataField("reachedDistance")]
|
||||
public float ReachedDistance = 1f;
|
||||
|
||||
public EntityUid? Target = null;
|
||||
public bool IsActive = false;
|
||||
public Direction DirectionToTarget = Direction.Invalid;
|
||||
public Distance DistanceToTarget = Distance.UNKNOWN;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PinpointerComponentState : ComponentState
|
||||
{
|
||||
public bool IsActive;
|
||||
public Direction DirectionToTarget;
|
||||
public Distance DistanceToTarget;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum Distance : byte
|
||||
{
|
||||
UNKNOWN,
|
||||
REACHED,
|
||||
CLOSE,
|
||||
MEDIUM,
|
||||
FAR
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user