Interface declaring callbacks the player object can receive for gameplay events like movement, dashes, combat, status effects, perks, UI events and state changes.
#nullable enable
using System.Numerics;
using Sandbox;
public interface IPlayerCallbacks
{
void Colliding( Thing other, float percent, float dt );
void OnRunStart();
void OnDashStartedEarly( Vector2 dir );
void OnDashStarted( Vector2 dir );
void OnDashFinished( Vector2 dir );
void OnDashRecharged();
void OnStartReload();
void OnFinishReload();
void OnShoot();
void OnIgnite( Enemy enemy );
void OnFreeze( Enemy enemy );
void OnPoison( Enemy enemy );
void OnFear( Enemy enemy );
void OnKill( Enemy enemy, DamageType damageType, bool countsAsKill );
void OnDamageEnemy( Enemy enemy, float damage, DamageType damageType, Vector2 dir, bool isCrit );
void OnHurt( float amount, DamageType damageType, bool isSelfInflicted, Vector2 dir, Enemy enemySource, EnemyType enemyType, float previousHealth );
void OnHit( float amount, DamageType damageType, bool isSelfInflicted, Vector2 dir, float force, Enemy enemySource, EnemyType enemyType, float previousHealth );
void OnLoseArmor( float amount, DamageType damageType, bool isSelfInflicted, Vector2 dir, Enemy enemySource );
bool TryPreventDeath();
void OnDie();
void OnRevive();
void OnHeal( float amount );
void OnHealOther( float amount, Player other );
void OnGainXpCoin( float xp );
void OnGainHealthpack( float amount );
void OnPlayerLevelUp();
void OnRerollBefore(); // before determining random perks
void OnRerollAfter(); // after determining random perks
void OnGainReroll( int amount );
void OnBanish();
void OnGainBanish( int amount );
void OnGainShield();
void OnLoseShield();
void OnLand();
void OnSayChat( string message );
void OnBulletHitGround( Bullet bullet );
void OnBulletPierce( Bullet bullet, Thing other );
void OnBulletBounce( Bullet bullet, Thing other );
void OnDodged( float damage, DamageType damageType, Vector2 dir, Enemy enemySource );
void OnSetMinute( int minute );
void OnAddPerkBefore( TypeDescription type );
void OnAddPerkAfter( TypeDescription type );
void OnRemovePerk( TypeDescription type );
void OnChoosePerk( TypeDescription type );
void OnPerkChoicesRefreshed( int numUniqueConsumed );
void OnTeleport( Vector2 from, Vector2 to );
}