Salvage magnet revamp (#23119)

* Generic offering window

* More work

* weh

* Parity

* Progression meter

* magnet

* rona

* PG asteroid work

* code red

* Asteroid spawnings

* clams

* a

* Marker fixes

* More fixes

* Workings of biome asteroids

* A

* Fix this loading code

* a

* Fix masking

* weh

* Fixes

* Magnet claiming

* toe

* petogue

* magnet

* Bunch of fixes

* Fix default

* Fixes

* asteroids

* Fix offerings

* Localisation and a bunch of fixes

* a

* Fixes

* Preliminary draft

* Announcement fixes

* Fixes and bump spawn rate

* Fix asteroid spawns and UI

* More fixes

* Expeditions fix

* fix

* Gravity

* Fix announcement rounding

* a

* Offset tweak

* sus

* jankass

* Fix merge
This commit is contained in:
metalgearsloth
2024-01-04 14:25:32 +11:00
committed by GitHub
parent 98f5f47355
commit bf79acd127
66 changed files with 2257 additions and 1252 deletions

View File

@@ -12,6 +12,8 @@ public sealed class ArtifactMagnetTriggerSystem : EntitySystem
{
[Dependency] private readonly ArtifactSystem _artifact = default!;
private readonly List<EntityUid> _toActivate = new();
/// <inheritdoc/>
public override void Initialize()
{
@@ -25,7 +27,7 @@ public sealed class ArtifactMagnetTriggerSystem : EntitySystem
if (!EntityQuery<ArtifactMagnetTriggerComponent>().Any())
return;
List<EntityUid> toActivate = new();
_toActivate.Clear();
//assume that there's more instruments than artifacts
var query = EntityQueryEnumerator<MagbootsComponent, TransformComponent>();
@@ -43,21 +45,20 @@ public sealed class ArtifactMagnetTriggerSystem : EntitySystem
if (distance > trigger.Range)
continue;
toActivate.Add(artifactUid);
_toActivate.Add(artifactUid);
}
}
foreach (var a in toActivate)
foreach (var a in _toActivate)
{
_artifact.TryActivateArtifact(a);
}
}
private void OnMagnetActivated(SalvageMagnetActivatedEvent ev)
private void OnMagnetActivated(ref SalvageMagnetActivatedEvent ev)
{
var magXform = Transform(ev.Magnet);
var toActivate = new List<EntityUid>();
var query = EntityQueryEnumerator<ArtifactMagnetTriggerComponent, TransformComponent>();
while (query.MoveNext(out var uid, out var artifact, out var xform))
{
@@ -67,10 +68,10 @@ public sealed class ArtifactMagnetTriggerSystem : EntitySystem
if (distance > artifact.Range)
continue;
toActivate.Add(uid);
_toActivate.Add(uid);
}
foreach (var a in toActivate)
foreach (var a in _toActivate)
{
_artifact.TryActivateArtifact(a);
}