Skip to content

Commit

Permalink
make glimmer events trigger psionic artifacts (#2440)
Browse files Browse the repository at this point in the history
* make glimmer events trigger psionic artifacts

* :trollface:

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Dec 19, 2024
1 parent 60780ad commit 61cad3c
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
using Content.Server.Nyanotrasen.StationEvents.Events;
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
using Content.Shared.Abilities.Psionics;

namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
Expand All @@ -13,10 +14,21 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<ArtifactMetapsionicTriggerComponent, PsionicPowerDetectedEvent>(OnPowerDetected);

SubscribeLocalEvent<GlimmerEventEndedEvent>(OnGlimmerEventEnded);
}

private void OnPowerDetected(Entity<ArtifactMetapsionicTriggerComponent> ent, ref PsionicPowerDetectedEvent args)
{
_artifact.TryActivateArtifact(ent);
}

private void OnGlimmerEventEnded(GlimmerEventEndedEvent args)
{
var query = EntityQueryEnumerator<ArtifactMetapsionicTriggerComponent>();
while (query.MoveNext(out var uid, out _))
{
_artifact.TryActivateArtifact(uid);
}
}
}

0 comments on commit 61cad3c

Please sign in to comment.