From 5ba25299560fb11ccaa0609b9347b02bef28f46f Mon Sep 17 00:00:00 2001 From: Theodore Lukin <66275205+pheenty@users.noreply.github.com> Date: Sat, 2 Nov 2024 01:36:00 +0700 Subject: [PATCH] shadowlings can't cuff (#205) * shadowlings can't cuff * cuffingspeed * thick-fingers * cuffercomponent * just make them worse --- Content.Shared/Cuffs/SharedCuffableSystem.cs | 10 ++++++++++ Content.Shared/Stories/Cuffs/CufferComponent.cs | 8 ++++++++ .../ru-RU/cuffs/components/handcuff-component.ftl | 2 ++ .../Stories/Entities/Mobs/Species/shadowling.yml | 2 ++ 4 files changed, 22 insertions(+) create mode 100644 Content.Shared/Stories/Cuffs/CufferComponent.cs diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 21d09c744c..a13b9df514 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -500,6 +500,16 @@ public bool TryCuffing(EntityUid user, EntityUid target, EntityUid handcuff, Han if (HasComp(target)) cuffTime = MathF.Max(0.1f, cuffTime - handcuffComponent.StunBonus); + if (TryComp(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(target)) cuffTime = 0.0f; // cuff them instantly. diff --git a/Content.Shared/Stories/Cuffs/CufferComponent.cs b/Content.Shared/Stories/Cuffs/CufferComponent.cs new file mode 100644 index 0000000000..34750df8bb --- /dev/null +++ b/Content.Shared/Stories/Cuffs/CufferComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared.Cuffs; + +[RegisterComponent] +public sealed partial class CufferComponent : Component +{ + [DataField("timeModifier")] + public float? TimeModifier = 1; +} diff --git a/Resources/Locale/ru-RU/cuffs/components/handcuff-component.ftl b/Resources/Locale/ru-RU/cuffs/components/handcuff-component.ftl index 9dc0a949fe..8d679077ea 100644 --- a/Resources/Locale/ru-RU/cuffs/components/handcuff-component.ftl +++ b/Resources/Locale/ru-RU/cuffs/components/handcuff-component.ftl @@ -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 = Ваши пальцы слишком толстые, чтобы использовать наручники! diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml index d1ba65428c..dfed65792b 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml @@ -9,6 +9,8 @@ id: BaseMobShadowling abstract: true components: + - type: Cuffer + timeModifier: 2 - type: ZombieImmune - type: ThermalVision - type: ComplexInteraction