Skip to content

Commit

Permalink
cuffercomponent
Browse files Browse the repository at this point in the history
  • Loading branch information
pheenty committed Oct 31, 2024
1 parent 80af0e2 commit bafd549
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
8 changes: 3 additions & 5 deletions Content.Shared/Cuffs/SharedCuffableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
using Robust.Shared.Utility;
using PullableComponent = Content.Shared.Movement.Pulling.Components.PullableComponent;

using Content.Shared.Stories.Cuffs; // Stories

namespace Content.Shared.Cuffs
{
// TODO remove all the IsServer() checks.
Expand Down Expand Up @@ -502,14 +500,14 @@ public bool TryCuffing(EntityUid user, EntityUid target, EntityUid handcuff, Han
if (HasComp<StunnedComponent>(target))
cuffTime = MathF.Max(0.1f, cuffTime - handcuffComponent.StunBonus);

if (TryComp<CuffingSpeedComponent>(user, out var speed)) // Stories - CuffingSpeed - start
if (TryComp<CufferComponent>(user, out var cuffer)) // Stories - CuffingSpeed - start
{
if (speed.Modifier == 0)
if (cuffer.TimeModifier == null)
{
_popup.PopupClient(Loc.GetString("handcuff-component-cannot-use-cuffs"), user, user);
return false;
}
cuffTime = cuffTime / speed.Modifier;
cuffTime = cuffTime * (float)cuffer.TimeModifier;
} // Stories - CuffingSpeed - end

if (HasComp<DisarmProneComponent>(target))
Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/Stories/Cuffs/CufferComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Content.Shared.Cuffs;

[RegisterComponent]
public sealed partial class CufferComponent : Component
{
[DataField("timeModifier")]
public float? TimeModifier = 1;
}
8 changes: 0 additions & 8 deletions Content.Shared/Stories/Cuffs/CuffingSpeedComponent.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
id: BaseMobShadowling
abstract: true
components:
- type: CuffingSpeed
- type: Cuffer
timeModifier: null
- type: ZombieImmune
- type: ThermalVision
- type: ComplexInteraction
Expand Down

0 comments on commit bafd549

Please sign in to comment.