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

◆ AI_130_FlameBurstTower()

void Terraria.Projectile.AI_130_FlameBurstTower ( )
inlineprivate

Definition at line 74829 of file Projectile.cs.

74830 {
74831 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
74832 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
74833 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
74834 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
74835 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
74836 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
74837 //IL_0093: Unknown result type (might be due to invalid IL or missing references)
74838 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
74839 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
74840 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
74841 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
74842 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
74843 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
74844 //IL_0366: Unknown result type (might be due to invalid IL or missing references)
74845 //IL_0370: Unknown result type (might be due to invalid IL or missing references)
74846 //IL_037b: Unknown result type (might be due to invalid IL or missing references)
74847 //IL_038a: Unknown result type (might be due to invalid IL or missing references)
74848 //IL_038f: Unknown result type (might be due to invalid IL or missing references)
74849 //IL_03a3: Unknown result type (might be due to invalid IL or missing references)
74850 //IL_03ad: Unknown result type (might be due to invalid IL or missing references)
74851 //IL_03cf: Unknown result type (might be due to invalid IL or missing references)
74852 //IL_03e2: Unknown result type (might be due to invalid IL or missing references)
74853 //IL_03e7: Unknown result type (might be due to invalid IL or missing references)
74854 //IL_03ec: Unknown result type (might be due to invalid IL or missing references)
74855 //IL_066f: Unknown result type (might be due to invalid IL or missing references)
74856 //IL_0683: Unknown result type (might be due to invalid IL or missing references)
74857 //IL_068d: Unknown result type (might be due to invalid IL or missing references)
74858 //IL_0698: Unknown result type (might be due to invalid IL or missing references)
74859 //IL_06a7: Unknown result type (might be due to invalid IL or missing references)
74860 //IL_06ac: Unknown result type (might be due to invalid IL or missing references)
74861 //IL_06c0: Unknown result type (might be due to invalid IL or missing references)
74862 //IL_06ca: Unknown result type (might be due to invalid IL or missing references)
74863 //IL_06ec: Unknown result type (might be due to invalid IL or missing references)
74864 //IL_06ff: Unknown result type (might be due to invalid IL or missing references)
74865 //IL_0704: Unknown result type (might be due to invalid IL or missing references)
74866 //IL_0709: Unknown result type (might be due to invalid IL or missing references)
74867 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
74868 //IL_025f: Unknown result type (might be due to invalid IL or missing references)
74869 //IL_0570: Unknown result type (might be due to invalid IL or missing references)
74870 //IL_057c: Unknown result type (might be due to invalid IL or missing references)
74871 //IL_088d: Unknown result type (might be due to invalid IL or missing references)
74872 //IL_0899: Unknown result type (might be due to invalid IL or missing references)
74873 //IL_016f: Unknown result type (might be due to invalid IL or missing references)
74874 //IL_0171: Unknown result type (might be due to invalid IL or missing references)
74875 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
74876 //IL_0185: Unknown result type (might be due to invalid IL or missing references)
74877 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
74878 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
74879 //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
74880 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
74881 //IL_0216: Unknown result type (might be due to invalid IL or missing references)
74882 //IL_028b: Unknown result type (might be due to invalid IL or missing references)
74883 //IL_0b0a: Unknown result type (might be due to invalid IL or missing references)
74884 //IL_048c: Unknown result type (might be due to invalid IL or missing references)
74885 //IL_048e: Unknown result type (might be due to invalid IL or missing references)
74886 //IL_049d: Unknown result type (might be due to invalid IL or missing references)
74887 //IL_04a2: Unknown result type (might be due to invalid IL or missing references)
74888 //IL_04a7: Unknown result type (might be due to invalid IL or missing references)
74889 //IL_04b0: Unknown result type (might be due to invalid IL or missing references)
74890 //IL_04e2: Unknown result type (might be due to invalid IL or missing references)
74891 //IL_052e: Unknown result type (might be due to invalid IL or missing references)
74892 //IL_0533: Unknown result type (might be due to invalid IL or missing references)
74893 //IL_05a8: Unknown result type (might be due to invalid IL or missing references)
74894 //IL_07a9: Unknown result type (might be due to invalid IL or missing references)
74895 //IL_07ab: Unknown result type (might be due to invalid IL or missing references)
74896 //IL_07ba: Unknown result type (might be due to invalid IL or missing references)
74897 //IL_07bf: Unknown result type (might be due to invalid IL or missing references)
74898 //IL_07c4: Unknown result type (might be due to invalid IL or missing references)
74899 //IL_07cd: Unknown result type (might be due to invalid IL or missing references)
74900 //IL_07ff: Unknown result type (might be due to invalid IL or missing references)
74901 //IL_084b: Unknown result type (might be due to invalid IL or missing references)
74902 //IL_0850: Unknown result type (might be due to invalid IL or missing references)
74903 //IL_08c5: Unknown result type (might be due to invalid IL or missing references)
74904 //IL_0b43: Unknown result type (might be due to invalid IL or missing references)
74905 //IL_0b47: Unknown result type (might be due to invalid IL or missing references)
74906 //IL_0b4c: Unknown result type (might be due to invalid IL or missing references)
74907 //IL_0b20: Unknown result type (might be due to invalid IL or missing references)
74908 //IL_0b25: Unknown result type (might be due to invalid IL or missing references)
74909 //IL_0b26: Unknown result type (might be due to invalid IL or missing references)
74910 //IL_0b2b: Unknown result type (might be due to invalid IL or missing references)
74911 //IL_0b37: Unknown result type (might be due to invalid IL or missing references)
74912 //IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
74913 //IL_0b41: Unknown result type (might be due to invalid IL or missing references)
74914 //IL_0b61: Unknown result type (might be due to invalid IL or missing references)
74915 //IL_0b62: Unknown result type (might be due to invalid IL or missing references)
74916 //IL_0a62: Unknown result type (might be due to invalid IL or missing references)
74917 //IL_02d0: Unknown result type (might be due to invalid IL or missing references)
74918 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)
74919 //IL_02d7: Unknown result type (might be due to invalid IL or missing references)
74920 //IL_02de: Unknown result type (might be due to invalid IL or missing references)
74921 //IL_02f3: Unknown result type (might be due to invalid IL or missing references)
74922 //IL_02f9: Unknown result type (might be due to invalid IL or missing references)
74923 //IL_032a: Unknown result type (might be due to invalid IL or missing references)
74924 //IL_0334: Unknown result type (might be due to invalid IL or missing references)
74925 //IL_0339: Unknown result type (might be due to invalid IL or missing references)
74926 //IL_0a7d: Unknown result type (might be due to invalid IL or missing references)
74927 //IL_0a82: Unknown result type (might be due to invalid IL or missing references)
74928 //IL_05ed: Unknown result type (might be due to invalid IL or missing references)
74929 //IL_05ef: Unknown result type (might be due to invalid IL or missing references)
74930 //IL_05f4: Unknown result type (might be due to invalid IL or missing references)
74931 //IL_05fb: Unknown result type (might be due to invalid IL or missing references)
74932 //IL_0610: Unknown result type (might be due to invalid IL or missing references)
74933 //IL_0616: Unknown result type (might be due to invalid IL or missing references)
74934 //IL_0647: Unknown result type (might be due to invalid IL or missing references)
74935 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
74936 //IL_0656: Unknown result type (might be due to invalid IL or missing references)
74937 //IL_090a: Unknown result type (might be due to invalid IL or missing references)
74938 //IL_090c: Unknown result type (might be due to invalid IL or missing references)
74939 //IL_0911: Unknown result type (might be due to invalid IL or missing references)
74940 //IL_0918: Unknown result type (might be due to invalid IL or missing references)
74941 //IL_092d: Unknown result type (might be due to invalid IL or missing references)
74942 //IL_0933: Unknown result type (might be due to invalid IL or missing references)
74943 //IL_0964: Unknown result type (might be due to invalid IL or missing references)
74944 //IL_096e: Unknown result type (might be due to invalid IL or missing references)
74945 //IL_0973: Unknown result type (might be due to invalid IL or missing references)
74946 float num = 900f;
74947 float angleRatioMax = 1f;
74948 Vector2 vector = base.Center;
74949 int num3 = 664;
74950 int num4 = 12;
74951 float num5 = 12f;
74952 int num6 = 1;
74953 int num7 = 6;
74954 int num8 = 4;
74955 int num9 = 80;
74956 switch (type)
74957 {
74958 case 663:
74959 {
74960 Lighting.AddLight(base.Center, new Vector3(0.4f, 0.2f, 0.1f));
74961 Lighting.AddLight(base.Bottom + new Vector2(0f, -10f), new Vector3(0.4f, 0.2f, 0.1f));
74962 vector = base.Bottom + new Vector2((float)(direction * 6), -40f);
74963 if ((localAI[0] += 1f) >= 300f)
74964 {
74965 localAI[0] = 0f;
74966 }
74967 Rectangle r3 = default(Rectangle);
74968 ((Rectangle)(ref r3))._002Ector((int)position.X + width / 4, (int)position.Y + height - 16, width / 4 * 3, 6);
74969 if (direction == 1)
74970 {
74971 r3.X -= width / 4;
74972 }
74973 for (int m = 0; m < 1; m++)
74974 {
74975 if (Main.rand.Next(2) == 0)
74976 {
74977 Dust dust3 = Dust.NewDustDirect(r3.TopLeft() + new Vector2(-2f, -2f), r3.Width + 4, r3.Height + 4, 270, -direction * 2, -2f, 200, new Color(255, 255, 255, 0));
74978 dust3.fadeIn = 0.6f + Main.rand.NextFloat() * 0.6f;
74979 dust3.scale = 0.4f;
74980 dust3.noGravity = true;
74981 dust3.noLight = true;
74982 dust3.velocity = Vector2.Zero;
74983 dust3.velocity.X = (float)(-direction) * Main.rand.NextFloat() * dust3.fadeIn;
74984 }
74985 }
74986 ((Rectangle)(ref r3))._002Ector((int)base.Center.X, (int)base.Bottom.Y, width / 4, 10);
74987 if (direction == -1)
74988 {
74989 r3.X -= r3.Width;
74990 }
74991 r3.X += direction * 4;
74992 r3.Y -= height - 10;
74993 for (int n = 0; n < 1; n++)
74994 {
74995 if (Main.rand.Next(5) == 0)
74996 {
74997 Dust dust6 = Dust.NewDustDirect(r3.TopLeft(), r3.Width, r3.Height, 6);
74998 dust6.fadeIn = 1f;
74999 dust6.scale = 1f;
75000 dust6.noGravity = true;
75001 dust6.noLight = true;
75002 dust6.velocity *= 2f;
75003 }
75004 }
75005 break;
75006 }
75007 case 665:
75008 {
75009 Lighting.AddLight(base.Center, new Vector3(0.4f, 0.2f, 0.1f) * 1.2f);
75010 Lighting.AddLight(base.Bottom + new Vector2(0f, -10f), new Vector3(0.4f, 0.2f, 0.1f) * 1.2f);
75011 num9 = 70;
75012 num5 += 3f;
75013 num7 = 8;
75014 num3 = 666;
75015 vector = base.Bottom + new Vector2((float)(direction * 6), -44f);
75016 if ((localAI[0] += 1f) >= 300f)
75017 {
75018 localAI[0] = 0f;
75019 }
75020 Rectangle r2 = default(Rectangle);
75021 ((Rectangle)(ref r2))._002Ector((int)position.X + width / 4, (int)position.Y + height - 16, width / 4 * 2, 6);
75022 if (direction == 1)
75023 {
75024 r2.X -= width / 4;
75025 }
75026 for (int k = 0; k < 1; k++)
75027 {
75028 if (Main.rand.Next(2) == 0)
75029 {
75030 Dust dust2 = Dust.NewDustDirect(r2.TopLeft() + new Vector2(-2f, -2f), r2.Width + 4, r2.Height + 4, 270, -direction * 2, -2f, 200, new Color(255, 255, 255, 0));
75031 dust2.fadeIn = 0.6f + Main.rand.NextFloat() * 0.6f;
75032 dust2.scale = 0.4f;
75033 dust2.noGravity = true;
75034 dust2.noLight = true;
75035 dust2.velocity = Vector2.Zero;
75036 dust2.velocity.X = (float)(-direction) * Main.rand.NextFloat() * dust2.fadeIn;
75037 }
75038 }
75039 ((Rectangle)(ref r2))._002Ector((int)base.Center.X, (int)base.Bottom.Y, width / 4, 10);
75040 if (direction == -1)
75041 {
75042 r2.X -= r2.Width;
75043 }
75044 r2.X += direction * 4;
75045 r2.Y -= height - 10;
75046 for (int l = 0; l < 2; l++)
75047 {
75048 if (Main.rand.Next(5) == 0)
75049 {
75050 Dust dust5 = Dust.NewDustDirect(r2.TopLeft(), r2.Width, r2.Height, 6);
75051 dust5.fadeIn = 1f;
75052 dust5.scale = 1f;
75053 dust5.noGravity = true;
75054 dust5.noLight = true;
75055 dust5.velocity *= 2f;
75056 }
75057 }
75058 break;
75059 }
75060 case 667:
75061 {
75062 Lighting.AddLight(base.Center, new Vector3(0.4f, 0.2f, 0.1f) * 1.5f);
75063 Lighting.AddLight(base.Bottom + new Vector2(0f, -10f), new Vector3(0.4f, 0.2f, 0.1f) * 1.5f);
75064 num9 = 60;
75065 num5 += 6f;
75066 num7 = 8;
75067 num3 = 668;
75068 vector = base.Bottom + new Vector2((float)(direction * 6), -46f);
75069 if ((localAI[0] += 1f) >= 300f)
75070 {
75071 localAI[0] = 0f;
75072 }
75073 Rectangle r = default(Rectangle);
75074 ((Rectangle)(ref r))._002Ector((int)position.X + width / 4, (int)position.Y + height - 16, width / 4 * 2, 6);
75075 if (direction == 1)
75076 {
75077 r.X -= width / 4;
75078 }
75079 for (int i = 0; i < 1; i++)
75080 {
75081 if (Main.rand.Next(2) == 0)
75082 {
75083 Dust dust = Dust.NewDustDirect(r.TopLeft() + new Vector2(-2f, -2f), r.Width + 4, r.Height + 4, 270, -direction * 2, -2f, 200, new Color(255, 255, 255, 0));
75084 dust.fadeIn = 0.6f + Main.rand.NextFloat() * 0.6f;
75085 dust.scale = 0.4f;
75086 dust.noGravity = true;
75087 dust.noLight = true;
75088 dust.velocity = Vector2.Zero;
75089 dust.velocity.X = (float)(-direction) * Main.rand.NextFloat() * dust.fadeIn;
75090 }
75091 }
75092 ((Rectangle)(ref r))._002Ector((int)base.Center.X, (int)base.Bottom.Y, width / 4, 10);
75093 if (direction == -1)
75094 {
75095 r.X -= r.Width;
75096 }
75097 r.X += direction * 4;
75098 r.Y -= height - 10;
75099 for (int j = 0; j < 3; j++)
75100 {
75101 if (Main.rand.Next(5) == 0)
75102 {
75103 Dust dust4 = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 6);
75104 dust4.fadeIn = 1.1f;
75105 dust4.scale = 1f;
75106 dust4.noGravity = true;
75107 dust4.noLight = true;
75108 dust4.velocity *= 2.4f;
75109 }
75110 }
75111 break;
75112 }
75113 }
75114 if (Main.player[owner].setApprenticeT2)
75115 {
75116 angleRatioMax = 0.1f;
75117 num *= 1.5f;
75118 num5 *= 1.4f;
75119 }
75120 if (ai[0] == 0f)
75121 {
75122 direction = (spriteDirection = Main.player[owner].direction);
75123 ai[0] = 1f;
75124 ai[1] = 0f;
75125 netUpdate = true;
75126 }
75127 if (ai[0] == 1f)
75128 {
75129 frame = 0;
75130 bool flag = false;
75131 if (ai[1] > 0f)
75132 {
75133 ai[1] -= 1f;
75134 }
75135 else
75136 {
75137 flag = true;
75138 }
75139 if (flag && owner == Main.myPlayer)
75140 {
75142 if (num10 != -1)
75143 {
75144 direction = Math.Sign(DirectionTo(Main.npc[num10].Center).X);
75145 ai[0] = 2f;
75146 ai[1] = 0f;
75147 netUpdate = true;
75148 }
75149 }
75150 }
75151 else if (ai[0] == 2f)
75152 {
75153 frame = num6 + (int)(ai[1] / (float)num8);
75154 if (ai[1] == (float)num4)
75155 {
75156 Vector2 vector2 = default(Vector2);
75157 ((Vector2)(ref vector2))._002Ector((float)direction, 0f);
75159 if (num2 != -1)
75160 {
75161 vector2 = (Main.npc[num2].Center - vector).SafeNormalize(Vector2.UnitX * (float)direction);
75162 }
75163 Vector2 vector3 = vector2 * num5;
75164 if (owner == Main.myPlayer)
75165 {
75167 }
75168 }
75169 if ((ai[1] += 1f) >= (float)(num7 * num8))
75170 {
75171 ai[0] = 1f;
75172 ai[1] = num9;
75173 }
75174 }
75176 tileCollide = true;
75177 velocity.Y += 0.2f;
75178 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
int AI_130_FlameBurstTower_FindTarget(float shot_range, float angleRatioMax, Vector2 shootingSpot, bool canChangeDirection=true)
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
float knockBack
This will always be set in Projectile.NewProjectile based on the weapons knockback and player stat mo...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and...

References Terraria.Lighting.AddLight(), Terraria.Dust.fadeIn, Terraria.Main.myPlayer, Terraria.Dust.NewDustDirect(), Terraria.Main.npc, Terraria.Main.player, and Terraria.Main.rand.

+ Here is the call graph for this function: