Crawling Part 1: The Knockdownening (#36881)

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
Princess Cheeseballs
2025-07-19 16:54:42 -07:00
committed by GitHub
parent cfb0a95035
commit dec2d42a1d
60 changed files with 1595 additions and 220 deletions

View File

@@ -1,18 +1,46 @@
using Robust.Shared.Audio;
using Content.Shared.DoAfter;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Stunnable;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedStunSystem))]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas:true), AutoGenerateComponentPause, Access(typeof(SharedStunSystem))]
public sealed partial class KnockedDownComponent : Component
{
[DataField("helpInterval"), AutoNetworkedField]
public float HelpInterval = 1f;
/// <summary>
/// Game time that we can stand up.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
public TimeSpan NextUpdate;
[DataField("helpAttemptSound")]
public SoundSpecifier StunAttemptSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
/// <summary>
/// Should we try to stand up?
/// </summary>
[DataField, AutoNetworkedField]
public bool AutoStand = true;
[ViewVariables, AutoNetworkedField]
public float HelpTimer = 0f;
/// <summary>
/// The Standing Up DoAfter.
/// </summary>
[DataField, AutoNetworkedField]
public ushort? DoAfterId;
/// <summary>
/// Friction modifier for knocked down players.
/// Makes them accelerate and deccelerate slower.
/// </summary>
[DataField, AutoNetworkedField]
public float FrictionModifier = 1f; // Should add a friction modifier to slipping to compensate for this
/// <summary>
/// Modifier to the maximum movement speed of a knocked down mover.
/// </summary>
[DataField, AutoNetworkedField]
public float SpeedModifier = 1f;
/// <summary>
/// How long does it take us to get up?
/// </summary>
[DataField, AutoNetworkedField]
public TimeSpan GetUpDoAfter = TimeSpan.FromSeconds(1);
}