SS14-26964 Clown Waddling Replicates, etc (#26983)

This commit is contained in:
Hannah Giovanna Dawson
2024-06-04 14:23:09 +01:00
committed by GitHub
parent 58647e7036
commit d4fe7eda51
6 changed files with 213 additions and 122 deletions

View File

@@ -1,31 +1,32 @@
using System.Numerics;
using Robust.Shared.Serialization;
namespace Content.Shared.Movement.Components;
/// <summary>
/// Declares that an entity has started to waddle like a duck/clown.
/// </summary>
/// <param name="Entity">The newly be-waddled.</param>
[ByRefEvent]
public record struct StartedWaddlingEvent(EntityUid Entity)
/// <param name="entity">The newly be-waddled.</param>
[Serializable, NetSerializable]
public sealed class StartedWaddlingEvent(NetEntity entity) : EntityEventArgs
{
public EntityUid Entity = Entity;
public NetEntity Entity = entity;
}
/// <summary>
/// Declares that an entity has stopped waddling like a duck/clown.
/// </summary>
/// <param name="Entity">The former waddle-er.</param>
[ByRefEvent]
public record struct StoppedWaddlingEvent(EntityUid Entity)
/// <param name="entity">The former waddle-er.</param>
[Serializable, NetSerializable]
public sealed class StoppedWaddlingEvent(NetEntity entity) : EntityEventArgs
{
public EntityUid Entity = Entity;
public NetEntity Entity = entity;
}
/// <summary>
/// Defines something as having a waddle animation when it moves.
/// </summary>
[RegisterComponent]
[RegisterComponent, AutoGenerateComponentState]
public sealed partial class WaddleAnimationComponent : Component
{
/// <summary>
@@ -38,26 +39,26 @@ public sealed partial class WaddleAnimationComponent : Component
///<summary>
/// How high should they hop during the waddle? Higher hop = more energy.
/// </summary>
[DataField]
[DataField, AutoNetworkedField]
public Vector2 HopIntensity = new(0, 0.25f);
/// <summary>
/// How far should they rock backward and forward during the waddle?
/// Each step will alternate between this being a positive and negative rotation. More rock = more scary.
/// </summary>
[DataField]
[DataField, AutoNetworkedField]
public float TumbleIntensity = 20.0f;
/// <summary>
/// How long should a complete step take? Less time = more chaos.
/// </summary>
[DataField]
[DataField, AutoNetworkedField]
public float AnimationLength = 0.66f;
/// <summary>
/// How much shorter should the animation be when running?
/// </summary>
[DataField]
[DataField, AutoNetworkedField]
public float RunAnimationLengthMultiplier = 0.568f;
/// <summary>
@@ -68,5 +69,6 @@ public sealed partial class WaddleAnimationComponent : Component
/// <summary>
/// Stores if we're currently waddling so we can start/stop as appropriate and can tell other systems our state.
/// </summary>
[AutoNetworkedField]
public bool IsCurrentlyWaddling;
}