From 966131ce4f8b7b8fbd105601e8686adbfa65aa69 Mon Sep 17 00:00:00 2001 From: Lemird Date: Sat, 25 May 2024 18:02:23 +0300 Subject: [PATCH] update old code for battle low player --- .../CommunicationsConsoleSystem.cs | 6 ------ .../Kitchen/EntitySystems/MicrowaveSystem.cs | 2 +- Content.Server/Morgue/CrematoriumSystem.cs | 2 -- Content.Server/Tools/ToolSystem.cs | 19 +------------------ .../Item/ItemToggle/SharedItemToggleSystem.cs | 10 ++++++++++ 5 files changed, 12 insertions(+), 27 deletions(-) diff --git a/Content.Server/Communications/CommunicationsConsoleSystem.cs b/Content.Server/Communications/CommunicationsConsoleSystem.cs index d0ade6b51aa..42429c82dd8 100644 --- a/Content.Server/Communications/CommunicationsConsoleSystem.cs +++ b/Content.Server/Communications/CommunicationsConsoleSystem.cs @@ -231,10 +231,7 @@ private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleCompo //A-13 Eblan system update start if (HasComp(mob)) - { - _popupSystem.PopupEntity(Loc.GetString("В данный момент вы наиграли слишком мало времени, новички не могут пользоваться консолью связи."), uid, message.Session); return; - } //A-13 Eblan system update end if (!CanUse(mob, uid)) @@ -265,10 +262,7 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com //A-13 Eblan system update start if (HasComp(mob)) - { - _popupSystem.PopupEntity(Loc.GetString("В данный момент вы наиграли слишком мало времени, новички не могут пользоваться консолью связи."), uid, message.Session); return; - } //A-13 Eblan system update end if (!CanUse(mob, uid)) diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index 6efb50b2c6a..34913d5ab98 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -294,7 +294,7 @@ private void OnInteractUsing(Entity ent, ref InteractUsingEv //A-13 Eblan system update start if (HasComp(args.User) && TryComp(args.Used, out var _)) { - _popupSystem.PopupEntity(Loc.GetString("Вы не можете вставить батарейку в микроволновку!"), ent, args.User); + _popupSystem.PopupCursor(Loc.GetString("Вы не можете вставить батарейку в микроволновку."), args.User, PopupType.Large); return; } //A-13 Eblan system update end diff --git a/Content.Server/Morgue/CrematoriumSystem.cs b/Content.Server/Morgue/CrematoriumSystem.cs index 0359abe9bb3..b61a0fcc775 100644 --- a/Content.Server/Morgue/CrematoriumSystem.cs +++ b/Content.Server/Morgue/CrematoriumSystem.cs @@ -81,9 +81,7 @@ private void AddCremateVerb(EntityUid uid, CrematoriumComponent component, GetVe //A-13 Eblan system update start if (HasComp(args.User)) - { return; - } //A-13 Eblan system update end if (!args.CanAccess || !args.CanInteract || args.Hands == null || storage.Open) diff --git a/Content.Server/Tools/ToolSystem.cs b/Content.Server/Tools/ToolSystem.cs index 73ea83abbd8..65bc233f386 100644 --- a/Content.Server/Tools/ToolSystem.cs +++ b/Content.Server/Tools/ToolSystem.cs @@ -1,10 +1,7 @@ using Content.Server.Atmos.EntitySystems; using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Popups; -using Content.Shared.Popups; //A-13 Eblan system update using Content.Server.Tools.Components; -using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update -using Content.Shared.Tools.Components; //A-13 Eblan system update using Robust.Server.GameObjects; using Robust.Shared.Audio.Systems; @@ -17,17 +14,14 @@ public sealed partial class ToolSystem : SharedToolSystem { [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; [Dependency] private readonly PopupSystem _popup = default!; - [Dependency] private readonly SharedPopupSystem _popupSystem = default!; //A-13 Eblan system update [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; - private const string WeldingQualityId = "Welding"; //A-13 Eblan system update public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnToolUseAttempt); //A-13 Eblan system update InitializeWelders(); } @@ -38,20 +32,9 @@ public override void Update(float frameTime) UpdateWelders(frameTime); } - //A-13 Eblan system update start - private void OnToolUseAttempt(EntityUid uid, ToolComponent component, ToolUseAttemptEvent args) - { - if (component.Qualities.Contains(WeldingQualityId) && EntityManager.HasComponent(args.User)) - { - args.Cancel(); - _popupSystem.PopupCursor(Loc.GetString("Вы наиграли слишком мало времени, вы не можете пользоваться сваркой."), args.User, PopupType.Large); - } - } - //A-13 Eblan system update end - protected override bool IsWelder(EntityUid uid) { return HasComp(uid); } } -} +} \ No newline at end of file diff --git a/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs b/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs index e2e5fc2e3c3..e0ea313ddf6 100644 --- a/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs +++ b/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs @@ -6,6 +6,8 @@ using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Network; +using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update +using Content.Shared.Tools.Components; //A-13 Eblan system update namespace Content.Shared.Item.ItemToggle; /// @@ -39,6 +41,14 @@ private void OnUseInHand(EntityUid uid, ItemToggleComponent itemToggle, UseInHan if (args.Handled) return; + //A-13 Eblan system update start + if (HasComp(args.User)) + { + if (TryComp(uid, out var toolComponent) && toolComponent.Qualities.Contains("Welding")) + return; + } + //A-13 Eblan system update end + args.Handled = true; Toggle(uid, args.User, predicted: itemToggle.Predictable, itemToggle: itemToggle);