tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.Projectile Class Reference

Inherits Terraria.Entity, and Terraria.ModLoader.IEntityWithGlobals< GlobalProjectile >.

Classes

struct  HallowBossPelletStormInfo
 

Public Member Functions

void AI ()
 
bool AI_137_CanHit (Vector2 targetPosition)
 
Color AI_156_GetColor ()
 
Color AI_171_GetColor ()
 
HallowBossPelletStormInfo AI_172_GetPelletStormInfo (int stormIndex)
 
int AI_172_GetPelletStormsCount ()
 
Color AI_173_GetColor ()
 
bool CanBeReflected ()
 
bool CanExplodeTile (int x, int y)
 
bool CanHitWithMeleeWeapon (Entity ent)
 
bool CanHitWithOwnBody (Entity ent)
 
void CheckUsability (Player player, ref bool currentlyUsable)
 
void CloneDefaults (int TypeToClone)
 
bool Colliding (Rectangle myRect, Rectangle targetRect)
 
bool CountsAsClass (DamageClass damageClass)
 
void Damage ()
 
void ExplodeCrackedTiles (Vector2 compareSpot, int radius, int minI, int maxI, int minJ, int maxJ)
 
void ExplodeTiles (Vector2 compareSpot, int radius, int minI, int maxI, int minJ, int maxJ, bool wallSplode)
 
NPC FindTargetWithinRange (float maxRange)
 
int FindTargetWithLineOfSight (float maxRange=800f)
 
void FishingCheck ()
 
Color GetAlpha (Color newColor)
 
Color GetCeleb2Color ()
 
Color GetFairyQueenWeaponsColor (float alphaChannelMultiplier=1f, float lerpToWhite=0f, float? rawHueOverride=null)
 
Color GetFirstFractalColor ()
 
Color GetFloatingDaggerMinionGlowColor ()
 
GetGlobalProjectile< T > (bool exactType=true)
 Gets the instance of the specified GlobalProjectile type. This will throw exceptions on failure. More...
 
GetGlobalProjectile< T > (T baseInstance)
 Gets the local instance of the type of the specified GlobalProjectile instance. This will throw exceptions on failure. More...
 
float GetLastPrismHue (float laserIndex, ref float laserLuminance, ref float laserAlphaMultiplier)
 
IProjectileSource GetProjectileSource_FromThis ()
 
Rectangle getRect ()
 
void ghostHeal (int dmg, Vector2 Position)
 
void ghostHurt (int dmg, Vector2 Position)
 
void Interrupt (Player player)
 
bool IsAttachedTo (NPC npc)
 
bool IsInRangeOfMeOrMyOwner (Entity entity, float maxDistance, out float myDistance, out float playerDistance, out bool closerIsMe)
 
bool IsInteractible ()
 
bool IsInterruptible (Player player)
 
void Kill ()
 
void Kill_DirtAndFluidProjectiles_RunDelegateMethodPushUpForHalfBricks (Point pt, float size, Utils.TileActionAttempt plot)
 
void Minion_FindTargetInRange (int startAttackRange, ref int attackTarget, bool skipIfCannotHitWithOwnBody, Func< Entity, int, bool > customEliminationCheck=null)
 
void ProjectileFixDesperation ()
 
void ProjLight ()
 
void Resize (int newWidth, int newHeight)
 
void SetDefaults (int Type)
 
bool ShouldUseWindPhysics ()
 
bool ShouldWallExplode (Vector2 compareSpot, int radius, int minI, int maxI, int minJ, int maxJ)
 
void StatusNPC (int i)
 
void StatusPlayer (int i)
 
void StatusPvP (int i)
 
override string ToString ()
 
bool TryGetContainerIndex (out int containerIndex)
 
bool TryGetGlobalProjectile< T > (out T result, bool exactType=true)
 Gets the instance of the specified GlobalProjectile type. More...
 
bool TryGetGlobalProjectile< T > (T baseInstance, out T result)
 Safely attempts to get the local instance of the type of the specified GlobalProjectile instance. More...
 
bool TurretShouldPersist ()
 
void Update (int i)
 
void vampireHeal (int dmg, Vector2 Position)
 
void VanillaAI ()
 
- Public Member Functions inherited from Terraria.Entity
float AngleFrom (Vector2 Source)
 
float AngleTo (Vector2 Destination)
 
Vector2 DirectionFrom (Vector2 Source)
 
Vector2 DirectionTo (Vector2 Destination)
 
float Distance (Vector2 Other)
 
float DistanceSQ (Vector2 Other)
 
bool WithinRange (Vector2 Target, float MaxRange)
 

Static Public Member Functions

static Vector2 AI_158_GetHomeLocation (Player master, int stackedIndex)
 
static Vector2 AI_164_GetHomeLocation (Player master, int stackedIndex, int totalIndexes)
 
static void EmitBlackLightningParticles (NPC targetNPC)
 
static void FillWhipControlPoints (Projectile proj, List< Vector2 > controlPoints)
 
static int FindOldestProjectile ()
 
static int GetByUUID (int owner, float uuid)
 
static int GetByUUID (int owner, int uuid)
 
static Color GetGolfTrailColor (Projectile proj)
 
static int GetNextSlot ()
 
static IProjectileSource GetNoneSource ()
 
static void GetWhipSettings (Projectile proj, out float timeToFlyOut, out int segments, out float rangeMultiplier)
 
static IProjectileSource InheritSource (Projectile projectile)
 
static void InitializeStaticThings ()
 
static bool IsNPCIndexImmuneToProjectileType (int projectileType, int npcIndex)
 
static int NewProjectile (IProjectileSource spawnSource, float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner=255, float ai0=0f, float ai1=0f)
 
static int NewProjectile (IProjectileSource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=255, float ai0=0f, float ai1=0f)
 
static Projectile NewProjectileDirect (IProjectileSource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=255, float ai0=0f, float ai1=0f)
 
static void ResetImmunity ()
 

Public Attributes

float[] ai = new float[maxAI]
 
int aiStyle
 
int alpha
 
bool arrow
 
int bannerIdToRespondTo
 
bool bobber
 
bool coldDamage
 
bool counterweight
 
int damage
 
bool decidesManualFallThrough
 
int extraUpdates
 
int frame
 
int frameCounter
 
bool friendly
 
float gfxOffY
 
short glowMask
 
bool hide
 
bool hostile
 
int identity
 
int idStaticNPCHitCooldown = -1
 
bool ignoreWater
 
float knockBack
 
float light
 
float[] localAI = new float[maxAI]
 
int localNPCHitCooldown = -2
 
int[] localNPCImmunity = new int[200]
 
bool manualDirectionChange
 
int maxPenetrate = 1
 
bool minion
 
int minionPos
 
float minionSlots
 
string miscText = ""
 
bool netImportant
 
int netSpam
 
bool netUpdate
 
bool netUpdate2
 
bool noDropItem
 
bool noEnchantments
 
bool noEnchantmentVisuals
 
bool npcProj
 
int numHits
 
int numUpdates
 
Vector2[] oldPos = new Vector2[10]
 
float[] oldRot = new float[10]
 
int[] oldSpriteDirection = new int[10]
 
int originalDamage
 
bool originatedFromActivableTile
 
int owner = 255
 
bool ownerHitCheck
 
float ownerHitCheckDistance = 1000f
 
int penetrate = 1
 
int[] playerImmune = new int[255]
 
int projUUID = -1
 
int restrikeDelay
 
float rotation
 
float scale = 1f
 
bool sentry
 
bool shouldFallThrough
 
int soundDelay
 
int spriteDirection = 1
 
float stepSpeed = 1f
 
bool tileCollide
 
int timeLeft
 
bool trap
 
int type
 
bool usesIDStaticNPCImmunity
 
bool usesLocalNPCImmunity
 
List< Vector2 > WhipPointsForCollision = new List<Vector2>()
 
- Public Attributes inherited from Terraria.Entity
bool active
 
int direction = 1
 
int height
 
bool honeyWet
 
bool lavaWet
 
int oldDirection
 
Vector2 oldPosition
 
Vector2 oldVelocity
 
Vector2 position
 
Vector2 velocity
 
bool wet
 
byte wetCount
 
int whoAmI
 
int width
 

Static Public Attributes

const int ArrowLifeTime = 1200
 
static int maxAI = 2
 
static uint[][] perIDStaticNPCImmunity = new uint[956][]
 
const int SentryLifeTime = 7200
 

Properties

DamageClass?? DamageType [get, set]
 The damage type of this Projectile. Assign to DamageClass.Generic/Melee/Ranged/Magic/Summon/Throwing, or ModContent.GetInstance<T>() for custom damage types. More...
 
RefReadOnlyArray< Instanced< GlobalProjectile > > Globals [get]
 
int MaxUpdates [get, set]
 
ModProjectile ModProjectile [get, set]
 
string?? Name [get, set]
 
float Opacity [get, set]
 
NPC OwnerMinionAttackTargetNPC [get]
 
bool WipableTurret [get]
 
- Properties inherited from Terraria.Entity
Vector2 Bottom [get, set]
 
Vector2 BottomLeft [get, set]
 
Vector2 BottomRight [get, set]
 
Vector2 Center [get, set]
 
Rectangle Hitbox [get, set]
 
Vector2 Left [get, set]
 
Vector2 Right [get, set]
 
Vector2 Size [get, set]
 
Vector2 Top [get, set]
 
Vector2 TopLeft [get, set]
 
Vector2 TopRight [get, set]
 
virtual Vector2 VisualPosition [get]
 
- Properties inherited from Terraria.ModLoader.IEntityWithGlobals< GlobalProjectile >
RefReadOnlyArray< Instanced< T > > Globals [get]
 

Member Function Documentation

◆ GetGlobalProjectile< T >() [1/2]

T Terraria.Projectile.GetGlobalProjectile< T > ( bool  exactType = true)

Gets the instance of the specified GlobalProjectile type. This will throw exceptions on failure.

Exceptions
KeyNotFoundException
Exceptions
IndexOutOfRangeException
Type Constraints
T :GlobalProjectile 
T :GlobalType.GetGlobal 
T :Projectile 
T :GlobalProjectile 
T :T 
T :globalProjectiles 
T :exactType 

◆ GetGlobalProjectile< T >() [2/2]

T Terraria.Projectile.GetGlobalProjectile< T > ( baseInstance)

Gets the local instance of the type of the specified GlobalProjectile instance. This will throw exceptions on failure.

Exceptions
KeyNotFoundException
Exceptions
NullReferenceException
Type Constraints
T :GlobalProjectile 
T :GlobalType.GetGlobal 
T :Projectile 
T :GlobalProjectile 
T :T 
T :globalProjectiles 
T :baseInstance 

◆ TryGetGlobalProjectile< T >() [1/2]

bool Terraria.Projectile.TryGetGlobalProjectile< T > ( out T  result,
bool  exactType = true 
)

Gets the instance of the specified GlobalProjectile type.

Type Constraints
T :GlobalProjectile 
T :GlobalType.TryGetGlobal 
T :GlobalProjectile 
T :T 
T :globalProjectiles 
T :exactType 
T :out 
T :result 

◆ TryGetGlobalProjectile< T >() [2/2]

bool Terraria.Projectile.TryGetGlobalProjectile< T > ( baseInstance,
out T  result 
)

Safely attempts to get the local instance of the type of the specified GlobalProjectile instance.

Returns
Whether or not the requested instance has been found.
Type Constraints
T :GlobalProjectile 
T :GlobalType.TryGetGlobal 
T :GlobalProjectile 
T :T 
T :globalProjectiles 
T :baseInstance 
T :out 
T :result 

Property Documentation

◆ DamageType

DamageClass?? Terraria.Projectile.DamageType
getset

The damage type of this Projectile. Assign to DamageClass.Generic/Melee/Ranged/Magic/Summon/Throwing, or ModContent.GetInstance<T>() for custom damage types.