Skip to content

Commit

Permalink
shadowlings can't cuff (#205)
Browse files Browse the repository at this point in the history
* shadowlings can't cuff

* cuffingspeed

* thick-fingers

* cuffercomponent

* just make them worse
  • Loading branch information
pheenty authored Nov 1, 2024
1 parent 5d83778 commit 5ba2529
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Content.Shared/Cuffs/SharedCuffableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,16 @@ public bool TryCuffing(EntityUid user, EntityUid target, EntityUid handcuff, Han
if (HasComp<StunnedComponent>(target))
cuffTime = MathF.Max(0.1f, cuffTime - handcuffComponent.StunBonus);

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

if (HasComp<DisarmProneComponent>(target))
cuffTime = 0.0f; // cuff them instantly.

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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ handcuff-component-cuff-interrupt-other-message = Вы помешали { $other
handcuff-component-cuff-interrupt-buckled-message = Вы не можете пристегнуться в наручниках!
handcuff-component-cuff-interrupt-unbuckled-message = Вы не можете отстегнуться в наручниках!
handcuff-component-cannot-drop-cuffs = Вы не можете надеть наручники на { $target }
handcuff-component-cannot-use-cuffs = Ваши пальцы слишком толстые, чтобы использовать наручники!
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
id: BaseMobShadowling
abstract: true
components:
- type: Cuffer
timeModifier: 2
- type: ZombieImmune
- type: ThermalVision
- type: ComplexInteraction
Expand Down

0 comments on commit 5ba2529

Please sign in to comment.