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:
Alex Evgrashin
2021-11-04 00:35:34 +03:00
committed by GitHub
parent b29e826102
commit c1cf22d97e
29 changed files with 686 additions and 1 deletions

View 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
}
}