Skip to content

Commit

Permalink
Возможность брать людей на руки (#31)
Browse files Browse the repository at this point in the history
* carry

* fix

* carriable update

* Removed carriable from vox, slime

---------

Co-authored-by: Vigers Ray <[email protected]>
  • Loading branch information
babaevlsdd and VigersRay authored Jun 9, 2024
1 parent 34ec132 commit f51d4ae
Show file tree
Hide file tree
Showing 17 changed files with 814 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Content.Server/Resist/EscapeInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void OnRelayMovement(EntityUid uid, CanEscapeInventoryComponent componen
AttemptEscape(uid, container.Owner, component);
}

private void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
public void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
{
if (component.IsEscaping)
return;
Expand Down
11 changes: 11 additions & 0 deletions Content.Server/_Sunrise/Carrying/BeingCarriedComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Server.Carrying
{
/// <summary>
/// Stores the carrier of an entity being carried.
/// </summary>
[RegisterComponent]
public sealed partial class BeingCarriedComponent : Component
{
public EntityUid Carrier = default!;
}
}
17 changes: 17 additions & 0 deletions Content.Server/_Sunrise/Carrying/CarriableComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Threading;

namespace Content.Server.Carrying
{
[RegisterComponent]
public sealed partial class CarriableComponent : Component
{
/// <summary>
/// необходимое количество свободных рук
/// что-бы взять сущность
/// </summary>
[DataField("freeHandsRequired")]
public int FreeHandsRequired = 2;

public CancellationTokenSource? CancelToken;
}
}
11 changes: 11 additions & 0 deletions Content.Server/_Sunrise/Carrying/CarryingComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Server.Carrying
{
/// <summary>
/// Added to an entity when they are carrying somebody.
/// </summary>
[RegisterComponent]
public sealed partial class CarryingComponent : Component
{
public EntityUid Carried = default!;
}
}
Loading

0 comments on commit f51d4ae

Please sign in to comment.