Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
formlessnameless committed Nov 30, 2024
2 parents afa7f57 + 9c21050 commit 938e68b
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;

/// <summary>
/// Knocksdown everything within range, or on the entire local grid.
/// </summary>
[RegisterComponent]
public sealed partial class KnockdownArtifactComponent : Component
{
/// <summary>
/// How close do you have to be to get knocked down?
/// </summary>
[DataField("range"), ViewVariables(VVAccess.ReadWrite)]
public float Range = 8f;

/// <summary>
/// How strongly does stuff get thrown?
/// </summary>
[DataField("entireGrid"), ViewVariables(VVAccess.ReadWrite)]
public bool EntireGrid = false;

/// <summary>
/// How long to remain knocked down for?
/// </summary>
[DataField("knockdownTime"), ViewVariables(VVAccess.ReadWrite)]
public float KnockdownTime = 3f;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Shared.Buckle.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.Maps;
using Content.Shared.Throwing;
using Robust.Server.GameObjects;
using Robust.Shared.Random;
using Content.Shared.StatusEffect;
using Content.Server.Stunnable;


namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;

public sealed class KnockdownArtifactSystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly StunSystem _stuns = default!;

private EntityQuery<BuckleComponent> _buckleQuery;
private EntityQuery<StatusEffectsComponent> _statusQuery;


/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<KnockdownArtifactComponent, ArtifactActivatedEvent>(OnActivated);
_buckleQuery = GetEntityQuery<BuckleComponent>();
_statusQuery = GetEntityQuery<StatusEffectsComponent>();

}

private void OnActivated(EntityUid uid, KnockdownArtifactComponent component, ArtifactActivatedEvent args)
{
var transform = Transform(uid);
var gridUid = transform.GridUid;
// knock over everyone on the same grid, fall back to range if not on a grid.
if (component.EntireGrid && gridUid != null) {
var gridTransform = Transform((EntityUid)gridUid);
var childEnumerator = gridTransform.ChildEnumerator;
while (childEnumerator.MoveNext(out var child))
{
if (!_buckleQuery.TryGetComponent(child, out var buckle) || buckle.Buckled)
continue;

if (!_statusQuery.TryGetComponent(child, out var status))
continue;

_stuns.TryParalyze(child, TimeSpan.FromSeconds(component.KnockdownTime), true, status);
}



}
else // knock over only people in range
{
var ents = _lookup.GetEntitiesInRange(uid, component.Range);
if (args.Activator != null)
ents.Add(args.Activator.Value);
foreach (var ent in ents)
{
if (!_buckleQuery.TryGetComponent(ent, out var buckle) || buckle.Buckled)
continue;

if (!_statusQuery.TryGetComponent(ent, out var status))
continue;

_stuns.TryParalyze(ent, TimeSpan.FromSeconds(component.KnockdownTime), true, status);
}

}
}
}
29 changes: 15 additions & 14 deletions Resources/Changelog/Impstation.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
Entries:
- author: formlessnameless
changes:
- message: Upstream merge + fixes
type: Tweak
id: 107
time: '2024-08-20T23:31:30.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/126
- author: formlessnameless
changes:
- message: A quick fix and a small boat update
type: Tweak
id: 108
time: '2024-08-21T03:29:59.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/127
- author: Darkmajia
changes:
- message: sleeper agents, random sentience, and event timings fix + announcer weights
Expand Down Expand Up @@ -4362,3 +4348,18 @@
id: 606
time: '2024-11-29T07:43:50.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/833
- author: TheGrimbeeper
changes:
- message: artifact effect that will have chemists and bartenders upset at the scientists
type: Add
id: 607
time: '2024-11-30T00:26:39.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/835
- author: Sha-Seng
changes:
- message: Mime hardsuit helmet light now has the eyes light up instead of just
using a hardhat light
type: Tweak
id: 608
time: '2024-11-30T00:27:19.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/838
1 change: 1 addition & 0 deletions Resources/Locale/en-US/xenoarchaeology/artifact-hints.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ artifact-effect-hint-sentience = Neurological activity
artifact-effect-hint-polymorph = Transmogrificational activity
artifact-effect-hint-magnet = Magnetic waves
artifact-effect-hint-visual = Visual distortions
artifact-effect-hint-stationwide-disruption = Stationwide disruption
# the triggers should be more obvious than the effects
# gives people an idea of what to do: don't be too specific (i.e. no "welders")
Expand Down
22 changes: 21 additions & 1 deletion Resources/Prototypes/XenoArch/Effects/normal_effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,17 @@
intensity: 2
slope: 0.3

- type: artifactEffect
id: EffectLocalKnockdown
targetDepth: 3
effectHint: artifact-effect-hint-environment
effectProb: 0.7
components:
- type: KnockdownArtifact
range: 8
entireGrid: false
knockdownTime: 4

- type: artifactEffect
id: EffectMaterialSpawn
targetDepth: 3
Expand Down Expand Up @@ -766,7 +777,6 @@
- SpaceDrugs
- BrosochloricBros
- JuiceThatMakesYouUngh
- Pilk
- Nocturine
- MuteToxin
- Phlogiston
Expand Down Expand Up @@ -1049,6 +1059,16 @@
prob: 1
orGroup: magicbook

- type: artifactEffect
id: EffectGridKnockdown
targetDepth: 4
effectHint: artifact-effect-hint-stationwide-disruption
effectProb: 0.6
components:
- type: KnockdownArtifact
entireGrid: true
knockdownTime: 2.5

- type: artifactEffect
id: EffectSingulo
targetDepth: 10
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/4f6190e2895e09116663ef282d3ce1d8b35c032e, sprited by Fazansen(https://github.com/Fazansen)",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/4f6190e2895e09116663ef282d3ce1d8b35c032e, sprited by Fazansen(https://github.com/Fazansen), lit sprite modified by Sha-Seng (Github)",
"size": {
"x": 32,
"y": 32
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 938e68b

Please sign in to comment.