Skip to content

Commit

Permalink
Revert "Magboots/Moonboots with jetpack fix"
Browse files Browse the repository at this point in the history
This reverts commit f7f81e6.
  • Loading branch information
Kirus59 committed Aug 19, 2024
1 parent 7938a21 commit 8620888
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 79 deletions.
19 changes: 0 additions & 19 deletions Content.Shared/Clothing/EntitySystems/AntiGravityClothingSystem.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
using Content.Shared.Clothing.Components;
using Content.Shared.Gravity;
using Content.Shared.Inventory;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Popups;

namespace Content.Shared.Clothing.EntitySystems;

public sealed class AntiGravityClothingSystem : EntitySystem
{
/// <inheritdoc/>
[Dependency] private readonly SharedJetpackSystem _jetpackSystem = default!; //SS220 Moonboots with jet fix
[Dependency] private readonly SharedPopupSystem _popupSystem = default!; //SS220 Moonboots with jet fix

public override void Initialize()
{
SubscribeLocalEvent<AntiGravityClothingComponent, InventoryRelayedEvent<IsWeightlessEvent>>(OnIsWeightless);
SubscribeLocalEvent<AntiGravityClothingComponent, ClothingGotUnequippedEvent>(OnUnequipped); //SS220 Moonboots with jet fix
}

private void OnIsWeightless(Entity<AntiGravityClothingComponent> ent, ref InventoryRelayedEvent<IsWeightlessEvent> args)
Expand All @@ -27,16 +20,4 @@ private void OnIsWeightless(Entity<AntiGravityClothingComponent> ent, ref Invent
args.Args.Handled = true;
args.Args.IsWeightless = true;
}

//SS220 Moonboots with jet fix begin
private void OnUnequipped(Entity<AntiGravityClothingComponent> ent, ref ClothingGotUnequippedEvent args)
{
if (TryComp<JetpackUserComponent>(args.Wearer, out var jetpackUserComp) &&
TryComp<JetpackComponent>(jetpackUserComp.Jetpack, out var jetpack))
{
_jetpackSystem.SetEnabled(jetpackUserComp.Jetpack, jetpack, false);
_popupSystem.PopupClient(Loc.GetString("jetpack-to-grid"), jetpackUserComp.Jetpack, args.Wearer);
}
}
//SS220 Moonboots with jet fix end
}
14 changes: 0 additions & 14 deletions Content.Shared/Clothing/MagbootsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public void UpdateMagbootEffects(EntityUid user, Entity<MagbootsComponent> ent,
_alerts.ShowAlert(user, ent.Comp.MagbootsAlert);
else
_alerts.ClearAlert(user, ent.Comp.MagbootsAlert);

//SS220 Magboots with jet fix begin
var ev = new MagbootsUpdateStateEvent(state);
RaiseLocalEvent(user, ref ev);
//SS220 Magboots with jet fix end
}

private void OnIsWeightless(Entity<MagbootsComponent> ent, ref IsWeightlessEvent args)
Expand All @@ -93,12 +88,3 @@ private void OnIsWeightless(Entity<MagbootsComponent> ent, ref InventoryRelayedE
OnIsWeightless(ent, ref args.Args);
}
}

//SS220 Magboots with jet fix begin
/// <summary>
/// The event that rises when the state of MagbootEffects is changes
/// </summary>
/// <param name="State"></param>
[ByRefEvent]
public record struct MagbootsUpdateStateEvent(bool State);
//SS220 Magboots with jet fix end
42 changes: 0 additions & 42 deletions Content.Shared/Movement/Systems/SharedJetpackSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Content.Shared.Actions;
using Content.Shared.Clothing;
using Content.Shared.Clothing.Components;
using Content.Shared.Gravity;
using Content.Shared.Interaction.Events;
using Content.Shared.Inventory;
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Events;
using Content.Shared.Popups;
Expand All @@ -24,7 +20,6 @@ public abstract class SharedJetpackSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly InventorySystem _inventory = default!; //SS220 Magboots with jet fix

public override void Initialize()
{
Expand All @@ -36,7 +31,6 @@ public override void Initialize()

SubscribeLocalEvent<JetpackUserComponent, CanWeightlessMoveEvent>(OnJetpackUserCanWeightless);
SubscribeLocalEvent<JetpackUserComponent, EntParentChangedMessage>(OnJetpackUserEntParentChanged);
SubscribeLocalEvent<JetpackUserComponent, MagbootsUpdateStateEvent>(OnMagbootsUpdateState); //SS220 Magboots with jet fix

SubscribeLocalEvent<GravityChangedEvent>(OnJetpackUserGravityChanged);
SubscribeLocalEvent<JetpackComponent, MapInitEvent>(OnMapInit);
Expand Down Expand Up @@ -119,28 +113,6 @@ private void OnJetpackToggle(EntityUid uid, JetpackComponent component, ToggleJe
if (args.Handled)
return;

//SS220 Magboots with jet fix begin
var slotEnumerator = _inventory.GetSlotEnumerator(args.Performer);
while (slotEnumerator.NextItem(out var item))
{
if (HasComp<MagbootsComponent>(item) &&
TryComp<ItemToggleComponent>(item, out var itemToggle) &&
itemToggle.Activated)
{
_popup.PopupClient(Loc.GetString("jetpack-no-magboots"), uid, args.Performer);
return;
}

//SS220 Moonboots with jet fix begin
if (HasComp<AntiGravityClothingComponent>(item))
{
SetEnabled(uid, component, !IsEnabled(uid));
return;
}
//SS220 Moonboots with jet fix end
}
//SS220 Magboots with jet fix end

if (TryComp(uid, out TransformComponent? xform) && !CanEnableOnGrid(xform.GridUid))
{
_popup.PopupClient(Loc.GetString("jetpack-no-station"), uid, args.Performer);
Expand Down Expand Up @@ -228,20 +200,6 @@ protected virtual bool CanEnable(EntityUid uid, JetpackComponent component)
{
return true;
}

//SS220 Magboots with jet fix begin
private void OnMagbootsUpdateState(Entity<JetpackUserComponent> ent, ref MagbootsUpdateStateEvent args)
{
if (!args.State)
return;

if (TryComp<JetpackComponent>(ent.Comp.Jetpack, out var jetpack))
{
SetEnabled(ent.Comp.Jetpack, jetpack, false);
_popup.PopupClient(Loc.GetString("jetpack-to-grid"), ent.Comp.Jetpack, ent.Owner);
}
}
//SS220 Magboots with jet fix end
}

[Serializable, NetSerializable]
Expand Down
4 changes: 0 additions & 4 deletions Resources/Locale/ru-RU/movement/jetpacks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ action-name-jetpack-toggle = Переключить джетпак
action-description-jetpack-toggle = Переключить джетпак, позволяющий с лёгкостью передвигаться вне станции.
jetpack-no-station = Невозможно использовать джетпак под действием гравитации
jetpack-to-grid = Джетпак отключился
#SS220 Magboots with jet fix begin
jetpack-no-magboots = Невозможно использовать джетпак вместе с магнитными сапогами
#SS220 Magboots with jet fix end

0 comments on commit 8620888

Please sign in to comment.