@@ -1,4 +1,3 @@
|
||||
using Content.Server.Contests;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.ActionBlocker;
|
||||
@@ -7,7 +6,6 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Resist;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -21,12 +19,6 @@ public sealed class EscapeInventorySystem : EntitySystem
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly ContestsSystem _contests = default!;
|
||||
|
||||
/// <summary>
|
||||
/// You can't escape the hands of an entity this many times more massive than you.
|
||||
/// </summary>
|
||||
public const float MaximumMassDisadvantage = 6f;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -53,23 +45,9 @@ public sealed class EscapeInventorySystem : EntitySystem
|
||||
}
|
||||
|
||||
// Contested
|
||||
if (_handsSystem.IsHolding(container.Owner, uid, out var inHand))
|
||||
if (_handsSystem.IsHolding(container.Owner, uid, out _))
|
||||
{
|
||||
var contestResults = _contests.MassContest(uid, container.Owner);
|
||||
|
||||
// Inverse if we aren't going to divide by 0, otherwise just use a default multiplier of 1.
|
||||
if (contestResults != 0)
|
||||
contestResults = 1 / contestResults;
|
||||
else
|
||||
contestResults = 1;
|
||||
|
||||
if (contestResults >= MaximumMassDisadvantage)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-failed-resisting"), uid, uid);
|
||||
return;
|
||||
}
|
||||
|
||||
AttemptEscape(uid, container.Owner, component, contestResults);
|
||||
AttemptEscape(uid, container.Owner, component);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user