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

◆ AI_142_MonkStaffT2And3()

void Terraria.Projectile.AI_142_MonkStaffT2And3 ( )
inlineprivate

Definition at line 76836 of file Projectile.cs.

76837 {
76838 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
76839 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
76840 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
76841 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
76842 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
76843 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
76844 //IL_041e: Unknown result type (might be due to invalid IL or missing references)
76845 //IL_0489: Unknown result type (might be due to invalid IL or missing references)
76846 //IL_04b3: Unknown result type (might be due to invalid IL or missing references)
76847 //IL_04c9: Unknown result type (might be due to invalid IL or missing references)
76848 //IL_04cf: Unknown result type (might be due to invalid IL or missing references)
76849 //IL_04d1: Unknown result type (might be due to invalid IL or missing references)
76850 //IL_04e0: Unknown result type (might be due to invalid IL or missing references)
76851 //IL_04e5: Unknown result type (might be due to invalid IL or missing references)
76852 //IL_04ea: Unknown result type (might be due to invalid IL or missing references)
76853 //IL_04ee: Unknown result type (might be due to invalid IL or missing references)
76854 //IL_04f3: Unknown result type (might be due to invalid IL or missing references)
76855 //IL_04fa: Unknown result type (might be due to invalid IL or missing references)
76856 //IL_0500: Unknown result type (might be due to invalid IL or missing references)
76857 //IL_0502: Unknown result type (might be due to invalid IL or missing references)
76858 //IL_0511: Unknown result type (might be due to invalid IL or missing references)
76859 //IL_051b: Unknown result type (might be due to invalid IL or missing references)
76860 //IL_0521: Unknown result type (might be due to invalid IL or missing references)
76861 //IL_0523: Unknown result type (might be due to invalid IL or missing references)
76862 //IL_0528: Unknown result type (might be due to invalid IL or missing references)
76863 //IL_052d: Unknown result type (might be due to invalid IL or missing references)
76864 //IL_0532: Unknown result type (might be due to invalid IL or missing references)
76865 //IL_0537: Unknown result type (might be due to invalid IL or missing references)
76866 //IL_0538: Unknown result type (might be due to invalid IL or missing references)
76867 //IL_053f: Unknown result type (might be due to invalid IL or missing references)
76868 //IL_0545: Unknown result type (might be due to invalid IL or missing references)
76869 //IL_0547: Unknown result type (might be due to invalid IL or missing references)
76870 //IL_054c: Unknown result type (might be due to invalid IL or missing references)
76871 //IL_0561: Unknown result type (might be due to invalid IL or missing references)
76872 //IL_056b: Unknown result type (might be due to invalid IL or missing references)
76873 //IL_0571: Unknown result type (might be due to invalid IL or missing references)
76874 //IL_0573: Unknown result type (might be due to invalid IL or missing references)
76875 //IL_0578: Unknown result type (might be due to invalid IL or missing references)
76876 //IL_057d: Unknown result type (might be due to invalid IL or missing references)
76877 //IL_0580: Unknown result type (might be due to invalid IL or missing references)
76878 //IL_0582: Unknown result type (might be due to invalid IL or missing references)
76879 //IL_0583: Unknown result type (might be due to invalid IL or missing references)
76880 //IL_0588: Unknown result type (might be due to invalid IL or missing references)
76881 //IL_058d: Unknown result type (might be due to invalid IL or missing references)
76882 //IL_00db: Unknown result type (might be due to invalid IL or missing references)
76883 //IL_0105: Unknown result type (might be due to invalid IL or missing references)
76884 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
76885 //IL_0121: Unknown result type (might be due to invalid IL or missing references)
76886 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
76887 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
76888 //IL_0137: Unknown result type (might be due to invalid IL or missing references)
76889 //IL_013c: Unknown result type (might be due to invalid IL or missing references)
76890 //IL_0140: Unknown result type (might be due to invalid IL or missing references)
76891 //IL_0145: Unknown result type (might be due to invalid IL or missing references)
76892 //IL_014c: Unknown result type (might be due to invalid IL or missing references)
76893 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
76894 //IL_0154: Unknown result type (might be due to invalid IL or missing references)
76895 //IL_0163: Unknown result type (might be due to invalid IL or missing references)
76896 //IL_016d: Unknown result type (might be due to invalid IL or missing references)
76897 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
76898 //IL_0175: Unknown result type (might be due to invalid IL or missing references)
76899 //IL_017a: Unknown result type (might be due to invalid IL or missing references)
76900 //IL_017f: Unknown result type (might be due to invalid IL or missing references)
76901 //IL_0184: Unknown result type (might be due to invalid IL or missing references)
76902 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
76903 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
76904 //IL_0191: Unknown result type (might be due to invalid IL or missing references)
76905 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
76906 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
76907 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
76908 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
76909 //IL_01bd: Unknown result type (might be due to invalid IL or missing references)
76910 //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
76911 //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
76912 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
76913 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
76914 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
76915 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
76916 //IL_05c6: Unknown result type (might be due to invalid IL or missing references)
76917 //IL_05cb: Unknown result type (might be due to invalid IL or missing references)
76918 //IL_05cc: Unknown result type (might be due to invalid IL or missing references)
76919 //IL_05d1: Unknown result type (might be due to invalid IL or missing references)
76920 //IL_05d6: Unknown result type (might be due to invalid IL or missing references)
76921 //IL_05dc: Unknown result type (might be due to invalid IL or missing references)
76922 //IL_05de: Unknown result type (might be due to invalid IL or missing references)
76923 //IL_05df: Unknown result type (might be due to invalid IL or missing references)
76924 //IL_05e4: Unknown result type (might be due to invalid IL or missing references)
76925 //IL_05e9: Unknown result type (might be due to invalid IL or missing references)
76926 //IL_05f0: Unknown result type (might be due to invalid IL or missing references)
76927 //IL_05f5: Unknown result type (might be due to invalid IL or missing references)
76928 //IL_05fa: Unknown result type (might be due to invalid IL or missing references)
76929 //IL_05ff: Unknown result type (might be due to invalid IL or missing references)
76930 //IL_0208: Unknown result type (might be due to invalid IL or missing references)
76931 //IL_020a: Unknown result type (might be due to invalid IL or missing references)
76932 //IL_020f: Unknown result type (might be due to invalid IL or missing references)
76933 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
76934 //IL_0216: Unknown result type (might be due to invalid IL or missing references)
76935 //IL_0218: Unknown result type (might be due to invalid IL or missing references)
76936 //IL_021d: Unknown result type (might be due to invalid IL or missing references)
76937 //IL_0220: Unknown result type (might be due to invalid IL or missing references)
76938 //IL_0225: Unknown result type (might be due to invalid IL or missing references)
76939 //IL_022a: Unknown result type (might be due to invalid IL or missing references)
76940 //IL_022f: Unknown result type (might be due to invalid IL or missing references)
76941 //IL_0630: Unknown result type (might be due to invalid IL or missing references)
76942 //IL_0641: Unknown result type (might be due to invalid IL or missing references)
76943 //IL_0646: Unknown result type (might be due to invalid IL or missing references)
76944 //IL_064b: Unknown result type (might be due to invalid IL or missing references)
76945 //IL_064d: Unknown result type (might be due to invalid IL or missing references)
76946 //IL_0654: Unknown result type (might be due to invalid IL or missing references)
76947 //IL_0659: Unknown result type (might be due to invalid IL or missing references)
76948 //IL_0241: Unknown result type (might be due to invalid IL or missing references)
76949 //IL_025d: Unknown result type (might be due to invalid IL or missing references)
76950 //IL_0263: Unknown result type (might be due to invalid IL or missing references)
76951 //IL_0273: Unknown result type (might be due to invalid IL or missing references)
76952 //IL_0276: Unknown result type (might be due to invalid IL or missing references)
76953 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
76954 //IL_0285: Unknown result type (might be due to invalid IL or missing references)
76955 //IL_028a: Unknown result type (might be due to invalid IL or missing references)
76956 //IL_0292: Unknown result type (might be due to invalid IL or missing references)
76957 //IL_0297: Unknown result type (might be due to invalid IL or missing references)
76958 //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
76959 //IL_02bd: Unknown result type (might be due to invalid IL or missing references)
76960 //IL_02bf: Unknown result type (might be due to invalid IL or missing references)
76961 //IL_02c9: Unknown result type (might be due to invalid IL or missing references)
76962 //IL_02ce: Unknown result type (might be due to invalid IL or missing references)
76963 //IL_02d3: Unknown result type (might be due to invalid IL or missing references)
76964 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
76965 //IL_02fd: Unknown result type (might be due to invalid IL or missing references)
76966 //IL_0304: Unknown result type (might be due to invalid IL or missing references)
76967 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
76968 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
76969 //IL_0675: Unknown result type (might be due to invalid IL or missing references)
76970 //IL_0682: Unknown result type (might be due to invalid IL or missing references)
76971 //IL_0688: Unknown result type (might be due to invalid IL or missing references)
76972 //IL_068a: Unknown result type (might be due to invalid IL or missing references)
76973 //IL_068f: Unknown result type (might be due to invalid IL or missing references)
76974 //IL_06cd: Unknown result type (might be due to invalid IL or missing references)
76975 //IL_06e1: Unknown result type (might be due to invalid IL or missing references)
76976 //IL_06e6: Unknown result type (might be due to invalid IL or missing references)
76977 //IL_06ef: Unknown result type (might be due to invalid IL or missing references)
76978 //IL_06f4: Unknown result type (might be due to invalid IL or missing references)
76979 //IL_0693: Unknown result type (might be due to invalid IL or missing references)
76980 //IL_06a0: Unknown result type (might be due to invalid IL or missing references)
76981 //IL_06a6: Unknown result type (might be due to invalid IL or missing references)
76982 //IL_06a8: Unknown result type (might be due to invalid IL or missing references)
76983 //IL_06ad: Unknown result type (might be due to invalid IL or missing references)
76984 //IL_06b1: Unknown result type (might be due to invalid IL or missing references)
76985 //IL_06be: Unknown result type (might be due to invalid IL or missing references)
76986 //IL_06c4: Unknown result type (might be due to invalid IL or missing references)
76987 //IL_06c6: Unknown result type (might be due to invalid IL or missing references)
76988 //IL_06cb: Unknown result type (might be due to invalid IL or missing references)
76989 //IL_0344: Unknown result type (might be due to invalid IL or missing references)
76990 //IL_0360: Unknown result type (might be due to invalid IL or missing references)
76991 //IL_0366: Unknown result type (might be due to invalid IL or missing references)
76992 //IL_0376: Unknown result type (might be due to invalid IL or missing references)
76993 //IL_0379: Unknown result type (might be due to invalid IL or missing references)
76994 //IL_037e: Unknown result type (might be due to invalid IL or missing references)
76995 //IL_0388: Unknown result type (might be due to invalid IL or missing references)
76996 //IL_038d: Unknown result type (might be due to invalid IL or missing references)
76997 //IL_0395: Unknown result type (might be due to invalid IL or missing references)
76998 //IL_039a: Unknown result type (might be due to invalid IL or missing references)
76999 //IL_03a1: Unknown result type (might be due to invalid IL or missing references)
77000 //IL_03a6: Unknown result type (might be due to invalid IL or missing references)
77001 //IL_03ab: Unknown result type (might be due to invalid IL or missing references)
77002 //IL_0790: Unknown result type (might be due to invalid IL or missing references)
77003 //IL_07b4: Unknown result type (might be due to invalid IL or missing references)
77004 //IL_07ba: Unknown result type (might be due to invalid IL or missing references)
77005 //IL_07ca: Unknown result type (might be due to invalid IL or missing references)
77006 //IL_07e2: Unknown result type (might be due to invalid IL or missing references)
77007 //IL_07e9: Unknown result type (might be due to invalid IL or missing references)
77008 //IL_07f0: Unknown result type (might be due to invalid IL or missing references)
77009 //IL_07f5: Unknown result type (might be due to invalid IL or missing references)
77010 Player player = Main.player[owner];
77011 Vector2 vector = player.RotatedRelativePoint(player.MountedCenter);
77012 direction = player.direction;
77013 player.heldProj = whoAmI;
77014 base.Center = vector;
77015 if (player.dead)
77016 {
77017 Kill();
77018 return;
77019 }
77020 if (!player.frozen)
77021 {
77022 if (type == 699)
77023 {
77024 spriteDirection = (direction = player.direction);
77025 Vector2 vector2 = vector;
77026 alpha -= 127;
77027 if (alpha < 0)
77028 {
77029 alpha = 0;
77030 }
77031 if (localAI[0] > 0f)
77032 {
77033 localAI[0] -= 1f;
77034 }
77035 float num = (float)player.itemAnimation / (float)player.itemAnimationMax;
77036 float num6 = 1f - num;
77037 float num7 = velocity.ToRotation();
77038 float num8 = ((Vector2)(ref velocity)).Length();
77039 float num9 = 22f;
77040 Vector2 spinningpoint = Utils.RotatedBy(new Vector2(1f, 0f), (float)Math.PI + num6 * ((float)Math.PI * 2f)) * new Vector2(num8, ai[0]);
77041 position += spinningpoint.RotatedBy(num7) + Utils.RotatedBy(new Vector2(num8 + num9, 0f), num7);
77042 Vector2 target = vector2 + spinningpoint.RotatedBy(num7) + Utils.RotatedBy(new Vector2(num8 + num9 + 40f, 0f), num7);
77043 rotation = vector2.AngleTo(target) + (float)Math.PI / 4f * (float)player.direction;
77044 if (spriteDirection == -1)
77045 {
77046 rotation += (float)Math.PI;
77047 }
77048 vector2.DirectionTo(base.Center);
77049 Vector2 vector3 = vector2.DirectionTo(target);
77050 Vector2 vector4 = velocity.SafeNormalize(Vector2.UnitY);
77051 float num10 = 2f;
77052 for (int i = 0; (float)i < num10; i++)
77053 {
77054 Dust dust = Dust.NewDustDirect(base.Center, 14, 14, 228, 0f, 0f, 110);
77055 dust.velocity = vector2.DirectionTo(dust.position) * 2f;
77056 dust.position = base.Center + vector4.RotatedBy(num6 * ((float)Math.PI * 2f) * 2f + (float)i / num10 * ((float)Math.PI * 2f)) * 10f;
77057 dust.scale = 1f + 0.6f * Main.rand.NextFloat();
77058 dust.velocity += vector4 * 3f;
77059 dust.noGravity = true;
77060 }
77061 for (int j = 0; j < 1; j++)
77062 {
77063 if (Main.rand.Next(3) == 0)
77064 {
77065 Dust dust2 = Dust.NewDustDirect(base.Center, 20, 20, 228, 0f, 0f, 110);
77066 dust2.velocity = vector2.DirectionTo(dust2.position) * 2f;
77067 dust2.position = base.Center + vector3 * -110f;
77068 dust2.scale = 0.45f + 0.4f * Main.rand.NextFloat();
77069 dust2.fadeIn = 0.7f + 0.4f * Main.rand.NextFloat();
77070 dust2.noGravity = true;
77071 dust2.noLight = true;
77072 }
77073 }
77074 }
77075 else if (type == 708)
77076 {
77077 Lighting.AddLight(player.Center, 0.75f, 0.9f, 1.15f);
77078 spriteDirection = (direction = player.direction);
77079 alpha -= 127;
77080 if (alpha < 0)
77081 {
77082 alpha = 0;
77083 }
77084 float num11 = (float)player.itemAnimation / (float)player.itemAnimationMax;
77085 float num12 = 1f - num11;
77086 float num13 = velocity.ToRotation();
77087 float num2 = ((Vector2)(ref velocity)).Length();
77088 float num3 = 22f;
77089 Vector2 spinningpoint2 = Utils.RotatedBy(new Vector2(1f, 0f), (float)Math.PI + num12 * ((float)Math.PI * 2f)) * new Vector2(num2, ai[0]);
77090 position += spinningpoint2.RotatedBy(num13) + Utils.RotatedBy(new Vector2(num2 + num3, 0f), num13);
77091 Vector2 vector5 = vector + spinningpoint2.RotatedBy(num13) + Utils.RotatedBy(new Vector2(num2 + num3 + 40f, 0f), num13);
77092 rotation = (vector5 - vector).SafeNormalize(Vector2.UnitX).ToRotation() + (float)Math.PI / 4f * (float)player.direction;
77093 if (spriteDirection == -1)
77094 {
77095 rotation += (float)Math.PI;
77096 }
77097 (base.Center - vector).SafeNormalize(Vector2.Zero);
77098 (vector5 - vector).SafeNormalize(Vector2.Zero);
77099 Vector2 vector6 = velocity.SafeNormalize(Vector2.UnitY);
77100 if ((player.itemAnimation == 2 || player.itemAnimation == 6 || player.itemAnimation == 10) && owner == Main.myPlayer)
77101 {
77102 Vector2 vector7 = vector6 + Main.rand.NextVector2Square(-0.2f, 0.2f);
77103 vector7 *= 12f;
77104 switch (player.itemAnimation)
77105 {
77106 case 2:
77107 vector7 = vector6.RotatedBy(0.3839724659919739);
77108 break;
77109 case 6:
77110 vector7 = vector6.RotatedBy(-0.3839724659919739);
77111 break;
77112 case 10:
77113 vector7 = vector6.RotatedBy(0.0);
77114 break;
77115 }
77116 vector7 *= 10f + (float)Main.rand.Next(4);
77118 }
77119 for (int k = 0; k < 3; k += 2)
77120 {
77121 float num4 = 1f;
77122 float num5 = 1f;
77123 switch (k)
77124 {
77125 case 1:
77126 num5 = -1f;
77127 break;
77128 case 2:
77129 num5 = 1.25f;
77130 num4 = 0.5f;
77131 break;
77132 case 3:
77133 num5 = -1.25f;
77134 num4 = 0.5f;
77135 break;
77136 }
77137 if (Main.rand.Next(6) != 0)
77138 {
77139 num5 *= 1.2f;
77140 Dust dust3 = Dust.NewDustDirect(position, width, height, 226, 0f, 0f, 100);
77141 dust3.velocity = vector6 * (4f + 4f * Main.rand.NextFloat()) * num5 * num4;
77142 dust3.noGravity = true;
77143 dust3.noLight = true;
77144 dust3.scale = 0.75f;
77145 dust3.fadeIn = 0.8f;
77146 dust3.customData = this;
77147 if (Main.rand.Next(3) == 0)
77148 {
77149 dust3.noGravity = false;
77150 dust3.fadeIn = 0f;
77151 }
77152 }
77153 }
77154 }
77155 }
77156 if (player.whoAmI == Main.myPlayer && player.itemAnimation <= 2)
77157 {
77158 Kill();
77159 player.reuseDelay = 2;
77160 }
77161 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
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
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....
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
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.Entity.Center, Terraria.Player.dead, Terraria.Entity.direction, Terraria.Player.frozen, Terraria.Player.itemAnimation, Terraria.Player.itemAnimationMax, Terraria.Player.MountedCenter, Terraria.Main.myPlayer, Terraria.Dust.NewDustDirect(), Terraria.Main.player, Terraria.Dust.position, Terraria.Main.rand, Terraria.Utils.RotatedBy(), Terraria.Player.RotatedRelativePoint(), and Terraria.Entity.whoAmI.

+ Here is the call graph for this function: