TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ AI_121_QueenSlime_FlyMovement()

void Terraria.NPC.AI_121_QueenSlime_FlyMovement ( )
inlineprivate

Definition at line 45834 of file NPC.cs.

45835 {
45836 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
45837 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
45838 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
45839 //IL_0149: Unknown result type (might be due to invalid IL or missing references)
45840 //IL_014e: Unknown result type (might be due to invalid IL or missing references)
45841 //IL_0154: Unknown result type (might be due to invalid IL or missing references)
45842 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
45843 //IL_015e: Unknown result type (might be due to invalid IL or missing references)
45844 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
45845 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
45846 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
45847 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
45848 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
45849 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
45850 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
45851 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
45852 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
45853 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
45854 //IL_0084: Unknown result type (might be due to invalid IL or missing references)
45855 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
45856 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
45857 //IL_0093: Unknown result type (might be due to invalid IL or missing references)
45858 //IL_0095: Unknown result type (might be due to invalid IL or missing references)
45859 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
45860 //IL_01ee: Unknown result type (might be due to invalid IL or missing references)
45861 //IL_01f3: Unknown result type (might be due to invalid IL or missing references)
45862 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
45863 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
45864 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
45865 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
45866 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
45867 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
45868 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
45869 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
45870 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
45871 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
45872 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
45873 //IL_021d: Unknown result type (might be due to invalid IL or missing references)
45874 //IL_021f: Unknown result type (might be due to invalid IL or missing references)
45875 //IL_0224: Unknown result type (might be due to invalid IL or missing references)
45876 //IL_0206: Unknown result type (might be due to invalid IL or missing references)
45877 //IL_020e: Unknown result type (might be due to invalid IL or missing references)
45878 //IL_0213: Unknown result type (might be due to invalid IL or missing references)
45879 //IL_0226: Unknown result type (might be due to invalid IL or missing references)
45880 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
45881 noTileCollide = true;
45882 noGravity = true;
45883 float num = 12f;
45884 float num2 = 0.085f;
45885 float num3 = 250f;
45886 TargetClosest();
45887 Vector2 desiredVelocity = base.Center;
45888 if (timeLeft > 10)
45889 {
45890 if (!Collision.CanHit(this, Main.player[target]))
45891 {
45892 bool flag = false;
45893 Vector2 center = Main.player[target].Center;
45894 for (int i = 0; i < 16; i++)
45895 {
45896 float num4 = 16 * i;
45897 Point point = (center + new Vector2(0f, 0f - num4)).ToTileCoordinates();
45898 if (WorldGen.SolidOrSlopedTile(point.X, point.Y))
45899 {
45900 desiredVelocity = center + new Vector2(0f, 0f - num4 + 16f) - base.Center;
45901 flag = true;
45902 break;
45903 }
45904 }
45905 if (!flag)
45906 {
45907 desiredVelocity = center - base.Center;
45908 }
45909 }
45910 else
45911 {
45912 desiredVelocity = Main.player[target].Center + new Vector2(0f, 0f - num3) - base.Center;
45913 }
45914 }
45915 else
45916 {
45917 desiredVelocity = base.Center + new Vector2(500f * (float)direction, 0f - num3) - base.Center;
45918 }
45919 float num5 = ((Vector2)(ref desiredVelocity)).Length();
45920 if (Math.Abs(desiredVelocity.X) < 40f)
45921 {
45922 desiredVelocity.X = velocity.X;
45923 }
45924 float num6 = num - 2f;
45925 if (num5 > 100f && ((velocity.X < 0f - num6 && desiredVelocity.X > 0f) || (velocity.X > num6 && desiredVelocity.X < 0f)))
45926 {
45927 num2 *= 2f;
45928 }
45929 if (num5 < 40f)
45930 {
45932 }
45933 else if (num5 < 80f)
45934 {
45935 ((Vector2)(ref desiredVelocity)).Normalize();
45936 desiredVelocity *= num * 0.65f;
45937 }
45938 else
45939 {
45940 ((Vector2)(ref desiredVelocity)).Normalize();
45942 }
45944 rotation = velocity.X * 0.1f;
45945 if (rotation > 0.5f)
45946 {
45947 rotation = 0.5f;
45948 }
45949 if (rotation < -0.5f)
45950 {
45951 rotation = -0.5f;
45952 }
45953 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
int timeLeft
Definition NPC.cs:1017
void TargetClosest(bool faceTarget=true)
Definition NPC.cs:83247
bool noGravity
If true, the npc will not be affected by gravity. Demon Eyes and other floating npc use this....
Definition NPC.cs:1122
float rotation
Definition NPC.cs:1116
bool noTileCollide
If true, the npc does not collide with tiles, making the npc pass through tiles freely....
Definition NPC.cs:1128
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)
Definition NPC.cs:82824
int target
Definition NPC.cs:1019

References Terraria.Collision.CanHit(), Terraria.Entity.direction, Terraria.NPC.noGravity, Terraria.NPC.noTileCollide, Terraria.Main.player, Terraria.NPC.rotation, Terraria.NPC.SimpleFlyMovement(), Terraria.WorldGen.SolidOrSlopedTile(), Terraria.NPC.target, Terraria.NPC.TargetClosest(), Terraria.NPC.timeLeft, and Terraria.Entity.velocity.

Referenced by Terraria.NPC.AI_121_QueenSlime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: