Add basic teleportation and portals (#269)

* Add basic teleportation and portals

* Address PJB's feedback and minor cleanup
This commit is contained in:
metalgearsloth
2019-07-19 18:09:33 +10:00
committed by Pieter-Jan Briers
parent 52a6d9ff43
commit 1f320eccd7
22 changed files with 825 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System;
using Content.Shared.GameObjects.Components.Movement;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
namespace Content.Client.GameObjects.Components.Movement
{
[UsedImplicitly]
public class HandTeleporterVisualizer2D : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
var sprite = component.Owner.GetComponent<ISpriteComponent>();
if (!component.TryGetData(TeleporterVisuals.VisualState, out TeleporterVisualState state))
{
state = TeleporterVisualState.Ready;
}
switch (state)
{
case TeleporterVisualState.Charging:
sprite.LayerSetState(0, "charging");
break;
case TeleporterVisualState.Ready:
sprite.LayerSetState(0, "ready");
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}