40339 {
40340 float moveSpeed = 0.15f;
40341 float num = 7.5f;
40349 bool flag = false;
40351 {
40354 if (Main.netMode != 1)
40355 {
40358 }
40359 }
40360 if (
ai[0] != -1f && Main.rand.Next(4) == 0)
40361 {
40364 dust.velocity *= 0.5f;
40365 if (dust.velocity.Y < 0f)
40366 {
40367 dust.velocity.Y *= -1f;
40368 }
40369 dust.alpha = 120;
40370 dust.scale = 1f + Main.rand.NextFloat() * 0.4f;
40373 }
40375 {
40378 }
40380 {
40382 }
40384 if (Main.dayTime || !Main.bloodMoon)
40385 {
40387 }
40389 switch ((
int)
ai[0])
40390 {
40391 case -1:
40392 {
40396 {
40399 }
40401 {
40405 {
40410 Main.dust[
num19].noGravity =
true;
40413 }
40414 }
40416 {
40417 velocity.Y = -2.5f;
40420 {
40423 {
40425 }
40426 }
40428 {
40430 }
40431 }
40434 {
40440 }
40441 break;
40442 }
40443 case 0:
40444 {
40447 {
40450 }
40454 {
40456 }
40458 {
40462 }
40466 {
40469 if (
num16 % 7 == 3)
40470 {
40472 }
40473 else if (
num16 % 2 == 0)
40474 {
40477 }
40478 else
40479 {
40482 }
40483 }
40484 break;
40485 }
40486 case 1:
40487 {
40491 {
40493 }
40496 {
40500 }
40502 {
40504 {
40506 }
40507 flag = true;
40513 dust6.fadeIn = 1f;
40514 dust6.velocity =
dust6.position.DirectionTo(
mouthPosition4 + Main.rand.NextVector2Circular(15f, 15f)) *
dust6.velocity.Length();
40515 dust6.noGravity = true;
40517 dust6.fadeIn = 1.5f;
40518 dust6.velocity =
dust6.position.DirectionTo(
mouthPosition4 + Main.rand.NextVector2Circular(15f, 15f)) * (
dust6.velocity.Length() + 5f);
40519 dust6.noGravity = true;
40521 }
40523 {
40528 {
40530 }
40531 for (
int m = 0;
m < 4;
m++)
40532 {
40534 dust7.velocity =
dust7.position.DirectionFrom(
mouthPosition5 + Main.rand.NextVector2Circular(5f, 5f)) *
dust7.velocity.Length();
40537 dust7.velocity =
dust7.position.DirectionFrom(
mouthPosition5 + Main.rand.NextVector2Circular(10f, 10f)) * (
dust7.velocity.Length() + 5f);
40539 }
40541 }
40544 {
40546 }
40547 break;
40548 }
40549 case 2:
40550 {
40554 {
40556 }
40558 {
40562 }
40565 {
40569 if (Main.rand.Next(4) != 0)
40570 {
40572 dust3.fadeIn = 1f;
40573 dust3.velocity =
dust3.position.DirectionTo(
mouthPosition2 + Main.rand.NextVector2Circular(15f, 15f)) * (
dust3.velocity.Length() + 3f);
40574 dust3.noGravity = true;
40576 dust3.fadeIn = 1.5f;
40577 dust3.velocity =
dust3.position.DirectionTo(
mouthPosition2 + Main.rand.NextVector2Circular(15f, 15f)) * (
dust3.velocity.Length() + 5f);
40578 dust3.noGravity = true;
40579 }
40581 }
40583 {
40589 {
40590 for (
int i = 0;
i < 5;
i++)
40591 {
40593 dust4.velocity =
dust4.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(5f, 5f)) *
dust4.velocity.Length();
40596 dust4.velocity =
dust4.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(10f, 10f)) * (
dust4.velocity.Length() + 5f);
40598 }
40599 }
40600 if ((
int)
num13 == 0)
40601 {
40603 for (
int j = 0;
j < 20;
j++)
40604 {
40606 dust5.velocity =
dust5.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(5f, 5f)) *
dust5.velocity.Length();
40609 dust5.velocity =
dust5.position.DirectionFrom(
mouthPosition3 + Main.rand.NextVector2Circular(10f, 10f)) * (
dust5.velocity.Length() + 5f);
40611 }
40612 if (Main.netMode != 1)
40613 {
40614 int num14 = Main.rand.Next(5, 11);
40618 {
40621 }
40622 }
40623 }
40625 }
40628 {
40630 }
40631 break;
40632 }
40633 case 3:
40634 {
40639 {
40647 float num11 = Utils.GetLerpValue(0f, 0.5f, t) * Utils.GetLerpValue(1f, 0.5f, t);
40649 if (Main.rand.Next(3) != 0)
40650 {
40653 dust2.velocity *= 0.1f;
40654 }
40656 }
40657 if (
ai[1] == 10f ||
ai[1] == 20f ||
ai[1] == 30f)
40658 {
40660 }
40663 {
40665 }
40666 break;
40667 }
40668 }
40670 {
40677 {
40679 }
40680 else
40681 {
40683 }
40684 }
40686 }
static float Clamp(float value, float min, float max)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 DirectionTo(Vector2 Destination)
static readonly LegacySoundStyle Item170
static readonly LegacySoundStyle Item172
void TargetClosest(bool faceTarget=true)
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
void BloodNautilus_CallForHelp()
IEntitySource GetSpawnSource_ForProjectile()
void BloodNautilus_GetMouthPositionAndRotation(out Vector2 mouthPosition, out Vector2 mouthDirection)
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)
static float Distance(Vector2 value1, Vector2 value2)
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)