remove a bunch of instances of component reference (#13164)
This commit is contained in:
@@ -1,11 +0,0 @@
|
|||||||
using Content.Shared.Buckle.Components;
|
|
||||||
|
|
||||||
namespace Content.Client.Buckle;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedBuckleComponent))]
|
|
||||||
[Access(typeof(BuckleSystem))]
|
|
||||||
public sealed class BuckleComponent : SharedBuckleComponent
|
|
||||||
{
|
|
||||||
public int? OriginalDrawDepth { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
using Content.Client.Buckle.Strap;
|
|
||||||
using Content.Client.Rotation;
|
using Content.Client.Rotation;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Buckle;
|
using Content.Shared.Buckle;
|
||||||
@@ -12,15 +11,14 @@ namespace Content.Client.Buckle
|
|||||||
internal sealed class BuckleSystem : SharedBuckleSystem
|
internal sealed class BuckleSystem : SharedBuckleSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||||
[Dependency] private readonly AppearanceSystem AppearanceSystem = default!;
|
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;
|
||||||
[Dependency] private readonly RotationVisualizerSystem RotationVisualizerSystem = default!;
|
[Dependency] private readonly RotationVisualizerSystem _rotationVisualizerSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<BuckleComponent, ComponentHandleState>(OnBuckleHandleState);
|
SubscribeLocalEvent<BuckleComponent, ComponentHandleState>(OnBuckleHandleState);
|
||||||
SubscribeLocalEvent<StrapComponent, ComponentHandleState>(OnStrapHandleState);
|
|
||||||
SubscribeLocalEvent<BuckleComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
SubscribeLocalEvent<BuckleComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,22 +63,10 @@ namespace Content.Client.Buckle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStrapHandleState(EntityUid uid, StrapComponent component, ref ComponentHandleState args)
|
|
||||||
{
|
|
||||||
if (args.Current is not StrapComponentState state)
|
|
||||||
return;
|
|
||||||
|
|
||||||
component.Position = state.Position;
|
|
||||||
component.BuckleOffsetUnclamped = state.BuckleOffsetClamped;
|
|
||||||
component.BuckledEntities.Clear();
|
|
||||||
component.BuckledEntities.UnionWith(state.BuckledEntities);
|
|
||||||
component.MaxBuckleDistance = state.MaxBuckleDistance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args)
|
private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args)
|
||||||
{
|
{
|
||||||
if (!AppearanceSystem.TryGetData<int>(uid, StrapVisuals.RotationAngle, out var angle, args.Component) ||
|
if (!_appearanceSystem.TryGetData<int>(uid, StrapVisuals.RotationAngle, out var angle, args.Component) ||
|
||||||
!AppearanceSystem.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component) ||
|
!_appearanceSystem.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component) ||
|
||||||
!buckled ||
|
!buckled ||
|
||||||
args.Sprite == null)
|
args.Sprite == null)
|
||||||
{
|
{
|
||||||
@@ -88,7 +74,7 @@ namespace Content.Client.Buckle
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Animate strapping yourself to something at a given angle
|
// Animate strapping yourself to something at a given angle
|
||||||
RotationVisualizerSystem.AnimateSpriteRotation(args.Sprite, Angle.FromDegrees(angle), 0.125f);
|
_rotationVisualizerSystem.AnimateSpriteRotation(args.Sprite, Angle.FromDegrees(angle), 0.125f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
using Content.Shared.Buckle.Components;
|
|
||||||
|
|
||||||
namespace Content.Client.Buckle.Strap;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedStrapComponent))]
|
|
||||||
[Access(typeof(BuckleSystem))]
|
|
||||||
public sealed class StrapComponent : SharedStrapComponent
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -6,10 +6,3 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
|
|||||||
{
|
{
|
||||||
//Empty client system for component replication
|
//Empty client system for component replication
|
||||||
}
|
}
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedCartridgeLoaderComponent))]
|
|
||||||
public sealed class CartridgeLoaderComponent : SharedCartridgeLoaderComponent
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using static Content.Shared.Configurable.SharedConfigurationComponent;
|
using static Content.Shared.Configurable.ConfigurationComponent;
|
||||||
|
|
||||||
namespace Content.Client.Configurable.UI
|
namespace Content.Client.Configurable.UI
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using static Content.Shared.Configurable.SharedConfigurationComponent;
|
using static Content.Shared.Configurable.ConfigurationComponent;
|
||||||
using static Robust.Client.UserInterface.Controls.BaseButton;
|
using static Robust.Client.UserInterface.Controls.BaseButton;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
using Content.Shared.Ensnaring.Components;
|
|
||||||
|
|
||||||
namespace Content.Client.Ensnaring.Components;
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedEnsnareableComponent))]
|
|
||||||
public sealed class EnsnareableComponent : SharedEnsnareableComponent
|
|
||||||
{
|
|
||||||
[DataField("sprite")]
|
|
||||||
public string? Sprite;
|
|
||||||
|
|
||||||
[DataField("state")]
|
|
||||||
public string? State;
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,3 @@
|
|||||||
using Content.Shared.Ensnaring.Components;
|
using Content.Shared.Ensnaring.Components;
|
||||||
|
|
||||||
namespace Content.Client.Ensnaring.Components;
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedEnsnaringComponent))]
|
|
||||||
public sealed class EnsnaringComponent : SharedEnsnaringComponent
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Content.Client.Ensnaring.Components;
|
|
||||||
using Content.Shared.Ensnaring;
|
using Content.Shared.Ensnaring;
|
||||||
|
using Content.Shared.Ensnaring.Components;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
|
|
||||||
namespace Content.Client.Ensnaring.Visualizers;
|
namespace Content.Client.Ensnaring.Visualizers;
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ namespace Content.Client.Inventory
|
|||||||
}
|
}
|
||||||
|
|
||||||
// snare-removal button. This is just the old button before the change to item slots. It is pretty out of place.
|
// snare-removal button. This is just the old button before the change to item slots. It is pretty out of place.
|
||||||
if (_entMan.TryGetComponent(Owner.Owner, out SharedEnsnareableComponent? snare) && snare.IsEnsnared)
|
if (_entMan.TryGetComponent(Owner.Owner, out EnsnareableComponent? snare) && snare.IsEnsnared)
|
||||||
{
|
{
|
||||||
var button = new Button()
|
var button = new Button()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
using Content.Client.Movement.Systems;
|
|
||||||
using Content.Shared.Climbing;
|
|
||||||
|
|
||||||
namespace Content.Client.Movement.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[Access(typeof(ClimbSystem))]
|
|
||||||
[ComponentReference(typeof(SharedClimbableComponent))]
|
|
||||||
public sealed class ClimbableComponent : SharedClimbableComponent { }
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using Content.Client.Movement.Systems;
|
|
||||||
using Content.Shared.Climbing;
|
|
||||||
|
|
||||||
namespace Content.Client.Movement.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[Access(typeof(ClimbSystem))]
|
|
||||||
[ComponentReference(typeof(SharedClimbingComponent))]
|
|
||||||
public sealed class ClimbingComponent : SharedClimbingComponent { }
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Content.Client.Interactable;
|
using Content.Client.Interactable;
|
||||||
using Content.Client.Movement.Components;
|
|
||||||
using Content.Shared.Climbing;
|
using Content.Shared.Climbing;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
@@ -18,14 +17,14 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
|
|
||||||
private static void OnClimbingState(EntityUid uid, ClimbingComponent component, ref ComponentHandleState args)
|
private static void OnClimbingState(EntityUid uid, ClimbingComponent component, ref ComponentHandleState args)
|
||||||
{
|
{
|
||||||
if (args.Current is not SharedClimbingComponent.ClimbModeComponentState climbModeState)
|
if (args.Current is not ClimbingComponent.ClimbModeComponentState climbModeState)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
component.IsClimbing = climbModeState.Climbing;
|
component.IsClimbing = climbModeState.Climbing;
|
||||||
component.OwnerIsTransitioning = climbModeState.IsTransitioning;
|
component.OwnerIsTransitioning = climbModeState.IsTransitioning;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCanDragDropOn(EntityUid uid, SharedClimbableComponent component, CanDragDropOnEvent args)
|
protected override void OnCanDragDropOn(EntityUid uid, ClimbableComponent component, CanDragDropOnEvent args)
|
||||||
{
|
{
|
||||||
base.OnCanDragDropOn(uid, component, args);
|
base.OnCanDragDropOn(uid, component, args);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
using Content.Shared.Singularity.Components;
|
|
||||||
|
|
||||||
namespace Content.Client.Singularity.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedContainmentFieldComponent))]
|
|
||||||
public sealed class ContainmentFieldComponent : SharedContainmentFieldComponent { }
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
using Content.Shared.Singularity.Components;
|
|
||||||
|
|
||||||
namespace Content.Client.Singularity.Components;
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedContainmentFieldGeneratorComponent))]
|
|
||||||
public sealed class ContainmentFieldGeneratorComponent : SharedContainmentFieldGeneratorComponent { }
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Body.Systems;
|
using Content.Server.Body.Systems;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.Buckle.Systems;
|
using Content.Server.Buckle.Systems;
|
||||||
using Content.Server.Hands.Components;
|
using Content.Server.Hands.Components;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Body.Part;
|
using Content.Shared.Body.Part;
|
||||||
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Standing;
|
using Content.Shared.Standing;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Climbing.Components;
|
using Content.Server.Climbing.Components;
|
||||||
|
using Content.Shared.Climbing;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Content.Server.Prayer;
|
|||||||
using Content.Server.Xenoarchaeology.XenoArtifacts;
|
using Content.Server.Xenoarchaeology.XenoArtifacts;
|
||||||
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
|
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
|
using Content.Shared.Configurable;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
using Content.Shared.Interaction.Helpers;
|
using Content.Shared.Interaction.Helpers;
|
||||||
@@ -27,7 +28,7 @@ using Robust.Shared.Console;
|
|||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using static Content.Shared.Configurable.SharedConfigurationComponent;
|
using static Content.Shared.Configurable.ConfigurationComponent;
|
||||||
|
|
||||||
namespace Content.Server.Administration.Systems
|
namespace Content.Server.Administration.Systems
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Server.Ensnaring;
|
using Content.Server.Ensnaring;
|
||||||
using Content.Server.Ensnaring.Components;
|
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
|
using Content.Shared.Ensnaring.Components;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
namespace Content.Server.Alert.Click;
|
namespace Content.Server.Alert.Click;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using Content.Server.Actions;
|
|||||||
using Content.Server.Bed.Components;
|
using Content.Server.Bed.Components;
|
||||||
using Content.Server.Bed.Sleep;
|
using Content.Server.Bed.Sleep;
|
||||||
using Content.Server.Body.Systems;
|
using Content.Server.Body.Systems;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.MobState;
|
using Content.Server.MobState;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Power.EntitySystems;
|
using Content.Server.Power.EntitySystems;
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
using Content.Server.Buckle.Systems;
|
|
||||||
using Content.Shared.Buckle.Components;
|
|
||||||
|
|
||||||
namespace Content.Server.Buckle.Components;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Component that handles sitting entities into <see cref="StrapComponent"/>s.
|
|
||||||
/// </summary>
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedBuckleComponent))]
|
|
||||||
[Access(typeof(BuckleSystem))]
|
|
||||||
public sealed class BuckleComponent : SharedBuckleComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The amount of time that must pass for this entity to
|
|
||||||
/// be able to unbuckle after recently buckling.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("delay")]
|
|
||||||
public TimeSpan UnbuckleDelay = TimeSpan.FromSeconds(0.25f);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The time that this entity buckled at.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables] public TimeSpan BuckleTime;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The strap that this component is buckled to.
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables]
|
|
||||||
public StrapComponent? BuckledTo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The amount of space that this entity occupies in a
|
|
||||||
/// <see cref="StrapComponent"/>.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("size")]
|
|
||||||
public int Size = 100;
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
using Content.Server.Buckle.Systems;
|
|
||||||
using Content.Shared.Alert;
|
|
||||||
using Content.Shared.Buckle.Components;
|
|
||||||
using Robust.Shared.Audio;
|
|
||||||
|
|
||||||
namespace Content.Server.Buckle.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedStrapComponent))]
|
|
||||||
[Access(typeof(BuckleSystem))]
|
|
||||||
public sealed class StrapComponent : SharedStrapComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The angle in degrees to rotate the player by when they get strapped
|
|
||||||
/// </summary>
|
|
||||||
[DataField("rotation")]
|
|
||||||
public int Rotation { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The size of the strap which is compared against when buckling entities
|
|
||||||
/// </summary>
|
|
||||||
[DataField("size")]
|
|
||||||
public int Size { get; set; } = 100;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If disabled, nothing can be buckled on this object, and it will unbuckle anything that's already buckled
|
|
||||||
/// </summary>
|
|
||||||
public bool Enabled { get; set; } = true;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// You can specify the offset the entity will have after unbuckling.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("unbuckleOffset", required: false)]
|
|
||||||
public Vector2 UnbuckleOffset = Vector2.Zero;
|
|
||||||
/// <summary>
|
|
||||||
/// The sound to be played when a mob is buckled
|
|
||||||
/// </summary>
|
|
||||||
[DataField("buckleSound")]
|
|
||||||
public SoundSpecifier BuckleSound { get; } = new SoundPathSpecifier("/Audio/Effects/buckle.ogg");
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The sound to be played when a mob is unbuckled
|
|
||||||
/// </summary>
|
|
||||||
[DataField("unbuckleSound")]
|
|
||||||
public SoundSpecifier UnbuckleSound { get; } = new SoundPathSpecifier("/Audio/Effects/unbuckle.ogg");
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ID of the alert to show when buckled
|
|
||||||
/// </summary>
|
|
||||||
[DataField("buckledAlertType")]
|
|
||||||
public AlertType BuckledAlertType { get; } = AlertType.Buckled;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The sum of the sizes of all the buckled entities in this strap
|
|
||||||
/// </summary>
|
|
||||||
public int OccupiedSize { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Bed.Sleep;
|
using Content.Shared.Bed.Sleep;
|
||||||
@@ -14,7 +13,6 @@ using Content.Shared.Stunnable;
|
|||||||
using Content.Shared.Vehicle.Components;
|
using Content.Shared.Vehicle.Components;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Server.Buckle.Systems;
|
namespace Content.Server.Buckle.Systems;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.Construction.Completions;
|
using Content.Server.Construction.Completions;
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.Destructible;
|
using Content.Shared.Destructible;
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using Content.Shared.CartridgeLoader;
|
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
|
||||||
|
|
||||||
namespace Content.Server.CartridgeLoader;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedCartridgeLoaderComponent))]
|
|
||||||
public sealed class CartridgeLoaderComponent : SharedCartridgeLoaderComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The maximum amount of programs that can be installed on the cartridge loader entity
|
|
||||||
/// </summary>
|
|
||||||
[DataField("diskSpace")]
|
|
||||||
public int DiskSpace = 5;
|
|
||||||
|
|
||||||
[DataField("uiKey", readOnly: true, required: true, customTypeSerializer: typeof(EnumSerializer))]
|
|
||||||
public Enum UiKey = default!;
|
|
||||||
}
|
|
||||||
@@ -241,13 +241,13 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
|
|||||||
loader.BackgroundPrograms.Remove(cartridgeUid);
|
loader.BackgroundPrograms.Remove(cartridgeUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnItemInserted(EntityUid uid, SharedCartridgeLoaderComponent loader, EntInsertedIntoContainerMessage args)
|
protected override void OnItemInserted(EntityUid uid, Shared.CartridgeLoader.CartridgeLoaderComponent loader, EntInsertedIntoContainerMessage args)
|
||||||
{
|
{
|
||||||
RaiseLocalEvent(args.Entity, new CartridgeAddedEvent(uid));
|
RaiseLocalEvent(args.Entity, new CartridgeAddedEvent(uid));
|
||||||
base.OnItemInserted(uid, loader, args);
|
base.OnItemInserted(uid, loader, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnItemRemoved(EntityUid uid, SharedCartridgeLoaderComponent loader, EntRemovedFromContainerMessage args)
|
protected override void OnItemRemoved(EntityUid uid, Shared.CartridgeLoader.CartridgeLoaderComponent loader, EntRemovedFromContainerMessage args)
|
||||||
{
|
{
|
||||||
var deactivate = loader.BackgroundPrograms.Remove(args.Entity);
|
var deactivate = loader.BackgroundPrograms.Remove(args.Entity);
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
SubscribeLocalEvent<GlassTableComponent, ClimbedOnEvent>(OnGlassClimbed);
|
SubscribeLocalEvent<GlassTableComponent, ClimbedOnEvent>(OnGlassClimbed);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCanDragDropOn(EntityUid uid, SharedClimbableComponent component, CanDragDropOnEvent args)
|
protected override void OnCanDragDropOn(EntityUid uid, ClimbableComponent component, CanDragDropOnEvent args)
|
||||||
{
|
{
|
||||||
base.OnCanDragDropOn(uid, component, args);
|
base.OnCanDragDropOn(uid, component, args);
|
||||||
|
|
||||||
@@ -166,6 +166,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
climbing.IsClimbing = true;
|
climbing.IsClimbing = true;
|
||||||
|
Dirty(climbing);
|
||||||
|
|
||||||
MoveEntityToward(uid, climbable, physics, climbing);
|
MoveEntityToward(uid, climbable, physics, climbing);
|
||||||
// we may potentially need additional logic since we're forcing a player onto a climbable
|
// we may potentially need additional logic since we're forcing a player onto a climbable
|
||||||
@@ -265,6 +266,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
|
|
||||||
climbing.IsClimbing = false;
|
climbing.IsClimbing = false;
|
||||||
climbing.OwnerIsTransitioning = false;
|
climbing.OwnerIsTransitioning = false;
|
||||||
|
Dirty(climbing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -275,7 +277,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
/// <param name="target">The object that is being vaulted</param>
|
/// <param name="target">The object that is being vaulted</param>
|
||||||
/// <param name="reason">The reason why it cant be dropped</param>
|
/// <param name="reason">The reason why it cant be dropped</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool CanVault(SharedClimbableComponent component, EntityUid user, EntityUid target, out string reason)
|
private bool CanVault(ClimbableComponent component, EntityUid user, EntityUid target, out string reason)
|
||||||
{
|
{
|
||||||
if (!_actionBlockerSystem.CanInteract(user, target))
|
if (!_actionBlockerSystem.CanInteract(user, target))
|
||||||
{
|
{
|
||||||
@@ -311,7 +313,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
/// <param name="target">The object that is being vaulted onto</param>
|
/// <param name="target">The object that is being vaulted onto</param>
|
||||||
/// <param name="reason">The reason why it cant be dropped</param>
|
/// <param name="reason">The reason why it cant be dropped</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool CanVault(SharedClimbableComponent component, EntityUid user, EntityUid dragged, EntityUid target,
|
private bool CanVault(ClimbableComponent component, EntityUid user, EntityUid dragged, EntityUid target,
|
||||||
out string reason)
|
out string reason)
|
||||||
{
|
{
|
||||||
if (!_actionBlockerSystem.CanInteract(user, dragged) || !_actionBlockerSystem.CanInteract(user, target))
|
if (!_actionBlockerSystem.CanInteract(user, dragged) || !_actionBlockerSystem.CanInteract(user, target))
|
||||||
@@ -353,7 +355,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
|
|
||||||
private static void OnClimbingGetState(EntityUid uid, ClimbingComponent component, ref ComponentGetState args)
|
private static void OnClimbingGetState(EntityUid uid, ClimbingComponent component, ref ComponentGetState args)
|
||||||
{
|
{
|
||||||
args.State = new SharedClimbingComponent.ClimbModeComponentState(component.IsClimbing, component.OwnerIsTransitioning);
|
args.State = new ClimbingComponent.ClimbModeComponentState(component.IsClimbing, component.OwnerIsTransitioning);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGlassClimbed(EntityUid uid, GlassTableComponent component, ClimbedOnEvent args)
|
private void OnGlassClimbed(EntityUid uid, GlassTableComponent component, ClimbedOnEvent args)
|
||||||
@@ -401,7 +403,7 @@ public sealed class ClimbSystem : SharedClimbSystem
|
|||||||
_actionBlockerSystem.UpdateCanMove(uid);
|
_actionBlockerSystem.UpdateCanMove(uid);
|
||||||
|
|
||||||
// Transition back to KinematicController after BufferTime
|
// Transition back to KinematicController after BufferTime
|
||||||
climbing.Owner.SpawnTimer((int) (SharedClimbingComponent.BufferTime * 1000), () =>
|
climbing.Owner.SpawnTimer((int) (ClimbingComponent.BufferTime * 1000), () =>
|
||||||
{
|
{
|
||||||
if (climbing.Deleted) return;
|
if (climbing.Deleted) return;
|
||||||
physics.BodyType = BodyType.KinematicController;
|
physics.BodyType = BodyType.KinematicController;
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
using Content.Shared.CCVar;
|
|
||||||
using Content.Shared.Climbing;
|
|
||||||
using Content.Shared.Damage;
|
|
||||||
using Robust.Shared.Audio;
|
|
||||||
|
|
||||||
namespace Content.Server.Climbing.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedClimbableComponent))]
|
|
||||||
public sealed class ClimbableComponent : SharedClimbableComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The time it takes to climb onto the entity.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("delay")]
|
|
||||||
public float ClimbDelay = 0.8f;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If set, people can bonk on this if <see cref="CCVars.GameTableBonk"/> is set or if they are clumsy.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("bonk")] public bool Bonk = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Chance of bonk triggering if the user is clumsy.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("bonkClumsyChance")]
|
|
||||||
public float BonkClumsyChance = 0.75f;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sound to play when bonking.
|
|
||||||
/// </summary>
|
|
||||||
/// <seealso cref="Bonk"/>
|
|
||||||
[DataField("bonkSound")]
|
|
||||||
public SoundSpecifier? BonkSound;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// How long to stun players on bonk, in seconds.
|
|
||||||
/// </summary>
|
|
||||||
/// <seealso cref="Bonk"/>
|
|
||||||
[DataField("bonkTime")]
|
|
||||||
public float BonkTime = 2;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// How much damage to apply on bonk.
|
|
||||||
/// </summary>
|
|
||||||
/// <seealso cref="Bonk"/>
|
|
||||||
[DataField("bonkDamage")]
|
|
||||||
public DamageSpecifier? BonkDamage;
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using Content.Shared.Climbing;
|
|
||||||
|
|
||||||
namespace Content.Server.Climbing.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedClimbingComponent))]
|
|
||||||
[Access(typeof(ClimbSystem))]
|
|
||||||
public sealed class ClimbingComponent : SharedClimbingComponent
|
|
||||||
{
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
public override bool IsClimbing
|
|
||||||
{
|
|
||||||
get => base.IsClimbing;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (base.IsClimbing == value) return;
|
|
||||||
base.IsClimbing = value;
|
|
||||||
Dirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool OwnerIsTransitioning
|
|
||||||
{
|
|
||||||
get => base.OwnerIsTransitioning;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == base.OwnerIsTransitioning) return;
|
|
||||||
base.OwnerIsTransitioning = value;
|
|
||||||
Dirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ViewVariables]
|
|
||||||
public Dictionary<string, int> DisabledFixtureMasks { get; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using Content.Shared.Configurable;
|
|
||||||
using Content.Shared.Tools;
|
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
||||||
|
|
||||||
namespace Content.Server.Configurable;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedConfigurationComponent))]
|
|
||||||
public sealed class ConfigurationComponent : SharedConfigurationComponent
|
|
||||||
{
|
|
||||||
[DataField("config")]
|
|
||||||
public readonly Dictionary<string, string> Config = new();
|
|
||||||
|
|
||||||
[DataField("qualityNeeded", customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
|
|
||||||
public string QualityNeeded = "Pulsing";
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
|
using Content.Shared.Configurable;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Tools.Components;
|
using Content.Shared.Tools.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using static Content.Shared.Configurable.SharedConfigurationComponent;
|
using static Content.Shared.Configurable.ConfigurationComponent;
|
||||||
|
|
||||||
namespace Content.Server.Configurable;
|
namespace Content.Server.Configurable;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Server.Bed.Components;
|
using Content.Server.Bed.Components;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Shared.Bed.Sleep;
|
using Content.Shared.Bed.Sleep;
|
||||||
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.Disease;
|
using Content.Shared.Disease;
|
||||||
|
|
||||||
namespace Content.Server.Disease.Cures
|
namespace Content.Server.Disease.Cures
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
using Content.Shared.Ensnaring.Components;
|
|
||||||
using Robust.Shared.Containers;
|
|
||||||
|
|
||||||
namespace Content.Server.Ensnaring.Components;
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedEnsnareableComponent))]
|
|
||||||
public sealed class EnsnareableComponent : SharedEnsnareableComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The container where the <see cref="EnsnaringComponent"/> entity will be stored
|
|
||||||
/// </summary>
|
|
||||||
public Container Container = default!;
|
|
||||||
}
|
|
||||||
@@ -1,43 +1,5 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Shared.Ensnaring.Components;
|
using Content.Shared.Ensnaring.Components;
|
||||||
|
|
||||||
namespace Content.Server.Ensnaring.Components;
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedEnsnaringComponent))]
|
|
||||||
public sealed class EnsnaringComponent : SharedEnsnaringComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Should movement cancel breaking out?
|
|
||||||
/// </summary>
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
|
||||||
[DataField("canMoveBreakout")]
|
|
||||||
public bool CanMoveBreakout;
|
|
||||||
|
|
||||||
public CancellationTokenSource? CancelToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Used for the do after event to free the entity that owns the <see cref="EnsnareableComponent"/>
|
|
||||||
/// </summary>
|
|
||||||
public sealed class FreeEnsnareDoAfterComplete : EntityEventArgs
|
|
||||||
{
|
|
||||||
public readonly EntityUid EnsnaringEntity;
|
|
||||||
|
|
||||||
public FreeEnsnareDoAfterComplete(EntityUid ensnaringEntity)
|
|
||||||
{
|
|
||||||
EnsnaringEntity = ensnaringEntity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Used for the do after event when it fails to free the entity that owns the <see cref="EnsnareableComponent"/>
|
|
||||||
/// </summary>
|
|
||||||
public sealed class FreeEnsnareDoAfterCancel : EntityEventArgs
|
|
||||||
{
|
|
||||||
public readonly EntityUid EnsnaringEntity;
|
|
||||||
|
|
||||||
public FreeEnsnareDoAfterCancel(EntityUid ensnaringEntity)
|
|
||||||
{
|
|
||||||
EnsnaringEntity = ensnaringEntity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Server.DoAfter;
|
using Content.Server.DoAfter;
|
||||||
using Content.Server.Ensnaring.Components;
|
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Ensnaring.Components;
|
using Content.Shared.Ensnaring.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.StepTrigger.Systems;
|
using Content.Shared.StepTrigger.Systems;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Server.Ensnaring;
|
namespace Content.Server.Ensnaring;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
using Content.Server.Ensnaring.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Ensnaring;
|
using Content.Shared.Ensnaring;
|
||||||
using Content.Shared.Ensnaring.Components;
|
using Content.Shared.Ensnaring.Components;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Robust.Server.Containers;
|
using Robust.Server.Containers;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Server.Ensnaring;
|
namespace Content.Server.Ensnaring;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.Buckle.Systems;
|
using Content.Server.Buckle.Systems;
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.Foldable;
|
using Content.Shared.Foldable;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.Doors.Components;
|
using Content.Server.Doors.Components;
|
||||||
using Content.Server.Doors.Systems;
|
using Content.Server.Doors.Systems;
|
||||||
using Content.Server.Shuttles.Components;
|
using Content.Server.Shuttles.Components;
|
||||||
@@ -14,7 +13,7 @@ using Robust.Shared.Player;
|
|||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Server.Shuttles.Events;
|
using Content.Server.Shuttles.Events;
|
||||||
using Content.Server.Station.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,15 @@
|
|||||||
using Content.Server.Singularity.Components;
|
|
||||||
using Content.Server.Singularity.Events;
|
using Content.Server.Singularity.Events;
|
||||||
using Content.Shared.Singularity.Components;
|
using Content.Shared.Singularity.Components;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Dynamics;
|
|
||||||
using System.Linq;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Construction.Components;
|
using Content.Shared.Construction.Components;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Throwing;
|
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Server.Singularity.EntitySystems;
|
namespace Content.Server.Singularity.EntitySystems;
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Shuttles.Components;
|
using Content.Server.Shuttles.Components;
|
||||||
using Content.Server.Singularity.Components;
|
|
||||||
using Content.Server.Singularity.EntitySystems;
|
|
||||||
using Content.Server.Singularity.Events;
|
using Content.Server.Singularity.Events;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
|
using Content.Shared.Singularity.Components;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Server.Singularity.EntitySystems;
|
namespace Content.Server.Singularity.EntitySystems;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Content.Server.Cuffs.Components;
|
using Content.Server.Cuffs.Components;
|
||||||
using Content.Server.DoAfter;
|
using Content.Server.DoAfter;
|
||||||
using Content.Server.Ensnaring;
|
using Content.Server.Ensnaring;
|
||||||
using Content.Server.Ensnaring.Components;
|
|
||||||
using Content.Server.Hands.Components;
|
using Content.Server.Hands.Components;
|
||||||
using Content.Shared.CombatMode;
|
using Content.Shared.CombatMode;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
@@ -13,10 +12,10 @@ using Content.Shared.Popups;
|
|||||||
using Content.Shared.Strip.Components;
|
using Content.Shared.Strip.Components;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
|
using Content.Shared.Ensnaring.Components;
|
||||||
|
|
||||||
namespace Content.Server.Strip
|
namespace Content.Server.Strip
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Content.Server.Body.Systems;
|
using Content.Server.Body.Systems;
|
||||||
using Content.Server.Buckle.Components;
|
|
||||||
using Content.Server.Buckle.Systems;
|
using Content.Server.Buckle.Systems;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
@@ -7,6 +6,7 @@ using Content.Server.Storage.EntitySystems;
|
|||||||
using Content.Server.Tools;
|
using Content.Server.Tools;
|
||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Body.Part;
|
using Content.Shared.Body.Part;
|
||||||
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
|
|||||||
@@ -4,15 +4,14 @@ using Robust.Shared.Serialization;
|
|||||||
|
|
||||||
namespace Content.Shared.Buckle.Components;
|
namespace Content.Shared.Buckle.Components;
|
||||||
|
|
||||||
[NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
[Access(typeof(SharedBuckleSystem))]
|
public sealed class BuckleComponent : Component
|
||||||
public abstract class SharedBuckleComponent : Component
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The range from which this entity can buckle to a <see cref="SharedStrapComponent"/>.
|
/// The range from which this entity can buckle to a <see cref="StrapComponent"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("range")]
|
[DataField("range")]
|
||||||
public float Range { get; protected set; } = SharedInteractionSystem.InteractionRange / 1.4f;
|
public float Range = SharedInteractionSystem.InteractionRange / 1.4f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// True if the entity is buckled, false otherwise.
|
/// True if the entity is buckled, false otherwise.
|
||||||
@@ -22,6 +21,36 @@ public abstract class SharedBuckleComponent : Component
|
|||||||
public EntityUid? LastEntityBuckledTo { get; set; }
|
public EntityUid? LastEntityBuckledTo { get; set; }
|
||||||
|
|
||||||
public bool DontCollide { get; set; }
|
public bool DontCollide { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The amount of time that must pass for this entity to
|
||||||
|
/// be able to unbuckle after recently buckling.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("delay")]
|
||||||
|
public TimeSpan UnbuckleDelay = TimeSpan.FromSeconds(0.25f);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The time that this entity buckled at.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables] public TimeSpan BuckleTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The strap that this component is buckled to.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables]
|
||||||
|
public StrapComponent? BuckledTo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The amount of space that this entity occupies in a
|
||||||
|
/// <see cref="StrapComponent"/>.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("size")]
|
||||||
|
public int Size = 100;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for client rendering
|
||||||
|
/// </summary>
|
||||||
|
public int? OriginalDrawDepth { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using Content.Shared.Alert;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
@@ -21,9 +23,8 @@ public enum StrapPosition
|
|||||||
Down
|
Down
|
||||||
}
|
}
|
||||||
|
|
||||||
[NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
[Access(typeof(SharedBuckleSystem))]
|
public sealed class StrapComponent : Component
|
||||||
public abstract class SharedStrapComponent : Component
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The change in position to the strapped mob
|
/// The change in position to the strapped mob
|
||||||
@@ -58,6 +59,52 @@ public abstract class SharedStrapComponent : Component
|
|||||||
[DataField("buckleOffset", required: false)]
|
[DataField("buckleOffset", required: false)]
|
||||||
[Access(Other = AccessPermissions.ReadWrite)]
|
[Access(Other = AccessPermissions.ReadWrite)]
|
||||||
public Vector2 BuckleOffsetUnclamped = Vector2.Zero;
|
public Vector2 BuckleOffsetUnclamped = Vector2.Zero;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The angle in degrees to rotate the player by when they get strapped
|
||||||
|
/// </summary>
|
||||||
|
[DataField("rotation")]
|
||||||
|
public int Rotation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The size of the strap which is compared against when buckling entities
|
||||||
|
/// </summary>
|
||||||
|
[DataField("size")]
|
||||||
|
public int Size { get; set; } = 100;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If disabled, nothing can be buckled on this object, and it will unbuckle anything that's already buckled
|
||||||
|
/// </summary>
|
||||||
|
public bool Enabled { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// You can specify the offset the entity will have after unbuckling.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("unbuckleOffset", required: false)]
|
||||||
|
public Vector2 UnbuckleOffset = Vector2.Zero;
|
||||||
|
/// <summary>
|
||||||
|
/// The sound to be played when a mob is buckled
|
||||||
|
/// </summary>
|
||||||
|
[DataField("buckleSound")]
|
||||||
|
public SoundSpecifier BuckleSound { get; } = new SoundPathSpecifier("/Audio/Effects/buckle.ogg");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The sound to be played when a mob is unbuckled
|
||||||
|
/// </summary>
|
||||||
|
[DataField("unbuckleSound")]
|
||||||
|
public SoundSpecifier UnbuckleSound { get; } = new SoundPathSpecifier("/Audio/Effects/unbuckle.ogg");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID of the alert to show when buckled
|
||||||
|
/// </summary>
|
||||||
|
[DataField("buckledAlertType")]
|
||||||
|
public AlertType BuckledAlertType { get; } = AlertType.Buckled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The sum of the sizes of all the buckled entities in this strap
|
||||||
|
/// </summary>
|
||||||
|
public int OccupiedSize { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
@@ -13,15 +13,15 @@ public abstract partial class SharedBuckleSystem
|
|||||||
{
|
{
|
||||||
private void InitializeBuckle()
|
private void InitializeBuckle()
|
||||||
{
|
{
|
||||||
SubscribeLocalEvent<SharedBuckleComponent, PreventCollideEvent>(PreventCollision);
|
SubscribeLocalEvent<BuckleComponent, PreventCollideEvent>(PreventCollision);
|
||||||
SubscribeLocalEvent<SharedBuckleComponent, DownAttemptEvent>(HandleDown);
|
SubscribeLocalEvent<BuckleComponent, DownAttemptEvent>(HandleDown);
|
||||||
SubscribeLocalEvent<SharedBuckleComponent, StandAttemptEvent>(HandleStand);
|
SubscribeLocalEvent<BuckleComponent, StandAttemptEvent>(HandleStand);
|
||||||
SubscribeLocalEvent<SharedBuckleComponent, ThrowPushbackAttemptEvent>(HandleThrowPushback);
|
SubscribeLocalEvent<BuckleComponent, ThrowPushbackAttemptEvent>(HandleThrowPushback);
|
||||||
SubscribeLocalEvent<SharedBuckleComponent, UpdateCanMoveEvent>(HandleMove);
|
SubscribeLocalEvent<BuckleComponent, UpdateCanMoveEvent>(HandleMove);
|
||||||
SubscribeLocalEvent<SharedBuckleComponent, ChangeDirectionAttemptEvent>(OnBuckleChangeDirectionAttempt);
|
SubscribeLocalEvent<BuckleComponent, ChangeDirectionAttemptEvent>(OnBuckleChangeDirectionAttempt);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PreventCollision(EntityUid uid, SharedBuckleComponent component, ref PreventCollideEvent args)
|
private void PreventCollision(EntityUid uid, BuckleComponent component, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
if (args.BodyB.Owner != component.LastEntityBuckledTo)
|
if (args.BodyB.Owner != component.LastEntityBuckledTo)
|
||||||
return;
|
return;
|
||||||
@@ -30,25 +30,25 @@ public abstract partial class SharedBuckleSystem
|
|||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleDown(EntityUid uid, SharedBuckleComponent component, DownAttemptEvent args)
|
private void HandleDown(EntityUid uid, BuckleComponent component, DownAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (component.Buckled)
|
if (component.Buckled)
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleStand(EntityUid uid, SharedBuckleComponent component, StandAttemptEvent args)
|
private void HandleStand(EntityUid uid, BuckleComponent component, StandAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (component.Buckled)
|
if (component.Buckled)
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleThrowPushback(EntityUid uid, SharedBuckleComponent component, ThrowPushbackAttemptEvent args)
|
private void HandleThrowPushback(EntityUid uid, BuckleComponent component, ThrowPushbackAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (component.Buckled)
|
if (component.Buckled)
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleMove(EntityUid uid, SharedBuckleComponent component, UpdateCanMoveEvent args)
|
private void HandleMove(EntityUid uid, BuckleComponent component, UpdateCanMoveEvent args)
|
||||||
{
|
{
|
||||||
if (component.LifeStage > ComponentLifeStage.Running)
|
if (component.LifeStage > ComponentLifeStage.Running)
|
||||||
return;
|
return;
|
||||||
@@ -58,13 +58,13 @@ public abstract partial class SharedBuckleSystem
|
|||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBuckleChangeDirectionAttempt(EntityUid uid, SharedBuckleComponent component, ChangeDirectionAttemptEvent args)
|
private void OnBuckleChangeDirectionAttempt(EntityUid uid, BuckleComponent component, ChangeDirectionAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (component.Buckled)
|
if (component.Buckled)
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsBuckled(EntityUid uid, SharedBuckleComponent? component = null)
|
public bool IsBuckled(EntityUid uid, BuckleComponent? component = null)
|
||||||
{
|
{
|
||||||
return Resolve(uid, ref component, false) && component.Buckled;
|
return Resolve(uid, ref component, false) && component.Buckled;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
/// <param name="buckleId">The entity to reattach.</param>
|
/// <param name="buckleId">The entity to reattach.</param>
|
||||||
/// <param name="strap">The strap to reattach to.</param>
|
/// <param name="strap">The strap to reattach to.</param>
|
||||||
/// <param name="buckle">The buckle component of the entity to reattach.</param>
|
/// <param name="buckle">The buckle component of the entity to reattach.</param>
|
||||||
public void ReAttach(EntityUid buckleId, SharedStrapComponent strap, SharedBuckleComponent? buckle = null)
|
public void ReAttach(EntityUid buckleId, StrapComponent strap, BuckleComponent? buckle = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(buckleId, ref buckle, false))
|
if (!Resolve(buckleId, ref buckle, false))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ public abstract partial class SharedBuckleSystem
|
|||||||
|
|
||||||
private void InitializeStrap()
|
private void InitializeStrap()
|
||||||
{
|
{
|
||||||
SubscribeLocalEvent<SharedStrapComponent, MoveEvent>(OnStrapRotate);
|
SubscribeLocalEvent<StrapComponent, MoveEvent>(OnStrapRotate);
|
||||||
SubscribeLocalEvent<SharedStrapComponent, ComponentHandleState>(OnStrapHandleState);
|
SubscribeLocalEvent<StrapComponent, ComponentHandleState>(OnStrapHandleState);
|
||||||
SubscribeLocalEvent<SharedStrapComponent, CanDragDropOnEvent>(OnStrapCanDragDropOn);
|
SubscribeLocalEvent<StrapComponent, CanDragDropOnEvent>(OnStrapCanDragDropOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStrapHandleState(EntityUid uid, SharedStrapComponent component, ref ComponentHandleState args)
|
private void OnStrapHandleState(EntityUid uid, StrapComponent component, ref ComponentHandleState args)
|
||||||
{
|
{
|
||||||
if (args.Current is not StrapComponentState state)
|
if (args.Current is not StrapComponentState state)
|
||||||
return;
|
return;
|
||||||
@@ -28,7 +28,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
component.MaxBuckleDistance = state.MaxBuckleDistance;
|
component.MaxBuckleDistance = state.MaxBuckleDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStrapRotate(EntityUid uid, SharedStrapComponent component, ref MoveEvent args)
|
private void OnStrapRotate(EntityUid uid, StrapComponent component, ref MoveEvent args)
|
||||||
{
|
{
|
||||||
// TODO: This looks dirty af.
|
// TODO: This looks dirty af.
|
||||||
// On rotation of a strap, reattach all buckled entities.
|
// On rotation of a strap, reattach all buckled entities.
|
||||||
@@ -50,7 +50,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
|
|
||||||
foreach (var buckledEntity in component.BuckledEntities)
|
foreach (var buckledEntity in component.BuckledEntities)
|
||||||
{
|
{
|
||||||
if (!EntityManager.TryGetComponent(buckledEntity, out SharedBuckleComponent? buckled))
|
if (!EntityManager.TryGetComponent(buckledEntity, out BuckleComponent? buckled))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ public abstract partial class SharedBuckleSystem
|
|||||||
EntityUid user,
|
EntityUid user,
|
||||||
EntityUid target,
|
EntityUid target,
|
||||||
EntityUid buckleId,
|
EntityUid buckleId,
|
||||||
SharedStrapComponent? strap = null,
|
StrapComponent? strap = null,
|
||||||
SharedBuckleComponent? buckle = null)
|
BuckleComponent? buckle = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(strapId, ref strap, false) ||
|
if (!Resolve(strapId, ref strap, false) ||
|
||||||
!Resolve(buckleId, ref buckle, false))
|
!Resolve(buckleId, ref buckle, false))
|
||||||
@@ -85,7 +85,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
return _interactions.InRangeUnobstructed(target, buckleId, buckle.Range, predicate: Ignored);
|
return _interactions.InRangeUnobstructed(target, buckleId, buckle.Range, predicate: Ignored);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStrapCanDragDropOn(EntityUid uid, SharedStrapComponent strap, CanDragDropOnEvent args)
|
private void OnStrapCanDragDropOn(EntityUid uid, StrapComponent strap, CanDragDropOnEvent args)
|
||||||
{
|
{
|
||||||
args.CanDrop = StrapCanDragDropOn(args.Target, args.User, args.Target, args.Dragged, strap);
|
args.CanDrop = StrapCanDragDropOn(args.Target, args.User, args.Target, args.Dragged, strap);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
using Content.Shared.Containers.ItemSlots;
|
using Content.Shared.Containers.ItemSlots;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
||||||
|
|
||||||
namespace Content.Shared.CartridgeLoader;
|
namespace Content.Shared.CartridgeLoader;
|
||||||
|
|
||||||
[Access(typeof(SharedCartridgeLoaderSystem))]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public abstract class SharedCartridgeLoaderComponent : Component
|
public sealed class CartridgeLoaderComponent : Component
|
||||||
{
|
{
|
||||||
public const string CartridgeSlotId = "Cartridge-Slot";
|
public const string CartridgeSlotId = "Cartridge-Slot";
|
||||||
|
|
||||||
@@ -33,4 +35,13 @@ public abstract class SharedCartridgeLoaderComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("installedCartridges")]
|
[DataField("installedCartridges")]
|
||||||
public List<EntityUid> InstalledPrograms = new();
|
public List<EntityUid> InstalledPrograms = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum amount of programs that can be installed on the cartridge loader entity
|
||||||
|
/// </summary>
|
||||||
|
[DataField("diskSpace")]
|
||||||
|
public int DiskSpace = 5;
|
||||||
|
|
||||||
|
[DataField("uiKey", readOnly: true, required: true, customTypeSerializer: typeof(EnumSerializer))]
|
||||||
|
public Enum UiKey = default!;
|
||||||
}
|
}
|
||||||
@@ -14,26 +14,26 @@ public abstract class SharedCartridgeLoaderSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedCartridgeLoaderComponent, ComponentInit>(OnComponentInit);
|
SubscribeLocalEvent<CartridgeLoaderComponent, ComponentInit>(OnComponentInit);
|
||||||
SubscribeLocalEvent<SharedCartridgeLoaderComponent, ComponentRemove>(OnComponentRemove);
|
SubscribeLocalEvent<CartridgeLoaderComponent, ComponentRemove>(OnComponentRemove);
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedCartridgeLoaderComponent, EntInsertedIntoContainerMessage>(OnItemInserted);
|
SubscribeLocalEvent<CartridgeLoaderComponent, EntInsertedIntoContainerMessage>(OnItemInserted);
|
||||||
SubscribeLocalEvent<SharedCartridgeLoaderComponent, EntRemovedFromContainerMessage>(OnItemRemoved);
|
SubscribeLocalEvent<CartridgeLoaderComponent, EntRemovedFromContainerMessage>(OnItemRemoved);
|
||||||
|
|
||||||
SubscribeLocalEvent<CartridgeComponent, ComponentGetState>(OnGetState);
|
SubscribeLocalEvent<CartridgeComponent, ComponentGetState>(OnGetState);
|
||||||
SubscribeLocalEvent<CartridgeComponent, ComponentHandleState>(OnHandleState);
|
SubscribeLocalEvent<CartridgeComponent, ComponentHandleState>(OnHandleState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnComponentInit(EntityUid uid, SharedCartridgeLoaderComponent loader, ComponentInit args)
|
private void OnComponentInit(EntityUid uid, CartridgeLoaderComponent loader, ComponentInit args)
|
||||||
{
|
{
|
||||||
_itemSlotsSystem.AddItemSlot(uid, SharedCartridgeLoaderComponent.CartridgeSlotId, loader.CartridgeSlot);
|
_itemSlotsSystem.AddItemSlot(uid, CartridgeLoaderComponent.CartridgeSlotId, loader.CartridgeSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marks installed program entities for deletion when the component gets removed
|
/// Marks installed program entities for deletion when the component gets removed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnComponentRemove(EntityUid uid, SharedCartridgeLoaderComponent loader, ComponentRemove args)
|
private void OnComponentRemove(EntityUid uid, CartridgeLoaderComponent loader, ComponentRemove args)
|
||||||
{
|
{
|
||||||
_itemSlotsSystem.RemoveItemSlot(uid, loader.CartridgeSlot);
|
_itemSlotsSystem.RemoveItemSlot(uid, loader.CartridgeSlot);
|
||||||
|
|
||||||
@@ -43,12 +43,12 @@ public abstract class SharedCartridgeLoaderSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnItemInserted(EntityUid uid, SharedCartridgeLoaderComponent loader, EntInsertedIntoContainerMessage args)
|
protected virtual void OnItemInserted(EntityUid uid, CartridgeLoaderComponent loader, EntInsertedIntoContainerMessage args)
|
||||||
{
|
{
|
||||||
UpdateAppearanceData(uid, loader);
|
UpdateAppearanceData(uid, loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnItemRemoved(EntityUid uid, SharedCartridgeLoaderComponent loader, EntRemovedFromContainerMessage args)
|
protected virtual void OnItemRemoved(EntityUid uid, CartridgeLoaderComponent loader, EntRemovedFromContainerMessage args)
|
||||||
{
|
{
|
||||||
UpdateAppearanceData(uid, loader);
|
UpdateAppearanceData(uid, loader);
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ public abstract class SharedCartridgeLoaderSystem : EntitySystem
|
|||||||
component.InstallationStatus = state.InstallationStatus;
|
component.InstallationStatus = state.InstallationStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAppearanceData(EntityUid uid, SharedCartridgeLoaderComponent loader)
|
private void UpdateAppearanceData(EntityUid uid, CartridgeLoaderComponent loader)
|
||||||
{
|
{
|
||||||
_appearanceSystem.SetData(uid, CartridgeLoaderVisuals.CartridgeInserted, loader.CartridgeSlot.HasItem);
|
_appearanceSystem.SetData(uid, CartridgeLoaderVisuals.CartridgeInserted, loader.CartridgeSlot.HasItem);
|
||||||
}
|
}
|
||||||
|
|||||||
55
Content.Shared/Climbing/ClimbableComponent.cs
Normal file
55
Content.Shared/Climbing/ClimbableComponent.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
using Content.Shared.CCVar;
|
||||||
|
using Content.Shared.Damage;
|
||||||
|
using Content.Shared.Interaction;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Shared.Climbing
|
||||||
|
{
|
||||||
|
[RegisterComponent, NetworkedComponent]
|
||||||
|
public sealed class ClimbableComponent : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The range from which this entity can be climbed.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("range")] public float Range = SharedInteractionSystem.InteractionRange / 1.4f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The time it takes to climb onto the entity.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("delay")]
|
||||||
|
public float ClimbDelay = 0.8f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If set, people can bonk on this if <see cref="CCVars.GameTableBonk"/> is set or if they are clumsy.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("bonk")] public bool Bonk = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chance of bonk triggering if the user is clumsy.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("bonkClumsyChance")]
|
||||||
|
public float BonkClumsyChance = 0.75f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sound to play when bonking.
|
||||||
|
/// </summary>
|
||||||
|
/// <seealso cref="Bonk"/>
|
||||||
|
[DataField("bonkSound")]
|
||||||
|
public SoundSpecifier? BonkSound;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// How long to stun players on bonk, in seconds.
|
||||||
|
/// </summary>
|
||||||
|
/// <seealso cref="Bonk"/>
|
||||||
|
[DataField("bonkTime")]
|
||||||
|
public float BonkTime = 2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// How much damage to apply on bonk.
|
||||||
|
/// </summary>
|
||||||
|
/// <seealso cref="Bonk"/>
|
||||||
|
[DataField("bonkDamage")]
|
||||||
|
public DamageSpecifier? BonkDamage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,26 +3,29 @@ using Robust.Shared.Serialization;
|
|||||||
|
|
||||||
namespace Content.Shared.Climbing;
|
namespace Content.Shared.Climbing;
|
||||||
|
|
||||||
[NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public abstract class SharedClimbingComponent : Component
|
public sealed class ClimbingComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the owner is climbing on a climbable entity.
|
/// Whether the owner is climbing on a climbable entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public virtual bool IsClimbing { get; set; }
|
public bool IsClimbing { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the owner is being moved onto the climbed entity.
|
/// Whether the owner is being moved onto the climbed entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public virtual bool OwnerIsTransitioning { get; set; }
|
public bool OwnerIsTransitioning { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// We'll launch the mob onto the table and give them at least this amount of time to be on it.
|
/// We'll launch the mob onto the table and give them at least this amount of time to be on it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const float BufferTime = 0.3f;
|
public const float BufferTime = 0.3f;
|
||||||
|
|
||||||
|
[ViewVariables]
|
||||||
|
public Dictionary<string, int> DisabledFixtureMasks { get; } = new();
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public sealed class ClimbModeComponentState : ComponentState
|
public sealed class ClimbModeComponentState : ComponentState
|
||||||
{
|
{
|
||||||
@@ -9,11 +9,11 @@ public abstract class SharedClimbSystem : EntitySystem
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<SharedClimbingComponent, UpdateCanMoveEvent>(HandleMoveAttempt);
|
SubscribeLocalEvent<ClimbingComponent, UpdateCanMoveEvent>(HandleMoveAttempt);
|
||||||
SubscribeLocalEvent<SharedClimbableComponent, CanDragDropOnEvent>(OnCanDragDropOn);
|
SubscribeLocalEvent<ClimbableComponent, CanDragDropOnEvent>(OnCanDragDropOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HandleMoveAttempt(EntityUid uid, SharedClimbingComponent component, UpdateCanMoveEvent args)
|
private static void HandleMoveAttempt(EntityUid uid, ClimbingComponent component, UpdateCanMoveEvent args)
|
||||||
{
|
{
|
||||||
if (component.LifeStage > ComponentLifeStage.Running)
|
if (component.LifeStage > ComponentLifeStage.Running)
|
||||||
return;
|
return;
|
||||||
@@ -22,8 +22,8 @@ public abstract class SharedClimbSystem : EntitySystem
|
|||||||
args.Cancel();
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCanDragDropOn(EntityUid uid, SharedClimbableComponent component, CanDragDropOnEvent args)
|
protected virtual void OnCanDragDropOn(EntityUid uid, ClimbableComponent component, CanDragDropOnEvent args)
|
||||||
{
|
{
|
||||||
args.CanDrop = HasComp<SharedClimbingComponent>(args.Dragged);
|
args.CanDrop = HasComp<ClimbingComponent>(args.Dragged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
using Content.Shared.Interaction;
|
|
||||||
|
|
||||||
namespace Content.Shared.Climbing
|
|
||||||
{
|
|
||||||
public abstract class SharedClimbableComponent : Component
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The range from which this entity can be climbed.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("range")] public float Range = SharedInteractionSystem.InteractionRange / 1.4f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,20 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Content.Shared.Tools;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
|
|
||||||
namespace Content.Shared.Configurable
|
namespace Content.Shared.Configurable
|
||||||
{
|
{
|
||||||
[Virtual]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public class SharedConfigurationComponent : Component
|
public sealed class ConfigurationComponent : Component
|
||||||
{
|
{
|
||||||
|
[DataField("config")]
|
||||||
|
public readonly Dictionary<string, string> Config = new();
|
||||||
|
|
||||||
|
[DataField("qualityNeeded", customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
|
||||||
|
public string QualityNeeded = "Pulsing";
|
||||||
|
|
||||||
[DataField("validation")]
|
[DataField("validation")]
|
||||||
public readonly Regex Validation = new("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled);
|
public readonly Regex Validation = new("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled);
|
||||||
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Ensnaring.Components;
|
namespace Content.Shared.Ensnaring.Components;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use this on an entity that you would like to be ensnared by anything that has the <see cref="SharedEnsnaringComponent"/>
|
/// Use this on an entity that you would like to be ensnared by anything that has the <see cref="EnsnaringComponent"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public abstract class SharedEnsnareableComponent : Component
|
public sealed class EnsnareableComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How much should this slow down the entities walk?
|
/// How much should this slow down the entities walk?
|
||||||
@@ -28,6 +29,17 @@ public abstract class SharedEnsnareableComponent : Component
|
|||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("isEnsnared")]
|
[DataField("isEnsnared")]
|
||||||
public bool IsEnsnared;
|
public bool IsEnsnared;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The container where the <see cref="EnsnaringComponent"/> entity will be stored
|
||||||
|
/// </summary>
|
||||||
|
public Container Container = default!;
|
||||||
|
|
||||||
|
[DataField("sprite")]
|
||||||
|
public string? Sprite;
|
||||||
|
|
||||||
|
[DataField("state")]
|
||||||
|
public string? State;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
namespace Content.Shared.Ensnaring.Components;
|
using System.Threading;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Shared.Ensnaring.Components;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use this on something you want to use to ensnare an entity with
|
/// Use this on something you want to use to ensnare an entity with
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class SharedEnsnaringComponent : Component
|
[RegisterComponent, NetworkedComponent]
|
||||||
|
public sealed class EnsnaringComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How long it should take to free someone else.
|
/// How long it should take to free someone else.
|
||||||
@@ -45,10 +49,19 @@ public abstract class SharedEnsnaringComponent : Component
|
|||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("ensnared")]
|
[DataField("ensnared")]
|
||||||
public EntityUid? Ensnared;
|
public EntityUid? Ensnared;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Should movement cancel breaking out?
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField("canMoveBreakout")]
|
||||||
|
public bool CanMoveBreakout;
|
||||||
|
|
||||||
|
public CancellationTokenSource? CancelToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used whenever you want to do something when someone becomes ensnared by the <see cref="SharedEnsnaringComponent"/>
|
/// Used whenever you want to do something when someone becomes ensnared by the <see cref="EnsnaringComponent"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class EnsnareEvent : EntityEventArgs
|
public sealed class EnsnareEvent : EntityEventArgs
|
||||||
{
|
{
|
||||||
@@ -63,9 +76,35 @@ public sealed class EnsnareEvent : EntityEventArgs
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used whenever you want to do something when someone is freed by the <see cref="SharedEnsnaringComponent"/>
|
/// Used whenever you want to do something when someone is freed by the <see cref="EnsnaringComponent"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class EnsnareRemoveEvent : CancellableEntityEventArgs
|
public sealed class EnsnareRemoveEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for the do after event to free the entity that owns the <see cref="EnsnareableComponent"/>
|
||||||
|
/// </summary>
|
||||||
|
public sealed class FreeEnsnareDoAfterComplete : EntityEventArgs
|
||||||
|
{
|
||||||
|
public readonly EntityUid EnsnaringEntity;
|
||||||
|
|
||||||
|
public FreeEnsnareDoAfterComplete(EntityUid ensnaringEntity)
|
||||||
|
{
|
||||||
|
EnsnaringEntity = ensnaringEntity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for the do after event when it fails to free the entity that owns the <see cref="EnsnareableComponent"/>
|
||||||
|
/// </summary>
|
||||||
|
public sealed class FreeEnsnareDoAfterCancel : EntityEventArgs
|
||||||
|
{
|
||||||
|
public readonly EntityUid EnsnaringEntity;
|
||||||
|
|
||||||
|
public FreeEnsnareDoAfterCancel(EntityUid ensnaringEntity)
|
||||||
|
{
|
||||||
|
EnsnaringEntity = ensnaringEntity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,15 +13,15 @@ public abstract class SharedEnsnareableSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedEnsnareableComponent, RefreshMovementSpeedModifiersEvent>(MovementSpeedModify);
|
SubscribeLocalEvent<EnsnareableComponent, RefreshMovementSpeedModifiersEvent>(MovementSpeedModify);
|
||||||
SubscribeLocalEvent<SharedEnsnareableComponent, EnsnareEvent>(OnEnsnare);
|
SubscribeLocalEvent<EnsnareableComponent, EnsnareEvent>(OnEnsnare);
|
||||||
SubscribeLocalEvent<SharedEnsnareableComponent, EnsnareRemoveEvent>(OnEnsnareRemove);
|
SubscribeLocalEvent<EnsnareableComponent, EnsnareRemoveEvent>(OnEnsnareRemove);
|
||||||
SubscribeLocalEvent<SharedEnsnareableComponent, EnsnaredChangedEvent>(OnEnsnareChange);
|
SubscribeLocalEvent<EnsnareableComponent, EnsnaredChangedEvent>(OnEnsnareChange);
|
||||||
SubscribeLocalEvent<SharedEnsnareableComponent, ComponentGetState>(OnGetState);
|
SubscribeLocalEvent<EnsnareableComponent, ComponentGetState>(OnGetState);
|
||||||
SubscribeLocalEvent<SharedEnsnareableComponent, ComponentHandleState>(OnHandleState);
|
SubscribeLocalEvent<EnsnareableComponent, ComponentHandleState>(OnHandleState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHandleState(EntityUid uid, SharedEnsnareableComponent component, ref ComponentHandleState args)
|
private void OnHandleState(EntityUid uid, EnsnareableComponent component, ref ComponentHandleState args)
|
||||||
{
|
{
|
||||||
if (args.Current is not EnsnareableComponentState state)
|
if (args.Current is not EnsnareableComponentState state)
|
||||||
return;
|
return;
|
||||||
@@ -33,12 +33,12 @@ public abstract class SharedEnsnareableSystem : EntitySystem
|
|||||||
RaiseLocalEvent(uid, new EnsnaredChangedEvent(component.IsEnsnared));
|
RaiseLocalEvent(uid, new EnsnaredChangedEvent(component.IsEnsnared));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGetState(EntityUid uid, SharedEnsnareableComponent component, ref ComponentGetState args)
|
private void OnGetState(EntityUid uid, EnsnareableComponent component, ref ComponentGetState args)
|
||||||
{
|
{
|
||||||
args.State = new EnsnareableComponentState(component.IsEnsnared);
|
args.State = new EnsnareableComponentState(component.IsEnsnared);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnsnare(EntityUid uid, SharedEnsnareableComponent component, EnsnareEvent args)
|
private void OnEnsnare(EntityUid uid, EnsnareableComponent component, EnsnareEvent args)
|
||||||
{
|
{
|
||||||
component.WalkSpeed = args.WalkSpeed;
|
component.WalkSpeed = args.WalkSpeed;
|
||||||
component.SprintSpeed = args.SprintSpeed;
|
component.SprintSpeed = args.SprintSpeed;
|
||||||
@@ -49,7 +49,7 @@ public abstract class SharedEnsnareableSystem : EntitySystem
|
|||||||
RaiseLocalEvent(uid, ev);
|
RaiseLocalEvent(uid, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnsnareRemove(EntityUid uid, SharedEnsnareableComponent component, EnsnareRemoveEvent args)
|
private void OnEnsnareRemove(EntityUid uid, EnsnareableComponent component, EnsnareRemoveEvent args)
|
||||||
{
|
{
|
||||||
_speedModifier.RefreshMovementSpeedModifiers(uid);
|
_speedModifier.RefreshMovementSpeedModifiers(uid);
|
||||||
|
|
||||||
@@ -57,17 +57,17 @@ public abstract class SharedEnsnareableSystem : EntitySystem
|
|||||||
RaiseLocalEvent(uid, ev);
|
RaiseLocalEvent(uid, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnsnareChange(EntityUid uid, SharedEnsnareableComponent component, EnsnaredChangedEvent args)
|
private void OnEnsnareChange(EntityUid uid, EnsnareableComponent component, EnsnaredChangedEvent args)
|
||||||
{
|
{
|
||||||
UpdateAppearance(uid, component);
|
UpdateAppearance(uid, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAppearance(EntityUid uid, SharedEnsnareableComponent component, AppearanceComponent? appearance = null)
|
private void UpdateAppearance(EntityUid uid, EnsnareableComponent component, AppearanceComponent? appearance = null)
|
||||||
{
|
{
|
||||||
Appearance.SetData(uid, EnsnareableVisuals.IsEnsnared, component.IsEnsnared, appearance);
|
Appearance.SetData(uid, EnsnareableVisuals.IsEnsnared, component.IsEnsnared, appearance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MovementSpeedModify(EntityUid uid, SharedEnsnareableComponent component, RefreshMovementSpeedModifiersEvent args)
|
private void MovementSpeedModify(EntityUid uid, EnsnareableComponent component, RefreshMovementSpeedModifiersEvent args)
|
||||||
{
|
{
|
||||||
if (!component.IsEnsnared)
|
if (!component.IsEnsnared)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace Content.Shared.Interaction
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(user, out SharedBuckleComponent? buckle) && buckle.Buckled)
|
if (EntityManager.TryGetComponent(user, out BuckleComponent? buckle) && buckle.Buckled)
|
||||||
{
|
{
|
||||||
var suid = buckle.LastEntityBuckledTo;
|
var suid = buckle.LastEntityBuckledTo;
|
||||||
if (suid != null)
|
if (suid != null)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace Content.Shared.Pulling
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent<SharedBuckleComponent?>(puller, out var buckle))
|
if (EntityManager.TryGetComponent<BuckleComponent?>(puller, out var buckle))
|
||||||
{
|
{
|
||||||
// Prevent people pulling the chair they're on, etc.
|
// Prevent people pulling the chair they're on, etc.
|
||||||
if (buckle.Buckled && (buckle.LastEntityBuckledTo == pulled))
|
if (buckle.Buckled && (buckle.LastEntityBuckledTo == pulled))
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using Content.Shared.Singularity.Components;
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
namespace Content.Server.Singularity.Components;
|
namespace Content.Shared.Singularity.Components;
|
||||||
|
|
||||||
[RegisterComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
[ComponentReference(typeof(SharedContainmentFieldComponent))]
|
public sealed class ContainmentFieldComponent : Component
|
||||||
public sealed class ContainmentFieldComponent : SharedContainmentFieldComponent
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The throw force for the field if an entity collides with it
|
/// The throw force for the field if an entity collides with it
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using Content.Shared.Singularity.Components;
|
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
|
|
||||||
namespace Content.Server.Singularity.Components;
|
namespace Content.Shared.Singularity.Components;
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedContainmentFieldGeneratorComponent))]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public sealed class ContainmentFieldGeneratorComponent : SharedContainmentFieldGeneratorComponent
|
public sealed class ContainmentFieldGeneratorComponent : Component
|
||||||
{
|
{
|
||||||
private int _powerBuffer;
|
private int _powerBuffer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Store power with a cap. Decrease over time if not being powered from source.
|
/// Store power with a cap. Decrease over time if not being powered from source.
|
||||||
@@ -100,3 +101,29 @@ public sealed class ContainmentFieldGeneratorComponent : SharedContainmentFieldG
|
|||||||
[DataField("createdField", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("createdField", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string CreatedField = "ContainmentField";
|
public string CreatedField = "ContainmentField";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public enum ContainmentFieldGeneratorVisuals : byte
|
||||||
|
{
|
||||||
|
PowerLight,
|
||||||
|
FieldLight,
|
||||||
|
OnLight,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public enum PowerLevelVisuals : byte
|
||||||
|
{
|
||||||
|
NoPower,
|
||||||
|
LowPower,
|
||||||
|
MediumPower,
|
||||||
|
HighPower,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public enum FieldLevelVisuals : byte
|
||||||
|
{
|
||||||
|
NoLevel,
|
||||||
|
On,
|
||||||
|
OneField,
|
||||||
|
MultipleFields,
|
||||||
|
}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
namespace Content.Shared.Singularity.Components;
|
|
||||||
public abstract class SharedContainmentFieldComponent : Component { }
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
using Robust.Shared.Serialization;
|
|
||||||
|
|
||||||
namespace Content.Shared.Singularity.Components;
|
|
||||||
public abstract class SharedContainmentFieldGeneratorComponent : Component { }
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public enum ContainmentFieldGeneratorVisuals : byte
|
|
||||||
{
|
|
||||||
PowerLight,
|
|
||||||
FieldLight,
|
|
||||||
OnLight,
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public enum PowerLevelVisuals : byte
|
|
||||||
{
|
|
||||||
NoPower,
|
|
||||||
LowPower,
|
|
||||||
MediumPower,
|
|
||||||
HighPower,
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public enum FieldLevelVisuals : byte
|
|
||||||
{
|
|
||||||
NoLevel,
|
|
||||||
On,
|
|
||||||
OneField,
|
|
||||||
MultipleFields,
|
|
||||||
}
|
|
||||||
@@ -190,8 +190,8 @@ public abstract class SharedEventHorizonSystem : EntitySystem
|
|||||||
|
|
||||||
// If we can, breach containment
|
// If we can, breach containment
|
||||||
// otherwise, check if it's containment and just keep the collision
|
// otherwise, check if it's containment and just keep the collision
|
||||||
if (EntityManager.HasComponent<SharedContainmentFieldComponent>(otherUid) ||
|
if (EntityManager.HasComponent<ContainmentFieldComponent>(otherUid) ||
|
||||||
EntityManager.HasComponent<SharedContainmentFieldGeneratorComponent>(otherUid))
|
EntityManager.HasComponent<ContainmentFieldGeneratorComponent>(otherUid))
|
||||||
{
|
{
|
||||||
if (comp.CanBreachContainment)
|
if (comp.CanBreachContainment)
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public abstract partial class SharedVehicleSystem : EntitySystem
|
|||||||
UpdateDrawDepth(uid, 2);
|
UpdateDrawDepth(uid, 2);
|
||||||
|
|
||||||
// This code should be purged anyway but with that being said this doesn't handle components being changed.
|
// This code should be purged anyway but with that being said this doesn't handle components being changed.
|
||||||
if (TryComp<SharedStrapComponent>(uid, out var strap))
|
if (TryComp<StrapComponent>(uid, out var strap))
|
||||||
{
|
{
|
||||||
component.BaseBuckleOffset = strap.BuckleOffset;
|
component.BaseBuckleOffset = strap.BuckleOffset;
|
||||||
strap.BuckleOffsetUnclamped = Vector2.Zero;
|
strap.BuckleOffsetUnclamped = Vector2.Zero;
|
||||||
@@ -159,7 +159,7 @@ public abstract partial class SharedVehicleSystem : EntitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected void UpdateBuckleOffset(TransformComponent xform, VehicleComponent component)
|
protected void UpdateBuckleOffset(TransformComponent xform, VehicleComponent component)
|
||||||
{
|
{
|
||||||
if (!TryComp<SharedStrapComponent>(component.Owner, out var strap))
|
if (!TryComp<StrapComponent>(component.Owner, out var strap))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Strap should handle this but buckle E/C moment.
|
// TODO: Strap should handle this but buckle E/C moment.
|
||||||
|
|||||||
Reference in New Issue
Block a user