Files
crystall-punk-14/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellThrowToUser.cs
Ed 6f0bb473d2 Simple resurrection spell (#575)
* resurrection spell

* Update spawners.yml
2024-11-10 19:17:04 +03:00

24 lines
647 B
C#

using Content.Shared.Throwing;
namespace Content.Shared._CP14.MagicSpell.Spells;
public sealed partial class CP14SpellThrowToUser : CP14SpellEffect
{
[DataField]
public float ThrowPower = 10f;
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
{
if (args.Target is null)
return;
var targetEntity = args.Target.Value;
var throwing = entManager.System<ThrowingSystem>();
if (!entManager.TryGetComponent<TransformComponent>(args.User, out var xform))
return;
throwing.TryThrow(targetEntity, xform.Coordinates, ThrowPower);
}
}