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

◆ AI_165_Whip()

void Terraria.Projectile.AI_165_Whip ( )
inlineprivate

Definition at line 50811 of file Projectile.cs.

50812 {
50813 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
50814 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
50815 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
50816 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
50817 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
50818 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
50819 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
50820 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
50821 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
50822 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
50823 //IL_02fd: Unknown result type (might be due to invalid IL or missing references)
50824 //IL_030c: Unknown result type (might be due to invalid IL or missing references)
50825 //IL_0311: Unknown result type (might be due to invalid IL or missing references)
50826 //IL_0316: Unknown result type (might be due to invalid IL or missing references)
50827 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
50828 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
50829 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
50830 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
50831 //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
50832 //IL_01ef: Unknown result type (might be due to invalid IL or missing references)
50833 //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
50834 //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
50835 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
50836 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
50837 //IL_047c: Unknown result type (might be due to invalid IL or missing references)
50838 //IL_048b: Unknown result type (might be due to invalid IL or missing references)
50839 //IL_0490: Unknown result type (might be due to invalid IL or missing references)
50840 //IL_0495: Unknown result type (might be due to invalid IL or missing references)
50841 //IL_04aa: Unknown result type (might be due to invalid IL or missing references)
50842 //IL_04c2: Unknown result type (might be due to invalid IL or missing references)
50843 //IL_04c7: Unknown result type (might be due to invalid IL or missing references)
50844 //IL_04cc: Unknown result type (might be due to invalid IL or missing references)
50845 //IL_04d1: Unknown result type (might be due to invalid IL or missing references)
50846 //IL_04d6: Unknown result type (might be due to invalid IL or missing references)
50847 //IL_04d8: Unknown result type (might be due to invalid IL or missing references)
50848 //IL_04da: Unknown result type (might be due to invalid IL or missing references)
50849 //IL_04df: Unknown result type (might be due to invalid IL or missing references)
50850 //IL_04e6: Unknown result type (might be due to invalid IL or missing references)
50851 //IL_04ff: Unknown result type (might be due to invalid IL or missing references)
50852 //IL_0505: Unknown result type (might be due to invalid IL or missing references)
50853 //IL_0519: Unknown result type (might be due to invalid IL or missing references)
50854 //IL_051e: Unknown result type (might be due to invalid IL or missing references)
50855 //IL_0525: Unknown result type (might be due to invalid IL or missing references)
50856 //IL_052a: Unknown result type (might be due to invalid IL or missing references)
50857 //IL_052f: Unknown result type (might be due to invalid IL or missing references)
50858 //IL_0604: Unknown result type (might be due to invalid IL or missing references)
50859 //IL_0613: Unknown result type (might be due to invalid IL or missing references)
50860 //IL_0618: Unknown result type (might be due to invalid IL or missing references)
50861 //IL_061d: Unknown result type (might be due to invalid IL or missing references)
50862 //IL_0632: Unknown result type (might be due to invalid IL or missing references)
50863 //IL_064a: Unknown result type (might be due to invalid IL or missing references)
50864 //IL_064f: Unknown result type (might be due to invalid IL or missing references)
50865 //IL_0654: Unknown result type (might be due to invalid IL or missing references)
50866 //IL_0659: Unknown result type (might be due to invalid IL or missing references)
50867 //IL_065e: Unknown result type (might be due to invalid IL or missing references)
50868 //IL_0660: Unknown result type (might be due to invalid IL or missing references)
50869 //IL_0662: Unknown result type (might be due to invalid IL or missing references)
50870 //IL_0667: Unknown result type (might be due to invalid IL or missing references)
50871 //IL_066e: Unknown result type (might be due to invalid IL or missing references)
50872 //IL_06a6: Unknown result type (might be due to invalid IL or missing references)
50873 //IL_06ba: Unknown result type (might be due to invalid IL or missing references)
50874 //IL_06cf: Unknown result type (might be due to invalid IL or missing references)
50875 //IL_06d4: Unknown result type (might be due to invalid IL or missing references)
50876 //IL_0718: Unknown result type (might be due to invalid IL or missing references)
50877 //IL_071d: Unknown result type (might be due to invalid IL or missing references)
50878 //IL_0724: Unknown result type (might be due to invalid IL or missing references)
50879 //IL_0729: Unknown result type (might be due to invalid IL or missing references)
50880 //IL_072e: Unknown result type (might be due to invalid IL or missing references)
50881 //IL_032d: Unknown result type (might be due to invalid IL or missing references)
50882 //IL_032f: Unknown result type (might be due to invalid IL or missing references)
50883 //IL_0334: Unknown result type (might be due to invalid IL or missing references)
50884 //IL_033b: Unknown result type (might be due to invalid IL or missing references)
50885 //IL_0350: Unknown result type (might be due to invalid IL or missing references)
50886 //IL_0368: Unknown result type (might be due to invalid IL or missing references)
50887 //IL_036d: Unknown result type (might be due to invalid IL or missing references)
50888 //IL_0385: Unknown result type (might be due to invalid IL or missing references)
50889 //IL_0394: Unknown result type (might be due to invalid IL or missing references)
50890 //IL_0399: Unknown result type (might be due to invalid IL or missing references)
50891 //IL_039e: Unknown result type (might be due to invalid IL or missing references)
50892 //IL_03a9: Unknown result type (might be due to invalid IL or missing references)
50893 //IL_03b3: Unknown result type (might be due to invalid IL or missing references)
50894 //IL_03b8: Unknown result type (might be due to invalid IL or missing references)
50895 //IL_03bf: Unknown result type (might be due to invalid IL or missing references)
50896 //IL_03c4: Unknown result type (might be due to invalid IL or missing references)
50897 //IL_03d6: Unknown result type (might be due to invalid IL or missing references)
50898 //IL_03dc: Unknown result type (might be due to invalid IL or missing references)
50899 //IL_03de: Unknown result type (might be due to invalid IL or missing references)
50900 //IL_03e3: Unknown result type (might be due to invalid IL or missing references)
50901 //IL_03e8: Unknown result type (might be due to invalid IL or missing references)
50902 //IL_03ee: Unknown result type (might be due to invalid IL or missing references)
50903 //IL_03f8: Unknown result type (might be due to invalid IL or missing references)
50904 //IL_03fd: Unknown result type (might be due to invalid IL or missing references)
50905 //IL_057b: Unknown result type (might be due to invalid IL or missing references)
50906 //IL_0580: Unknown result type (might be due to invalid IL or missing references)
50907 //IL_0594: Unknown result type (might be due to invalid IL or missing references)
50908 //IL_054d: Unknown result type (might be due to invalid IL or missing references)
50909 //IL_054f: Unknown result type (might be due to invalid IL or missing references)
50910 //IL_0558: Unknown result type (might be due to invalid IL or missing references)
50911 //IL_055d: Unknown result type (might be due to invalid IL or missing references)
50912 //IL_0562: Unknown result type (might be due to invalid IL or missing references)
50913 //IL_0aaf: Unknown result type (might be due to invalid IL or missing references)
50914 //IL_0abe: Unknown result type (might be due to invalid IL or missing references)
50915 //IL_0ac3: Unknown result type (might be due to invalid IL or missing references)
50916 //IL_0ac8: Unknown result type (might be due to invalid IL or missing references)
50917 //IL_0add: Unknown result type (might be due to invalid IL or missing references)
50918 //IL_0af5: Unknown result type (might be due to invalid IL or missing references)
50919 //IL_0afa: Unknown result type (might be due to invalid IL or missing references)
50920 //IL_0aff: Unknown result type (might be due to invalid IL or missing references)
50921 //IL_0b04: Unknown result type (might be due to invalid IL or missing references)
50922 //IL_0b09: Unknown result type (might be due to invalid IL or missing references)
50923 //IL_0d06: Unknown result type (might be due to invalid IL or missing references)
50924 //IL_0d15: Unknown result type (might be due to invalid IL or missing references)
50925 //IL_0d1a: Unknown result type (might be due to invalid IL or missing references)
50926 //IL_0d1f: Unknown result type (might be due to invalid IL or missing references)
50927 //IL_0d34: Unknown result type (might be due to invalid IL or missing references)
50928 //IL_0d4c: Unknown result type (might be due to invalid IL or missing references)
50929 //IL_0d51: Unknown result type (might be due to invalid IL or missing references)
50930 //IL_0d56: Unknown result type (might be due to invalid IL or missing references)
50931 //IL_0d5b: Unknown result type (might be due to invalid IL or missing references)
50932 //IL_0d60: Unknown result type (might be due to invalid IL or missing references)
50933 //IL_080e: Unknown result type (might be due to invalid IL or missing references)
50934 //IL_081d: Unknown result type (might be due to invalid IL or missing references)
50935 //IL_0822: Unknown result type (might be due to invalid IL or missing references)
50936 //IL_0827: Unknown result type (might be due to invalid IL or missing references)
50937 //IL_083c: Unknown result type (might be due to invalid IL or missing references)
50938 //IL_0854: Unknown result type (might be due to invalid IL or missing references)
50939 //IL_0859: Unknown result type (might be due to invalid IL or missing references)
50940 //IL_085e: Unknown result type (might be due to invalid IL or missing references)
50941 //IL_0863: Unknown result type (might be due to invalid IL or missing references)
50942 //IL_0868: Unknown result type (might be due to invalid IL or missing references)
50943 //IL_086a: Unknown result type (might be due to invalid IL or missing references)
50944 //IL_086c: Unknown result type (might be due to invalid IL or missing references)
50945 //IL_0871: Unknown result type (might be due to invalid IL or missing references)
50946 //IL_0878: Unknown result type (might be due to invalid IL or missing references)
50947 //IL_088e: Unknown result type (might be due to invalid IL or missing references)
50948 //IL_0894: Unknown result type (might be due to invalid IL or missing references)
50949 //IL_08b5: Unknown result type (might be due to invalid IL or missing references)
50950 //IL_08ba: Unknown result type (might be due to invalid IL or missing references)
50951 //IL_08c1: Unknown result type (might be due to invalid IL or missing references)
50952 //IL_08c6: Unknown result type (might be due to invalid IL or missing references)
50953 //IL_08cb: Unknown result type (might be due to invalid IL or missing references)
50954 //IL_0783: Unknown result type (might be due to invalid IL or missing references)
50955 //IL_0788: Unknown result type (might be due to invalid IL or missing references)
50956 //IL_094b: Unknown result type (might be due to invalid IL or missing references)
50957 //IL_095a: Unknown result type (might be due to invalid IL or missing references)
50958 //IL_095f: Unknown result type (might be due to invalid IL or missing references)
50959 //IL_0964: Unknown result type (might be due to invalid IL or missing references)
50960 //IL_0979: Unknown result type (might be due to invalid IL or missing references)
50961 //IL_0991: Unknown result type (might be due to invalid IL or missing references)
50962 //IL_0996: Unknown result type (might be due to invalid IL or missing references)
50963 //IL_099b: Unknown result type (might be due to invalid IL or missing references)
50964 //IL_09a0: Unknown result type (might be due to invalid IL or missing references)
50965 //IL_09a5: Unknown result type (might be due to invalid IL or missing references)
50966 //IL_09a7: Unknown result type (might be due to invalid IL or missing references)
50967 //IL_09a9: Unknown result type (might be due to invalid IL or missing references)
50968 //IL_09ae: Unknown result type (might be due to invalid IL or missing references)
50969 //IL_09b5: Unknown result type (might be due to invalid IL or missing references)
50970 //IL_09cb: Unknown result type (might be due to invalid IL or missing references)
50971 //IL_09d1: Unknown result type (might be due to invalid IL or missing references)
50972 //IL_0b10: Unknown result type (might be due to invalid IL or missing references)
50973 //IL_0b12: Unknown result type (might be due to invalid IL or missing references)
50974 //IL_0b17: Unknown result type (might be due to invalid IL or missing references)
50975 //IL_0b1e: Unknown result type (might be due to invalid IL or missing references)
50976 //IL_0b34: Unknown result type (might be due to invalid IL or missing references)
50977 //IL_0b3a: Unknown result type (might be due to invalid IL or missing references)
50978 //IL_0b4e: Unknown result type (might be due to invalid IL or missing references)
50979 //IL_0b53: Unknown result type (might be due to invalid IL or missing references)
50980 //IL_0b5a: Unknown result type (might be due to invalid IL or missing references)
50981 //IL_0b5f: Unknown result type (might be due to invalid IL or missing references)
50982 //IL_0b64: Unknown result type (might be due to invalid IL or missing references)
50983 //IL_0a13: Unknown result type (might be due to invalid IL or missing references)
50984 //IL_0a18: Unknown result type (might be due to invalid IL or missing references)
50985 //IL_0a1f: Unknown result type (might be due to invalid IL or missing references)
50986 //IL_0a24: Unknown result type (might be due to invalid IL or missing references)
50987 //IL_0a29: Unknown result type (might be due to invalid IL or missing references)
50988 //IL_0b79: Unknown result type (might be due to invalid IL or missing references)
50989 //IL_0b7b: Unknown result type (might be due to invalid IL or missing references)
50990 //IL_0b80: Unknown result type (might be due to invalid IL or missing references)
50991 //IL_0b87: Unknown result type (might be due to invalid IL or missing references)
50992 //IL_0b9d: Unknown result type (might be due to invalid IL or missing references)
50993 //IL_0ba3: Unknown result type (might be due to invalid IL or missing references)
50994 //IL_0bb0: Unknown result type (might be due to invalid IL or missing references)
50995 //IL_0bb5: Unknown result type (might be due to invalid IL or missing references)
50996 //IL_0bbc: Unknown result type (might be due to invalid IL or missing references)
50997 //IL_0bc1: Unknown result type (might be due to invalid IL or missing references)
50998 //IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
50999 //IL_0e2c: Unknown result type (might be due to invalid IL or missing references)
51000 //IL_0e2e: Unknown result type (might be due to invalid IL or missing references)
51001 //IL_0e33: Unknown result type (might be due to invalid IL or missing references)
51002 //IL_0e3a: Unknown result type (might be due to invalid IL or missing references)
51003 //IL_0e4f: Unknown result type (might be due to invalid IL or missing references)
51004 //IL_0e55: Unknown result type (might be due to invalid IL or missing references)
51005 //IL_0e66: Unknown result type (might be due to invalid IL or missing references)
51006 //IL_0e6b: Unknown result type (might be due to invalid IL or missing references)
51007 //IL_0e72: Unknown result type (might be due to invalid IL or missing references)
51008 //IL_0e77: Unknown result type (might be due to invalid IL or missing references)
51009 //IL_0e7c: Unknown result type (might be due to invalid IL or missing references)
51010 //IL_0d8a: Unknown result type (might be due to invalid IL or missing references)
51011 //IL_0d8c: Unknown result type (might be due to invalid IL or missing references)
51012 //IL_0d91: Unknown result type (might be due to invalid IL or missing references)
51013 //IL_0d98: Unknown result type (might be due to invalid IL or missing references)
51014 //IL_0dae: Unknown result type (might be due to invalid IL or missing references)
51015 //IL_0db4: Unknown result type (might be due to invalid IL or missing references)
51016 //IL_0dea: Unknown result type (might be due to invalid IL or missing references)
51017 //IL_0def: Unknown result type (might be due to invalid IL or missing references)
51018 //IL_0df6: Unknown result type (might be due to invalid IL or missing references)
51019 //IL_0dfb: Unknown result type (might be due to invalid IL or missing references)
51020 //IL_0e00: Unknown result type (might be due to invalid IL or missing references)
51021 //IL_0c68: Unknown result type (might be due to invalid IL or missing references)
51022 //IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
51023 //IL_0c81: Unknown result type (might be due to invalid IL or missing references)
51024 //IL_0beb: Unknown result type (might be due to invalid IL or missing references)
51025 //IL_0bed: Unknown result type (might be due to invalid IL or missing references)
51026 //IL_0bf2: Unknown result type (might be due to invalid IL or missing references)
51027 //IL_0bf9: Unknown result type (might be due to invalid IL or missing references)
51028 //IL_0c10: Unknown result type (might be due to invalid IL or missing references)
51029 //IL_0c21: Unknown result type (might be due to invalid IL or missing references)
51030 //IL_0c26: Unknown result type (might be due to invalid IL or missing references)
51031 //IL_0c2d: Unknown result type (might be due to invalid IL or missing references)
51032 //IL_0c32: Unknown result type (might be due to invalid IL or missing references)
51033 //IL_0c37: Unknown result type (might be due to invalid IL or missing references)
51034 //IL_0c3e: Unknown result type (might be due to invalid IL or missing references)
51035 //IL_0c48: Unknown result type (might be due to invalid IL or missing references)
51036 //IL_0c4d: Unknown result type (might be due to invalid IL or missing references)
51037 Player player = Main.player[owner];
51038 rotation = velocity.ToRotation() + (float)Math.PI / 2f;
51039 ai[0] += 1f;
51041 base.Center = Main.GetPlayerArmPosition(this) + velocity * (ai[0] - 1f);
51042 spriteDirection = ((!(Vector2.Dot(velocity, Vector2.UnitX) < 0f)) ? 1 : (-1));
51043 if (ai[0] >= timeToFlyOut)
51044 {
51045 Kill();
51046 return;
51047 }
51048 player.heldProj = whoAmI;
51049 player.MatchItemTimeToItemAnimation();
51050 if (ai[0] == (float)(int)(timeToFlyOut / 2f))
51051 {
51052 WhipPointsForCollision.Clear();
51054 Vector2 vector = WhipPointsForCollision[WhipPointsForCollision.Count - 1];
51056 }
51057 switch (type)
51058 {
51059 case 848:
51060 {
51061 float t3 = ai[0] / timeToFlyOut;
51062 float num5 = Utils.GetLerpValue(0.1f, 0.7f, t3, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t3, clamped: true);
51063 if (num5 > 0.1f && Main.rand.NextFloat() < num5 / 2f)
51064 {
51065 WhipPointsForCollision.Clear();
51067 Rectangle r4 = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(30f, 30f));
51068 int num6 = Dust.NewDust(r4.TopLeft(), r4.Width, r4.Height, 172, 0f, 0f, 100, default(Color), 1.5f);
51069 Main.dust[num6].noGravity = true;
51070 Main.dust[num6].velocity.X /= 2f;
51071 Main.dust[num6].velocity.Y /= 2f;
51072 }
51073 break;
51074 }
51075 case 847:
51076 {
51077 float t2 = ai[0] / timeToFlyOut;
51078 if (Utils.GetLerpValue(0.1f, 0.7f, t2, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t2, clamped: true) > 0.5f && Main.rand.Next(3) != 0)
51079 {
51080 WhipPointsForCollision.Clear();
51082 int num2 = Main.rand.Next(WhipPointsForCollision.Count - 10, WhipPointsForCollision.Count);
51083 Rectangle r2 = Utils.CenteredRectangle(WhipPointsForCollision[num2], new Vector2(30f, 30f));
51084 int num3 = 57;
51085 if (Main.rand.Next(3) == 0)
51086 {
51087 num3 = 43;
51088 }
51089 Dust dust14 = Dust.NewDustDirect(r2.TopLeft(), r2.Width, r2.Height, num3, 0f, 0f, 100, Color.White);
51090 dust14.position = WhipPointsForCollision[num2];
51091 dust14.fadeIn = 0.3f;
51093 dust14.noGravity = true;
51094 dust14.velocity *= 0.5f;
51095 dust14.velocity += spinningpoint.RotatedBy((float)player.direction * ((float)Math.PI / 2f));
51096 dust14.velocity *= 0.5f;
51097 }
51098 break;
51099 }
51100 case 849:
51101 {
51102 float num4 = ai[0] / timeToFlyOut;
51103 Utils.GetLerpValue(0.1f, 0.7f, num4, clamped: true);
51104 Utils.GetLerpValue(0.9f, 0.7f, num4, clamped: true);
51105 if (num4 > 0.4f && Main.rand.Next(9) != 0)
51106 {
51107 WhipPointsForCollision.Clear();
51109 Rectangle r3 = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(30f, 30f));
51110 Vector2 vector3 = WhipPointsForCollision[WhipPointsForCollision.Count - 2].DirectionTo(WhipPointsForCollision[WhipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero);
51111 Dust dust15 = Dust.NewDustDirect(r3.TopLeft(), r3.Width, r3.Height, 191, 0f, 0f, 0, default(Color), 1.3f);
51112 dust15.noGravity = true;
51113 dust15.velocity += vector3 * 2f;
51114 if (Main.rand.Next(2) == 0)
51115 {
51117 {
51118 MovementVector = vector3,
51119 PositionInWorld = ((Rectangle)(ref r3)).Center.ToVector2()
51120 }, owner);
51121 }
51122 Lighting.AddLight(((Rectangle)(ref r3)).Center.ToVector2(), new Vector3(0.2f, 0f, 0.4f));
51123 }
51124 break;
51125 }
51126 case 915:
51127 {
51128 float t5 = ai[0] / timeToFlyOut;
51129 if (Utils.GetLerpValue(0.1f, 0.7f, t5, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t5, clamped: true) > 0.1f)
51130 {
51131 WhipPointsForCollision.Clear();
51133 Rectangle r6 = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(30f, 30f));
51134 Vector2 vector5 = WhipPointsForCollision[WhipPointsForCollision.Count - 2].DirectionTo(WhipPointsForCollision[WhipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero);
51135 Dust dust12 = Dust.NewDustDirect(r6.TopLeft(), r6.Width, r6.Height, 267, 0f, 0f, 0, Main.hslToRgb(player.miscCounterNormalized * 9f % 1f, 1f, 0.5f), 1.3f);
51136 dust12.velocity *= Main.rand.NextFloat() * 0.8f;
51137 dust12.noGravity = true;
51138 dust12.scale = 0.9f + Main.rand.NextFloat() * 0.9f;
51139 dust12.fadeIn = Main.rand.NextFloat() * 0.9f;
51140 dust12.velocity += vector5 * 2f;
51141 if (dust12.dustIndex != 6000)
51142 {
51143 Dust dust19 = Dust.CloneDust(dust12);
51144 dust19.scale /= 2f;
51145 dust19.fadeIn *= 0.85f;
51146 dust19.color = new Color(255, 255, 255, 255);
51147 }
51148 }
51149 break;
51150 }
51151 case 914:
51152 {
51153 float t6 = ai[0] / timeToFlyOut;
51154 float num8 = Utils.GetLerpValue(0.1f, 0.7f, t6, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t6, clamped: true);
51155 if (num8 > 0.1f && Main.rand.NextFloat() < num8 / 2f)
51156 {
51157 WhipPointsForCollision.Clear();
51159 Rectangle r7 = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(30f, 30f));
51160 Vector2 vector6 = WhipPointsForCollision[WhipPointsForCollision.Count - 2].DirectionTo(WhipPointsForCollision[WhipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero);
51161 Dust dust20 = Dust.NewDustDirect(r7.TopLeft(), r7.Width, r7.Height, 39, 0f, 0f, 0, default(Color), 1.2f);
51162 dust20.noGravity = Main.rand.Next(3) == 0;
51163 dust20.velocity += vector6 * 2f;
51164 }
51165 break;
51166 }
51167 case 952:
51168 {
51169 float t7 = ai[0] / timeToFlyOut;
51170 float num9 = Utils.GetLerpValue(0.1f, 0.7f, t7, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t7, clamped: true);
51171 if (num9 > 0.15f && Main.rand.NextFloat() < num9)
51172 {
51173 WhipPointsForCollision.Clear();
51175 Rectangle r8 = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(30f, 30f));
51176 Vector2 vector7 = WhipPointsForCollision[WhipPointsForCollision.Count - 2].DirectionTo(WhipPointsForCollision[WhipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero);
51177 Dust dust10 = Dust.NewDustDirect(r8.TopLeft(), r8.Width, r8.Height, 26, 0f, 0f, 0, default(Color), 0.7f);
51178 dust10.noGravity = Main.rand.Next(3) == 0;
51179 if (dust10.noGravity)
51180 {
51181 dust10.scale += 0.4f;
51182 }
51183 dust10.velocity += vector7 * 2f;
51184 }
51185 break;
51186 }
51187 case 912:
51188 {
51189 float t4 = ai[0] / timeToFlyOut;
51190 float num7 = Utils.GetLerpValue(0.1f, 0.7f, t4, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t4, clamped: true);
51191 if (!(num7 > 0.1f) || !(Main.rand.NextFloat() < num7 / 2f))
51192 {
51193 break;
51194 }
51195 WhipPointsForCollision.Clear();
51197 Rectangle r5 = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(30f, 30f));
51198 Vector2 vector4 = WhipPointsForCollision[WhipPointsForCollision.Count - 2].DirectionTo(WhipPointsForCollision[WhipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero);
51199 for (int j = 0; j < 3; j++)
51200 {
51201 Dust dust16 = Dust.NewDustDirect(r5.TopLeft(), r5.Width, r5.Height, 16, 0f, 0f, 0, default(Color), 1.2f);
51202 dust16.noGravity = true;
51203 dust16.velocity += vector4 * 2f;
51204 }
51205 for (int k = 0; k < 1; k++)
51206 {
51207 Dust dust17 = Dust.NewDustDirect(r5.TopLeft(), r5.Width, r5.Height, 13, 0f, 0f, 0, default(Color), 0.8f);
51208 dust17.velocity += vector4 * 2f;
51209 }
51210 for (int l = 0; l < 3; l++)
51211 {
51212 if (Main.rand.Next(2) != 0)
51213 {
51214 Dust dust18 = Dust.NewDustDirect(r5.TopLeft(), r5.Width, r5.Height, 261, 0f, 0f, 0, Color.Transparent, 0.8f);
51215 dust18.velocity += vector4 * 2f;
51216 dust18.velocity *= 0.3f;
51217 dust18.noGravity = true;
51218 }
51219 }
51220 Lighting.AddLight(((Rectangle)(ref r5)).Center.ToVector2(), new Vector3(0.1f, 0.1f, 0.2f));
51221 break;
51222 }
51223 case 913:
51224 {
51225 float t = ai[0] / timeToFlyOut;
51226 float num = Utils.GetLerpValue(0.1f, 0.7f, t, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t, clamped: true);
51227 if (!(num > 0.1f) || !(Main.rand.NextFloat() < num))
51228 {
51229 break;
51230 }
51231 WhipPointsForCollision.Clear();
51233 Rectangle r = Utils.CenteredRectangle(WhipPointsForCollision[WhipPointsForCollision.Count - 1], new Vector2(20f, 20f));
51234 Vector2 vector2 = WhipPointsForCollision[WhipPointsForCollision.Count - 2].DirectionTo(WhipPointsForCollision[WhipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero);
51235 for (int i = 0; i < 3; i++)
51236 {
51237 if (Main.rand.Next(3) != 0)
51238 {
51239 continue;
51240 }
51241 if (Main.rand.Next(7) == 0)
51242 {
51243 Dust dust13 = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 31);
51244 dust13.velocity.X /= 2f;
51245 dust13.velocity.Y /= 2f;
51246 dust13.velocity += vector2 * 2f;
51247 dust13.fadeIn = 1f + Main.rand.NextFloat() * 0.6f;
51248 dust13.noGravity = true;
51249 continue;
51250 }
51251 Dust dust11 = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 6, 0f, 0f, 0, default(Color), 1.2f);
51252 dust11.velocity += vector2 * 2f;
51253 if (Main.rand.Next(3) != 0)
51254 {
51255 dust11.fadeIn = 0.7f + Main.rand.NextFloat() * 0.9f;
51256 dust11.scale = 0.6f;
51257 dust11.noGravity = true;
51258 }
51259 }
51260 break;
51261 }
51262 }
51263 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 Center
Definition Entity.cs:70
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
static void RequestParticleSpawn(bool clientOnly, ParticleOrchestraType type, ParticleOrchestraSettings settings, int? overrideInvokingPlayerIndex=null)
static readonly SoundStyle Item153
Definition SoundID.cs:983
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
static void FillWhipControlPoints(Projectile proj, List< Vector2 > controlPoints)
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...
List< Vector2 > WhipPointsForCollision
static void GetWhipSettings(Projectile proj, out float timeToFlyOut, out int segments, out float rangeMultiplier)

References Terraria.Lighting.AddLight(), Terraria.Utils.CenteredRectangle(), Terraria.Dust.CloneDust(), Terraria.Entity.direction, Terraria.Main.dust, Terraria.Utils.GetLerpValue(), Terraria.Main.GetPlayerArmPosition(), Terraria.Main.hslToRgb(), Terraria.ID.SoundID.Item153, Terraria.Player.MatchItemTimeToItemAnimation(), Terraria.Player.miscCounterNormalized, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, and Terraria.GameContent.Drawing.ParticleOrchestrator.RequestParticleSpawn().

+ Here is the call graph for this function: