forked from DeltaV-Station/Delta-v
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DeltaV-Station:master' into master
- Loading branch information
Showing
72 changed files
with
37,573 additions
and
22,337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...erver/DeltaV/Xenoarchaeology/XenoArtifacts/Effects/Components/GlimmerArtifactComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Systems; | ||
using Content.Shared.Destructible.Thresholds; | ||
|
||
namespace Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Components; | ||
|
||
/// <summary> | ||
/// Raises or lowers glimmer when this artifact is triggered. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(GlimmerArtifactSystem))] | ||
public sealed partial class GlimmerArtifactComponent : Component | ||
{ | ||
/// <summary> | ||
/// If glimmer is not in this range it won't do anything. | ||
/// Prevents the trigger being too extreme or too beneficial. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public MinMax Range; | ||
|
||
/// <summary> | ||
/// Number to add to glimmer when triggering. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public int Change; | ||
} |
22 changes: 22 additions & 0 deletions
22
...taV/Xenoarchaeology/XenoArtifacts/Effects/Components/PsionicProducingArtifactComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Systems; | ||
|
||
namespace Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Components; | ||
|
||
/// <summary> | ||
/// Makes people in a radius around it psionic when triggered. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(PsionicProducingArtifactSystem))] | ||
public sealed partial class PsionicProducingArtifactComponent : Component | ||
{ | ||
/// <summary> | ||
/// Range to look for potential psionics in. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public float Range; | ||
|
||
/// <summary> | ||
/// Number of times this node can trigger before it switches to doing nothing. | ||
/// </summary> | ||
[DataField] | ||
public int Limit = 1; | ||
} |
27 changes: 27 additions & 0 deletions
27
Content.Server/DeltaV/Xenoarchaeology/XenoArtifacts/Effects/Systems/GlimmerArtifactSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Components; | ||
using Content.Server.Xenoarchaeology.XenoArtifacts.Events; | ||
using Content.Shared.Psionics.Glimmer; | ||
|
||
namespace Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Systems; | ||
|
||
public sealed class GlimmerArtifactSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly GlimmerSystem _glimmer = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<GlimmerArtifactComponent, ArtifactActivatedEvent>(OnActivated); | ||
} | ||
|
||
private void OnActivated(Entity<GlimmerArtifactComponent> ent, ref ArtifactActivatedEvent args) | ||
{ | ||
var range = ent.Comp.Range; | ||
var current = _glimmer.Glimmer; | ||
if (current < range.Min || current > range.Max) | ||
return; | ||
|
||
_glimmer.Glimmer += ent.Comp.Change; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...er/DeltaV/Xenoarchaeology/XenoArtifacts/Effects/Systems/PsionicProducingArtifactSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Effects.Components; | ||
using Content.Server.Xenoarchaeology.XenoArtifacts; | ||
using Content.Server.Xenoarchaeology.XenoArtifacts.Events; | ||
using Content.Server.Psionics; | ||
|
||
public sealed class PsionicProducingArtifactSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ArtifactSystem _artifact = default!; | ||
[Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
[Dependency] private readonly PsionicsSystem _psionics = default!; | ||
|
||
public const string NodeDataPsionicAmount = "nodeDataPsionicAmount"; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<PsionicProducingArtifactComponent, ArtifactActivatedEvent>(OnActivated); | ||
} | ||
|
||
private void OnActivated(Entity<PsionicProducingArtifactComponent> ent, ref ArtifactActivatedEvent args) | ||
{ | ||
var (uid, comp) = ent; | ||
if (!_artifact.TryGetNodeData(uid, NodeDataPsionicAmount, out int amount)) | ||
amount = 0; | ||
|
||
if (amount >= comp.Limit) | ||
return; | ||
|
||
var coords = Transform(uid).Coordinates; | ||
foreach (var target in _lookup.GetEntitiesInRange<PotentialPsionicComponent>(coords, comp.Range)) | ||
{ | ||
_psionics.TryMakePsionic(target); | ||
} | ||
|
||
_artifact.SetNodeData(uid, NodeDataPsionicAmount, amount + 1); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
.../Xenoarchaeology/XenoArtifacts/Triggers/Components/ArtifactMetapsionicTriggerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Triggers.Components; | ||
|
||
/// <summary> | ||
/// Triggers if a psionic power is used nearby. | ||
/// Requires <c>MetapsionicPowerComponent</c> to be added too. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class ArtifactMetapsionicTriggerComponent : Component; |
22 changes: 22 additions & 0 deletions
22
...DeltaV/Xenoarchaeology/XenoArtifacts/Triggers/Systems/ArtifactMetapsionicTriggerSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Content.Server.DeltaV.Xenoarchaeology.XenoArtifacts.Triggers.Components; | ||
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems; | ||
using Content.Shared.Abilities.Psionics; | ||
|
||
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems; | ||
|
||
public sealed class ArtifactMetapsionicTriggerSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ArtifactSystem _artifact = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ArtifactMetapsionicTriggerComponent, PsionicPowerDetectedEvent>(OnPowerDetected); | ||
} | ||
|
||
private void OnPowerDetected(Entity<ArtifactMetapsionicTriggerComponent> ent, ref PsionicPowerDetectedEvent args) | ||
{ | ||
_artifact.TryActivateArtifact(ent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.