TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ AI_130_FlameBurstTower_FindTarget()

int Terraria.Projectile.AI_130_FlameBurstTower_FindTarget ( float shot_range,
float angleRatioMax,
Vector2 shootingSpot,
bool canChangeDirection = true )
inlineprivate

Definition at line 75180 of file Projectile.cs.

75181 {
75182 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
75183 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
75184 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
75185 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
75186 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
75187 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
75188 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
75189 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
75190 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
75191 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
75192 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
75193 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
75194 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
75195 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
75196 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
75197 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
75198 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
75199 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
75200 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
75201 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
75202 //IL_0149: Unknown result type (might be due to invalid IL or missing references)
75203 //IL_0172: Unknown result type (might be due to invalid IL or missing references)
75204 //IL_0177: Unknown result type (might be due to invalid IL or missing references)
75205 //IL_015e: Unknown result type (might be due to invalid IL or missing references)
75206 //IL_0166: Unknown result type (might be due to invalid IL or missing references)
75207 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
75208 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
75209 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
75210 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
75211 //IL_009f: Unknown result type (might be due to invalid IL or missing references)
75212 int num = -1;
75214 if (ownerMinionAttackTargetNPC != null && ownerMinionAttackTargetNPC.CanBeChasedBy(this))
75215 {
75216 for (int i = 0; i < 1; i++)
75217 {
75218 if (!ownerMinionAttackTargetNPC.CanBeChasedBy(this))
75219 {
75220 continue;
75221 }
75222 float num2 = Vector2.Distance(shootingSpot, ownerMinionAttackTargetNPC.Center);
75223 if (!(num2 > shot_range))
75224 {
75225 Vector2 vector = (ownerMinionAttackTargetNPC.Center - shootingSpot).SafeNormalize(Vector2.UnitY);
75226 if (!(Math.Abs(vector.X) < Math.Abs(vector.Y) * angleRatioMax) && (canChangeDirection || !((float)direction * vector.X < 0f)) && (num == -1 || num2 < Vector2.Distance(shootingSpot, Main.npc[num].Center)) && Collision.CanHitLine(shootingSpot, 0, 0, ownerMinionAttackTargetNPC.Center, 0, 0))
75227 {
75229 }
75230 }
75231 }
75232 if (num != -1)
75233 {
75234 return num;
75235 }
75236 }
75237 for (int j = 0; j < 200; j++)
75238 {
75239 NPC nPC = Main.npc[j];
75240 if (!nPC.CanBeChasedBy(this))
75241 {
75242 continue;
75243 }
75244 float num3 = Vector2.Distance(shootingSpot, nPC.Center);
75245 if (!(num3 > shot_range))
75246 {
75247 Vector2 vector2 = (nPC.Center - shootingSpot).SafeNormalize(Vector2.UnitY);
75248 if (!(Math.Abs(vector2.X) < Math.Abs(vector2.Y) * angleRatioMax) && (canChangeDirection || !((float)direction * vector2.X < 0f)) && (num == -1 || num3 < Vector2.Distance(shootingSpot, Main.npc[num].Center)) && Collision.CanHitLine(shootingSpot, 0, 0, nPC.Center, 0, 0))
75249 {
75250 num = j;
75251 }
75252 }
75253 }
75254 return num;
75255 }

References Terraria.Collision.CanHitLine(), and Terraria.Main.npc.

+ Here is the call graph for this function: