* Fix bypassing bonking with verb * Revert "Fix bypassing bonking with verb" This reverts commit efa0f0f5777b893bcee5a852994cfa1e3fda3e71. * Properly refactored BonkSystem. * Oh hey, this is redundant now * Better solution * Reduced default bonk chance from 75% to 50% * Also do a little grammar fix * Moved BonkChance from BonkableComponent to ClumsyComponent. * Revert "Moved BonkChance from BonkableComponent to ClumsyComponent." This reverts commit 0acbd9273f20ec478692603781adf15e06e5ed41. * Another little grammar fix * Matched default bonk doAfter length to default climb doAfter length * Fixed duplicate popups * Check CanVault with verb use too. Add granularity to ClimbingComponent and remove Leg/Foot requirement. * Don't show verb if you can't climb * Removed CanForceClimb * byref record struct
50 lines
1.6 KiB
C#
50 lines
1.6 KiB
C#
using System.Numerics;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared.Climbing.Components;
|
|
|
|
/// <summary>
|
|
/// Indicates that this entity is able to be placed on top of surfaces like tables.
|
|
/// Does not by itself allow the entity to carry out the action of climbing, unless
|
|
/// <see cref="CanClimb"/> is true. Use <see cref="CanForceClimb"/> to control whether
|
|
/// the entity can force other entities onto surfaces.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
|
public sealed partial class ClimbingComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Whether the owner is able to climb onto things by their own action.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool CanClimb = true;
|
|
|
|
/// <summary>
|
|
/// Whether the owner is climbing on a climbable entity.
|
|
/// </summary>
|
|
[AutoNetworkedField, DataField]
|
|
public bool IsClimbing;
|
|
|
|
/// <summary>
|
|
/// Whether the owner is being moved onto the climbed entity.
|
|
/// </summary>
|
|
[AutoNetworkedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
[AutoPausedField]
|
|
public TimeSpan? NextTransition;
|
|
|
|
/// <summary>
|
|
/// Direction to move when transition.
|
|
/// </summary>
|
|
[AutoNetworkedField, DataField]
|
|
public Vector2 Direction;
|
|
|
|
/// <summary>
|
|
/// How fast the entity is moved when climbing.
|
|
/// </summary>
|
|
[DataField]
|
|
public float TransitionRate = 5f;
|
|
|
|
[AutoNetworkedField, DataField]
|
|
public Dictionary<string, int> DisabledFixtureMasks = new();
|
|
}
|