Adds IThrowCollide, Creaming people with cream pies and tactical stun baton throws (#2122)

This commit is contained in:
Víctor Aguilera Puerto
2020-09-22 15:34:30 +02:00
committed by GitHub
parent db32180942
commit 4c34a12c67
33 changed files with 285 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
using Content.Shared.GameObjects.Components.Nutrition;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
namespace Content.Client.GameObjects.Components.Nutrition
{
[UsedImplicitly]
public class CreamPiedVisualizer : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (component.TryGetData<bool>(CreamPiedVisuals.Creamed, out var pied))
{
SetPied(component, pied);
}
}
private void SetPied(AppearanceComponent component, bool pied)
{
var sprite = component.Owner.GetComponent<ISpriteComponent>();
sprite.LayerSetVisible(CreamPiedVisualLayers.Pie, pied);
}
}
public enum CreamPiedVisualLayers
{
Pie,
}
}