49806 {
49807
49808
49809
49810
49811
49812
49813
49814
49815
49816
49817
49818
49819
49820
49821
49822
49823
49824
49825
49826
49827
49828
49829
49830
49831
49832
49833
49834
49835
49836
49837
49838
49839
49840
49841
49842
49843
49844
49845
49846
49847
49848
49849
49850
49851
49852
49853
49854
49855
49856
49857
49858
49859
49860
49861
49862
49863
49864
49865
49866
49867
49868
49869
49870
49871
49872
49873
49874
49875
49876
49877
49878
49879
49880
49881
49882
49883 if (
localAI[0] == 0
f && Main.netMode != 1)
49884 {
49889 velocity = (Main.rand.NextVector2Circular(5
f, 3
f) + Main.rand.NextVector2CircularEdge(5
f, 3
f)) * 0.4
f;
49893 }
49894 switch ((
int)
ai[0])
49895 {
49896 case 0:
49898 if (Main.netMode != 1 && (
ai[1] += 1
f) >= (float)(60 + Main.rand.Next(60)))
49899 {
49900 Vector2
vector =
default(Vector2);
49903 {
49905 }
49907 {
49909 }
49910 else
49911 {
49912 velocity = (Main.rand.NextVector2Circular(5
f, 3
f) + Main.rand.NextVector2CircularEdge(5
f, 3
f)) * 0.4
f;
49913 }
49917 }
49918 break;
49919 case 1:
49920 {
49922 Vector2
other =
default(Vector2);
49925 {
49927 }
49928 if ((
ai[1] += 1
f) >= (float)
num)
49929 {
49933 }
49934 int num2 = (int)
base.Center.X / 16;
49935 int num3 = (int)
base.Center.Y / 16;
49938 {
49939 if (Main.tile[
num2, i] !=
null && ((Main.tile[
num2, i].nactive() && Main.tileSolid[Main.tile[
num2, i].type]) || Main.tile[
num2, i].liquid > 0))
49940 {
49942 {
49943 velocity.Y *= 0.9f;
49944 }
49945 velocity.Y -= 0.2f;
49946 }
49947 }
49949 {
49950 break;
49951 }
49955 {
49956 if (Main.tile[
num2,
j] !=
null && Main.tile[
num2,
j].nactive() && Main.tileSolid[Main.tile[
num2,
j].type])
49957 {
49959 break;
49960 }
49961 }
49963 {
49964 velocity.Y *= 0.9f;
49965 }
49966 break;
49967 }
49968 }
49970 {
49972 }
49974 {
49976 }
49978 {
49980 return;
49981 }
49984 Vector2
zero = Vector2.Zero;
49985 for (
int k = 0;
k < 200;
k++)
49986 {
49988 if (
nPC.active &&
nPC.damage > 0 && !
nPC.friendly &&
nPC.Hitbox.Distance(
base.Center) <= 100
f)
49989 {
49992 }
49993 }
49994 for (
int l = 0;
l < 255;
l++)
49995 {
49996 Player player = Main.player[
l];
49997 if (player.active && player.Hitbox.Distance(
base.Center) <= 150
f)
49998 {
50001 }
50002 }
50004 {
50010 {
50012 }
50019 }
50020 else
50021 {
50022 if (Main.netMode == 1)
50023 {
50024 return;
50025 }
50026 Vector2
val =
new Vector2(
ai[2],
ai[3]) -
base.Center;
50027 if (!(((Vector2)(
ref val)).Length() < 16
f))
50028 {
50029 return;
50030 }
50032 if (Main.tile[(
int)
ai[2] / 16, (
int)
ai[3] / 16].type != 519)
50033 {
50035 }
50036 if (Main.rand.Next(
maxValue) != 0)
50037 {
50038 return;
50039 }
50043 {
50047 return;
50048 }
50051 for (
m = (
int)(base.Center.Y / 16
f); !
WorldGen.SolidTile(
num8,
m) && (double)
m < Main.worldSurface;
m++)
50052 {
50053 }
50054 m -= Main.rand.Next(3, 6);
50058 }
50059 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Vector2 DirectionFrom(Vector2 Source)
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
float Distance(Vector2 Other)
Vector2 DirectionTo(Vector2 Destination)
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
static bool FindCattailTop(int landX, int landY, out int cattailX, out int cattailY)