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.
25 lines
592 B
C#
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);
|
|
}
|
|
}
|