Skip to content

Commit

Permalink
No more darkswap
Browse files Browse the repository at this point in the history
No more darkswap. Boo wamp, needs some revamping before it's re-enabled.
  • Loading branch information
SixplyDev authored Jan 13, 2025
1 parent 2fe15fb commit 2fe492c
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions Content.Server/Abilities/Psionics/Abilities/DarkSwapSystem.cs
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
using Content.Shared.Abilities.Psionics;
using Content.Shared.Actions.Events;
using Content.Shared.Shadowkin;
using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Maps;
using Robust.Server.GameObjects;

namespace Content.Server.Abilities.Psionics
{
public sealed class DarkSwapSystem : EntitySystem
{
[Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly PhysicsSystem _physics = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DarkSwapActionEvent>(OnPowerUsed);
}

private void OnPowerUsed(DarkSwapActionEvent args)
{
if (TryComp<EtherealComponent>(args.Performer, out var ethereal))
{
var tileref = Transform(args.Performer).Coordinates.GetTileRef();
if (tileref != null
&& _physics.GetEntitiesIntersectingBody(args.Performer, (int) CollisionGroup.Impassable).Count > 0)
{
_popup.PopupEntity(Loc.GetString("revenant-in-solid"), args.Performer, args.Performer);
return;
}

if (_psionics.OnAttemptPowerUse(args.Performer, "DarkSwap"))
{
SpawnAtPosition("ShadowkinShadow", Transform(args.Performer).Coordinates);
SpawnAtPosition("EffectFlashShadowkinDarkSwapOff", Transform(args.Performer).Coordinates);
RemComp(args.Performer, ethereal);
args.Handled = true;
}
}
else if (_psionics.OnAttemptPowerUse(args.Performer, "DarkSwap", args.ManaCost))
{
var newethereal = EnsureComp<EtherealComponent>(args.Performer);
newethereal.Darken = true;

SpawnAtPosition("ShadowkinShadow", Transform(args.Performer).Coordinates);
SpawnAtPosition("EffectFlashShadowkinDarkSwapOn", Transform(args.Performer).Coordinates);

args.Handled = true;
}

if (args.Handled)
_psionics.LogPowerUsed(args.Performer, "DarkSwap");
}
}
}
# using Content.Shared.Abilities.Psionics;
# using Content.Shared.Actions.Events;
# using Content.Shared.Shadowkin;
# using Content.Shared.Physics;
# using Content.Shared.Popups;
# using Content.Shared.Maps;
# using Robust.Server.GameObjects;

# namespace Content.Server.Abilities.Psionics
# {
# public sealed class DarkSwapSystem : EntitySystem
# {
# [Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
# [Dependency] private readonly SharedPopupSystem _popup = default!;
# [Dependency] private readonly PhysicsSystem _physics = default!;

# public override void Initialize()
# {
# base.Initialize();
# SubscribeLocalEvent<DarkSwapActionEvent>(OnPowerUsed);
# }
#
# private void OnPowerUsed(DarkSwapActionEvent args)
# {
# if (TryComp<EtherealComponent>(args.Performer, out var ethereal))
# {
# var tileref = Transform(args.Performer).Coordinates.GetTileRef();
# if (tileref != null
# && _physics.GetEntitiesIntersectingBody(args.Performer, (int) CollisionGroup.Impassable).Count > 0)
# {
# _popup.PopupEntity(Loc.GetString("revenant-in-solid"), args.Performer, args.Performer);
# return;
# }

# if (_psionics.OnAttemptPowerUse(args.Performer, "DarkSwap"))
# {
# SpawnAtPosition("ShadowkinShadow", Transform(args.Performer).Coordinates);
# SpawnAtPosition("EffectFlashShadowkinDarkSwapOff", Transform(args.Performer).Coordinates);
# RemComp(args.Performer, ethereal);
# args.Handled = true;
# }
# }
# else if (_psionics.OnAttemptPowerUse(args.Performer, "DarkSwap", args.ManaCost))
# {
# var newethereal = EnsureComp<EtherealComponent>(args.Performer);
# newethereal.Darken = true;

# SpawnAtPosition("ShadowkinShadow", Transform(args.Performer).Coordinates);
# SpawnAtPosition("EffectFlashShadowkinDarkSwapOn", Transform(args.Performer).Coordinates);

# args.Handled = true;
# }

# if (args.Handled)
# _psionics.LogPowerUsed(args.Performer, "DarkSwap");
# }
# }
# }


0 comments on commit 2fe492c

Please sign in to comment.