Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Terraria.Projectile Class Reference

Classes

struct  HallowBossPelletStormInfo
 
class  NPCDistanceByIndexComparator
 

Public Member Functions

bool TurretShouldPersist ()
 
void SetDefaults (int Type)
 
void DefaultToSpray ()
 
void DefaultToWhip ()
 
void StatusNPC (int i)
 
void StatusPvP (int i)
 
void ghostHurt (int dmg, Vector2 Position, Entity victim)
 
void ghostHeal (int dmg, Vector2 Position, Entity victim)
 
void vampireHeal (int dmg, Vector2 Position, Entity victim)
 
void StatusPlayer (int i)
 
bool CanHitWithMeleeWeapon (Entity ent)
 
bool CanHitWithOwnBody (Entity ent)
 
void Damage ()
 
bool IsDamageDodgable ()
 
bool Colliding (Rectangle myRect, Rectangle targetRect)
 
void ProjLight ()
 
Rectangle getRect ()
 
void Update (int i)
 
void EmitEnchantmentVisualsAt (Vector2 boxPosition, int boxWidth, int boxHeight)
 
void FishingCheck ()
 
bool CanBeReflected ()
 
Color GetFairyQueenWeaponsColor (float alphaChannelMultiplier=1f, float lerpToWhite=0f, float? rawHueOverride=null)
 
float GetLastPrismHue (float laserIndex, ref float laserLuminance, ref float laserAlphaMultiplier)
 
void ProjectileFixDesperation ()
 
bool ShouldUseWindPhysics ()
 
bool IsInterruptible (Player player)
 
void Interrupt (Player player)
 
IEntitySource GetNPCSource_FromThis ()
 
IEntitySource GetProjectileSource_FromThis ()
 
IEntitySource GetItemSource_DropAsItem ()
 
IEntitySource GetItemSource_FromThis ()
 
IEntitySource GetProjectileSource_OnHit (Entity victim, int projectileSourceId)
 
IEntitySource GetItemSource_OnHit (Entity victim, int itemSourceId)
 
void Resize (int newWidth, int newHeight)
 
void AI ()
 
NPC FindTargetWithinRange (float maxRange, bool checkCanHit=false)
 
Color AI_173_GetColor ()
 
Color AI_171_GetColor ()
 
int AI_172_GetPelletStormsCount ()
 
HallowBossPelletStormInfo AI_172_GetPelletStormInfo (int stormIndex)
 
int FindTargetWithLineOfSight (float maxRange=800f)
 
bool AI_019_Spears_GetExtensionHitbox (out Rectangle extensionBox)
 
void Minion_FindTargetInRange (int startAttackRange, ref int attackTarget, bool skipIfCannotHitWithOwnBody, Func< Entity, int, bool > customEliminationCheck=null)
 
bool IsInRangeOfMeOrMyOwner (Entity entity, float maxDistance, out float myDistance, out float playerDistance, out bool closerIsMe)
 
Color AI_156_GetColor ()
 
Color GetCeleb2Color ()
 
void CheckUsability (Player player, ref bool currentlyUsable)
 
bool AI_137_CanHit (Vector2 targetPosition)
 
Color GetFirstFractalColor ()
 
void Kill_DirtAndFluidProjectiles_RunDelegateMethodPushUpForHalfBricks (Point pt, float size, Utils.TileActionAttempt plot)
 
bool IsAttachedTo (NPC npc)
 
void Kill ()
 
bool ShouldWallExplode (Vector2 compareSpot, int radius, int minI, int maxI, int minJ, int maxJ)
 
Color GetFloatingDaggerMinionGlowColor ()
 
bool CanExplodeTile (int x, int y)
 
void ExplodeTiles (Vector2 compareSpot, int radius, int minI, int maxI, int minJ, int maxJ, bool wallSplode)
 
void ExplodeCrackedTiles (Vector2 compareSpot, int radius, int minI, int maxI, int minJ, int maxJ)
 
bool TryGetContainerIndex (out int containerIndex)
 
bool IsInteractible ()
 
Color GetAlpha (Color newColor)
 
override string ToString ()
 
float AngleTo (Vector2 Destination)
 
float AngleFrom (Vector2 Source)
 
float Distance (Vector2 Other)
 
float DistanceSQ (Vector2 Other)
 
Vector2 DirectionTo (Vector2 Destination)
 
Vector2 DirectionFrom (Vector2 Source)
 
bool WithinRange (Vector2 Target, float MaxRange)
 

Static Public Member Functions

static void InitializeStaticThings ()
 
static void ResetImmunity ()
 
static bool IsNPCIndexImmuneToProjectileType (int projectileType, int npcIndex)
 
static int GetNextSlot ()
 
static int NewProjectile (IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
 
static int FindOldestProjectile ()
 
static int NewProjectile (IEntitySource spawnSource, float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
 
static Color GetGolfTrailColor (Projectile proj)
 
static void KillOldestJavelin (int protectedProjectileIndex, int projectileType, int targetNPCIndex, Point[] bufferForScan)
 
static int GetByUUID (int owner, float uuid)
 
static int GetByUUID (int owner, int uuid)
 
static IEntitySource GetNoneSource ()
 
static IEntitySource InheritSource (Projectile projectile)
 
static void UseGasTrapInChest (int chestIndex, Chest theChest, int gasTrapIndex, int gasOffsetX, int gasOffsetY)
 
static bool GasTrapCheck (int x, int y, Player user)
 
static void AI_192_GetJuminoFall (Projectile proj, out float timeSinceFall, out float fall)
 
static void RandomizeInsanityShadowFor (Entity targetEntity, bool isHostile, out Vector2 spawnposition, out Vector2 spawnvelocity, out float ai0, out float ai1)
 
static Vector2 AI_164_GetHomeLocation (Player master, int stackedIndex, int totalIndexes)
 
static void FillWhipControlPoints (Projectile proj, List< Vector2 > controlPoints)
 
static void GetWhipSettings (Projectile proj, out float timeToFlyOut, out int segments, out float rangeMultiplier)
 
static Vector2 AI_158_GetHomeLocation (Player master, int stackedIndex)
 
static int GetBallistraShotDelay (Player player)
 
static int GetExplosiveTrapCooldown (Player player)
 

Public Attributes

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

Static Public Attributes

static uint[][] perIDStaticNPCImmunity = new uint[ProjectileID.Count][]
 
const int SentryLifeTime = 36000
 
const int ArrowLifeTime = 1200
 
static int maxAI = 3
 

Package Attributes

long entityId
 

Properties

string Name [get]
 
bool WipableTurret [get]
 
float Opacity [get, set]
 
int MaxUpdates [get, set]
 
NPC OwnerMinionAttackTargetNPC [get]
 
virtual Vector2 VisualPosition [get]
 
Vector2 Center [get, set]
 
Vector2 Left [get, set]
 
Vector2 Right [get, set]
 
Vector2 Top [get, set]
 
Vector2 TopLeft [get, set]
 
Vector2 TopRight [get, set]
 
Vector2 Bottom [get, set]
 
Vector2 BottomLeft [get, set]
 
Vector2 BottomRight [get, set]
 
Vector2 Size [get, set]
 
Rectangle Hitbox [get, set]
 

Private Member Functions

Rectangle Damage_GetHitbox ()
 
void BombsHurtPlayers (Rectangle projRectangle, int j)
 
int CountEnemiesWhoAreImmuneToMeRightNow (int cap)
 
void TryDoingOnHitEffects (Entity entity)
 
void SummonSuperStarSlash (Vector2 target)
 
void SummonMonkGhast ()
 
void CutTiles ()
 
void CutTilesAt (Vector2 boxPosition, int boxWidth, int boxHeight)
 
bool CanCutTiles ()
 
bool AutomaticallyChangesDirection ()
 
void UpdateEnchantmentVisuals ()
 
void HandleMovement (Vector2 wetVelocity, out int overrideWidth, out int overrideHeight)
 
void LightDisc_Bounce (Vector2 hitPoint, Vector2 normal)
 
void AI_149_GolfBall ()
 
void MakeBoulderOfEarthExplosion ()
 
void UpdatePosition (Vector2 wetVelocity)
 
void FishingCheck_RollEnemySpawns (ref FishingAttempt fisher)
 
void FishingCheck_RollItemDrop (ref FishingAttempt fisher)
 
void FishingCheck_ProbeForQuestFish (ref FishingAttempt fisher)
 
void FishingCheck_RollDropLevels (int fishingLevel, out bool common, out bool uncommon, out bool rare, out bool veryrare, out bool legendary, out bool crate)
 
void AI_151_SuperStar ()
 
void AI_152_SuperStarSlash ()
 
void Shimmer ()
 
void AI_195_JimsDrone ()
 
void AI_111_DryadsWard ()
 
void AI_194_HorsemanPumpkin ()
 
void AI_193_Flamethrower ()
 
void AI_047_MagnetSphere ()
 
void AI_047_MagnetSphere_TryAttacking ()
 
void AI_192_JuminoAnimation ()
 
void AI_191_TrueNightsEdge ()
 
void AI_190_NightsEdge ()
 
void AI_188_LightsBane ()
 
void AI_189_Volcano ()
 
void AI_066_TryInterceptingTarget (Vector2 targetDir, Vector2 targetVelocity, float speed)
 
void AI_187_ShadowHand ()
 
void AI_187_ShadowHand_GetVariation (out int variation, out float fakeCounter, out float counterMax)
 
void AI_185_LifeDrain ()
 
void AI_186_PrincessWeapon ()
 
void AI_184_BadTorchLuck ()
 
void AI_121_StardustDragon ()
 
Projectile FindStardustDragonHeadOfOwner ()
 
void AI_183_ZoologistStrike ()
 
void AI_182_FinalFractal ()
 
void AI_181_FairyQueenRangedItemShot ()
 
void AI_009_MagicMissiles ()
 
void AI_009_MagicMissiles_Old ()
 
void AI_015_HandleMovementCollision (ref Vector2 wetVelocity, ref Vector2 lastVelocity)
 
void ResetLocalNPCHitImmunity ()
 
void AI_015_Flails ()
 
void AI_015_HandleMovementCollision_Old (ref Vector2 wetVelocity, ref Vector2 lastVelocity)
 
void AI_015_Flails_Old ()
 
void AI_015_Flails_Dust (bool doFastThrowDust)
 
void AI_100_Medusa ()
 
void AI_120_StardustGuardian ()
 
void AI_120_StardustGuardian_FindTarget (float lookupRange, ref int targetNPCIndex, ref float distanceToClosestTarget)
 
void AI_180_FairyQueenSunDance ()
 
void AI_179_FairyQueenLance ()
 
void AI_176_EdgyLightning ()
 
void AI_177_IceWhipSlicer ()
 
void AI_178_FireExplosion ()
 
void AI_175_TitaniumStormShards ()
 
void AI_174_MultisegmentPet ()
 
void AI_173_HallowBossRainbowTrail ()
 
void AI_171_HallowBossRainbowStreak ()
 
void AI_172_HallowBossRainbowPelletStorm ()
 
void AI_170_FairyGlowstick ()
 
void AI_169_Smolstars ()
 
void AI_019_Spears ()
 
void AI_019_Spears_Old ()
 
void AI_168_FirstFractal ()
 
void AI_167_SparkleGuitar ()
 
void AI_164_StormTigerGem ()
 
void AI_162_TigerPounce ()
 
void PrepareBombToBlow ()
 
void AI_016 ()
 
void AI_166_Dove ()
 
void AI_161_RapierStabs ()
 
void AI_165_Whip ()
 
void AI_160_Kites ()
 
void AI_159_PaperAirplanes ()
 
void AI_158_BabyBird ()
 
bool AI_067_CustomEliminationCheck_Pirates (Entity otherEntity, int currentTarget)
 
bool AI_067_TigerSpecialAttack ()
 
void AI_067_FreakingPirates ()
 
void AI_157_SharpTears ()
 
void AI_156_BatOfLight ()
 
void AI_156_Think (List< int > blacklist)
 
void AI_156_StartAttack ()
 
int AI_156_TryAttackingNPCs (List< int > blackListedTargets, bool skipBodyCheck=false)
 
void AI_GetMyGroupIndexAndFillBlackList (List< int > blackListedTargets, out int index, out int totalIndexesInGroup)
 
void AI_156_GetIdlePosition (int stackedIndex, int totalIndexes, out Vector2 idleSpot, out float idleRotation)
 
void AI_155_MysticSnakeCoil ()
 
void AI_155_RemoveRope (Point start, Point end)
 
void AI_155_SpawnRopeIn (int x, int y)
 
void AI_154_VoidLens ()
 
void AI_153_ToiletPop ()
 
void AI_150_GolfClubHelper ()
 
void AI_007_GrapplingHooks ()
 
bool AI_007_GrapplingHooks_CanTileBeLatchedOnTo (Tile theTile)
 
void AI_147_Celeb2Rocket ()
 
void AI_148_StarSpawner ()
 
void AI_147_Explosion ()
 
void CreateGroundExplosion (float MAX_SPREAD, int fluff, int distFluff, int layerStart, int layerEnd, int layerJump)
 
void AI_163_Chum ()
 
void ReduceRemainingChumsInPool ()
 
void AI_061_FishingBobber ()
 
float AI_061_FishingBobber_GetWaterLine (int X, int Y)
 
void AI_061_FishingBobber_DoASplash ()
 
void AI_061_FishingBobber_GiveItemToPlayer (Player thePlayer, int itemType)
 
void AI_146_DD2Victory ()
 
void BetsySharpnel (int npcIndex)
 
void CopyLocalNPCImmunityTimes (Projectile p)
 
void AI_001 ()
 
void AI_010 ()
 
void AI_026 ()
 
bool Chester_IsAnyPlayerTrackingThisProjectile ()
 
void AI_062 ()
 
void AI_075 ()
 
void AI_099_1 ()
 
void AI_099_2 ()
 
void AI_130_FlameBurstTower ()
 
int AI_130_FlameBurstTower_FindTarget (float shot_range, float angleRatioMax, Vector2 shootingSpot, bool canChangeDirection=true)
 
int AI_134_Ballista_FindTarget (float shot_range, float deadBottomAngle, Vector2 shootingSpot)
 
void AI_131_FlameBurstShot ()
 
void AI_134_Ballista ()
 
void AI_135_OgreStomp ()
 
void AI_136_BetsyBreath ()
 
void AI_137_LightningAura ()
 
void AI_138_ExplosiveTrap ()
 
void AI_139_ExplosiveTrapExplosion ()
 
void AI_140_MonkStaffT1 ()
 
void AI_141_MonkStaffT1Explosion ()
 
void CreateImpactExplosion (int dustAmountMultiplier, Vector2 explosionOrigin, ref Point scanAreaStart, ref Point scanAreaEnd, int explosionRange, out bool causedShockwaves)
 
void CreateImpactExplosion2_SleepyOctopod (Vector2 explosionOrigin, bool causedShockwaves)
 
void CreateImpactExplosion2_FlailTileCollision (Vector2 explosionOrigin, bool causedShockwaves, Vector2 velocityBeforeCollision)
 
void AI_142_MonkStaffT2And3 ()
 
void AI_143_MonkStaffT2Ghast ()
 
void AI_144_DD2Pet ()
 
void AI_145_BookStaffStorm ()
 
Point GetScarabBombDigDirectionSnap8 ()
 
void BoulderExplosion ()
 
void SpawnWebs ()
 
void DropGeodeGems ()
 
void TryGettingHitByOtherPlayersExplosives ()
 
void DoRainbowCrystalStaffExplosion ()
 

Static Private Member Functions

static void FindBannerToAssociateTo (IEntitySource spawnSource, Projectile next)
 
static void EmitBlackLightningParticles (NPC targetNPC)
 
static void GetFishingPondState (int x, int y, out bool lava, out bool honey, out int numWaters, out int chumCount)
 
static void GetFishingPondWidth (int x, int y, out int minX, out int maxX)
 

Private Attributes

int[] localNPCImmunity = new int[200]
 

Static Private Attributes

static Conditions.IsSolid _cachedConditions_solid = new Conditions.IsSolid()
 
static Conditions.NotNull _cachedConditions_notNull = new Conditions.NotNull()
 
static Point[] _javelinsMax6 = new Point[6]
 
static Point[] _javelinsMax8 = new Point[8]
 
static Point[] _javelinsMax10 = new Point[10]
 
static Rectangle _lanceHitboxBounds = new Rectangle(0, 0, 300, 300)
 
static List< Tuple< int, float > > _medusaHeadTargetList = new List<Tuple<int, float>>()
 
static NPCDistanceByIndexComparator _medusaTargetComparer = new NPCDistanceByIndexComparator()
 
static List< int > _ai164_blacklistedTargets = new List<int>()
 
static List< int > _ai158_blacklistedTargets = new List<int>()
 
static List< int > _ai156_blacklistedTargets = new List<int>()
 
static float[] _CompanionCubeScreamCooldown = new float[255]
 

Detailed Description

Definition at line 30 of file Projectile.cs.


The documentation for this class was generated from the following file: