CatStation/Content.Shared/Magic/Events/ProjectileSpellEvent.cs
Whatstone 3bce58629d
Add rear velocity compensation for projectile spells. (#46275)
* Allow projectile spells to set velocity inheritance

* dot product suggestions

* finish the damn comment

* little cleanup, a few comments, use the coeff

* magic system cleanup

* no default for structs

---------

Co-authored-by: themias <themias5@gmail.com>
2026-10-02 01:56:43 +00:00

29 lines
847 B
C#

using Content.Shared.Actions;
using Robust.Shared.Prototypes;
namespace Content.Shared.Magic.Events;
public sealed partial class ProjectileSpellEvent : WorldTargetActionEvent
{
/// <summary>
/// What entity should be spawned.
/// </summary>
[DataField(required: true)]
public EntProtoId Prototype;
/// <summary>
/// How fast the projectile should travel
/// </summary>
[DataField]
public float ProjectileSpeed = 25f;
/// <summary>
/// A coefficient to adjust velocity by when shooting the opposite way you're moving.
/// </summary>
/// <remarks>
/// Useful for slow projectiles to prevent them from feeling sluggish.
/// A value of 0.5 increases projectile speed by 50% if shot directly behind you.
/// </remarks>
[DataField]
public float RearVelocityCompensation;
}