From d6f3e1be8fc8395c3b7add4cb89dcc09816095da Mon Sep 17 00:00:00 2001
From: Velcroboy <>
Date: Sun, 10 Mar 2024 15:11:35 -0500
Subject: [PATCH 1/5] Add magnet pickup system from Frontier
---
.../MaterialReclaimerMagnetPickupComponent.cs | 20 +++
.../MaterialStorageMagnetPickupComponent.cs | 20 +++
.../MaterialReclaimerMagnetPickupSystem.cs | 118 ++++++++++++++++++
.../MaterialStorageMagnetPickupSystem.cs | 118 ++++++++++++++++++
.../Entities/Structures/Machines/lathe.yml | 5 +
.../Machines/material_reclaimer.yml | 16 +++
6 files changed, 297 insertions(+)
create mode 100644 Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs
create mode 100644 Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs
create mode 100644 Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs
create mode 100644 Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs
diff --git a/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs b/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs
new file mode 100644
index 00000000000..e5096d00a26
--- /dev/null
+++ b/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs
@@ -0,0 +1,20 @@
+namespace Content.Server.Storage.Components;
+
+///
+/// Applies an ongoing pickup area around the attached entity.
+///
+[RegisterComponent]
+public sealed partial class MaterialReclaimerMagnetPickupComponent : Component
+{
+ [ViewVariables(VVAccess.ReadWrite), DataField("nextScan")]
+ public TimeSpan NextScan = TimeSpan.Zero;
+
+ [ViewVariables(VVAccess.ReadWrite), DataField("range")]
+ public float Range = 1f;
+
+ ///
+ /// Frontier - Is the magnet currently enabled?
+ ///
+ [ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")]
+ public bool MagnetEnabled = false;
+}
diff --git a/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs b/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs
new file mode 100644
index 00000000000..999c96c1945
--- /dev/null
+++ b/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs
@@ -0,0 +1,20 @@
+namespace Content.Server.Storage.Components;
+
+///
+/// Applies an ongoing pickup area around the attached entity.
+///
+[RegisterComponent]
+public sealed partial class MaterialStorageMagnetPickupComponent : Component
+{
+ [ViewVariables(VVAccess.ReadWrite), DataField("nextScan")]
+ public TimeSpan NextScan = TimeSpan.Zero;
+
+ [ViewVariables(VVAccess.ReadWrite), DataField("range")]
+ public float Range = 1f;
+
+ ///
+ /// Frontier - Is the magnet currently enabled?
+ ///
+ [ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")]
+ public bool MagnetEnabled = false;
+}
diff --git a/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs b/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs
new file mode 100644
index 00000000000..e7221f72347
--- /dev/null
+++ b/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs
@@ -0,0 +1,118 @@
+using Content.Server.Storage.Components;
+using Content.Shared.Materials;
+using Robust.Shared.Physics.Components;
+using Robust.Shared.Timing;
+using Content.Shared.Examine; // Frontier
+using Content.Shared.Hands.Components; // Frontier
+using Content.Shared.Verbs; // Frontier
+using Robust.Shared.Utility; // Frontier
+
+namespace Content.Shared.Storage.EntitySystems;
+
+///
+///
+///
+public sealed class MaterialReclaimerMagnetPickupSystem : EntitySystem
+{
+ [Dependency] private readonly IGameTiming _timing = default!;
+ [Dependency] private readonly EntityLookupSystem _lookup = default!;
+ [Dependency] private readonly SharedMaterialReclaimerSystem _storage = default!;
+
+ private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1);
+
+ private EntityQuery _physicsQuery;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+ _physicsQuery = GetEntityQuery();
+ SubscribeLocalEvent(OnMagnetMapInit);
+ SubscribeLocalEvent(OnMagnetUnpaused);
+ SubscribeLocalEvent(OnExamined); // Frontier
+ SubscribeLocalEvent>(AddToggleMagnetVerb); // Frontier
+ }
+
+ private void OnMagnetUnpaused(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ref EntityUnpausedEvent args)
+ {
+ component.NextScan += args.PausedTime;
+ }
+
+ private void OnMagnetMapInit(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, MapInitEvent args)
+ {
+ component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1); // Need to add 1 sec to fix a weird time bug with it that make it never start the magnet
+ }
+
+ // Frontier, used to add the magnet toggle to the context menu
+ private void AddToggleMagnetVerb(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, GetVerbsEvent args)
+ {
+ if (!args.CanAccess || !args.CanInteract)
+ return;
+
+ if (!HasComp(args.User))
+ return;
+
+ AlternativeVerb verb = new()
+ {
+ Act = () =>
+ {
+ ToggleMagnet(uid, component);
+ },
+ Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
+ Text = Loc.GetString("magnet-pickup-component-toggle-verb"),
+ Priority = 3
+ };
+
+ args.Verbs.Add(verb);
+ }
+
+ // Frontier, used to show the magnet state on examination
+ private void OnExamined(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ExaminedEvent args)
+ {
+ args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main",
+ ("stateText", Loc.GetString(component.MagnetEnabled
+ ? "magnet-pickup-component-magnet-on"
+ : "magnet-pickup-component-magnet-off"))));
+ }
+
+ // Frontier, used to toggle the magnet on the ore bag/box
+ public bool ToggleMagnet(EntityUid uid, MaterialReclaimerMagnetPickupComponent comp)
+ {
+ var query = EntityQueryEnumerator();
+ comp.MagnetEnabled = !comp.MagnetEnabled;
+
+ return comp.MagnetEnabled;
+ }
+
+ public override void Update(float frameTime)
+ {
+ base.Update(frameTime);
+ var query = EntityQueryEnumerator();
+ var currentTime = _timing.CurTime;
+
+ while (query.MoveNext(out var uid, out var comp, out var storage, out var xform))
+ {
+ if (comp.NextScan < currentTime)
+ continue;
+
+ comp.NextScan += ScanDelay;
+
+ // Frontier - magnet disabled
+ if (!comp.MagnetEnabled)
+ continue;
+
+ var parentUid = xform.ParentUid;
+
+ foreach (var near in _lookup.GetEntitiesInRange(uid, comp.Range, LookupFlags.Dynamic | LookupFlags.Sundries))
+ {
+ if (!_physicsQuery.TryGetComponent(near, out var physics) || physics.BodyStatus != BodyStatus.OnGround)
+ continue;
+
+ if (near == parentUid)
+ continue;
+
+ if (!_storage.TryStartProcessItem(uid, near))
+ continue;
+ }
+ }
+ }
+}
diff --git a/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs b/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs
new file mode 100644
index 00000000000..9978d4a1a75
--- /dev/null
+++ b/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs
@@ -0,0 +1,118 @@
+using Content.Server.Storage.Components;
+using Content.Shared.Materials;
+using Robust.Shared.Physics.Components;
+using Robust.Shared.Timing;
+using Content.Shared.Examine; // Frontier
+using Content.Shared.Hands.Components; // Frontier
+using Content.Shared.Verbs; // Frontier
+using Robust.Shared.Utility; // Frontier
+
+namespace Content.Shared.Storage.EntitySystems;
+
+///
+///
+///
+public sealed class MaterialStorageMagnetPickupSystem : EntitySystem
+{
+ [Dependency] private readonly IGameTiming _timing = default!;
+ [Dependency] private readonly EntityLookupSystem _lookup = default!;
+ [Dependency] private readonly SharedMaterialStorageSystem _storage = default!;
+
+ private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1);
+
+ private EntityQuery _physicsQuery;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+ _physicsQuery = GetEntityQuery();
+ SubscribeLocalEvent(OnMagnetMapInit);
+ SubscribeLocalEvent(OnMagnetUnpaused);
+ SubscribeLocalEvent(OnExamined); // Frontier
+ SubscribeLocalEvent>(AddToggleMagnetVerb); // Frontier
+ }
+
+ private void OnMagnetUnpaused(EntityUid uid, MaterialStorageMagnetPickupComponent component, ref EntityUnpausedEvent args)
+ {
+ component.NextScan += args.PausedTime;
+ }
+
+ private void OnMagnetMapInit(EntityUid uid, MaterialStorageMagnetPickupComponent component, MapInitEvent args)
+ {
+ component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1); // Need to add 1 sec to fix a weird time bug with it that make it never start the magnet
+ }
+
+ // Frontier, used to add the magnet toggle to the context menu
+ private void AddToggleMagnetVerb(EntityUid uid, MaterialStorageMagnetPickupComponent component, GetVerbsEvent args)
+ {
+ if (!args.CanAccess || !args.CanInteract)
+ return;
+
+ if (!HasComp(args.User))
+ return;
+
+ AlternativeVerb verb = new()
+ {
+ Act = () =>
+ {
+ ToggleMagnet(uid, component);
+ },
+ Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
+ Text = Loc.GetString("magnet-pickup-component-toggle-verb"),
+ Priority = 3
+ };
+
+ args.Verbs.Add(verb);
+ }
+
+ // Frontier, used to show the magnet state on examination
+ private void OnExamined(EntityUid uid, MaterialStorageMagnetPickupComponent component, ExaminedEvent args)
+ {
+ args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main",
+ ("stateText", Loc.GetString(component.MagnetEnabled
+ ? "magnet-pickup-component-magnet-on"
+ : "magnet-pickup-component-magnet-off"))));
+ }
+
+ // Frontier, used to toggle the magnet on the ore bag/box
+ public bool ToggleMagnet(EntityUid uid, MaterialStorageMagnetPickupComponent comp)
+ {
+ var query = EntityQueryEnumerator();
+ comp.MagnetEnabled = !comp.MagnetEnabled;
+
+ return comp.MagnetEnabled;
+ }
+
+ public override void Update(float frameTime)
+ {
+ base.Update(frameTime);
+ var query = EntityQueryEnumerator();
+ var currentTime = _timing.CurTime;
+
+ while (query.MoveNext(out var uid, out var comp, out var storage, out var xform))
+ {
+ if (comp.NextScan < currentTime)
+ continue;
+
+ comp.NextScan += ScanDelay;
+
+ // Frontier - magnet disabled
+ if (!comp.MagnetEnabled)
+ continue;
+
+ var parentUid = xform.ParentUid;
+
+ foreach (var near in _lookup.GetEntitiesInRange(uid, comp.Range, LookupFlags.Dynamic | LookupFlags.Sundries))
+ {
+ if (!_physicsQuery.TryGetComponent(near, out var physics) || physics.BodyStatus != BodyStatus.OnGround)
+ continue;
+
+ if (near == parentUid)
+ continue;
+
+ if (!_storage.TryInsertMaterialEntity(uid, near, uid, storage))
+ continue;
+ }
+ }
+ }
+}
diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
index 02eeca1dd19..93fdfd79dcc 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
@@ -1180,6 +1180,11 @@
- IngotGold30
- IngotSilver30
- MaterialBananium10
+ - type: MaterialStorageMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier
+ range: 0.30
+ whitelist:
+ tags:
+ - Ore # Delta V - End Magnet Pull
- type: entity
parent: OreProcessor
diff --git a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
index 829525439ed..f179c639465 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
@@ -103,3 +103,19 @@
solution: output
- type: StaticPrice
price: 500
+ - type: MaterialReclaimerMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier
+ range: 0.30
+ whitelist:
+ components:
+ - PhysicalComposition
+ - SpaceGarbage
+ tags:
+ - Trash
+ - Recyclable
+ blacklist:
+ components:
+ - Material
+ - Pda
+ - IdCard
+ tags:
+ - HighRiskItem # Delta V - End Magnet Pull
From 2e0ddae98fac4b2dcbc1492dceddc2b37d120393 Mon Sep 17 00:00:00 2001
From: Velcroboy <>
Date: Sun, 10 Mar 2024 15:30:32 -0500
Subject: [PATCH 2/5] No wl needed here
---
.../Entities/Structures/Machines/lathe.yml | 6 ++----
.../Structures/Machines/material_reclaimer.yml | 17 ++---------------
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
index 93fdfd79dcc..53a5dcedbb9 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
@@ -1181,10 +1181,8 @@
- IngotSilver30
- MaterialBananium10
- type: MaterialStorageMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier
- range: 0.30
- whitelist:
- tags:
- - Ore # Delta V - End Magnet Pull
+ magnetEnabled: True
+ range: 0.30 # Delta V - End Magnet Pull
- type: entity
parent: OreProcessor
diff --git a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
index f179c639465..66f16e5de88 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
@@ -104,18 +104,5 @@
- type: StaticPrice
price: 500
- type: MaterialReclaimerMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier
- range: 0.30
- whitelist:
- components:
- - PhysicalComposition
- - SpaceGarbage
- tags:
- - Trash
- - Recyclable
- blacklist:
- components:
- - Material
- - Pda
- - IdCard
- tags:
- - HighRiskItem # Delta V - End Magnet Pull
+ magnetEnabled: True
+ range: 0.30 # Delta V - End Magnet Pull
From a2b756be292f75b7a7782cc5782d89923ac5a55b Mon Sep 17 00:00:00 2001
From: Velcroboy <>
Date: Sun, 10 Mar 2024 15:39:04 -0500
Subject: [PATCH 3/5] Add translation strings
---
.../frontier/storage/components/magnet-pickup-components.ftl | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 Resources/Locale/en-US/frontier/storage/components/magnet-pickup-components.ftl
diff --git a/Resources/Locale/en-US/frontier/storage/components/magnet-pickup-components.ftl b/Resources/Locale/en-US/frontier/storage/components/magnet-pickup-components.ftl
new file mode 100644
index 00000000000..0a82347631f
--- /dev/null
+++ b/Resources/Locale/en-US/frontier/storage/components/magnet-pickup-components.ftl
@@ -0,0 +1,4 @@
+magnet-pickup-component-toggle-verb = Toggle magnet
+magnet-pickup-component-on-examine-main = The magnet appears to be {$stateText}.
+magnet-pickup-component-magnet-on = [color=darkgreen]on[/color]
+magnet-pickup-component-magnet-off = [color=darkred]off[/color]
From 1985dadfe79d09f0585d1ed30b4078f87b5eac20 Mon Sep 17 00:00:00 2001
From: VMSolidus
Date: Sun, 10 Mar 2024 21:49:51 -0400
Subject: [PATCH 4/5] Making code optimizations, missing component on upgraded
smelter
---
.../MaterialReclaimerMagnetPickupComponent.cs | 2 +-
.../MaterialStorageMagnetPickupComponent.cs | 2 +-
.../MaterialReclaimerMagnetPickupSystem.cs | 25 ++++++-------------
.../MaterialStorageMagnetPickupSystem.cs | 25 ++++++-------------
.../Entities/Structures/Machines/lathe.yml | 3 +++
5 files changed, 19 insertions(+), 38 deletions(-)
diff --git a/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs b/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs
index e5096d00a26..fb55184eb36 100644
--- a/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs
+++ b/Content.Shared/Frontier/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs
@@ -1,4 +1,4 @@
-namespace Content.Server.Storage.Components;
+namespace Content.Shared.Frontier.Storage.Components;
///
/// Applies an ongoing pickup area around the attached entity.
diff --git a/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs b/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs
index 999c96c1945..f83c81dc9ae 100644
--- a/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs
+++ b/Content.Shared/Frontier/Storage/Components/MaterialStorageMagnetPickupComponent.cs
@@ -1,4 +1,4 @@
-namespace Content.Server.Storage.Components;
+namespace Content.Shared.Frontier.Storage.Components;
///
/// Applies an ongoing pickup area around the attached entity.
diff --git a/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs b/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs
index e7221f72347..bee489446f2 100644
--- a/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs
+++ b/Content.Shared/Frontier/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs
@@ -1,4 +1,4 @@
-using Content.Server.Storage.Components;
+using Content.Shared.Frontier.Storage.Components;
using Content.Shared.Materials;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;
@@ -7,7 +7,7 @@
using Content.Shared.Verbs; // Frontier
using Robust.Shared.Utility; // Frontier
-namespace Content.Shared.Storage.EntitySystems;
+namespace Content.Shared.Frontier.Storage.EntitySystems;
///
///
@@ -45,17 +45,16 @@ private void OnMagnetMapInit(EntityUid uid, MaterialReclaimerMagnetPickupCompone
// Frontier, used to add the magnet toggle to the context menu
private void AddToggleMagnetVerb(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, GetVerbsEvent args)
{
- if (!args.CanAccess || !args.CanInteract)
- return;
-
- if (!HasComp(args.User))
+ if (!HasComp(args.User)
+ || !args.CanInteract
+ || !args.CanAccess)
return;
AlternativeVerb verb = new()
{
Act = () =>
{
- ToggleMagnet(uid, component);
+ component.MagnetEnabled = !component.MagnetEnabled;
},
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
Text = Loc.GetString("magnet-pickup-component-toggle-verb"),
@@ -74,15 +73,6 @@ private void OnExamined(EntityUid uid, MaterialReclaimerMagnetPickupComponent co
: "magnet-pickup-component-magnet-off"))));
}
- // Frontier, used to toggle the magnet on the ore bag/box
- public bool ToggleMagnet(EntityUid uid, MaterialReclaimerMagnetPickupComponent comp)
- {
- var query = EntityQueryEnumerator();
- comp.MagnetEnabled = !comp.MagnetEnabled;
-
- return comp.MagnetEnabled;
- }
-
public override void Update(float frameTime)
{
base.Update(frameTime);
@@ -110,8 +100,7 @@ public override void Update(float frameTime)
if (near == parentUid)
continue;
- if (!_storage.TryStartProcessItem(uid, near))
- continue;
+ _storage.TryStartProcessItem(uid, near);
}
}
}
diff --git a/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs b/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs
index 9978d4a1a75..0efea1e793d 100644
--- a/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs
+++ b/Content.Shared/Frontier/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs
@@ -1,4 +1,4 @@
-using Content.Server.Storage.Components;
+using Content.Shared.Frontier.Storage.Components;
using Content.Shared.Materials;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;
@@ -7,7 +7,7 @@
using Content.Shared.Verbs; // Frontier
using Robust.Shared.Utility; // Frontier
-namespace Content.Shared.Storage.EntitySystems;
+namespace Content.Shared.Frontier.Storage.EntitySystems;
///
///
@@ -45,17 +45,16 @@ private void OnMagnetMapInit(EntityUid uid, MaterialStorageMagnetPickupComponent
// Frontier, used to add the magnet toggle to the context menu
private void AddToggleMagnetVerb(EntityUid uid, MaterialStorageMagnetPickupComponent component, GetVerbsEvent args)
{
- if (!args.CanAccess || !args.CanInteract)
- return;
-
- if (!HasComp(args.User))
+ if (!HasComp(args.User)
+ || !args.CanInteract
+ || !args.CanAccess)
return;
AlternativeVerb verb = new()
{
Act = () =>
{
- ToggleMagnet(uid, component);
+ component.MagnetEnabled = !component.MagnetEnabled;
},
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
Text = Loc.GetString("magnet-pickup-component-toggle-verb"),
@@ -74,15 +73,6 @@ private void OnExamined(EntityUid uid, MaterialStorageMagnetPickupComponent comp
: "magnet-pickup-component-magnet-off"))));
}
- // Frontier, used to toggle the magnet on the ore bag/box
- public bool ToggleMagnet(EntityUid uid, MaterialStorageMagnetPickupComponent comp)
- {
- var query = EntityQueryEnumerator();
- comp.MagnetEnabled = !comp.MagnetEnabled;
-
- return comp.MagnetEnabled;
- }
-
public override void Update(float frameTime)
{
base.Update(frameTime);
@@ -110,8 +100,7 @@ public override void Update(float frameTime)
if (near == parentUid)
continue;
- if (!_storage.TryInsertMaterialEntity(uid, near, uid, storage))
- continue;
+ _storage.TryInsertMaterialEntity(uid, near, uid, storage);
}
}
}
diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
index 53a5dcedbb9..9a9dd615ac4 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
@@ -1211,6 +1211,9 @@
- IngotGold30
- IngotSilver30
- MaterialBananium10
+ - type: MaterialStorageMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier
+ magnetEnabled: True
+ range: 0.30 # Delta V - End Magnet Pull
- type: entity
parent: BaseLathe
From 72f457c18d008baa274fdac696e6cb0523dbf123 Mon Sep 17 00:00:00 2001
From: VMSolidus
Date: Sun, 10 Mar 2024 21:55:09 -0400
Subject: [PATCH 5/5] Update lathe.yml
---
Resources/Prototypes/Entities/Structures/Machines/lathe.yml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
index 9a9dd615ac4..53a5dcedbb9 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
@@ -1211,9 +1211,6 @@
- IngotGold30
- IngotSilver30
- MaterialBananium10
- - type: MaterialStorageMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier
- magnetEnabled: True
- range: 0.30 # Delta V - End Magnet Pull
- type: entity
parent: BaseLathe