Files
crystall-punk-14/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellDemiplaneInfiltration.cs
Ed 35303d7d80 Guildmaster 2 spells (#842)
* merge movement and gate magic types into darkness new

* demiplane infiltration spell

* Update CP14SharedDemiplanSytem.cs

* finish

* locale
2025-02-05 22:52:50 +03:00

27 lines
854 B
C#

using Content.Shared._CP14.Demiplane;
using Content.Shared._CP14.Demiplane.Components;
namespace Content.Shared._CP14.MagicSpell.Spells;
public sealed partial class CP14SpellDemiplaneInfiltration : CP14SpellEffect
{
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
{
if (args.User is null)
return;
if (!entManager.TryGetComponent<CP14DemiplaneRiftComponent>(args.Target, out var rift))
return;
if (rift.Demiplane is null)
return;
if (!entManager.TryGetComponent<CP14DemiplaneComponent>(rift.Demiplane.Value, out var demiplane))
return;
var demiplaneSystem = entManager.System<CP14SharedDemiplaneSystem>();
demiplaneSystem.TryTeleportIntoDemiplane((rift.Demiplane.Value, demiplane), args.User.Value);
}
}