Files
crystall-punk-14/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellDash.cs
Ed 63a1d60c6a Add dash range limit to dash spell and system
Introduces a maximum dash range to the dash system and spell effect, clamping the dash target if it exceeds the allowed distance. Updates configuration fields and prototype YAML to support the new range parameter.
2025-06-19 12:47:46 +03:00

25 lines
592 B
C#

using Content.Shared._CP14.Dash;
namespace Content.Shared._CP14.MagicSpell.Spells;
public sealed partial class CP14SpellDash : CP14SpellEffect
{
[DataField]
public float Speed = 10f;
[DataField]
public float Range = 3.5f;
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
{
if (args.User is null)
return;
if (args.Position is null)
return;
var dashSys = entManager.System<CP14DashSystem>();
dashSys.PerformDash(args.User.Value, args.Position.Value, Speed, Range);
}
}