Definition at line 83279 of file NPC.cs.
83280 {
83281
83282
83283 float num =
Math.Abs(Main.player[
j].position.X + (
float)(Main.player[
j].width / 2) -
position.X + (
float)(
width / 2)) +
Math.Abs(Main.player[
j].position.Y + (
float)(Main.player[
j].height / 2) -
position.Y + (
float)(
height / 2));
83284 num -= (float)Main.player[
j].aggro;
83286 {
83288 }
83290 {
83291 t = true;
83296 }
83297 if (Main.player[
j].tankPet >= 0 && !Main.player[
j].npcTypeNoAggro[
type])
83298 {
83299 int tankPet = Main.player[
j].tankPet;
83300 float num2 =
Math.Abs(Main.projectile[tankPet].position.X + (
float)(Main.projectile[tankPet].width / 2) -
position.X + (
float)(
width / 2)) +
Math.Abs(Main.projectile[tankPet].position.Y + (
float)(Main.projectile[tankPet].height / 2) -
position.Y + (
float)(
height / 2));
83302 if (
num2 <
distance &&
num2 < 200
f && Collision.CanHit(
base.Center, 1, 1, Main.projectile[tankPet].Center, 1, 1))
83303 {
83305 }
83306 }
83307 }
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
int height
The height of this Entity's hitbox, in pixels.
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
References Terraria.Collision.CanHit(), Terraria.Entity.direction, Terraria.Entity.height, Terraria.Main.player, Terraria.Entity.position, Terraria.Main.projectile, Terraria.NPC.target, Terraria.NPC.type, and Terraria.Entity.width.
Referenced by Terraria.NPC.TargetClosest(), and Terraria.NPC.TargetClosest_WOF().