Skip to content

Commit

Permalink
Merge pull request #144 from Lemirda/master-andromeda
Browse files Browse the repository at this point in the history
Lemird memes code
  • Loading branch information
13lackHawk authored May 26, 2024
2 parents 915c03d + 966131c commit 4309090
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Shared.Atmos.Piping;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Audio;
using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update
using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Interaction;
Expand Down Expand Up @@ -108,6 +109,14 @@ private void OnPumpActivate(EntityUid uid, GasPressurePumpComponent pump, Activa
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
return;

//A-13 Eblan system update start
if (HasComp<EblanComponent>(args.User))
{
_popup.PopupCursor(Loc.GetString("Вы не можете пока что пользоваться этим устройством, потому что, наиграли слишком мало времени"), args.User, PopupType.Large);
return;
}
//A-13 Eblan system update end

if (Transform(uid).Anchored)
{
_userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Server.NodeContainer.Nodes;
using Content.Shared.Atmos.Piping;
using Content.Shared.Audio;
using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update
using Content.Shared.Examine;
using Content.Shared.Interaction;
using JetBrains.Annotations;
Expand Down Expand Up @@ -52,6 +53,11 @@ private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStar

private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args)
{
//A-13 Eblan system update start
if (HasComp<EblanComponent>(args.User))
return;
//A-13 Eblan system update end

Toggle(uid, component);
_audio.PlayPvs(component.ValveSound, uid, AudioParams.Default.WithVariation(0.25f));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Content.Server.Popups;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -207,6 +208,11 @@ private void OnCanisterActivate(EntityUid uid, GasCanisterComponent component, A
if (!TryComp<ActorComponent>(args.User, out var actor))
return;

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

if (CheckLocked(uid, component, args.User))
return;

Expand All @@ -224,6 +230,11 @@ private void OnCanisterInteractHand(EntityUid uid, GasCanisterComponent componen
if (!TryComp<ActorComponent>(args.User, out var actor))
return;

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

if (CheckLocked(uid, component, args.User))
return;

Expand Down
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
14 changes: 14 additions & 0 deletions Content.Server/Singularity/EntitySystems/EmitterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Server.Power.EntitySystems;
using Content.Server.Projectiles;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update
using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Interaction;
Expand Down Expand Up @@ -64,6 +65,14 @@ private void OnInteractHand(EntityUid uid, EmitterComponent component, InteractH
if (args.Handled)
return;

//A-13 Eblan system update start
if (HasComp<EblanComponent>(args.User))
{
_popup.PopupCursor(Loc.GetString("Вы не можете пока что пользоватсья такими устройствами, потому что, наиграли ещё слишком мало времени."), args.User, PopupType.Large);
return;
}
//A-13 Eblan system update end

if (TryComp(uid, out LockComponent? lockComp) && lockComp.Locked)
{
_popup.PopupEntity(Loc.GetString("comp-emitter-access-locked",
Expand Down Expand Up @@ -103,6 +112,11 @@ private void OnGetVerb(EntityUid uid, EmitterComponent component, GetVerbsEvent<
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
return;

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

if (TryComp<LockComponent>(uid, out var lockComp) && lockComp.Locked)
return;

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
11 changes: 11 additions & 0 deletions Content.Shared/RCD/Systems/RCDSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Shared.Administration.Logs;
using Content.Shared.Charges.Components;
using Content.Shared.Charges.Systems;
using Content.Shared.CombatMode.Pacification; //A-13 Eblan system update
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
Expand Down Expand Up @@ -66,6 +67,11 @@ private void OnUseInHand(EntityUid uid, RCDComponent comp, UseInHandEvent args)
if (args.Handled)
return;

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

NextMode(uid, comp, args.User);
args.Handled = true;
}
Expand All @@ -75,6 +81,11 @@ private void OnAfterInteract(EntityUid uid, RCDComponent comp, AfterInteractEven
if (args.Handled || !args.CanReach)
return;

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

var user = args.User;

TryComp<LimitedChargesComponent>(uid, out var charges);
Expand Down

0 comments on commit 4309090

Please sign in to comment.