107079 {
107080
107081
107082
107083
107084
107085
107086
107087
107088
107089
107090
107091
107092
107093
107094
107095
107096
107097
107098
107099
107100
107101
107102
107103
107104
107105
107106
107107
107108
107109
107110
107111
107112
107113
107114
107115
107116
107117
107118
107119
107120
107121
107122
107123
107124
107125
107126
107127
107128
107129
107130
107131
107132
107133
107134
107135
107136
107137
107138
107139
107140
107141
107142
107144 {
107146 }
107147 else if (Main.netMode == 2)
107148 {
107150 }
107151 else if (Main.multiplayerNPCSmoothingRange <= 0)
107152 {
107154 }
107156 {
107158 {
107160 }
107162 {
107164 }
107165 else
107166 {
107168 float num4 = Main.multiplayerNPCSmoothingRange;
107171 {
107175 }
107182 {
107184 }
107186 {
107188 {
107190 }
107192 {
107194 }
107195 }
107196 }
107197 }
107200 {
107202 }
107203 if (Main.netMode != 2)
107204 {
107206 }
107210 if (
aiStyle == 7 &&
position.Y > Main.bottomWorld - 640
f + (
float)
height && Main.netMode != 1 && !Main.xMas)
107211 {
107213 if (Main.netMode == 2)
107214 {
107215 NetMessage.SendData(28, -1, -1,
null,
whoAmI, 9999
f);
107216 }
107217 }
107218 if (Main.netMode == 1)
107219 {
107222 if (!Main.sectionManager.TilesLoaded(
num6 - 3,
num7 - 3,
num6 + 3,
num7 + 3))
107223 {
107224 return;
107225 }
107226 }
107237 {
107239 }
107241 {
107246 return;
107247 }
107253 {
107256 {
107258 }
107259 }
107261 {
107264 {
107266 }
107267 }
107269 {
107271 }
107273 {
107275 }
107281 {
107285 {
107288 }
107290 {
107293 }
107295 {
107298 }
107299 if (Main.rand.Next((
int)
num10) == 0)
107300 {
107304 obj.velocity *= 0.1f;
107306 }
107307 }
107308 for (
int j = 0;
j < 256;
j++)
107309 {
107311 {
107313 }
107314 }
107316 {
107320 {
107324 }
107325 }
107327 {
107330 {
107332 }
107333 }
107334 if ((
double)velocity.X < 0.005 && (double)
velocity.X > -0.005)
107335 {
107337 }
107339 {
107341 {
107343 }
107346 }
107348 {
107350 }
107352 {
107354 }
107355 else
107356 {
107361 {
107363 {
107365 {
107367 }
107368 }
107369 }
107370 }
107372 {
107376 }
107383 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
int height
The height of this Entity's hitbox, in pixels.
static bool[] AllNPCs
An array of length P:Terraria.ModLoader.NPCLoader.NPCCount with only true entries....
static bool[] TakesDamageFromHostilesWithoutBeingFriendly
If true for a given NPC type (F:Terraria.NPC.type), then that NPC can take damage from hostile NPCs w...
static bool[] NoMultiplayerSmoothingByType
If true for a given NPC type (F:Terraria.NPC.type), then that NPC will not smooth its visual position...
static bool[] NoMultiplayerSmoothingByAI
If true for a given T:Terraria.ID.NPCAIStyleID (F:Terraria.NPC.aiStyle), then that AI style will not ...
static bool[] HurtingBees
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is a bee that will hurt other non-b...
static void ResetEffects(NPC npc)
This serves as the central class from which NPC-related functions are carried out....
bool boss
Set to true if the NPC is a boss. Prevents off-screen despawn. Bosses also need [AutoloadBossHead] an...
void UpdateNPC_CritterSounds()
int[] immune
This determines if an NPC can be hit by a item or projectile owned by a particular player (it is an a...
void UpdateNPC_BuffApplyDOTs()
void UpdateNPC_BuffSetFlags(bool lowerBuffTime=true)
float maxFallSpeed
The current fall speed cap in velocity applied every frame. Multiply F:Terraria....
static readonly int maxBuffs
int lifeMax
The maximum life of this NPC.
float gfxOffY
An offset from the actual position of the npc that will be added to the draw position....
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla NPC AI styles are enumerated in the T:Te...
void UpdateNPC_BuffApplyVFX()
float gravity
The current change in velocity due to gravity applied every frame. Multiply F:Terraria....
bool noGravity
If true, the npc will not be affected by gravity. Demon Eyes and other floating npc use this....
void UpdateNPC_CastLights()
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
void UpdateNPC_BuffFlagsReset()
void UpdateNetworkCode(int i)
bool friendly
Indicates that an NPC is friendly to players. If true, a player won't damage the NPC and the NPC won'...
float stepSpeed
Has nothing to do with the speed that this NPC travels, that is dictated by AI code adjusting F:Terra...
void UpdateNPC_UpdateTrails()
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
void DelBuff(int buffIndex)
Removes the buff at the provided index and shuffles the remaining buff indexes down to fill the gap....
void SubAI_HandleTemporaryCatchableNPCPlayerInvulnerability()
bool noTileCollide
If true, the npc does not collide with tiles, making the npc pass through tiles freely....
static int offSetDelayTime
void TrySyncingUniqueTownNPCData(int npcIndex)
void GetHurtByOtherNPCs(bool[] acceptableNPCIDs)
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
static bool[] npcsFoundForCheckActive
void UpdateNPC_BloodMoonTransformations()
void UpdateNPC_BuffClearExpiredBuffs()
void UpdateNPC_SoulDrainDebuff()
int StrikeNPCNoInteraction(int Damage, float knockBack, int hitDirection)
void UpdateNPC_UpdateGravity()
Updates P:Terraria.NPC.maxFallSpeed and P:Terraria.NPC.gravity in line with vanilla behavior and rese...
void UpdateNPC_TeleportVisuals()