Skip to content

Commit

Permalink
update old code for battle low player
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemirda committed May 25, 2024
1 parent 9522c1e commit 966131c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 27 deletions.
6 changes: 0 additions & 6 deletions Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleCompo

//A-13 Eblan system update start
if (HasComp<EblanComponent>(mob))
{
_popupSystem.PopupEntity(Loc.GetString("В данный момент вы наиграли слишком мало времени, новички не могут пользоваться консолью связи."), uid, message.Session);
return;
}
//A-13 Eblan system update end

if (!CanUse(mob, uid))
Expand Down Expand Up @@ -265,10 +262,7 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com

//A-13 Eblan system update start
if (HasComp<EblanComponent>(mob))
{
_popupSystem.PopupEntity(Loc.GetString("В данный момент вы наиграли слишком мало времени, новички не могут пользоваться консолью связи."), uid, message.Session);
return;
}
//A-13 Eblan system update end

if (!CanUse(mob, uid))
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private void OnInteractUsing(Entity<MicrowaveComponent> ent, ref InteractUsingEv
//A-13 Eblan system update start
if (HasComp<EblanComponent>(args.User) && TryComp<BatteryComponent>(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
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Morgue/CrematoriumSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ private void AddCremateVerb(EntityUid uid, CrematoriumComponent component, GetVe

//A-13 Eblan system update start
if (HasComp<EblanComponent>(args.User))
{
return;
}
//A-13 Eblan system update end

if (!args.CanAccess || !args.CanInteract || args.Hands == null || storage.Open)
Expand Down
19 changes: 1 addition & 18 deletions Content.Server/Tools/ToolSystem.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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<ToolComponent, ToolUseAttemptEvent>(OnToolUseAttempt); //A-13 Eblan system update
InitializeWelders();
}

Expand All @@ -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<EblanComponent>(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<WelderComponent>(uid);
}
}
}
}
10 changes: 10 additions & 0 deletions Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/// <summary>
Expand Down Expand Up @@ -39,6 +41,14 @@ private void OnUseInHand(EntityUid uid, ItemToggleComponent itemToggle, UseInHan
if (args.Handled)
return;

//A-13 Eblan system update start
if (HasComp<EblanComponent>(args.User))
{
if (TryComp<ToolComponent>(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);
Expand Down

0 comments on commit 966131c

Please sign in to comment.