tModLoader v2024.03
A mod to make and play Terraria mods
ProjectileLoader Class Reference

This serves as the central class from which projectile-related functions are carried out. It also stores a list of mod projectiles by ID. More...

Static Public Member Functions

static T AddModHook< T > (T hook)
 
static void AI (Projectile projectile)
 
static ? bool CanCutTiles (Projectile projectile)
 
static ? bool CanDamage (Projectile projectile)
 
static ? bool CanHitNPC (Projectile projectile, NPC target)
 
static bool CanHitPlayer (Projectile projectile, Player target)
 
static bool CanHitPvp (Projectile projectile, Player target)
 
static ? bool CanUseGrapple (int type, Player player)
 
static ? bool Colliding (Projectile projectile, Rectangle projHitbox, Rectangle targetHitbox)
 
static void CutTiles (Projectile projectile)
 
static void DrawHeldProjInFrontOfHeldItemAndArms (Projectile projectile, ref bool flag)
 
static void DrawOffset (Projectile projectile, ref int offsetX, ref int offsetY, ref float originX)
 
static ? Color GetAlpha (Projectile projectile, Color lightColor)
 
static ModProjectile GetProjectile (int type)
 Gets the ModProjectile template instance corresponding to the specified type (not the clone/new instance which gets added to Projectiles as the game is played). More...
 
static ? bool GrappleCanLatchOnTo (Projectile projectile, Player player, int x, int y)
 
static bool GrappleOutOfRange (float distance, Projectile projectile)
 
static void GrapplePullSpeed (Projectile projectile, Player player, ref float speed)
 
static void GrappleRetreatSpeed (Projectile projectile, Player player, ref float speed)
 
static void GrappleTargetPoint (Projectile projectile, Player player, ref float grappleX, ref float grappleY)
 
static void Kill_Obsolete (Projectile projectile, int timeLeft)
 
static bool MinionContactDamage (Projectile projectile)
 
static void ModifyDamageHitbox (Projectile projectile, ref Rectangle hitbox)
 
static void ModifyFishingLine (Projectile projectile, ref float polePosX, ref float polePosY, ref Color lineColor)
 
static void ModifyHitNPC (Projectile projectile, NPC target, ref NPC.HitModifiers modifiers)
 
static void ModifyHitPlayer (Projectile projectile, Player target, ref Player.HurtModifiers modifiers)
 
static void NumGrappleHooks (Projectile projectile, Player player, ref int numHooks)
 
static void OnHitNPC (Projectile projectile, NPC target, in NPC.HitInfo hit, int damageDone)
 
static void OnHitPlayer (Projectile projectile, Player target, in Player.HurtInfo hurtInfo)
 
static void OnKill (Projectile projectile, int timeLeft)
 
static bool OnTileCollide (Projectile projectile, Vector2 oldVelocity)
 
static void PostAI (Projectile projectile)
 
static void PostDraw (Projectile projectile, Color lightColor)
 
static bool PreAI (Projectile projectile)
 
static bool PreDraw (Projectile projectile, ref Color lightColor)
 
static bool PreDrawExtras (Projectile projectile)
 
static bool PreKill (Projectile projectile, int timeLeft)
 
static void ProjectileAI (Projectile projectile)
 
static byte[] ReadExtraAI (BinaryReader reader)
 
static void ReceiveExtraAI (Projectile projectile, byte[] extraAI)
 
static void SendExtraAI (BinaryWriter writer, byte[] extraAI)
 
static bool ShouldUpdatePosition (Projectile projectile)
 
static bool TileCollideStyle (Projectile projectile, ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac)
 
static void UseGrapple (Player player, ref int type)
 
static byte[] WriteExtraAI (Projectile projectile)
 

Properties

static int ProjectileCount = ProjectileID.Count [get]
 

Detailed Description

This serves as the central class from which projectile-related functions are carried out. It also stores a list of mod projectiles by ID.

Member Function Documentation

◆ AddModHook< T >()

static T ProjectileLoader.AddModHook< T > ( hook)
static
Type Constraints
T :HookList 

◆ GetProjectile()

static ModProjectile ProjectileLoader.GetProjectile ( int  type)
static

Gets the ModProjectile template instance corresponding to the specified type (not the clone/new instance which gets added to Projectiles as the game is played).

Parameters
typeThe type of the projectile
Returns
The ModProjectile instance in the projectiles array, null if not found.