-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No more darkswap. Boo wamp, needs some revamping before it's re-enabled.
- Loading branch information
Showing
1 changed file
with
58 additions
and
58 deletions.
There are no files selected for viewing
116 changes: 58 additions & 58 deletions
116
Content.Server/Abilities/Psionics/Abilities/DarkSwapSystem.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 |
---|---|---|
@@ -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"); | ||
# } | ||
# } | ||
# } | ||
|
||
|