49646 {
49647
49648
49649
49650
49651
49652
49653
49654
49655
49656
49657
49658
49659
49660
49661
49662
49663
49664
49665
49666
49667
49668
49669
49670
49671 if (Main.netMode != 1)
49672 {
49674 {
49675 ai[1] = Main.rand.NextFloat() * 0.2f + 0.7f;
49677 }
49679 {
49680 localAI[0] = Main.rand.Next(60, 181);
49681 if (Main.rand.Next(5) == 0)
49682 {
49684 {
49688 }
49689 else if (
ai[2] == 1
f)
49690 {
49693 ai[0] = Main.rand.NextFloat() * ((float)
Math.PI * 2
f);
49695 {
49696 ai[0] =
AngleTo(Main.player[
target].Center) + Main.rand.NextFloatDirection() * 0.3f;
49697 }
49699 }
49700 }
49702 ai[0] = Main.rand.NextFloat() * ((float)
Math.PI * 2
f);
49704 {
49705 ai[0] =
AngleTo(Main.player[
target].Center) + Main.rand.NextFloatDirection() * 0.3f;
49706 }
49708 }
49709 }
49712 {
49713 Vector2
value =
ai[0].ToRotationVector2() * 1
f;
49714 value.X += Main.windSpeedTarget * 0.8f;
49717 {
49719 int num2 = (int)
base.Center.X / 16;
49720 int num3 = (int)
base.Center.Y / 16;
49722 {
49723 if (Main.tile[
num2, i] !=
null && ((Main.tile[
num2, i].nactive() && Main.tileSolid[Main.tile[
num2, i].type]) || Main.tile[
num2, i].liquid > 0))
49724 {
49725 ai[0] = 0
f -
ai[0];
49727 {
49728 velocity.Y *= 0.9f;
49729 }
49730 }
49731 }
49732 }
49734 {
49737 int num5 = (int)
base.Center.X / 16;
49738 int num6 = (int)
base.Center.Y / 16;
49740 {
49741 if (Main.tile[
num5,
j] !=
null && ((Main.tile[
num5,
j].nactive() && Main.tileSolid[Main.tile[
num5,
j].type]) || Main.tile[
num5,
j].liquid > 0))
49742 {
49744 }
49745 }
49747 {
49748 ai[0] = 0
f -
ai[0];
49750 {
49751 velocity.Y *= 0.9f;
49752 }
49753 }
49754 }
49756 {
49758 velocity.X *= -0.2f;
49759 }
49760 }
49761 else
49762 {
49764 {
49767 int num9 = (int)
base.Center.Y / 16;
49769 {
49770 if (Main.tile[
num8,
k] !=
null && Main.tile[
num8,
k].liquid > 0)
49771 {
49775 ai[0] = Main.rand.NextFloat() * ((float)
Math.PI / 4
f) - (float)
Math.PI / 2
f;
49777 {
49778 ai[0] =
AngleTo(Main.player[
target].Center) + Main.rand.NextFloatDirection() * 0.3f;
49779 }
49781 return;
49782 }
49783 }
49784 }
49786 {
49787 velocity.X *= 0.98f;
49789 }
49790 else
49791 {
49793 velocity.Y += 0.2f;
49795 {
49797 velocity.X *= -0.2f;
49799 }
49800 }
49801 }
49803 }
float AngleTo(Vector2 Destination)
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
float Distance(Vector2 Other)
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
void TargetClosest(bool faceTarget=true)
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
float value
How many copper coins the NPC will drop when killed (100 copper coins = 1 silver coin etc....
float scale
Makes the NPC bigger or smaller. Bigger than 1f is bigger. Defaults to 1f.