46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
using CalamityMod.Enums;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
|
|
namespace CalamityMod.CalPlayer.Dashes
|
|
{
|
|
public abstract class PlayerDashEffect
|
|
{
|
|
// For the sake of easy access without the need for stored instances, this property is defined as static instead of abstract.
|
|
// Derived classes should use the new keyword on this member to define their own version of it.
|
|
public static string ID { get; }
|
|
public int dashTime { get; set; }
|
|
public virtual int dashStartup => 0;
|
|
|
|
public int DashTimeAdjustedForStartup => dashTime - dashStartup;
|
|
|
|
public abstract DashCollisionType CollisionType { get; }
|
|
|
|
public abstract bool IsOmnidirectional { get; }
|
|
|
|
public abstract float CalculateDashSpeed(Player player);
|
|
/// <summary>
|
|
/// Effects that happen once when the main dash starts
|
|
/// </summary>
|
|
/// <param name="player"></param>
|
|
public virtual void OnDashEffects(Player player) { }
|
|
/// <summary>
|
|
/// Effects that happen once when the dash startup starts
|
|
/// This does not run on dashes without set startup
|
|
/// </summary>
|
|
/// <param name="player"></param>
|
|
|
|
public virtual void OnDashStartupEffects(Player player) { }
|
|
/// <summary>
|
|
/// Effects that run during the dash startup time
|
|
/// This does not run on dashes without set startup
|
|
/// </summary>
|
|
/// <param name="player"></param>
|
|
public virtual void DashStartupEffects(Player player) { }
|
|
|
|
public virtual void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) { }
|
|
|
|
public virtual void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) { }
|
|
}
|
|
}
|