Example #1
0
			public void CopyFrom(Lighting.LightingSwipeData from)
			{
				this.innerLoop1Start = from.innerLoop1Start;
				this.outerLoopStart = from.outerLoopStart;
				this.innerLoop1End = from.innerLoop1End;
				this.outerLoopEnd = from.outerLoopEnd;
				this.innerLoop2Start = from.innerLoop2Start;
				this.innerLoop2End = from.innerLoop2End;
				this.function = from.function;
				this.jaggedArray = from.jaggedArray;
			}
Example #2
0
 private static void doColors_Mode3_Swipe(Lighting.LightingSwipeData swipeData)
 {
     try
     {
         bool flag1 = true;
         while (true)
         {
             int num1;
             int num2;
             int num3;
             if (flag1)
             {
                 num1 = 1;
                 num2 = swipeData.innerLoop1Start;
                 num3 = swipeData.innerLoop1End;
             }
             else
             {
                 num1 = -1;
                 num2 = swipeData.innerLoop2Start;
                 num3 = swipeData.innerLoop2End;
             }
             int num4 = swipeData.outerLoopStart;
             int num5 = swipeData.outerLoopEnd;
             for (int index1 = num4; index1 < num5; ++index1)
             {
                 Lighting.LightingState[] lightingStateArray = swipeData.jaggedArray[index1];
                 float num6 = 0.0f;
                 float num7 = 0.0f;
                 float num8 = 0.0f;
                 int index2 = num2;
                 while (index2 != num3)
                 {
                     Lighting.LightingState lightingState = lightingStateArray[index2];
                     bool flag2;
                     bool flag3 = flag2 = false;
                     if ((double)lightingState.r2 > (double)num6)
                         num6 = lightingState.r2;
                     else if ((double)num6 <= 0.0)
                         flag3 = true;
                     else
                         lightingState.r2 = num6;
                     if (!flag3)
                     {
                         if (lightingState.stopLight)
                             num6 -= Lighting.negLight2;
                         else if (lightingState.wetLight)
                             num6 -= Lighting.wetLightR;
                         else
                             num6 -= Lighting.negLight;
                     }
                     if ((double)lightingState.g2 > (double)num7)
                         num7 = lightingState.g2;
                     else if ((double)num7 <= 0.0)
                         flag2 = true;
                     else
                         lightingState.g2 = num7;
                     if (!flag2)
                     {
                         if (lightingState.stopLight)
                             num7 -= Lighting.negLight2;
                         else if (lightingState.wetLight)
                             num7 -= Lighting.wetLightG;
                         else
                             num7 -= Lighting.negLight;
                     }
                     if ((double)lightingState.b2 > (double)num8)
                         num8 = lightingState.b2;
                     else if ((double)num8 > 0.0)
                         lightingState.b2 = num8;
                     else
                         goto label_35;
                     if (lightingState.stopLight)
                         num8 -= Lighting.negLight2;
                     else
                         num8 -= Lighting.negLight;
                 label_35:
                     index2 += num1;
                 }
             }
             if (flag1)
                 flag1 = false;
             else
                 break;
         }
     }
     catch
     {
     }
 }
Example #3
0
 private static void doColors_Mode2_Swipe(Lighting.LightingSwipeData swipeData)
 {
     try
     {
         bool flag = true;
         while (true)
         {
             int num1;
             int num2;
             int num3;
             if (flag)
             {
                 num1 = 1;
                 num2 = swipeData.innerLoop1Start;
                 num3 = swipeData.innerLoop1End;
             }
             else
             {
                 num1 = -1;
                 num2 = swipeData.innerLoop2Start;
                 num3 = swipeData.innerLoop2End;
             }
             int num4 = swipeData.outerLoopStart;
             int num5 = swipeData.outerLoopEnd;
             for (int index1 = num4; index1 < num5; ++index1)
             {
                 Lighting.LightingState[] lightingStateArray = swipeData.jaggedArray[index1];
                 float num6 = 0.0f;
                 int index2 = num2;
                 while (index2 != num3)
                 {
                     Lighting.LightingState lightingState = lightingStateArray[index2];
                     if ((double)lightingState.r2 > (double)num6)
                         num6 = lightingState.r2;
                     else if ((double)num6 > 0.0)
                         lightingState.r2 = num6;
                     else
                         goto label_15;
                     if (lightingState.stopLight)
                         num6 -= Lighting.negLight2;
                     else if (lightingState.wetLight)
                         num6 -= Lighting.wetLightR;
                     else
                         num6 -= Lighting.negLight;
                 label_15:
                     index2 += num1;
                 }
             }
             if (flag)
                 flag = false;
             else
                 break;
         }
     }
     catch
     {
     }
 }
Example #4
0
 private static void doColors_Mode1_Swipe(Lighting.LightingSwipeData swipeData)
 {
     try
     {
         bool flag = true;
         while (true)
         {
             int num1;
             int num2;
             int num3;
             if (flag)
             {
                 num1 = 1;
                 num2 = swipeData.innerLoop1Start;
                 num3 = swipeData.innerLoop1End;
             }
             else
             {
                 num1 = -1;
                 num2 = swipeData.innerLoop2Start;
                 num3 = swipeData.innerLoop2End;
             }
             int num4 = swipeData.outerLoopStart;
             int num5 = swipeData.outerLoopEnd;
             for (int index1 = num4; index1 < num5; ++index1)
             {
                 Lighting.LightingState[] lightingStateArray = swipeData.jaggedArray[index1];
                 float num6 = 0.0f;
                 int index2 = num2;
                 while (index2 != num3)
                 {
                     Lighting.LightingState lightingState = lightingStateArray[index2];
                     if ((double)lightingState.r2 > (double)num6)
                         num6 = lightingState.r2;
                     else if ((double)num6 > 0.0185)
                     {
                         if ((double)lightingState.r2 < (double)num6)
                             lightingState.r2 = num6;
                     }
                     else
                         goto label_19;
                     if ((double)lightingStateArray[index2 + num1].r2 <= (double)num6)
                     {
                         if (lightingState.stopLight)
                             num6 *= Lighting.negLight2;
                         else if (lightingState.wetLight)
                         {
                             if (lightingState.honeyLight)
                                 num6 *= (float)((double)Lighting.honeyLightR * (double)swipeData.rand.Next(98, 100) * 0.00999999977648258);
                             else
                                 num6 *= (float)((double)Lighting.wetLightR * (double)swipeData.rand.Next(98, 100) * 0.00999999977648258);
                         }
                         else
                             num6 *= Lighting.negLight;
                     }
                 label_19:
                     index2 += num1;
                 }
             }
             if (flag)
                 flag = false;
             else
                 break;
         }
     }
     catch
     {
     }
 }
Example #5
0
 private static void doColors_Mode0_Swipe(Lighting.LightingSwipeData swipeData)
 {
     try
     {
         bool flag1 = true;
         while (true)
         {
             int num1;
             int num2;
             int num3;
             if (flag1)
             {
                 num1 = 1;
                 num2 = swipeData.innerLoop1Start;
                 num3 = swipeData.innerLoop1End;
             }
             else
             {
                 num1 = -1;
                 num2 = swipeData.innerLoop2Start;
                 num3 = swipeData.innerLoop2End;
             }
             int num4 = swipeData.outerLoopStart;
             int num5 = swipeData.outerLoopEnd;
             for (int index1 = num4; index1 < num5; ++index1)
             {
                 Lighting.LightingState[] lightingStateArray = swipeData.jaggedArray[index1];
                 float num6 = 0.0f;
                 float num7 = 0.0f;
                 float num8 = 0.0f;
                 int index2 = num2;
                 while (index2 != num3)
                 {
                     Lighting.LightingState lightingState1 = lightingStateArray[index2];
                     Lighting.LightingState lightingState2 = lightingStateArray[index2 + num1];
                     bool flag2;
                     bool flag3 = flag2 = false;
                     if ((double)lightingState1.r2 > (double)num6)
                         num6 = lightingState1.r2;
                     else if ((double)num6 <= 0.0185)
                         flag3 = true;
                     else if ((double)lightingState1.r2 < (double)num6)
                         lightingState1.r2 = num6;
                     if (!flag3 && (double)lightingState2.r2 <= (double)num6)
                     {
                         if (lightingState1.stopLight)
                             num6 *= Lighting.negLight2;
                         else if (lightingState1.wetLight)
                         {
                             if (lightingState1.honeyLight)
                                 num6 *= (float)((double)Lighting.honeyLightR * (double)swipeData.rand.Next(98, 100) * 0.00999999977648258);
                             else
                                 num6 *= (float)((double)Lighting.wetLightR * (double)swipeData.rand.Next(98, 100) * 0.00999999977648258);
                         }
                         else
                             num6 *= Lighting.negLight;
                     }
                     if ((double)lightingState1.g2 > (double)num7)
                         num7 = lightingState1.g2;
                     else if ((double)num7 <= 0.0185)
                         flag2 = true;
                     else
                         lightingState1.g2 = num7;
                     if (!flag2 && (double)lightingState2.g2 <= (double)num7)
                     {
                         if (lightingState1.stopLight)
                             num7 *= Lighting.negLight2;
                         else if (lightingState1.wetLight)
                         {
                             if (lightingState1.honeyLight)
                                 num7 *= (float)((double)Lighting.honeyLightG * (double)swipeData.rand.Next(97, 100) * 0.00999999977648258);
                             else
                                 num7 *= (float)((double)Lighting.wetLightG * (double)swipeData.rand.Next(97, 100) * 0.00999999977648258);
                         }
                         else
                             num7 *= Lighting.negLight;
                     }
                     if ((double)lightingState1.b2 > (double)num8)
                         num8 = lightingState1.b2;
                     else if ((double)num8 > 0.0185)
                         lightingState1.b2 = num8;
                     else
                         goto label_45;
                     if ((double)lightingState2.b2 < (double)num8)
                     {
                         if (lightingState1.stopLight)
                             num8 *= Lighting.negLight2;
                         else if (lightingState1.wetLight)
                         {
                             if (lightingState1.honeyLight)
                                 num8 *= (float)((double)Lighting.honeyLightB * (double)swipeData.rand.Next(97, 100) * 0.00999999977648258);
                             else
                                 num8 *= (float)((double)Lighting.wetLightB * (double)swipeData.rand.Next(97, 100) * 0.00999999977648258);
                         }
                         else
                             num8 *= Lighting.negLight;
                     }
                 label_45:
                     index2 += num1;
                 }
             }
             if (flag1)
                 flag1 = false;
             else
                 break;
         }
     }
     catch
     {
     }
 }
Example #6
0
		private static void doColors_Mode3_Swipe(Lighting.LightingSwipeData swipeData)
		{
			try
			{
				bool flag = true;
				while (true)
				{
					int num;
					int num2;
					int num3;
					if (flag)
					{
						num = 1;
						num2 = swipeData.innerLoop1Start;
						num3 = swipeData.innerLoop1End;
					}
					else
					{
						num = -1;
						num2 = swipeData.innerLoop2Start;
						num3 = swipeData.innerLoop2End;
					}
					int outerLoopStart = swipeData.outerLoopStart;
					int outerLoopEnd = swipeData.outerLoopEnd;
					for (int i = outerLoopStart; i < outerLoopEnd; i++)
					{
						Lighting.LightingState[] array = swipeData.jaggedArray[i];
						float num4 = 0f;
						float num5 = 0f;
						float num6 = 0f;
						int num7 = num2;
						while (num7 != num3)
						{
							Lighting.LightingState lightingState = array[num7];
							bool flag3;
							bool flag2 = flag3 = false;
							if (lightingState.r2 > num4)
							{
								num4 = lightingState.r2;
							}
							else if (num4 <= 0f)
							{
								flag3 = true;
							}
							else
							{
								lightingState.r2 = num4;
							}
							if (!flag3)
							{
								if (lightingState.stopLight)
								{
									num4 -= Lighting.negLight2;
								}
								else if (lightingState.wetLight)
								{
									num4 -= Lighting.wetLightR;
								}
								else
								{
									num4 -= Lighting.negLight;
								}
							}
							if (lightingState.g2 > num5)
							{
								num5 = lightingState.g2;
							}
							else if (num5 <= 0f)
							{
								flag2 = true;
							}
							else
							{
								lightingState.g2 = num5;
							}
							if (!flag2)
							{
								if (lightingState.stopLight)
								{
									num5 -= Lighting.negLight2;
								}
								else if (lightingState.wetLight)
								{
									num5 -= Lighting.wetLightG;
								}
								else
								{
									num5 -= Lighting.negLight;
								}
							}
							if (lightingState.b2 > num6)
							{
								num6 = lightingState.b2;
								goto IL_167;
							}
							if (num6 > 0f)
							{
								lightingState.b2 = num6;
								goto IL_167;
							}
							IL_186:
							num7 += num;
							continue;
							IL_167:
							if (lightingState.stopLight)
							{
								num6 -= Lighting.negLight2;
								goto IL_186;
							}
							num6 -= Lighting.negLight;
							goto IL_186;
						}
					}
					if (!flag)
					{
						break;
					}
					flag = false;
				}
			}
			catch
			{
			}
		}
Example #7
0
		private static void doColors_Mode2_Swipe(Lighting.LightingSwipeData swipeData)
		{
			try
			{
				bool flag = true;
				while (true)
				{
					int num;
					int num2;
					int num3;
					if (flag)
					{
						num = 1;
						num2 = swipeData.innerLoop1Start;
						num3 = swipeData.innerLoop1End;
					}
					else
					{
						num = -1;
						num2 = swipeData.innerLoop2Start;
						num3 = swipeData.innerLoop2End;
					}
					int outerLoopStart = swipeData.outerLoopStart;
					int outerLoopEnd = swipeData.outerLoopEnd;
					for (int i = outerLoopStart; i < outerLoopEnd; i++)
					{
						Lighting.LightingState[] array = swipeData.jaggedArray[i];
						float num4 = 0f;
						int num5 = num2;
						while (num5 != num3)
						{
							Lighting.LightingState lightingState = array[num5];
							if (lightingState.r2 > num4)
							{
								num4 = lightingState.r2;
								goto IL_86;
							}
							if (num4 > 0f)
							{
								lightingState.r2 = num4;
								goto IL_86;
							}
							IL_BA:
							num5 += num;
							continue;
							IL_86:
							if (lightingState.stopLight)
							{
								num4 -= Lighting.negLight2;
								goto IL_BA;
							}
							if (lightingState.wetLight)
							{
								num4 -= Lighting.wetLightR;
								goto IL_BA;
							}
							num4 -= Lighting.negLight;
							goto IL_BA;
						}
					}
					if (!flag)
					{
						break;
					}
					flag = false;
				}
			}
			catch
			{
			}
		}
Example #8
0
		private static void doColors_Mode1_Swipe(Lighting.LightingSwipeData swipeData)
		{
			try
			{
				bool flag = true;
				while (true)
				{
					int num;
					int num2;
					int num3;
					if (flag)
					{
						num = 1;
						num2 = swipeData.innerLoop1Start;
						num3 = swipeData.innerLoop1End;
					}
					else
					{
						num = -1;
						num2 = swipeData.innerLoop2Start;
						num3 = swipeData.innerLoop2End;
					}
					int outerLoopStart = swipeData.outerLoopStart;
					int outerLoopEnd = swipeData.outerLoopEnd;
					for (int i = outerLoopStart; i < outerLoopEnd; i++)
					{
						Lighting.LightingState[] array = swipeData.jaggedArray[i];
						float num4 = 0f;
						int num5 = num2;
						while (num5 != num3)
						{
							Lighting.LightingState lightingState = array[num5];
							if (lightingState.r2 > num4)
							{
								num4 = lightingState.r2;
								goto IL_9C;
							}
							if ((double)num4 > 0.0185)
							{
								if (lightingState.r2 < num4)
								{
									lightingState.r2 = num4;
									goto IL_9C;
								}
								goto IL_9C;
							}
							IL_123:
							num5 += num;
							continue;
							IL_9C:
							if (array[num5 + num].r2 > num4)
							{
								goto IL_123;
							}
							if (lightingState.stopLight)
							{
								num4 *= Lighting.negLight2;
								goto IL_123;
							}
							if (!lightingState.wetLight)
							{
								num4 *= Lighting.negLight;
								goto IL_123;
							}
							if (lightingState.honeyLight)
							{
								num4 *= Lighting.honeyLightR * (float)swipeData.rand.Next(98, 100) * 0.01f;
								goto IL_123;
							}
							num4 *= Lighting.wetLightR * (float)swipeData.rand.Next(98, 100) * 0.01f;
							goto IL_123;
						}
					}
					if (!flag)
					{
						break;
					}
					flag = false;
				}
			}
			catch
			{
			}
		}
Example #9
0
		private static void doColors_Mode0_Swipe(Lighting.LightingSwipeData swipeData)
		{
			try
			{
				bool flag = true;
				while (true)
				{
					int num;
					int num2;
					int num3;
					if (flag)
					{
						num = 1;
						num2 = swipeData.innerLoop1Start;
						num3 = swipeData.innerLoop1End;
					}
					else
					{
						num = -1;
						num2 = swipeData.innerLoop2Start;
						num3 = swipeData.innerLoop2End;
					}
					int outerLoopStart = swipeData.outerLoopStart;
					int outerLoopEnd = swipeData.outerLoopEnd;
					for (int i = outerLoopStart; i < outerLoopEnd; i++)
					{
						Lighting.LightingState[] array = swipeData.jaggedArray[i];
						float num4 = 0f;
						float num5 = 0f;
						float num6 = 0f;
						int num7 = num2;
						while (num7 != num3)
						{
							Lighting.LightingState lightingState = array[num7];
							Lighting.LightingState lightingState2 = array[num7 + num];
							bool flag3;
							bool flag2 = flag3 = false;
							if (lightingState.r2 > num4)
							{
								num4 = lightingState.r2;
							}
							else if ((double)num4 <= 0.0185)
							{
								flag3 = true;
							}
							else if (lightingState.r2 < num4)
							{
								lightingState.r2 = num4;
							}
							if (!flag3 && lightingState2.r2 <= num4)
							{
								if (lightingState.stopLight)
								{
									num4 *= Lighting.negLight2;
								}
								else if (lightingState.wetLight)
								{
									if (lightingState.honeyLight)
									{
										num4 *= Lighting.honeyLightR * (float)swipeData.rand.Next(98, 100) * 0.01f;
									}
									else
									{
										num4 *= Lighting.wetLightR * (float)swipeData.rand.Next(98, 100) * 0.01f;
									}
								}
								else
								{
									num4 *= Lighting.negLight;
								}
							}
							if (lightingState.g2 > num5)
							{
								num5 = lightingState.g2;
							}
							else if ((double)num5 <= 0.0185)
							{
								flag2 = true;
							}
							else
							{
								lightingState.g2 = num5;
							}
							if (!flag2 && lightingState2.g2 <= num5)
							{
								if (lightingState.stopLight)
								{
									num5 *= Lighting.negLight2;
								}
								else if (lightingState.wetLight)
								{
									if (lightingState.honeyLight)
									{
										num5 *= Lighting.honeyLightG * (float)swipeData.rand.Next(97, 100) * 0.01f;
									}
									else
									{
										num5 *= Lighting.wetLightG * (float)swipeData.rand.Next(97, 100) * 0.01f;
									}
								}
								else
								{
									num5 *= Lighting.negLight;
								}
							}
							if (lightingState.b2 > num6)
							{
								num6 = lightingState.b2;
								goto IL_22F;
							}
							if ((double)num6 > 0.0185)
							{
								lightingState.b2 = num6;
								goto IL_22F;
							}
							IL_2B1:
							num7 += num;
							continue;
							IL_22F:
							if (lightingState2.b2 >= num6)
							{
								goto IL_2B1;
							}
							if (lightingState.stopLight)
							{
								num6 *= Lighting.negLight2;
								goto IL_2B1;
							}
							if (!lightingState.wetLight)
							{
								num6 *= Lighting.negLight;
								goto IL_2B1;
							}
							if (lightingState.honeyLight)
							{
								num6 *= Lighting.honeyLightB * (float)swipeData.rand.Next(97, 100) * 0.01f;
								goto IL_2B1;
							}
							num6 *= Lighting.wetLightB * (float)swipeData.rand.Next(97, 100) * 0.01f;
							goto IL_2B1;
						}
					}
					if (!flag)
					{
						break;
					}
					flag = false;
				}
			}
			catch
			{
			}
		}
Example #10
0
 internal ColorEventArgs(Lighting.LightingSwipeData swipeData)
 {
     SwipeData = swipeData;
 }
Example #11
0
 public void Update()
 {
     if (Main.netMode == 2 || !active)
     {
         return;
     }
     if (type >= 276 && type <= 282)
     {
         velocity.X *= 0.98f;
         velocity.Y *= 0.98f;
         if (velocity.Y < scale)
         {
             velocity.Y += 0.05f;
         }
         if ((double)velocity.Y > 0.1)
         {
             if (velocity.X > 0f)
             {
                 rotation += 0.01f;
             }
             else
             {
                 rotation -= 0.01f;
             }
         }
     }
     if (type >= 570 && type <= 572)
     {
         scale -= 0.001f;
         if ((double)scale <= 0.01)
         {
             scale    = 0.01f;
             goreTime = 0;
         }
         sticky   = false;
         rotation = velocity.X * 0.1f;
     }
     else if (type >= 706 && type <= 717)
     {
         if ((double)position.Y < Main.worldSurface * 16.0 + 8.0)
         {
             alpha = 0;
         }
         else
         {
             alpha = 100;
         }
         int num = 4;
         frameCounter++;
         if (frame <= 4)
         {
             int num2 = (int)(position.X / 16f);
             int num3 = (int)(position.Y / 16f) - 1;
             if (WorldGen.InWorld(num2, num3) && !Main.tile[num2, num3].active())
             {
                 active = false;
             }
             if (frame == 0)
             {
                 num = 24 + Main.rand.Next(256);
             }
             if (frame == 1)
             {
                 num = 24 + Main.rand.Next(256);
             }
             if (frame == 2)
             {
                 num = 24 + Main.rand.Next(256);
             }
             if (frame == 3)
             {
                 num = 24 + Main.rand.Next(96);
             }
             if (frame == 5)
             {
                 num = 16 + Main.rand.Next(64);
             }
             if (type == 716)
             {
                 num *= 2;
             }
             if (type == 717)
             {
                 num *= 4;
             }
             if (frameCounter >= num)
             {
                 frameCounter = 0;
                 frame++;
                 if (frame == 5)
                 {
                     int num4 = NewGore(position, velocity, type);
                     Main.gore[num4].frame     = 9;
                     Main.gore[num4].velocity *= 0f;
                 }
             }
         }
         else if (frame <= 6)
         {
             num = 8;
             if (type == 716)
             {
                 num *= 2;
             }
             if (type == 717)
             {
                 num *= 3;
             }
             if (frameCounter >= num)
             {
                 frameCounter = 0;
                 frame++;
                 if (frame == 7)
                 {
                     active = false;
                 }
             }
         }
         else if (frame <= 9)
         {
             num = 6;
             if (type == 716)
             {
                 num         = (int)((double)num * 1.5);
                 velocity.Y += 0.175f;
             }
             else if (type == 717)
             {
                 num        *= 2;
                 velocity.Y += 0.15f;
             }
             else
             {
                 velocity.Y += 0.2f;
             }
             if ((double)velocity.Y < 0.5)
             {
                 velocity.Y = 0.5f;
             }
             if (velocity.Y > 12f)
             {
                 velocity.Y = 12f;
             }
             if (frameCounter >= num)
             {
                 frameCounter = 0;
                 frame++;
             }
             if (frame > 9)
             {
                 frame = 7;
             }
         }
         else
         {
             if (type == 716)
             {
                 num *= 2;
             }
             else if (type == 717)
             {
                 num *= 6;
             }
             velocity.Y += 0.1f;
             if (frameCounter >= num)
             {
                 frameCounter = 0;
                 frame++;
             }
             velocity *= 0f;
             if (frame > 14)
             {
                 active = false;
             }
         }
     }
     else if (type == 11 || type == 12 || type == 13 || type == 61 || type == 62 || type == 63 || type == 99 || type == 220 || type == 221 || type == 222 || (type >= 375 && type <= 377) || (type >= 435 && type <= 437) || (type >= 861 && type <= 862))
     {
         velocity.Y *= 0.98f;
         velocity.X *= 0.98f;
         scale      -= 0.007f;
         if ((double)scale < 0.1)
         {
             scale = 0.1f;
             alpha = 255;
         }
     }
     else if (type == 16 || type == 17)
     {
         velocity.Y *= 0.98f;
         velocity.X *= 0.98f;
         scale      -= 0.01f;
         if ((double)scale < 0.1)
         {
             scale = 0.1f;
             alpha = 255;
         }
     }
     else if (type == 331)
     {
         alpha      += 5;
         velocity.Y *= 0.95f;
         velocity.X *= 0.95f;
         rotation    = velocity.X * 0.1f;
     }
     else if (type != 860 && type != 892 && type != 893 && (type < 825 || type > 827) && (type < 411 || type > 430))
     {
         velocity.Y += 0.2f;
     }
     rotation += velocity.X * 0.1f;
     if (type >= 580 && type <= 582)
     {
         rotation    = 0f;
         velocity.X *= 0.95f;
     }
     if (type >= 825 && type <= 827)
     {
         if (timeLeft < 60)
         {
             alpha += Main.rand.Next(1, 7);
         }
         else if (alpha > 100)
         {
             alpha -= Main.rand.Next(1, 4);
         }
         if (alpha < 0)
         {
             alpha = 0;
         }
         if (alpha > 255)
         {
             timeLeft = 0;
         }
         velocity.X = (velocity.X * 50f + Main.windSpeed * 2f + (float)Main.rand.Next(-10, 11) * 0.1f) / 51f;
         float num5 = 0f;
         if (velocity.X < 0f)
         {
             num5 = velocity.X * 0.2f;
         }
         velocity.Y = (velocity.Y * 50f + -0.35f + num5 + (float)Main.rand.Next(-10, 11) * 0.2f) / 51f;
         rotation   = velocity.X * 0.6f;
         float num6 = -1f;
         if (Main.goreLoaded[type])
         {
             Rectangle rectangle = new Rectangle((int)position.X, (int)position.Y, (int)((float)Main.goreTexture[type].Width * scale), (int)((float)Main.goreTexture[type].Height * scale));
             for (int i = 0; i < 16; i++)
             {
                 if (Main.player[i].active && !Main.player[i].dead)
                 {
                     Rectangle value = new Rectangle((int)Main.player[i].position.X, (int)Main.player[i].position.Y, Main.player[i].width, Main.player[i].height);
                     if (rectangle.Intersects(value))
                     {
                         timeLeft = 0;
                         num6     = Main.player[i].velocity.Length();
                         break;
                     }
                 }
             }
         }
         if (timeLeft > 0)
         {
             if (Main.rand.Next(2) == 0)
             {
                 timeLeft--;
             }
             if (Main.rand.Next(50) == 0)
             {
                 timeLeft -= 5;
             }
             if (Main.rand.Next(100) == 0)
             {
                 timeLeft -= 10;
             }
         }
         else
         {
             alpha = 255;
             if (Main.goreLoaded[type] && num6 != -1f)
             {
                 float num7  = (float)Main.goreTexture[type].Width * scale * 0.8f;
                 float x     = position.X;
                 float y     = position.Y;
                 float num8  = (float)Main.goreTexture[type].Width * scale;
                 float num9  = (float)Main.goreTexture[type].Height * scale;
                 int   num10 = 31;
                 for (int j = 0; (float)j < num7; j++)
                 {
                     int num11 = Dust.NewDust(new Vector2(x, y), (int)num8, (int)num9, num10);
                     Main.dust[num11].velocity *= (1f + num6) / 3f;
                     Main.dust[num11].noGravity = true;
                     Main.dust[num11].alpha     = 100;
                     Main.dust[num11].scale     = scale;
                 }
             }
         }
     }
     if (type >= 411 && type <= 430)
     {
         alpha      = 50;
         velocity.X = (velocity.X * 50f + Main.windSpeed * 2f + (float)Main.rand.Next(-10, 11) * 0.1f) / 51f;
         velocity.Y = (velocity.Y * 50f + -0.25f + (float)Main.rand.Next(-10, 11) * 0.2f) / 51f;
         rotation   = velocity.X * 0.3f;
         if (Main.goreLoaded[type])
         {
             Rectangle rectangle2 = new Rectangle((int)position.X, (int)position.Y, (int)((float)Main.goreTexture[type].Width * scale), (int)((float)Main.goreTexture[type].Height * scale));
             for (int k = 0; k < 16; k++)
             {
                 if (Main.player[k].active && !Main.player[k].dead)
                 {
                     Rectangle value2 = new Rectangle((int)Main.player[k].position.X, (int)Main.player[k].position.Y, Main.player[k].width, Main.player[k].height);
                     if (rectangle2.Intersects(value2))
                     {
                         timeLeft = 0;
                     }
                 }
             }
             if (Collision.SolidCollision(position, (int)((float)Main.goreTexture[type].Width * scale), (int)((float)Main.goreTexture[type].Height * scale)))
             {
                 timeLeft = 0;
             }
         }
         if (timeLeft > 0)
         {
             if (Main.rand.Next(2) == 0)
             {
                 timeLeft--;
             }
             if (Main.rand.Next(50) == 0)
             {
                 timeLeft -= 5;
             }
             if (Main.rand.Next(100) == 0)
             {
                 timeLeft -= 10;
             }
         }
         else
         {
             alpha = 255;
             if (Main.goreLoaded[type])
             {
                 float num12 = (float)Main.goreTexture[type].Width * scale * 0.8f;
                 float x2    = position.X;
                 float y2    = position.Y;
                 float num13 = (float)Main.goreTexture[type].Width * scale;
                 float num14 = (float)Main.goreTexture[type].Height * scale;
                 int   num15 = 176;
                 if (type >= 416 && type <= 420)
                 {
                     num15 = 177;
                 }
                 if (type >= 421 && type <= 425)
                 {
                     num15 = 178;
                 }
                 if (type >= 426 && type <= 430)
                 {
                     num15 = 179;
                 }
                 for (int l = 0; (float)l < num12; l++)
                 {
                     int num16 = Dust.NewDust(new Vector2(x2, y2), (int)num13, (int)num14, num15);
                     Main.dust[num16].noGravity = true;
                     Main.dust[num16].alpha     = 100;
                     Main.dust[num16].scale     = scale;
                 }
             }
         }
     }
     else if (type != 860 && type != 892 && type != 893)
     {
         if (type >= 706 && type <= 717)
         {
             if (type == 716)
             {
                 float num17 = 1f;
                 float num18 = 1f;
                 float num19 = 1f;
                 float num20 = 0.6f;
                 num20 = ((frame == 0) ? (num20 * 0.1f) : ((frame == 1) ? (num20 * 0.2f) : ((frame == 2) ? (num20 * 0.3f) : ((frame == 3) ? (num20 * 0.4f) : ((frame == 4) ? (num20 * 0.5f) : ((frame == 5) ? (num20 * 0.4f) : ((frame == 6) ? (num20 * 0.2f) : ((frame <= 9) ? (num20 * 0.5f) : ((frame == 10) ? (num20 * 0.5f) : ((frame == 11) ? (num20 * 0.4f) : ((frame == 12) ? (num20 * 0.3f) : ((frame == 13) ? (num20 * 0.2f) : ((frame != 14) ? 0f : (num20 * 0.1f))))))))))))));
                 num17 = 1f * num20;
                 num18 = 0.5f * num20;
                 num19 = 0.1f * num20;
                 Lighting.AddLight(position + new Vector2(8f, 8f), num17, num18, num19);
             }
             Vector2 value3 = velocity;
             velocity = Collision.TileCollision(position, velocity, 16, 14);
             if (velocity != value3)
             {
                 if (frame < 10)
                 {
                     frame        = 10;
                     frameCounter = 0;
                     if (type != 716 && type != 717)
                     {
                         Main.PlaySound(39, (int)position.X + 8, (int)position.Y + 8, Main.rand.Next(2));
                     }
                 }
             }
             else if (Collision.WetCollision(position + velocity, 16, 14))
             {
                 if (frame < 10)
                 {
                     frame        = 10;
                     frameCounter = 0;
                     if (type != 716 && type != 717)
                     {
                         Main.PlaySound(39, (int)position.X + 8, (int)position.Y + 8, 2);
                     }
                 }
                 int num21 = (int)(position.X + 8f) / 16;
                 int num22 = (int)(position.Y + 14f) / 16;
                 if (Main.tile[num21, num22] != null && Main.tile[num21, num22].liquid > 0)
                 {
                     velocity  *= 0f;
                     position.Y = num22 * 16 - (int)Main.tile[num21, num22].liquid / 16;
                 }
             }
         }
         else if (sticky)
         {
             int num23 = 32;
             if (Main.goreLoaded[type])
             {
                 num23 = Main.goreTexture[type].Width;
                 if (Main.goreTexture[type].Height < num23)
                 {
                     num23 = Main.goreTexture[type].Height;
                 }
             }
             num23    = (int)((float)num23 * 0.9f);
             velocity = Collision.TileCollision(position, velocity, (int)((float)num23 * scale), (int)((float)num23 * scale));
             if (velocity.Y == 0f)
             {
                 velocity.X *= 0.97f;
                 if ((double)velocity.X > -0.01 && (double)velocity.X < 0.01)
                 {
                     velocity.X = 0f;
                 }
             }
             if (timeLeft > 0)
             {
                 timeLeft--;
             }
             else
             {
                 alpha++;
             }
         }
         else
         {
             alpha += 2;
         }
     }
     if (type == 860 || type == 892 || type == 893)
     {
         if (velocity.Y < 0f)
         {
             Vector2 vector = new Vector2(velocity.X, 0.6f);
             int     num24  = 32;
             if (Main.goreLoaded[type])
             {
                 num24 = Main.goreTexture[type].Width;
                 if (Main.goreTexture[type].Height < num24)
                 {
                     num24 = Main.goreTexture[type].Height;
                 }
             }
             num24     = (int)((float)num24 * 0.9f);
             vector    = Collision.TileCollision(position, vector, (int)((float)num24 * scale), (int)((float)num24 * scale));
             vector.X *= 0.97f;
             if ((double)vector.X > -0.01 && (double)vector.X < 0.01)
             {
                 vector.X = 0f;
             }
             if (timeLeft > 0)
             {
                 timeLeft--;
             }
             else
             {
                 alpha++;
             }
             velocity.X = vector.X;
         }
         else
         {
             velocity.Y += (float)Math.PI / 60f;
             Vector2 vector2 = new Vector2(Vector2.UnitY.RotatedBy(velocity.Y).X * 2f, Math.Abs(Vector2.UnitY.RotatedBy(velocity.Y).Y) * 3f);
             vector2 *= 2f;
             int num25 = 32;
             if (Main.goreLoaded[type])
             {
                 num25 = Main.goreTexture[type].Width;
                 if (Main.goreTexture[type].Height < num25)
                 {
                     num25 = Main.goreTexture[type].Height;
                 }
             }
             Vector2 value4 = vector2;
             vector2 = Collision.TileCollision(position, vector2, (int)((float)num25 * scale), (int)((float)num25 * scale));
             if (vector2 != value4)
             {
                 velocity.Y = -1f;
             }
             position += vector2;
             rotation  = vector2.ToRotation() + (float)Math.PI;
             if (timeLeft > 0)
             {
                 timeLeft--;
             }
             else
             {
                 alpha++;
             }
         }
     }
     else
     {
         position += velocity;
     }
     if (alpha >= 255)
     {
         active = false;
     }
     if (light > 0f)
     {
         float num26 = light * scale;
         float num27 = light * scale;
         float num28 = light * scale;
         if (type == 16)
         {
             num28 *= 0.3f;
             num27 *= 0.8f;
         }
         else if (type == 17)
         {
             num27 *= 0.6f;
             num26 *= 0.3f;
         }
         if (Main.goreLoaded[type])
         {
             Lighting.AddLight((int)((position.X + (float)Main.goreTexture[type].Width * scale / 2f) / 16f), (int)((position.Y + (float)Main.goreTexture[type].Height * scale / 2f) / 16f), num26, num27, num28);
         }
         else
         {
             Lighting.AddLight((int)((position.X + 32f * scale / 2f) / 16f), (int)((position.Y + 32f * scale / 2f) / 16f), num26, num27, num28);
         }
     }
 }