35262 {
35264 {
35266 return;
35267 }
35268 int num = 32;
35270 int num2 = Main.maxTilesY * 16;
35273 {
35275 }
35276 bool flag =
ai[0] == -1f ||
ai[0] == -2f;
35278 {
35280 {
35283 {
35285 }
35286 }
35288 {
35292 }
35294 {
35297 }
35298 if (
num3 > 0 ||
ai[0] == -2f)
35299 {
35301 }
35302 }
35303 if (
owner == Main.myPlayer)
35304 {
35306 {
35307 if (player.channel && player.HeldItem.shoot ==
type)
35308 {
35312 {
35315 ai[1] = pointPoisition.Y + (float)(
num2 *
num3);
35316 }
35317 }
35318 else
35319 {
35325 {
35327 }
35329 {
35331 }
35332 else
35333 {
35335 }
35336 }
35337 }
35338 if (flag &&
ai[1] == -1f)
35339 {
35342 {
35345 }
35346 }
35347 }
35350 if (
ai[0] > 0f &&
ai[1] > 0f)
35351 {
35353 }
35354 if (flag &&
ai[1] >= 0f)
35355 {
35357 if (Main.npc.IndexInRange(
num6))
35358 {
35360 if (
nPC.CanBeChasedBy(
this))
35361 {
35366 }
35367 else
35368 {
35371 }
35372 }
35373 }
35374 bool flag2 =
false;
35375 if (flag)
35376 {
35378 }
35380 {
35383 {
35390 {
35392 }
35394 {
35396 }
35398 }
35399 else
35400 {
35404 }
35406 {
35408 }
35409 }
35410 if (flag &&
ai[1] < 0f)
35411 {
35413 {
35415 }
35417 {
35419 }
35420 }
35422 {
35424 }
35425 else
35426 {
35428 }
35431 {
35433 {
35436 }
35437 if (Main.rand.Next(9) == 0)
35438 {
35440 Main.dust[
num9].velocity *= 0.3f;
35441 Main.dust[
num9].position.X = position.X + (float)(
width / 2) + 4f + (float)Main.rand.Next(-4, 5);
35442 Main.dust[
num9].position.Y = position.Y + (float)(
height / 2) + (float)Main.rand.Next(-4, 5);
35443 Main.dust[
num9].noGravity =
true;
35444 Main.dust[
num9].velocity += Main.rand.NextVector2Circular(2f, 2f);
35445 }
35447 {
35448 int num10 = Main.rand.Next(2, 5);
35449 for (
int i = 0;
i <
num10;
i++)
35450 {
35452 dust.velocity *= 0.3f;
35453 dust.position =
base.Center;
35454 dust.noGravity = true;
35455 dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
35456 dust.fadeIn = 2.2f;
35457 }
35458 }
35459 }
35461 {
35462 return;
35463 }
35466 if (Main.rand.Next(6) == 0)
35467 {
35469 dust2.noGravity = true;
35470 dust2.velocity *= 1.4f;
35471 dust2.velocity += Main.rand.NextVector2Circular(1f, 1f);
35472 dust2.velocity +=
velocity * 0.15f;
35473 }
35474 if (Main.rand.Next(12) == 0)
35475 {
35477 dust3.velocity += Main.rand.NextVector2Circular(1f, 1f);
35478 dust3.velocity +=
velocity * 0.15f;
35479 }
35481 {
35484 {
35486 dust4.velocity *= 0.3f;
35487 dust4.position =
base.Center;
35488 dust4.noGravity = true;
35489 dust4.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
35490 dust4.fadeIn = 2.2f;
35491 dust4.position += (dust4.position -
base.Center) *
lerpValue * 10f;
35492 }
35493 }
35494 }
static float Lerp(float value1, float value2, float amount)
static byte Min(byte val1, byte val2)
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 DirectionFrom(Vector2 Source)
float Distance(Vector2 Other)
static readonly LegacySoundStyle Item9
void AI_009_MagicMissiles_Old()
int FindTargetWithLineOfSight(float maxRange=800f)
static Color Lerp(Color value1, Color value2, float amount)
static float Dot(Vector2 value1, Vector2 value2)
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)