Definition at line 36812 of file NPC.cs.
36813 {
36814 if (
localAI[0] == 0f && Main.netMode != 1)
36815 {
36819 }
36823 float num = float.PositiveInfinity;
36827 {
36828 zero = targetData.Center -
base.Bottom;
36830 {
36832 }
36833 num =
zero.Length();
36835 {
36837 }
36838 }
36840 {
36842 position.X -=
num3;
36851 return;
36852 }
36854 {
36855 velocity.Y = ((oldVelocity.Y > 0f) ? 1 : (-1));
36857 }
36858 float num4 = 3f +
Math.
Abs(Main.windSpeedTarget) * 2f;
36860 {
36861 velocity.X += (float)
direction * 0.04f;
36863 {
36865 {
36866 velocity.X += (float)
direction * 0.15f;
36867 }
36868 else
36869 {
36871 }
36872 }
36874 {
36876 }
36877 }
36880 bool flag = true;
36882 bool flag2 =
false;
36884 {
36885 if (Main.tile[
num5, i] ==
null)
36886 {
36888 }
36889 if ((Main.tile[
num5, i].nactive() && Main.tileSolid[Main.tile[
num5, i].type]) || Main.tile[
num5, i].liquid > 0)
36890 {
36892 {
36894 }
36895 flag = false;
36896 break;
36897 }
36898 }
36900 {
36902 float num9 = 0.035f;
36904 {
36905 velocity.Y -=
num9;
36907 {
36908 velocity.Y -=
num9;
36909 }
36910 }
36912 {
36913 velocity.Y +=
num9;
36915 {
36916 velocity.Y +=
num9;
36917 }
36918 }
36919 }
36920 else
36921 {
36922 if (flag)
36923 {
36924 velocity.Y += 0.05f;
36925 }
36926 else
36927 {
36928 velocity.Y -= 0.1f;
36929 }
36931 {
36932 velocity.Y -= 0.2f;
36933 }
36935 {
36936 velocity.Y = 2f;
36937 }
36939 {
36940 velocity.Y = -4f;
36941 }
36942 }
36943 }
static double Abs(double value)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
void TargetClosest(bool faceTarget=true)
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
LegacySoundStyle DeathSound
void HitEffect(int hitDirection=0, double dmg=10.0)
References System.Math.Abs(), Terraria.Entity.active, Terraria.Collision.CanHit(), Terraria.NPC.collideX, Terraria.NPC.collideY, Terraria.NPC.DeathSound, Terraria.Entity.direction, Terraria.NPC.GetTargetData(), Terraria.Entity.height, Terraria.NPC.HitEffect(), Terraria.NPC.life, Terraria.NPC.localAI, Terraria.Main.netMode, Terraria.NPC.netUpdate, Terraria.Entity.oldVelocity, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.NPC.rotation, System.Math.Sign(), Terraria.NPC.spriteDirection, Terraria.NPC.target, Terraria.NPC.TargetClosest(), Terraria.DataStructures.Tile, Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Entity.velocity, Terraria.Entity.wet, Terraria.Entity.width, Terraria.Main.windSpeedTarget, Microsoft.Xna.Framework.Vector2.X, Microsoft.Xna.Framework.Vector2.Y, and Microsoft.Xna.Framework.Vector2.Zero.
Referenced by Terraria.NPC.AI().