diff --git a/Content.Server/Sticky/Systems/StickySystem.cs b/Content.Server/Sticky/Systems/StickySystem.cs index 32c8287d897..2d51ec323b8 100644 --- a/Content.Server/Sticky/Systems/StickySystem.cs +++ b/Content.Server/Sticky/Systems/StickySystem.cs @@ -10,6 +10,7 @@ using Content.Shared.Sticky.Components; using Content.Shared.Verbs; using Robust.Shared.Containers; +using Robust.Shared.Random; //A-13 Detonation of C4 during detaching using Robust.Shared.Utility; namespace Content.Server.Sticky.Systems; @@ -22,6 +23,7 @@ public sealed class StickySystem : EntitySystem [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly IRobustRandom _random = default!; //A-13 Detonation of C4 during detaching private const string StickerSlotId = "stickers_container"; @@ -139,8 +141,12 @@ private void StartUnsticking(EntityUid uid, EntityUid user, StickyComponent? com //A-13 Detonation of C4 during detaching start if (TryComp(uid, out var c4Comp)) { - if (c4Comp.Detonation && TryComp(uid, out var activateComp)) + if (c4Comp.Detonation + && TryComp(uid, out var activateComp) + && _random.NextFloat(0.0f, 1.0f) > 0.5f) + { activateComp.TimeRemaining = 0; + } } //A-13 Detonation of C4 during detaching end diff --git a/Content.Shared/Andromeda/Voomra/C4/C4DetonationByUnstickSystem.cs b/Content.Shared/Andromeda/Voomra/C4/C4DetonationByUnstickSystem.cs index 33274961855..90acdad21fd 100644 --- a/Content.Shared/Andromeda/Voomra/C4/C4DetonationByUnstickSystem.cs +++ b/Content.Shared/Andromeda/Voomra/C4/C4DetonationByUnstickSystem.cs @@ -1,3 +1,5 @@ +using Content.Shared.Examine; +using Content.Shared.Explosion.Components; using Content.Shared.Verbs; namespace Content.Shared.Andromeda.Voomra.C4; @@ -15,6 +17,7 @@ public override void Initialize() SubscribeLocalEvent(OnComponentInit); SubscribeLocalEvent(OnComponentRemove); SubscribeLocalEvent>(OnGetAltVerbs); + SubscribeLocalEvent(OnExamined); } private void OnComponentInit(EntityUid uid, C4DetonationByUnstickComponent component, ComponentInit args) @@ -29,6 +32,9 @@ private void OnComponentRemove(EntityUid uid, C4DetonationByUnstickComponent com private void OnGetAltVerbs(EntityUid uid, C4DetonationByUnstickComponent component, GetVerbsEvent args) { + if (HasComp(uid)) + return; + args.Verbs.Add(new AlternativeVerb { Text = Loc.GetString("verb-c4-detonation-by-unstick", ("status", component.Detonation @@ -42,4 +48,10 @@ private void DoAltVerbs(C4DetonationByUnstickComponent component) { component.Detonation = !component.Detonation; } + + private void OnExamined(EntityUid uid, C4DetonationByUnstickComponent component, ExaminedEvent args) + { + if (component.Detonation) + args.PushMarkup(Loc.GetString("examine-c4-detonation-by-unstick")); + } } diff --git a/Resources/Locale/ru-RU/Andromeda/c4-detonation-by-unstick.ftl b/Resources/Locale/ru-RU/Andromeda/c4-detonation-by-unstick.ftl index 07e322e9f2a..5fbda53db22 100644 --- a/Resources/Locale/ru-RU/Andromeda/c4-detonation-by-unstick.ftl +++ b/Resources/Locale/ru-RU/Andromeda/c4-detonation-by-unstick.ftl @@ -1,3 +1,5 @@ verb-c4-detonation-by-unstick = Детонация при попытке снятия: {$status} verb-c4-detonation-by-unstick-status-off = ВЫКЛ verb-c4-detonation-by-unstick-status-on = ВКЛ + +examine-c4-detonation-by-unstick = [color=red]Детонирует при попытке открепить[/color]