From b2fd4a76e93842b3c16728367eb04a4399dfd8bb Mon Sep 17 00:00:00 2001 From: SliZen69 Date: Thu, 31 Jul 2025 21:04:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D1=8B=D1=87=D0=B0=20=D0=BE?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D0=BB=D0=BA=D0=BE=D0=B2=20=D1=81=D1=83=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=BC=D0=B0=D1=82=D1=82=D0=B5=D1=80=D0=B8=D0=B8=20?= =?UTF-8?q?=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D1=8D=D0=BD=D0=B5=D1=80?= =?UTF-8?q?=D0=B3=D0=B5=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8=D0=BC=20?= =?UTF-8?q?=D0=BE=D1=80=D1=83=D0=B6=D0=B8=D0=B5=D0=BC=20(#2672)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: SliZen69 --- .../EntitySystems/SupermatterSystem.cs | 33 ++++++++++++------- .../Melee/EnergySword/SMCuttableComponent.cs | 8 +++++ .../Objects/Weapons/Melee/e_sword.yml | 1 + 3 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 Content.Shared/Weapons/Melee/EnergySword/SMCuttableComponent.cs diff --git a/Content.Server/Supermatter/EntitySystems/SupermatterSystem.cs b/Content.Server/Supermatter/EntitySystems/SupermatterSystem.cs index 9a09479304..f82677cb5c 100644 --- a/Content.Server/Supermatter/EntitySystems/SupermatterSystem.cs +++ b/Content.Server/Supermatter/EntitySystems/SupermatterSystem.cs @@ -26,6 +26,7 @@ using Content.Shared.Examine; using Content.Server.DoAfter; using Content.Server.Explosion.EntitySystems; using Content.Server.Kitchen.Components; +using Content.Shared.Weapons.Melee.EnergySword; using Content.Shared.Singularity.Components; using System; using Robust.Shared.Audio; @@ -449,19 +450,27 @@ public sealed class SupermatterSystem : EntitySystem return; } - _adminLogger.Add(LogType.Action, LogImpact.High, $"{EntityManager.ToPrettyString(args.User):player} is trying to extract a sliver from the supermatter crystal."); - _popup.PopupEntity(Loc.GetString("supermatter-tamper-begin"), args.User, args.User); - - var doAfterArgs = new DoAfterArgs(EntityManager, args.User, 30, new SupermatterDoAfterEvent(), uid, target: uid, used: args.Used) + if (HasComp(args.Used)) { - BreakOnDamage = true, - BreakOnHandChange = true, - BreakOnMove = true, - BreakOnWeightlessMove = false, - NeedHand = true, - RequireCanInteract = true, - }; - _doAfter.TryStartDoAfter(doAfterArgs); + _adminLogger.Add(LogType.Action, LogImpact.High, $"{EntityManager.ToPrettyString(args.User):player} is trying to extract a sliver from the supermatter crystal."); + _popup.PopupEntity(Loc.GetString("supermatter-tamper-begin"), args.User, args.User); + + var doAfterArgs = new DoAfterArgs(EntityManager, args.User, 30, new SupermatterDoAfterEvent(), uid, target: uid, used: args.Used) + { + BreakOnDamage = true, + BreakOnHandChange = true, + BreakOnMove = true, + BreakOnWeightlessMove = false, + NeedHand = true, + RequireCanInteract = true, + }; + + _doAfter.TryStartDoAfter(doAfterArgs); + } + else + { + Vaporize(args.Used, uid); + } } } diff --git a/Content.Shared/Weapons/Melee/EnergySword/SMCuttableComponent.cs b/Content.Shared/Weapons/Melee/EnergySword/SMCuttableComponent.cs new file mode 100644 index 0000000000..7fb21ebbc7 --- /dev/null +++ b/Content.Shared/Weapons/Melee/EnergySword/SMCuttableComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared.Weapons.Melee.EnergySword; + +/// +/// Applies to items that are capable of cutting supermatter slivers +/// +[RegisterComponent] +public sealed partial class SMCuttableComponent : Component +{} diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml index d4ebe0b421..1e37968360 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml @@ -72,6 +72,7 @@ shader: unshaded - type: Reflect # Sunrise-start + - type: SMCuttable - type: Tag tags: - NoPaint