GetHairColor() public method

public GetHairColor ( bool useLighting = true ) : Color
useLighting bool
return Color
コード例 #1
0
ファイル: Main.cs プロジェクト: NoviaDroid/Terraria
		protected void DrawPlayerHead(Player drawPlayer, float X, float Y, float Alpha = 1f, float Scale = 1f)
		{
			int num = 0;
			int num2 = 0;
			for (int i = 0; i < 16; i++)
			{
				int num3 = i % 8;
				if (drawPlayer.dye[num3] != null && drawPlayer.armor[i].type > 0 && drawPlayer.armor[i].stack > 0 && drawPlayer.armor[i].faceSlot > 0 && drawPlayer.armor[i].faceSlot < 9)
				{
					num2 = (int)drawPlayer.dye[num3].dye;
				}
			}
			if (drawPlayer.face > 0 && drawPlayer.face < 9)
			{
				this.LoadAccFace((int)drawPlayer.face);
			}
			if (drawPlayer.dye[0] != null)
			{
				num = (int)drawPlayer.dye[0].dye;
			}
			int num4 = 0;
			switch (drawPlayer.team)
			{
			case 1:
				num4 = 1;
				break;
			case 2:
				num4 = 5;
				break;
			case 3:
				num4 = 9;
				break;
			case 4:
				num4 = 3;
				break;
			}
			if (num == 65)
			{
				num = num4;
			}
			if (num2 == 65)
			{
				num2 = num4;
			}
			this.LoadHair(drawPlayer.hair);
			Color color = this.quickAlpha(Color.White, Alpha);
			Color color2 = this.quickAlpha(drawPlayer.eyeColor, Alpha);
			Color color3 = this.quickAlpha(drawPlayer.GetHairColor(false), Alpha);
			Color color4 = this.quickAlpha(drawPlayer.skinColor, Alpha);
			Color color5 = this.quickAlpha(Color.White, Alpha);
			SpriteEffects effects = SpriteEffects.None;
			if (drawPlayer.direction < 0)
			{
				effects = SpriteEffects.FlipHorizontally;
			}
			Vector2 vector = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.4f);
			Vector2 position = drawPlayer.position;
			Rectangle bodyFrame = drawPlayer.bodyFrame;
			drawPlayer.bodyFrame.Y = 0;
			drawPlayer.position = Main.screenPosition;
			drawPlayer.position.X = drawPlayer.position.X + X;
			drawPlayer.position.Y = drawPlayer.position.Y + Y;
			drawPlayer.position.X = drawPlayer.position.X - 6f;
			drawPlayer.position.Y = drawPlayer.position.Y - 4f;
			float num5 = (float)drawPlayer.mount.PlayerHeadOffset;
			drawPlayer.position.Y = drawPlayer.position.Y - num5;
			if (drawPlayer.head > 0 && drawPlayer.head < 169)
			{
				this.LoadArmorHead(drawPlayer.head);
			}
			if (drawPlayer.face > 0 && drawPlayer.face < 9)
			{
				this.LoadAccFace((int)drawPlayer.face);
			}
			if (drawPlayer.head != 38 && drawPlayer.head != 135)
			{
				Main.spriteBatch.Draw(Main.playerHeadTexture, new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, vector, Scale, effects, 0f);
				Main.spriteBatch.Draw(Main.playerEyeWhitesTexture, new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color, drawPlayer.headRotation, vector, Scale, effects, 0f);
				Main.spriteBatch.Draw(Main.playerEyesTexture, new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, vector, Scale, effects, 0f);
			}
			if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106 || drawPlayer.head == 113 || drawPlayer.head == 116 || drawPlayer.head == 119 || drawPlayer.head == 133 || drawPlayer.head == 138 || drawPlayer.head == 139 || drawPlayer.head == 163)
			{
				Main.pixelShader.CurrentTechnique.Passes[num].Apply();
				Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f);
				Main.pixelShader.CurrentTechnique.Passes[0].Apply();
				if (!drawPlayer.invis)
				{
					Rectangle bodyFrame2 = drawPlayer.bodyFrame;
					bodyFrame2.Y -= 336;
					if (bodyFrame2.Y < 0)
					{
						bodyFrame2.Y = 0;
					}
					Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame2), color3, drawPlayer.headRotation, vector, Scale, effects, 0f);
				}
			}
			if (drawPlayer.head == 161 || drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69 || drawPlayer.head == 114 || drawPlayer.head == 121 || drawPlayer.head == 126 || drawPlayer.head == 130 || drawPlayer.head == 136 || drawPlayer.head == 140 || drawPlayer.head == 145 || drawPlayer.head == 158 || drawPlayer.head == 159)
			{
				Rectangle bodyFrame3 = drawPlayer.bodyFrame;
				bodyFrame3.Y -= 336;
				if (bodyFrame3.Y < 0)
				{
					bodyFrame3.Y = 0;
				}
				if (!drawPlayer.invis)
				{
					Main.spriteBatch.Draw(Main.playerHairAltTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame3), color3, drawPlayer.headRotation, vector, Scale, effects, 0f);
				}
			}
			if (drawPlayer.head == 23)
			{
				Rectangle bodyFrame4 = drawPlayer.bodyFrame;
				bodyFrame4.Y -= 336;
				if (bodyFrame4.Y < 0)
				{
					bodyFrame4.Y = 0;
				}
				if (!drawPlayer.invis)
				{
					Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame4), color3, drawPlayer.headRotation, vector, Scale, effects, 0f);
				}
				Main.pixelShader.CurrentTechnique.Passes[num].Apply();
				Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f);
				Main.pixelShader.CurrentTechnique.Passes[0].Apply();
			}
			else
			{
				if (drawPlayer.head == 14 || drawPlayer.head == 56 || drawPlayer.head == 158)
				{
					Rectangle bodyFrame5 = drawPlayer.bodyFrame;
					if (drawPlayer.head == 158)
					{
						bodyFrame5.Height -= 2;
					}
					int num6 = 0;
					if (bodyFrame5.Y == bodyFrame5.Height * 6)
					{
						bodyFrame5.Height -= 2;
					}
					else
					{
						if (bodyFrame5.Y == bodyFrame5.Height * 7)
						{
							num6 = -2;
						}
						else
						{
							if (bodyFrame5.Y == bodyFrame5.Height * 8)
							{
								num6 = -2;
							}
							else
							{
								if (bodyFrame5.Y == bodyFrame5.Height * 9)
								{
									num6 = -2;
								}
								else
								{
									if (bodyFrame5.Y == bodyFrame5.Height * 10)
									{
										num6 = -2;
									}
									else
									{
										if (bodyFrame5.Y == bodyFrame5.Height * 13)
										{
											bodyFrame5.Height -= 2;
										}
										else
										{
											if (bodyFrame5.Y == bodyFrame5.Height * 14)
											{
												num6 = -2;
											}
											else
											{
												if (bodyFrame5.Y == bodyFrame5.Height * 15)
												{
													num6 = -2;
												}
												else
												{
													if (bodyFrame5.Y == bodyFrame5.Height * 16)
													{
														num6 = -2;
													}
												}
											}
										}
									}
								}
							}
						}
					}
					bodyFrame5.Y += num6;
					Main.pixelShader.CurrentTechnique.Passes[num].Apply();
					Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f + (float)num6) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame5), color5, drawPlayer.headRotation, vector, Scale, effects, 0f);
					Main.pixelShader.CurrentTechnique.Passes[0].Apply();
				}
				else
				{
					if (drawPlayer.head > 0 && drawPlayer.head < 169 && drawPlayer.head != 28)
					{
						Main.pixelShader.CurrentTechnique.Passes[num].Apply();
						Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f);
						Main.pixelShader.CurrentTechnique.Passes[0].Apply();
					}
					else
					{
						Rectangle bodyFrame6 = drawPlayer.bodyFrame;
						bodyFrame6.Y -= 336;
						if (bodyFrame6.Y < 0)
						{
							bodyFrame6.Y = 0;
						}
						Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame6), color3, drawPlayer.headRotation, vector, Scale, effects, 0f);
					}
				}
			}
			if (drawPlayer.face > 0 && drawPlayer.face < 9)
			{
				Main.pixelShader.CurrentTechnique.Passes[num2].Apply();
				if (drawPlayer.face == 7)
				{
					Main.spriteBatch.Draw(Main.accFaceTexture[(int)drawPlayer.face], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), new Color(200, 200, 200, 150), drawPlayer.headRotation, vector, Scale, effects, 0f);
				}
				else
				{
					Main.spriteBatch.Draw(Main.accFaceTexture[(int)drawPlayer.face], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f);
				}
				Main.pixelShader.CurrentTechnique.Passes[0].Apply();
			}
			drawPlayer.position = position;
			drawPlayer.bodyFrame.Y = bodyFrame.Y;
		}
コード例 #2
0
ファイル: Main.cs プロジェクト: NoviaDroid/Terraria
		protected void DrawPlayer(Player drawPlayer, Vector2 Position, float rotation, Vector2 rotationOrigin, float shadow = 0f)
		{
			int num = -1;
			Main.playerDrawData.Clear();
			Main.playerDrawDust.Clear();
			Main.playerDrawGore.Clear();
			int num2 = 0;
			bool flag = false;
			bool flag2 = false;
			if (drawPlayer.body == 77 || drawPlayer.body == 103 || drawPlayer.body == 41 || drawPlayer.body == 100 || drawPlayer.body == 10 || drawPlayer.body == 11 || drawPlayer.body == 12 || drawPlayer.body == 13 || drawPlayer.body == 14 || drawPlayer.body == 43 || drawPlayer.body == 15 || drawPlayer.body == 16 || drawPlayer.body == 20 || drawPlayer.body == 39 || drawPlayer.body == 50 || drawPlayer.body == 38 || drawPlayer.body == 40 || drawPlayer.body == 57 || drawPlayer.body == 44 || drawPlayer.body == 52 || drawPlayer.body == 53 || drawPlayer.body == 68 || drawPlayer.body == 81 || drawPlayer.body == 85 || drawPlayer.body == 88 || drawPlayer.body == 98 || drawPlayer.body == 86 || drawPlayer.body == 87 || drawPlayer.body == 99 || drawPlayer.body == 165 || drawPlayer.body == 166 || drawPlayer.body == 167 || drawPlayer.body == 171 || drawPlayer.body == 45 || drawPlayer.body == 168)
			{
				flag = true;
			}
			if (drawPlayer.body == 99 || drawPlayer.body == 98 || drawPlayer.body == 100 || drawPlayer.body == 167 || drawPlayer.body == 171)
			{
				flag2 = true;
			}
			float num3 = (float)drawPlayer.mount.PlayerOffset;
			Position.Y -= num3;
			int num4 = 0;
			if (drawPlayer.dye[0] != null)
			{
				num4 = (int)drawPlayer.dye[0].dye;
			}
			int num5 = 0;
			if (drawPlayer.dye[1] != null)
			{
				num5 = (int)drawPlayer.dye[1].dye;
			}
			int num6 = 0;
			if (drawPlayer.dye[2] != null)
			{
				num6 = (int)drawPlayer.dye[2].dye;
			}
			if (drawPlayer.wearsRobe)
			{
				num6 = num5;
			}
			int num7 = 0;
			int num8 = 0;
			int num9 = 0;
			int num10 = 0;
			int num11 = 0;
			int num12 = 0;
			int num13 = 0;
			int num14 = 0;
			int num15 = 0;
			int num16 = 0;
			int num17 = 0;
			int num18 = 0;
			for (int i = 0; i < 16; i++)
			{
				int num19 = i % 8;
				if (drawPlayer.dye[num19] != null && drawPlayer.armor[i].type > 0 && drawPlayer.armor[i].stack > 0 && (i / 8 >= 1 || !drawPlayer.hideVisual[num19] || drawPlayer.armor[i].wingSlot > 0 || drawPlayer.armor[i].type == 934))
				{
					if (drawPlayer.armor[i].handOnSlot > 0 && drawPlayer.armor[i].handOnSlot < 18)
					{
						num7 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].handOffSlot > 0 && drawPlayer.armor[i].handOffSlot < 11)
					{
						num8 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].backSlot > 0 && drawPlayer.armor[i].backSlot < 8)
					{
						num9 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].frontSlot > 0 && drawPlayer.armor[i].frontSlot < 5)
					{
						num10 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].shoeSlot > 0 && drawPlayer.armor[i].shoeSlot < 16)
					{
						num11 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].waistSlot > 0 && drawPlayer.armor[i].waistSlot < 11)
					{
						num12 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].shieldSlot > 0 && drawPlayer.armor[i].shieldSlot < 5)
					{
						num13 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].neckSlot > 0 && drawPlayer.armor[i].neckSlot < 7)
					{
						num14 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].faceSlot > 0 && drawPlayer.armor[i].faceSlot < 9)
					{
						num15 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].balloonSlot > 0 && drawPlayer.armor[i].balloonSlot < 11)
					{
						num16 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].wingSlot > 0 && drawPlayer.armor[i].wingSlot < 27)
					{
						num17 = (int)drawPlayer.dye[num19].dye;
					}
					if (drawPlayer.armor[i].type == 934)
					{
						num18 = (int)drawPlayer.dye[num19].dye;
					}
				}
			}
			int num20 = 0;
			switch (drawPlayer.team)
			{
			case 1:
				num20 = 1;
				break;
			case 2:
				num20 = 5;
				break;
			case 3:
				num20 = 9;
				break;
			case 4:
				num20 = 3;
				break;
			}
			if (num4 == 65)
			{
				num4 = num20;
			}
			if (num5 == 65)
			{
				num5 = num20;
			}
			if (num6 == 65)
			{
				num6 = num20;
			}
			if (num7 == 65)
			{
				num7 = num20;
			}
			if (num8 == 65)
			{
				num8 = num20;
			}
			if (num10 == 65)
			{
				num10 = num20;
			}
			if (num9 == 65)
			{
				num9 = num20;
			}
			if (num11 == 65)
			{
				num11 = num20;
			}
			if (num12 == 65)
			{
				num12 = num20;
			}
			if (num13 == 65)
			{
				num13 = num20;
			}
			if (num14 == 65)
			{
				num14 = num20;
			}
			if (num15 == 65)
			{
				num15 = num20;
			}
			if (num16 == 65)
			{
				num16 = num20;
			}
			if (num17 == 65)
			{
				num17 = num20;
			}
			if (num18 == 65)
			{
				num18 = num20;
			}
			drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y + drawPlayer.gfxOffY;
			SpriteEffects spriteEffects = SpriteEffects.None;
			SpriteEffects effect = SpriteEffects.FlipHorizontally;
			Color color = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(true), shadow);
			Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White), shadow);
			Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor), shadow);
			Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor), shadow);
			Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor), shadow);
			Color color6 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor), shadow);
			Color color7 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor), shadow);
			Color color8 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor), shadow);
			Color color9 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor), shadow);
			Color color10 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor), shadow);
			Color color11 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)Position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White), shadow);
			Color color12 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)Position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White), shadow);
			Color color13 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)Position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White), shadow);
			if (drawPlayer.head > 0 && drawPlayer.head < 169)
			{
				this.LoadArmorHead(drawPlayer.head);
			}
			if (drawPlayer.body > 0 && drawPlayer.body < 175)
			{
				this.LoadArmorBody(drawPlayer.body);
			}
			if (drawPlayer.legs > 0 && drawPlayer.legs < 110)
			{
				this.LoadArmorLegs(drawPlayer.legs);
			}
			if (drawPlayer.handon > 0 && drawPlayer.handon < 18)
			{
				this.LoadAccHandsOn((int)drawPlayer.handon);
			}
			if (drawPlayer.handoff > 0 && drawPlayer.handoff < 11)
			{
				this.LoadAccHandsOff((int)drawPlayer.handoff);
			}
			if (drawPlayer.back > 0 && drawPlayer.back < 8)
			{
				this.LoadAccBack((int)drawPlayer.back);
			}
			if (drawPlayer.front > 0 && drawPlayer.front < 5)
			{
				this.LoadAccFront((int)drawPlayer.front);
			}
			if (drawPlayer.shoe > 0 && drawPlayer.shoe < 16)
			{
				this.LoadAccShoes((int)drawPlayer.shoe);
			}
			if (drawPlayer.waist > 0 && drawPlayer.waist < 11)
			{
				this.LoadAccWaist((int)drawPlayer.waist);
			}
			if (drawPlayer.shield > 0 && drawPlayer.shield < 5)
			{
				this.LoadAccShield((int)drawPlayer.shield);
			}
			if (drawPlayer.neck > 0 && drawPlayer.neck < 7)
			{
				this.LoadAccNeck((int)drawPlayer.neck);
			}
			if (drawPlayer.face > 0 && drawPlayer.face < 9)
			{
				this.LoadAccFace((int)drawPlayer.face);
			}
			if (drawPlayer.balloon > 0 && drawPlayer.balloon < 11)
			{
				this.LoadAccBalloon((int)drawPlayer.balloon);
			}
			this.LoadHair(drawPlayer.hair);
			if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47)
			{
				float num21 = (float)Main.mouseTextColor / 200f - 0.3f;
				if (shadow != 0f)
				{
					num21 = 0f;
				}
				color11.G = (byte)((float)color11.G * num21);
				color12.G = (byte)((float)color12.G * num21);
				color13.G = (byte)((float)color13.G * num21);
				color11.B = (byte)((float)color11.B * num21);
				color11.R = (byte)((float)color11.R * num21);
				color12.B = (byte)((float)color12.B * num21);
				color12.R = (byte)((float)color12.R * num21);
				color13.B = (byte)((float)color13.B * num21);
				color13.R = (byte)((float)color13.R * num21);
			}
			if (shadow > 0f)
			{
				color6 = Color.Transparent;
				color5 = Color.Transparent;
				color4 = Color.Transparent;
				color = Color.Transparent;
				color3 = Color.Transparent;
				color2 = Color.Transparent;
			}
			float num22 = 1f;
			float num23 = 1f;
			float num24 = 1f;
			float num25 = 1f;
			if (drawPlayer.honey && Main.rand.Next(30) == 0)
			{
				int num26 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 152, 0f, 0f, 150, default(Color), 1f);
				Main.dust[num26].velocity.Y = 0.3f;
				Dust expr_E12_cp_0 = Main.dust[num26];
				expr_E12_cp_0.velocity.X = expr_E12_cp_0.velocity.X * 0.1f;
				Main.dust[num26].scale += (float)Main.rand.Next(3, 4) * 0.1f;
				Main.dust[num26].alpha = 100;
				Main.dust[num26].noGravity = true;
				Main.dust[num26].velocity += drawPlayer.velocity * 0.1f;
				Main.playerDrawDust.Add(num26);
			}
			if (drawPlayer.poisoned)
			{
				if (Main.rand.Next(50) == 0)
				{
					int num27 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 46, 0f, 0f, 150, default(Color), 0.2f);
					Main.dust[num27].noGravity = true;
					Main.dust[num27].fadeIn = 1.9f;
					Main.playerDrawDust.Add(num27);
				}
				num22 *= 0.65f;
				num24 *= 0.75f;
			}
			if (drawPlayer.venom)
			{
				if (Main.rand.Next(10) == 0)
				{
					int num28 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 171, 0f, 0f, 100, default(Color), 0.5f);
					Main.dust[num28].noGravity = true;
					Main.dust[num28].fadeIn = 1.5f;
					Main.playerDrawDust.Add(num28);
				}
				num23 *= 0.45f;
				num22 *= 0.75f;
			}
			if (drawPlayer.onFire)
			{
				if (Main.rand.Next(4) == 0)
				{
					int num29 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
					Main.dust[num29].noGravity = true;
					Main.dust[num29].velocity *= 1.8f;
					Dust expr_1072_cp_0 = Main.dust[num29];
					expr_1072_cp_0.velocity.Y = expr_1072_cp_0.velocity.Y - 0.5f;
					Main.playerDrawDust.Add(num29);
				}
				num24 *= 0.6f;
				num23 *= 0.7f;
			}
			if (drawPlayer.dripping && shadow == 0f && Main.rand.Next(4) != 0)
			{
				Vector2 position = Position;
				position.X -= 2f;
				position.Y -= 2f;
				if (Main.rand.Next(2) == 0)
				{
					int num30 = Dust.NewDust(position, drawPlayer.width + 4, drawPlayer.height + 2, 211, 0f, 0f, 50, default(Color), 0.8f);
					if (Main.rand.Next(2) == 0)
					{
						Main.dust[num30].alpha += 25;
					}
					if (Main.rand.Next(2) == 0)
					{
						Main.dust[num30].alpha += 25;
					}
					Main.dust[num30].noLight = true;
					Main.dust[num30].velocity *= 0.2f;
					Dust expr_11BA_cp_0 = Main.dust[num30];
					expr_11BA_cp_0.velocity.Y = expr_11BA_cp_0.velocity.Y + 0.2f;
					Main.dust[num30].velocity += drawPlayer.velocity;
					Main.playerDrawDust.Add(num30);
				}
				else
				{
					int num31 = Dust.NewDust(position, drawPlayer.width + 8, drawPlayer.height + 8, 211, 0f, 0f, 50, default(Color), 1.1f);
					if (Main.rand.Next(2) == 0)
					{
						Main.dust[num31].alpha += 25;
					}
					if (Main.rand.Next(2) == 0)
					{
						Main.dust[num31].alpha += 25;
					}
					Main.dust[num31].noLight = true;
					Main.dust[num31].noGravity = true;
					Main.dust[num31].velocity *= 0.2f;
					Dust expr_12BF_cp_0 = Main.dust[num31];
					expr_12BF_cp_0.velocity.Y = expr_12BF_cp_0.velocity.Y + 1f;
					Main.dust[num31].velocity += drawPlayer.velocity;
					Main.playerDrawDust.Add(num31);
				}
			}
			if (drawPlayer.drippingSlime && shadow == 0f)
			{
				int alpha = 175;
				Color newColor = new Color(0, 80, 255, 100);
				if (Main.rand.Next(4) != 0)
				{
					Vector2 position2 = Position;
					position2.X -= 2f;
					position2.Y -= 2f;
					if (Main.rand.Next(2) == 0)
					{
						int num32 = Dust.NewDust(position2, drawPlayer.width + 4, drawPlayer.height + 2, 4, 0f, 0f, alpha, newColor, 1.4f);
						if (Main.rand.Next(2) == 0)
						{
							Main.dust[num32].alpha += 25;
						}
						if (Main.rand.Next(2) == 0)
						{
							Main.dust[num32].alpha += 25;
						}
						Main.dust[num32].noLight = true;
						Main.dust[num32].velocity *= 0.2f;
						Dust expr_141D_cp_0 = Main.dust[num32];
						expr_141D_cp_0.velocity.Y = expr_141D_cp_0.velocity.Y + 0.2f;
						Main.dust[num32].velocity += drawPlayer.velocity;
						Main.playerDrawDust.Add(num32);
					}
				}
				num22 *= 0.8f;
				num23 *= 0.8f;
			}
			if (drawPlayer.ichor)
			{
				num24 = 0f;
			}
			if (drawPlayer.burned)
			{
				int num33 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 2f);
				Main.dust[num33].noGravity = true;
				Main.dust[num33].velocity *= 1.8f;
				Dust expr_1528_cp_0 = Main.dust[num33];
				expr_1528_cp_0.velocity.Y = expr_1528_cp_0.velocity.Y - 0.75f;
				Main.playerDrawDust.Add(num33);
				num22 = 1f;
				num24 *= 0.6f;
				num23 *= 0.7f;
			}
			if (drawPlayer.onFrostBurn)
			{
				if (Main.rand.Next(4) == 0)
				{
					int num34 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 135, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
					Main.dust[num34].noGravity = true;
					Main.dust[num34].velocity *= 1.8f;
					Dust expr_1621_cp_0 = Main.dust[num34];
					expr_1621_cp_0.velocity.Y = expr_1621_cp_0.velocity.Y - 0.5f;
					Main.playerDrawDust.Add(num34);
				}
				num22 *= 0.5f;
				num23 *= 0.7f;
			}
			if (drawPlayer.onFire2)
			{
				if (Main.rand.Next(4) == 0)
				{
					int num35 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 75, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
					Main.dust[num35].noGravity = true;
					Main.dust[num35].velocity *= 1.8f;
					Dust expr_1710_cp_0 = Main.dust[num35];
					expr_1710_cp_0.velocity.Y = expr_1710_cp_0.velocity.Y - 0.5f;
					Main.playerDrawDust.Add(num35);
				}
				num24 *= 0.6f;
				num23 *= 0.7f;
			}
			if (drawPlayer.noItems)
			{
				num23 *= 0.8f;
				num22 *= 0.65f;
			}
			if (drawPlayer.blind)
			{
				num23 *= 0.65f;
				num22 *= 0.7f;
			}
			if (drawPlayer.bleed)
			{
				num23 *= 0.9f;
				num24 *= 0.9f;
				if (!drawPlayer.dead && Main.rand.Next(30) == 0)
				{
					int num36 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 5, 0f, 0f, 0, default(Color), 1f);
					Dust expr_17ED_cp_0 = Main.dust[num36];
					expr_17ED_cp_0.velocity.Y = expr_17ED_cp_0.velocity.Y + 0.5f;
					Main.dust[num36].velocity *= 0.25f;
					Main.playerDrawDust.Add(num36);
				}
			}
			if (shadow == 0f && drawPlayer.palladiumRegen && drawPlayer.statLife < drawPlayer.statLifeMax2 && base.IsActive && !Main.gamePaused && drawPlayer.miscCounter % 10 == 0)
			{
				Vector2 position3;
				position3.X = Position.X + (float)Main.rand.Next(drawPlayer.width);
				position3.Y = Position.Y + (float)Main.rand.Next(drawPlayer.height);
				position3.X = Position.X + (float)(drawPlayer.width / 2) - 6f;
				position3.Y = Position.Y + (float)(drawPlayer.height / 2) - 6f;
				position3.X -= (float)Main.rand.Next(-10, 11);
				position3.Y -= (float)Main.rand.Next(-20, 21);
				int num37 = Gore.NewGore(position3, new Vector2((float)Main.rand.Next(-10, 11) * 0.1f, (float)Main.rand.Next(-20, -10) * 0.1f), 331, (float)Main.rand.Next(80, 120) * 0.01f);
				Main.playerDrawGore.Add(num37);
			}
			if (shadow == 0f && drawPlayer.loveStruck && base.IsActive && !Main.gamePaused && Main.rand.Next(5) == 0)
			{
				Vector2 value = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
				value.Normalize();
				value.X *= 0.66f;
				int num38 = Gore.NewGore(Position + new Vector2((float)Main.rand.Next(drawPlayer.width + 1), (float)Main.rand.Next(drawPlayer.height + 1)), value * (float)Main.rand.Next(3, 6) * 0.33f, 331, (float)Main.rand.Next(40, 121) * 0.01f);
				Main.gore[num38].sticky = false;
				Main.gore[num38].velocity *= 0.4f;
				Gore expr_1AA9_cp_0 = Main.gore[num38];
				expr_1AA9_cp_0.velocity.Y = expr_1AA9_cp_0.velocity.Y - 0.6f;
				Main.playerDrawGore.Add(num38);
			}
			if (shadow == 0f && drawPlayer.stinky && base.IsActive && !Main.gamePaused)
			{
				num22 *= 0.7f;
				num24 *= 0.55f;
				if (Main.rand.Next(5) == 0)
				{
					Vector2 value2 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
					value2.Normalize();
					value2.X *= 0.66f;
					value2.Y = Math.Abs(value2.Y);
					Vector2 vector = value2 * (float)Main.rand.Next(3, 5) * 0.25f;
					int num39 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 188, vector.X, vector.Y * 0.5f, 100, default(Color), 1.5f);
					Main.dust[num39].velocity *= 0.1f;
					Dust expr_1BF0_cp_0 = Main.dust[num39];
					expr_1BF0_cp_0.velocity.Y = expr_1BF0_cp_0.velocity.Y - 0.5f;
					Main.playerDrawDust.Add(num39);
				}
			}
			if (num22 != 1f || num23 != 1f || num24 != 1f || num25 != 1f)
			{
				if (drawPlayer.onFire || drawPlayer.onFire2 || drawPlayer.onFrostBurn)
				{
					color2 = drawPlayer.GetImmuneAlpha(Color.White, shadow);
					color3 = drawPlayer.GetImmuneAlpha(drawPlayer.eyeColor, shadow);
					color = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(true), shadow);
					color4 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor, shadow);
					color5 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor, shadow);
					color7 = drawPlayer.GetImmuneAlpha(drawPlayer.shirtColor, shadow);
					color8 = drawPlayer.GetImmuneAlpha(drawPlayer.underShirtColor, shadow);
					color9 = drawPlayer.GetImmuneAlpha(drawPlayer.pantsColor, shadow);
					color10 = drawPlayer.GetImmuneAlpha(drawPlayer.shoeColor, shadow);
					color11 = drawPlayer.GetImmuneAlpha(Color.White, shadow);
					color12 = drawPlayer.GetImmuneAlpha(Color.White, shadow);
					color13 = drawPlayer.GetImmuneAlpha(Color.White, shadow);
				}
				else
				{
					color2 = Main.buffColor(color2, num22, num23, num24, num25);
					color3 = Main.buffColor(color3, num22, num23, num24, num25);
					color = Main.buffColor(color, num22, num23, num24, num25);
					color4 = Main.buffColor(color4, num22, num23, num24, num25);
					color5 = Main.buffColor(color5, num22, num23, num24, num25);
					color7 = Main.buffColor(color7, num22, num23, num24, num25);
					color8 = Main.buffColor(color8, num22, num23, num24, num25);
					color9 = Main.buffColor(color9, num22, num23, num24, num25);
					color10 = Main.buffColor(color10, num22, num23, num24, num25);
					color11 = Main.buffColor(color11, num22, num23, num24, num25);
					color12 = Main.buffColor(color12, num22, num23, num24, num25);
					color13 = Main.buffColor(color13, num22, num23, num24, num25);
				}
			}
			if (drawPlayer.socialGhost)
			{
				color2 = Color.Transparent;
				color3 = Color.Transparent;
				color = Color.Transparent;
				color4 = Color.Transparent;
				color5 = Color.Transparent;
				color7 = Color.Transparent;
				color8 = Color.Transparent;
				color9 = Color.Transparent;
				color10 = Color.Transparent;
				color6 = Color.Transparent;
				if (color11.A > Main.gFade)
				{
					color11.A = Main.gFade;
				}
				if (color12.A > Main.gFade)
				{
					color12.A = Main.gFade;
				}
				if (color13.A > Main.gFade)
				{
					color13.A = Main.gFade;
				}
			}
			float num40 = 1f;
			if (drawPlayer.armorSteath)
			{
				float num41 = drawPlayer.stealth;
				if ((double)num41 < 0.03)
				{
					num41 = 0.03f;
				}
				float num42 = (1f + num41 * 10f) / 11f;
				if (num41 < 0f)
				{
					num41 = 0f;
				}
				if (num41 >= 1f - shadow && shadow > 0f)
				{
					num41 = shadow * 0.5f;
				}
				num40 = num42;
				color11 = new Color((int)((byte)((float)color11.R * num41)), (int)((byte)((float)color11.G * num41)), (int)((byte)((float)color11.B * num42)), (int)((byte)((float)color11.A * num41)));
				color12 = new Color((int)((byte)((float)color12.R * num41)), (int)((byte)((float)color12.G * num41)), (int)((byte)((float)color12.B * num42)), (int)((byte)((float)color12.A * num41)));
				color13 = new Color((int)((byte)((float)color13.R * num41)), (int)((byte)((float)color13.G * num41)), (int)((byte)((float)color13.B * num42)), (int)((byte)((float)color13.A * num41)));
				num41 *= num41;
				color2 = Color.Multiply(color2, num41);
				color3 = Color.Multiply(color3, num41);
				color = Color.Multiply(color, num41);
				color4 = Color.Multiply(color4, num41);
				color5 = Color.Multiply(color5, num41);
				color7 = Color.Multiply(color7, num41);
				color8 = Color.Multiply(color8, num41);
				color9 = Color.Multiply(color9, num41);
				color10 = Color.Multiply(color10, num41);
				color6 = Color.Multiply(color6, num41);
			}
			if (drawPlayer.gravDir == 1f)
			{
				if (drawPlayer.direction == 1)
				{
					spriteEffects = SpriteEffects.None;
					effect = SpriteEffects.None;
				}
				else
				{
					spriteEffects = SpriteEffects.FlipHorizontally;
					effect = SpriteEffects.FlipHorizontally;
				}
				if (!drawPlayer.dead)
				{
					drawPlayer.legPosition.Y = 0f;
					drawPlayer.headPosition.Y = 0f;
					drawPlayer.bodyPosition.Y = 0f;
				}
			}
			else
			{
				if (drawPlayer.direction == 1)
				{
					spriteEffects = SpriteEffects.FlipVertically;
					effect = SpriteEffects.FlipVertically;
				}
				else
				{
					spriteEffects = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);
					effect = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);
				}
				if (!drawPlayer.dead)
				{
					drawPlayer.legPosition.Y = 6f;
					drawPlayer.headPosition.Y = 6f;
					drawPlayer.bodyPosition.Y = 6f;
				}
			}
			Vector2 vector2 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.75f);
			Vector2 origin = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.5f);
			Vector2 vector3 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.4f);
			if (drawPlayer.merman)
			{
				drawPlayer.headRotation = drawPlayer.velocity.Y * (float)drawPlayer.direction * 0.1f;
				if ((double)drawPlayer.headRotation < -0.3)
				{
					drawPlayer.headRotation = -0.3f;
				}
				if ((double)drawPlayer.headRotation > 0.3)
				{
					drawPlayer.headRotation = 0.3f;
				}
			}
			else
			{
				if (!drawPlayer.dead)
				{
					drawPlayer.headRotation = 0f;
				}
			}
			bool flag3 = false;
			if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106 || drawPlayer.head == 113 || drawPlayer.head == 116 || drawPlayer.head == 119 || drawPlayer.head == 133 || drawPlayer.head == 138 || drawPlayer.head == 139 || drawPlayer.head == 163)
			{
				flag3 = true;
			}
			bool flag4 = false;
			if (drawPlayer.head == 161 || drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69 || drawPlayer.head == 114 || drawPlayer.head == 121 || drawPlayer.head == 126 || drawPlayer.head == 130 || drawPlayer.head == 136 || drawPlayer.head == 140 || drawPlayer.head == 145 || drawPlayer.head == 158 || drawPlayer.head == 159)
			{
				flag4 = true;
			}
			bool flag5 = false;
			if (drawPlayer.face == 4 || drawPlayer.face == 3 || drawPlayer.face == 2)
			{
				flag5 = true;
			}
			Rectangle bodyFrame = drawPlayer.bodyFrame;
			bodyFrame.Y -= 336;
			if (bodyFrame.Y < 0)
			{
				bodyFrame.Y = 0;
			}
			int height = 26;
			int hair = drawPlayer.hair;
			if (flag5)
			{
				bodyFrame.Height = 0;
			}
			else
			{
				if (hair > 50 && (hair < 56 || hair > 63) && (hair < 74 || hair > 77) && (hair < 88 || hair > 89) && hair != 94 && hair != 100 && hair != 104 && hair != 112 && hair < 116)
				{
					if (drawPlayer.head == -1 || flag3 || drawPlayer.head == 23 || drawPlayer.head == 0)
					{
						DrawData value3 = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					else
					{
						if (flag4)
						{
							DrawData value3 = new DrawData(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
							Main.playerDrawData.Add(value3);
						}
					}
					if (drawPlayer.gravDir == 1f)
					{
						bodyFrame.Height = height;
					}
				}
			}
			if (drawPlayer.mount.Active)
			{
				int num43 = drawPlayer.mount.XOffset;
				int num44 = drawPlayer.mount.YOffset + (int)num3;
				if (drawPlayer.direction <= 0)
				{
					num43 *= -1;
				}
				Texture2D texture2D = drawPlayer.mount.BackTexture;
				if (texture2D != null)
				{
					DrawData value3 = new DrawData(texture2D, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num43)), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num44))), new Rectangle?(drawPlayer.mount.FrameRect), color12, drawPlayer.bodyRotation, drawPlayer.mount.Origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
				texture2D = drawPlayer.mount.BackTextureExtra;
				if (texture2D != null && shadow == 0f)
				{
					DrawData value3 = new DrawData(texture2D, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num43)), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num44))), new Rectangle?(drawPlayer.mount.FrameRectExtra), color12, drawPlayer.bodyRotation, drawPlayer.mount.Origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.carpetFrame >= 0)
			{
				Color color14 = color13;
				float num45 = 0f;
				if (drawPlayer.gravDir == -1f)
				{
					num45 = 10f;
				}
				DrawData value3 = new DrawData(Main.flyingCarpetTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 28f * drawPlayer.gravDir + num45))), new Rectangle?(new Rectangle(0, Main.flyingCarpetTexture.Height / 6 * drawPlayer.carpetFrame, Main.flyingCarpetTexture.Width, Main.flyingCarpetTexture.Height / 6)), color14, drawPlayer.bodyRotation, new Vector2((float)(Main.flyingCarpetTexture.Width / 2), (float)(Main.flyingCarpetTexture.Height / 8)), 1f, spriteEffects, 0);
				value3.shader = num18;
				Main.playerDrawData.Add(value3);
			}
			bool flag6 = false;
			if ((drawPlayer.wings == 0 || drawPlayer.velocity.Y == 0f) && (drawPlayer.inventory[drawPlayer.selectedItem].type == 1178 || drawPlayer.inventory[drawPlayer.selectedItem].type == 779 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1295 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1910 || drawPlayer.turtleArmor || drawPlayer.body == 106 || drawPlayer.body == 170))
			{
				flag6 = true;
				int type = drawPlayer.inventory[drawPlayer.selectedItem].type;
				int num46 = 1;
				float num47 = -4f;
				float num48 = -8f;
				int shader = 0;
				if (drawPlayer.turtleArmor)
				{
					num46 = 4;
					shader = num5;
				}
				else
				{
					if (drawPlayer.body == 106)
					{
						num46 = 6;
						shader = num5;
					}
					else
					{
						if (drawPlayer.body == 170)
						{
							num46 = 7;
							shader = num5;
						}
						else
						{
							if (type == 1178)
							{
								num46 = 1;
							}
							else
							{
								if (type == 779)
								{
									num46 = 2;
								}
								else
								{
									if (type == 1295)
									{
										num46 = 3;
									}
									else
									{
										if (type == 1910)
										{
											num46 = 5;
										}
									}
								}
							}
						}
					}
				}
				if (num46 == 7)
				{
					DrawData value3 = new DrawData(Main.BackPackTexture[num46], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, drawPlayer.bodyFrame.Y, Main.BackPackTexture[num46].Width, drawPlayer.bodyFrame.Height)), color12, drawPlayer.bodyRotation, new Vector2((float)Main.BackPackTexture[num46].Width * 0.5f, origin.Y), 1f, spriteEffects, 0);
					value3.shader = shader;
					Main.playerDrawData.Add(value3);
				}
				else
				{
					if (num46 == 4 || num46 == 6)
					{
						DrawData value3 = new DrawData(Main.BackPackTexture[num46], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						value3.shader = shader;
						Main.playerDrawData.Add(value3);
					}
					else
					{
						DrawData value3 = new DrawData(Main.BackPackTexture[num46], new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction))) + num47 * (float)drawPlayer.direction, (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + num48 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, 0, Main.BackPackTexture[num46].Width, Main.BackPackTexture[num46].Height)), color12, drawPlayer.bodyRotation, new Vector2((float)(Main.BackPackTexture[num46].Width / 2), (float)(Main.BackPackTexture[num46].Height / 2)), 1f, spriteEffects, 0);
						value3.shader = shader;
						Main.playerDrawData.Add(value3);
					}
				}
			}
			if (!flag6 && drawPlayer.back > 0 && drawPlayer.back < 8 && !drawPlayer.mount.Active)
			{
				if (drawPlayer.front >= 1 && drawPlayer.front <= 4)
				{
					int num49 = drawPlayer.bodyFrame.Y / 56;
					if (num49 < 1 || num49 > 5)
					{
						num2 = 10;
					}
					else
					{
						if (drawPlayer.front == 1)
						{
							num2 = 0;
						}
						if (drawPlayer.front == 2)
						{
							num2 = 8;
						}
						if (drawPlayer.front == 3)
						{
							num2 = 0;
						}
						if (drawPlayer.front == 4)
						{
							num2 = 8;
						}
					}
				}
				DrawData value3 = new DrawData(Main.accBackTexture[(int)drawPlayer.back], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				value3.shader = num9;
				Main.playerDrawData.Add(value3);
			}
			Position.Y += num3 / 2f;
			if (!flag6 && drawPlayer.wings > 0)
			{
				this.LoadWings(drawPlayer.wings);
				if (drawPlayer.wings == 22)
				{
					if ((drawPlayer.velocity.Y != 0f || drawPlayer.grappling[0] != -1) && !drawPlayer.mount.Active)
					{
						this.LoadItemFlames(1866);
						Color color15 = color12;
						int num50 = 24;
						int num51 = 0;
						DrawData value3;
						if (shadow == 0f && drawPlayer.grappling[0] == -1)
						{
							for (int j = 0; j < 7; j++)
							{
								Color color16 = new Color(250 - j * 10, 250 - j * 10, 250 - j * 10, 150 - j * 10);
								Vector2 vector4 = new Vector2((float)Main.rand.Next(-10, 11) * 0.2f, (float)Main.rand.Next(-10, 11) * 0.2f);
								num40 *= num40;
								num40 *= 1f - shadow;
								color16 = new Color((int)((float)color16.R * num40), (int)((float)color16.G * num40), (int)((float)color16.B * num40), (int)((float)color16.A * num40));
								vector4.X = drawPlayer.itemFlamePos[j].X;
								vector4.Y = -drawPlayer.itemFlamePos[j].Y;
								vector4 *= 0.5f;
								value3 = new DrawData(Main.itemFlameTexture[1866], new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num51 * drawPlayer.direction), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num50 * drawPlayer.gravDir))) + vector4, new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 7 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 7 - 2)), color16, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 14)), 1f, spriteEffects, 0);
								value3.shader = num17;
								Main.playerDrawData.Add(value3);
							}
						}
						value3 = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num51 * drawPlayer.direction), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num50 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 7 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 7)), color15, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 14)), 1f, spriteEffects, 0);
						value3.shader = num17;
						Main.playerDrawData.Add(value3);
					}
				}
				else
				{
					int num52 = 0;
					int num53 = 0;
					if (drawPlayer.wings == 5)
					{
						num53 = 4;
						num52 -= 4;
					}
					Color color17 = color12;
					if (drawPlayer.wings == 9)
					{
						num40 *= num40;
						num40 *= 1f - shadow;
						color17 = new Color((int)(250f * num40), (int)(250f * num40), (int)(250f * num40), (int)(100f * num40));
					}
					if (drawPlayer.wings == 10)
					{
						num40 *= num40;
						num40 *= 1f - shadow;
						color17 = new Color((int)(250f * num40), (int)(250f * num40), (int)(250f * num40), (int)(175f * num40));
					}
					if (drawPlayer.wings == 11 && color17.A > Main.gFade)
					{
						color17.A = Main.gFade;
					}
					DrawData value3 = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num53 * drawPlayer.direction), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num52 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color17, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0);
					value3.shader = num17;
					Main.playerDrawData.Add(value3);
					if (drawPlayer.wings == 23)
					{
						num40 *= num40;
						num40 *= 1f - shadow;
						color17 = new Color((int)(200f * num40), (int)(200f * num40), (int)(200f * num40), (int)(200f * num40));
						value3 = new DrawData(Main.FlameTexture[8], new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num53 * drawPlayer.direction), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num52 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color17, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0);
						value3.shader = num17;
						Main.playerDrawData.Add(value3);
					}
				}
			}
			if (drawPlayer.balloon > 0)
			{
				int num54 = DateTime.Now.Millisecond % 800 / 200;
				Vector2 vector5 = Main.offHandOffsets[drawPlayer.bodyFrame.Y / 56];
				if (drawPlayer.direction != 1)
				{
					vector5.X = (float)drawPlayer.width - vector5.X;
				}
				if (drawPlayer.gravDir != 1f)
				{
					vector5.Y -= (float)drawPlayer.height;
				}
				DrawData value3 = new DrawData(Main.accBalloonTexture[(int)drawPlayer.balloon], new Vector2((float)((int)(Position.X - Main.screenPosition.X + vector5.X)), (float)((int)(Position.Y - Main.screenPosition.Y + vector5.Y * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.accBalloonTexture[(int)drawPlayer.balloon].Height / 4 * num54, Main.accBalloonTexture[(int)drawPlayer.balloon].Width, Main.accBalloonTexture[(int)drawPlayer.balloon].Height / 4)), color12, drawPlayer.bodyRotation, new Vector2((float)(26 + drawPlayer.direction * 4), 28f + drawPlayer.gravDir * 6f), 1f, spriteEffects, 0);
				value3.shader = num16;
				Main.playerDrawData.Add(value3);
			}
			Position.Y -= num3 / 2f;
			if (!drawPlayer.invis && drawPlayer.body != 83 && drawPlayer.body != 82 && drawPlayer.body != 93)
			{
				DrawData value3 = new DrawData(Main.skinBodyTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
				if (drawPlayer.legs != 67 && drawPlayer.legs != 106 && drawPlayer.shoe != 15)
				{
					value3 = new DrawData(Main.skinLegsTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.legFrame), color6, drawPlayer.legRotation, origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.wearsRobe)
			{
				goto IL_3CA6;
			}
			IL_38CB:
			if (drawPlayer.legs > 0 && drawPlayer.legs < 110 && (drawPlayer.shoe != 15 || drawPlayer.wearsRobe))
			{
				if (!drawPlayer.invis || (drawPlayer.legs != 20 && drawPlayer.legs != 21))
				{
					DrawData value3 = new DrawData(Main.armorLegTexture[drawPlayer.legs], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(drawPlayer.legFrame), color13, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
					value3.shader = num6;
					Main.playerDrawData.Add(value3);
				}
			}
			else
			{
				if (!drawPlayer.invis && drawPlayer.shoe != 15)
				{
					if (!drawPlayer.male)
					{
						DrawData value3 = new DrawData(Main.femalePantsTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
						value3 = new DrawData(Main.femaleShoesTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(drawPlayer.legFrame), color10, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					else
					{
						DrawData value3 = new DrawData(Main.playerPantsTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
						value3 = new DrawData(Main.playerShoesTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(drawPlayer.legFrame), color10, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
				}
			}
			if (drawPlayer.wearsRobe)
			{
				goto IL_3D81;
			}
			IL_3CA6:
			if (drawPlayer.shoe > 0 && drawPlayer.shoe < 16)
			{
				DrawData value3 = new DrawData(Main.accShoesTexture[(int)drawPlayer.shoe], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(drawPlayer.legFrame), color13, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
				value3.shader = num11;
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.wearsRobe)
			{
				goto IL_38CB;
			}
			IL_3D81:
			if (drawPlayer.body > 0 && drawPlayer.body < 175)
			{
				Rectangle bodyFrame2 = drawPlayer.bodyFrame;
				int num55 = num2;
				bodyFrame2.X += num55;
				bodyFrame2.Width -= num55;
				if (drawPlayer.direction == -1)
				{
					num55 = 0;
				}
				if (!drawPlayer.invis || (drawPlayer.body != 21 && drawPlayer.body != 22))
				{
					if (!drawPlayer.male)
					{
						DrawData value3 = new DrawData(Main.femaleBodyTexture[drawPlayer.body], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2)) + num55), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame2), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						value3.shader = num5;
						Main.playerDrawData.Add(value3);
					}
					else
					{
						DrawData value3 = new DrawData(Main.armorBodyTexture[drawPlayer.body], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2)) + num55), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame2), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						value3.shader = num5;
						Main.playerDrawData.Add(value3);
					}
				}
				if (flag && !drawPlayer.invis)
				{
					DrawData value3 = new DrawData(Main.playerHandsTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			else
			{
				if (!drawPlayer.invis)
				{
					DrawData value3;
					if (!drawPlayer.male)
					{
						value3 = new DrawData(Main.femaleUnderShirtTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
						value3 = new DrawData(Main.femaleShirtTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					else
					{
						value3 = new DrawData(Main.playerUnderShirtTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
						value3 = new DrawData(Main.playerShirtTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					value3 = new DrawData(Main.playerHandsTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.handoff > 0 && drawPlayer.handoff < 11)
			{
				DrawData value3 = new DrawData(Main.accHandsOffTexture[(int)drawPlayer.handoff], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				value3.shader = num8;
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.waist > 0 && drawPlayer.waist < 11)
			{
				Rectangle legFrame = drawPlayer.legFrame;
				if (legFrame.Y >= 1064)
				{
					legFrame.Y = 0;
				}
				DrawData value3 = new DrawData(Main.accWaistTexture[(int)drawPlayer.waist], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector2, new Rectangle?(legFrame), color13, drawPlayer.legRotation, vector2, 1f, spriteEffects, 0);
				value3.shader = num12;
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.neck > 0 && drawPlayer.neck < 7)
			{
				DrawData value3 = new DrawData(Main.accNeckTexture[(int)drawPlayer.neck], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				value3.shader = num14;
				Main.playerDrawData.Add(value3);
			}
			if (!drawPlayer.invis && drawPlayer.head != 38 && drawPlayer.head != 135)
			{
				DrawData value3 = new DrawData(Main.playerHeadTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
				value3 = new DrawData(Main.playerEyeWhitesTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
				value3 = new DrawData(Main.playerEyesTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color3, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
			}
			if (flag3)
			{
				DrawData value3 = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				value3.shader = num4;
				Main.playerDrawData.Add(value3);
				if (!drawPlayer.invis)
				{
					value3 = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (flag4 && !drawPlayer.invis)
			{
				DrawData value3 = new DrawData(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.head == 23)
			{
				DrawData value3;
				if (!drawPlayer.invis)
				{
					value3 = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
				value3 = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				value3.shader = num4;
				Main.playerDrawData.Add(value3);
			}
			else
			{
				if (drawPlayer.head == 14 || drawPlayer.head == 56 || drawPlayer.head == 114 || drawPlayer.head == 158 || drawPlayer.head == 69)
				{
					Rectangle bodyFrame3 = drawPlayer.bodyFrame;
					Vector2 origin2 = vector3;
					if (drawPlayer.gravDir == 1f)
					{
						if (bodyFrame3.Y != 0)
						{
							bodyFrame3.Y -= 2;
							bodyFrame3.Height -= 8;
							origin2.Y += 2f;
						}
					}
					else
					{
						if (bodyFrame3.Y != 0)
						{
							bodyFrame3.Y -= 2;
							origin2.Y -= 10f;
							bodyFrame3.Height -= 8;
						}
					}
					DrawData value3 = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame3), color11, drawPlayer.headRotation, origin2, 1f, spriteEffects, 0);
					value3.shader = num4;
					Main.playerDrawData.Add(value3);
				}
				else
				{
					if (drawPlayer.head > 0 && drawPlayer.head < 169 && drawPlayer.head != 28)
					{
						if (!drawPlayer.invis || (drawPlayer.head != 39 && drawPlayer.head != 38))
						{
							if (drawPlayer.head > 0 && drawPlayer.head < 169)
							{
								this.LoadArmorHead(drawPlayer.head);
							}
							DrawData value3 = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
							value3.shader = num4;
							Main.playerDrawData.Add(value3);
						}
					}
					else
					{
						if (!drawPlayer.invis && drawPlayer.face != 3 && drawPlayer.face != 2 && drawPlayer.face != 4)
						{
							DrawData value3 = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
							Main.playerDrawData.Add(value3);
						}
					}
				}
			}
			if (drawPlayer.head == 137)
			{
				DrawData value3 = new DrawData(Main.jackHatTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), new Color(255, 255, 255, 255), drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
				for (int k = 0; k < 7; k++)
				{
					Color color18 = new Color(110 - k * 10, 110 - k * 10, 110 - k * 10, 110 - k * 10);
					Vector2 vector6 = new Vector2((float)Main.rand.Next(-10, 11) * 0.2f, (float)Main.rand.Next(-10, 11) * 0.2f);
					vector6.X = drawPlayer.itemFlamePos[k].X;
					vector6.Y = drawPlayer.itemFlamePos[k].Y;
					vector6 *= 0.5f;
					value3 = new DrawData(Main.jackHatTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3 + vector6, new Rectangle?(drawPlayer.bodyFrame), color18, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.face > 0 && drawPlayer.face < 9)
			{
				if (drawPlayer.face == 7)
				{
					DrawData value3 = new DrawData(Main.accFaceTexture[(int)drawPlayer.face], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), new Color(200, 200, 200, 150), drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
					value3.shader = num15;
					Main.playerDrawData.Add(value3);
				}
				else
				{
					DrawData value3 = new DrawData(Main.accFaceTexture[(int)drawPlayer.face], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector3, new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, vector3, 1f, spriteEffects, 0);
					value3.shader = num15;
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.mount.Active)
			{
				int num56 = drawPlayer.mount.XOffset;
				int num57 = drawPlayer.mount.YOffset + (int)num3;
				if (drawPlayer.direction <= 0 && drawPlayer.mount.Type != 6)
				{
					num56 *= -1;
				}
				Texture2D texture2D2 = drawPlayer.mount.FrontTexture;
				SpriteEffects effect2;
				if (drawPlayer.mount.Type == 6)
				{
					effect2 = (drawPlayer.mount.FlipDraw ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
				}
				else
				{
					effect2 = spriteEffects;
				}
				if (texture2D2 != null)
				{
					DrawData value3 = new DrawData(texture2D2, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num56)), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num57))), new Rectangle?(drawPlayer.mount.FrameRect), color12, drawPlayer.bodyRotation, drawPlayer.mount.Origin, 1f, effect2, 0);
					Main.playerDrawData.Add(value3);
				}
				texture2D2 = drawPlayer.mount.FrontTextureExtra;
				if (texture2D2 != null && shadow == 0f)
				{
					DrawData value3 = new DrawData(texture2D2, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num56)), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num57))), new Rectangle?(drawPlayer.mount.FrameRect), Color.White, drawPlayer.bodyRotation, drawPlayer.mount.Origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.pulley && drawPlayer.itemAnimation == 0)
			{
				if (drawPlayer.pulleyDir == 2)
				{
					int num58 = -26;
					int num59 = 0;
					float rotation2 = 0f;
					DrawData value3 = new DrawData(Main.pulleyTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num59 * drawPlayer.direction), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num58 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color11, rotation2, new Vector2((float)(Main.pulleyTexture.Width / 2), (float)(Main.pulleyTexture.Height / 4)), 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
				else
				{
					int num60 = -26;
					int num61 = 10;
					float rotation3 = 0.35f * (float)(-(float)drawPlayer.direction);
					DrawData value3 = new DrawData(Main.pulleyTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num61 * drawPlayer.direction), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num60 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color11, rotation3, new Vector2((float)(Main.pulleyTexture.Width / 2), (float)(Main.pulleyTexture.Height / 4)), 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.shield > 0 && drawPlayer.shield < 5)
			{
				DrawData value3 = new DrawData(Main.accShieldTexture[(int)drawPlayer.shield], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				value3.shader = num13;
				Main.playerDrawData.Add(value3);
				if (drawPlayer.mount.Type == 6)
				{
					Main.playerDrawData.Reverse(Main.playerDrawData.Count - 2, 2);
				}
			}
			if (drawPlayer.heldProj >= 0)
			{
				num = Main.playerDrawData.Count;
			}
			Color newColor2 = Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0));
			if (drawPlayer.inventory[drawPlayer.selectedItem].type == 678)
			{
				newColor2 = Color.White;
			}
			if (drawPlayer.armorSteath && drawPlayer.inventory[drawPlayer.selectedItem].ranged)
			{
				float num62 = drawPlayer.stealth;
				if ((double)num62 < 0.03)
				{
					num62 = 0.03f;
				}
				float num63 = (1f + num62 * 10f) / 11f;
				newColor2 = new Color((int)((byte)((float)newColor2.R * num62)), (int)((byte)((float)newColor2.G * num62)), (int)((byte)((float)newColor2.B * num63)), (int)((byte)((float)newColor2.A * num62)));
			}
			if (!drawPlayer.frozen && (drawPlayer.itemAnimation > 0 || (drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley && !drawPlayer.mount.Active)) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet))
			{
				string arg_5AFB_0 = drawPlayer.name;
				if (drawPlayer.inventory[drawPlayer.selectedItem].type == 662 || drawPlayer.inventory[drawPlayer.selectedItem].type == 663)
				{
					newColor2.R = (byte)Main.DiscoR;
					newColor2.G = (byte)Main.DiscoG;
					newColor2.B = (byte)Main.DiscoB;
					newColor2.A = 255;
				}
				if (drawPlayer.inventory[drawPlayer.selectedItem].useStyle == 5)
				{
					if (drawPlayer.inventory[drawPlayer.selectedItem].type == 2188 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1308 || drawPlayer.inventory[drawPlayer.selectedItem].type == 683 || drawPlayer.inventory[drawPlayer.selectedItem].type == 723 || drawPlayer.inventory[drawPlayer.selectedItem].type == 726 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1801 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1931 || (drawPlayer.inventory[drawPlayer.selectedItem].type >= 739 && drawPlayer.inventory[drawPlayer.selectedItem].type <= 744) || drawPlayer.inventory[drawPlayer.selectedItem].type == 788 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1326 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1444 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1445 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1446 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1930)
					{
						float num64 = drawPlayer.itemRotation + 0.785f * (float)drawPlayer.direction;
						int num65 = 0;
						int num66 = 0;
						Vector2 zero = new Vector2(0f, (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height);
						if (drawPlayer.gravDir == -1f)
						{
							if (drawPlayer.direction == -1)
							{
								num64 += 1.57f;
								zero = new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, 0f);
								num65 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width;
							}
							else
							{
								num64 -= 1.57f;
								zero = Vector2.Zero;
							}
						}
						else
						{
							if (drawPlayer.direction == -1)
							{
								zero = new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height);
								num65 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width;
							}
						}
						DrawData value3 = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(Position.X + (float)(drawPlayer.width / 2) - Main.screenPosition.X + zero.X + (float)num65)), (float)((int)(Position.Y + (float)(drawPlayer.height / 2) - Main.screenPosition.Y + (float)num66))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor2), num64, zero, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
						Main.playerDrawData.Add(value3);
					}
					else
					{
						Vector2 vector7 = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width / 2), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
						Vector2 vector8 = this.DrawPlayerItemPos(drawPlayer);
						int num67 = (int)vector8.X;
						vector7.Y = vector8.Y;
						Vector2 origin3 = new Vector2((float)(-(float)num67), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
						if (drawPlayer.direction == -1)
						{
							origin3 = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width + num67), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
						}
						DrawData value3 = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + vector7.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + vector7.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor2), drawPlayer.itemRotation, origin3, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
						Main.playerDrawData.Add(value3);
						if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color))
						{
							value3 = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + vector7.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + vector7.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor2), drawPlayer.itemRotation, origin3, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
							Main.playerDrawData.Add(value3);
						}
					}
				}
				else
				{
					if (drawPlayer.gravDir == -1f)
					{
						DrawData value3 = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor2), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
						Main.playerDrawData.Add(value3);
						if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color))
						{
							value3 = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor2), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
							Main.playerDrawData.Add(value3);
						}
					}
					else
					{
						if (drawPlayer.inventory[drawPlayer.selectedItem].type == 425 || drawPlayer.inventory[drawPlayer.selectedItem].type == 507)
						{
							if (drawPlayer.gravDir == 1f)
							{
								if (drawPlayer.direction == 1)
								{
									effect = SpriteEffects.FlipVertically;
								}
								else
								{
									effect = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);
								}
							}
							else
							{
								if (drawPlayer.direction == 1)
								{
									effect = SpriteEffects.None;
								}
								else
								{
									effect = SpriteEffects.FlipHorizontally;
								}
							}
						}
						int type2 = drawPlayer.inventory[drawPlayer.selectedItem].type;
						DrawData value3 = new DrawData(Main.itemTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor2), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
						Main.playerDrawData.Add(value3);
						if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color))
						{
							value3 = new DrawData(Main.itemTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor2), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
							Main.playerDrawData.Add(value3);
						}
						if (drawPlayer.inventory[drawPlayer.selectedItem].flame && shadow == 0f)
						{
							try
							{
								this.LoadItemFlames(type2);
								if (Main.itemFlameTexture[type2] != null)
								{
									for (int l = 0; l < 7; l++)
									{
										float x = drawPlayer.itemFlamePos[l].X;
										float y = drawPlayer.itemFlamePos[l].Y;
										value3 = new DrawData(Main.itemFlameTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)) + x, (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y)) + y), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), new Color(100, 100, 100, 0), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
										Main.playerDrawData.Add(value3);
									}
								}
							}
							catch
							{
							}
						}
					}
				}
			}
			if (drawPlayer.body > 0 && drawPlayer.body < 175)
			{
				Rectangle bodyFrame4 = drawPlayer.bodyFrame;
				int num68 = num2;
				bodyFrame4.X += num68;
				bodyFrame4.Width -= num68;
				if (drawPlayer.direction == -1)
				{
					num68 = 0;
				}
				if (!drawPlayer.invis || (drawPlayer.body != 21 && drawPlayer.body != 22))
				{
					DrawData value3;
					if (flag && !drawPlayer.invis)
					{
						int arg_690A_0 = drawPlayer.body;
						if (flag2)
						{
							value3 = new DrawData(Main.skinArmTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
							Main.playerDrawData.Add(value3);
						}
						value3 = new DrawData(Main.playerHands2Texture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					if (drawPlayer.body > 0 && drawPlayer.body < 175)
					{
						this.LoadArmorBody(drawPlayer.body);
					}
					value3 = new DrawData(Main.armorArmTexture[drawPlayer.body], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2)) + num68), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame4), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
					value3.shader = num5;
					Main.playerDrawData.Add(value3);
				}
			}
			else
			{
				if (!drawPlayer.invis)
				{
					DrawData value3;
					if (!drawPlayer.male)
					{
						value3 = new DrawData(Main.femaleUnderShirt2Texture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
						value3 = new DrawData(Main.femaleShirt2Texture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					else
					{
						value3 = new DrawData(Main.playerUnderShirt2Texture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					value3 = new DrawData(Main.playerHands2Texture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (drawPlayer.handon > 0 && drawPlayer.handon < 18)
			{
				DrawData value3 = new DrawData(Main.accHandsOnTexture[(int)drawPlayer.handon], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				value3.shader = num7;
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1827 && !drawPlayer.frozen && (drawPlayer.itemAnimation > 0 || (drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley)) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet))
			{
				if (drawPlayer.gravDir == -1f)
				{
					DrawData value3 = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor2), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
					Main.playerDrawData.Add(value3);
				}
				else
				{
					int type3 = drawPlayer.inventory[drawPlayer.selectedItem].type;
					DrawData value3 = new DrawData(Main.itemTexture[type3], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type3].Width, Main.itemTexture[type3].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor2), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type3].Width * 0.5f - (float)Main.itemTexture[type3].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type3].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (!flag6 && drawPlayer.front > 0 && drawPlayer.front < 5 && !drawPlayer.mount.Active)
			{
				DrawData value3 = new DrawData(Main.accFrontTexture[(int)drawPlayer.front], new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0);
				value3.shader = num10;
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.frozen)
			{
				Color color19 = color12;
				color19.R = (byte)((double)color19.R * 0.55);
				color19.G = (byte)((double)color19.G * 0.55);
				color19.B = (byte)((double)color19.B * 0.55);
				color19.A = (byte)((double)color19.A * 0.55);
				DrawData value3 = new DrawData(Main.frozenTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, 0, Main.frozenTexture.Width, Main.frozenTexture.Height)), color19, drawPlayer.bodyRotation, new Vector2((float)(Main.frozenTexture.Width / 2), (float)(Main.frozenTexture.Height / 2)), 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.iceBarrier && shadow == 0f)
			{
				int num69 = this.iceBarrierTexture.Height / 12;
				Color white = Color.White;
				DrawData value3 = new DrawData(this.iceBarrierTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, num69 * (int)drawPlayer.iceBarrierFrame, this.iceBarrierTexture.Width, num69)), white, 0f, new Vector2((float)(Main.frozenTexture.Width / 2), (float)(Main.frozenTexture.Height / 2)), 1f, spriteEffects, 0);
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.gem >= 0 && shadow == 0f)
			{
				DrawData value3 = new DrawData(Main.gemTexture[drawPlayer.gem], new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)drawPlayer.height - 80f))), new Rectangle?(new Rectangle(0, 0, Main.gemTexture[drawPlayer.gem].Width, Main.gemTexture[drawPlayer.gem].Height)), new Color(250, 250, 250, (int)(Main.mouseTextColor / 2)), 0f, new Vector2((float)(Main.gemTexture[drawPlayer.gem].Width / 2), (float)(Main.gemTexture[drawPlayer.gem].Height / 2)), (float)Main.mouseTextColor / 1000f + 0.8f, SpriteEffects.None, 0);
				Main.playerDrawData.Add(value3);
			}
			if (drawPlayer.beetleOffense || drawPlayer.beetleDefense)
			{
				for (int m = 0; m < drawPlayer.beetleOrbs; m++)
				{
					DrawData value3;
					for (int n = 0; n < 5; n++)
					{
						Color color20 = color12;
						float num70 = (float)n * 0.1f;
						num70 = 0.5f - num70;
						color20.R = (byte)((float)color20.R * num70);
						color20.G = (byte)((float)color20.G * num70);
						color20.B = (byte)((float)color20.B * num70);
						color20.A = (byte)((float)color20.A * num70);
						Vector2 value4 = -drawPlayer.beetleVel[m] * (float)n;
						value3 = new DrawData(Main.beetleTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2)))) + drawPlayer.beetlePos[m] + value4, new Rectangle?(new Rectangle(0, Main.beetleTexture.Height / 3 * drawPlayer.beetleFrame + 1, Main.beetleTexture.Width, Main.beetleTexture.Height / 3 - 2)), color20, 0f, new Vector2((float)(Main.beetleTexture.Width / 2), (float)(Main.beetleTexture.Height / 6)), 1f, spriteEffects, 0);
						Main.playerDrawData.Add(value3);
					}
					value3 = new DrawData(Main.beetleTexture, new Vector2((float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2)))) + drawPlayer.beetlePos[m], new Rectangle?(new Rectangle(0, Main.beetleTexture.Height / 3 * drawPlayer.beetleFrame + 1, Main.beetleTexture.Width, Main.beetleTexture.Height / 3 - 2)), color12, 0f, new Vector2((float)(Main.beetleTexture.Width / 2), (float)(Main.beetleTexture.Height / 6)), 1f, spriteEffects, 0);
					Main.playerDrawData.Add(value3);
				}
			}
			if (rotation != 0f)
			{
				Vector2 value5 = Position - Main.screenPosition + rotationOrigin;
				Vector2 value6 = drawPlayer.position + rotationOrigin;
				Matrix matrix = Matrix.CreateRotationZ(rotation);
				for (int num71 = 0; num71 < Main.playerDrawDust.Count; num71++)
				{
					Vector2 vector9 = Main.dust[Main.playerDrawDust[num71]].position - value6;
					vector9 = Vector2.Transform(vector9, matrix);
					Main.dust[Main.playerDrawDust[num71]].position = vector9 + value6;
				}
				for (int num72 = 0; num72 < Main.playerDrawGore.Count; num72++)
				{
					Vector2 vector10 = Main.gore[Main.playerDrawGore[num72]].position - value6;
					vector10 = Vector2.Transform(vector10, matrix);
					Main.gore[Main.playerDrawGore[num72]].position = vector10 + value6;
				}
				for (int num73 = 0; num73 < Main.playerDrawData.Count; num73++)
				{
					DrawData value3 = Main.playerDrawData[num73];
					Vector2 vector11 = value3.position - value5;
					vector11 = Vector2.Transform(vector11, matrix);
					value3.position = vector11 + value5;
					value3.rotation += rotation;
					Main.playerDrawData[num73] = value3;
				}
			}
			int num74 = -1;
			for (int num75 = 0; num75 < Main.playerDrawData.Count; num75++)
			{
				if (num == num75)
				{
					if (num74 != 0)
					{
						Main.pixelShader.CurrentTechnique.Passes[0].Apply();
						num74 = 0;
					}
					Main.projectile[drawPlayer.heldProj].gfxOffY = drawPlayer.gfxOffY;
					this.DrawProj(drawPlayer.heldProj);
				}
				DrawData value3 = Main.playerDrawData[num75];
				if (num74 != value3.shader)
				{
					Main.pixelShader.CurrentTechnique.Passes[value3.shader].Apply();
				}
				value3.Draw(Main.spriteBatch);
			}
			Main.pixelShader.CurrentTechnique.Passes[0].Apply();
			drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y - drawPlayer.gfxOffY;
		}
コード例 #3
0
ファイル: Main.cs プロジェクト: TerrariaJava/ExecutableSRC
 protected void DrawPlayer(Player drawPlayer)
 {
     int num = 0;
     bool flag = false;
     bool flag2 = false;
     if (drawPlayer.body == 77 || drawPlayer.body == 103 || drawPlayer.body == 41 || drawPlayer.body == 100 || drawPlayer.body == 10 || drawPlayer.body == 11 || drawPlayer.body == 12 || drawPlayer.body == 13 || drawPlayer.body == 14 || drawPlayer.body == 43 || drawPlayer.body == 15 || drawPlayer.body == 16 || drawPlayer.body == 20 || drawPlayer.body == 39 || drawPlayer.body == 50 || drawPlayer.body == 38 || drawPlayer.body == 40 || drawPlayer.body == 57 || drawPlayer.body == 44 || drawPlayer.body == 52 || drawPlayer.body == 53 || drawPlayer.body == 68 || drawPlayer.body == 81 || drawPlayer.body == 85 || drawPlayer.body == 88 || drawPlayer.body == 98 || drawPlayer.body == 86 || drawPlayer.body == 87 || drawPlayer.body == 99 || drawPlayer.body == 165 || drawPlayer.body == 166 || drawPlayer.body == 167)
     {
         flag = true;
     }
     if (drawPlayer.body == 99 || drawPlayer.body == 98 || drawPlayer.body == 100 || drawPlayer.body == 167)
     {
         flag2 = true;
     }
     float num2 = 0f;
     if (drawPlayer.mount == 1)
     {
         num2 = 30f;
         if (drawPlayer.mountFrame == 1)
         {
             num2 += 2f;
         }
         if (drawPlayer.mountFrame == 11)
         {
             num2 += 2f;
         }
     }
     drawPlayer.position.Y = drawPlayer.position.Y - num2;
     int num3 = 0;
     if (drawPlayer.dye[0] != null)
     {
         num3 = (int)drawPlayer.dye[0].dye;
     }
     int num4 = 0;
     if (drawPlayer.dye[1] != null)
     {
         num4 = (int)drawPlayer.dye[1].dye;
     }
     int num5 = 0;
     if (drawPlayer.dye[2] != null)
     {
         num5 = (int)drawPlayer.dye[2].dye;
     }
     if (drawPlayer.wearsRobe)
     {
         num5 = num4;
     }
     int num6 = 0;
     int num7 = 0;
     int num8 = 0;
     int num9 = 0;
     int num10 = 0;
     int num11 = 0;
     int num12 = 0;
     int num13 = 0;
     int num14 = 0;
     int num15 = 0;
     int num16 = 0;
     for (int i = 0; i < 16; i++)
     {
         int num17 = i % 8;
         if (drawPlayer.dye[num17] != null && drawPlayer.armor[i].type > 0 && drawPlayer.armor[i].stack > 0 && (i / 8 >= 1 || !drawPlayer.hideVisual[num17] || (drawPlayer.armor[i].wingSlot > 0 && drawPlayer.velocity.Y != 0f)))
         {
             if (drawPlayer.armor[i].handOnSlot > 0 && drawPlayer.armor[i].handOnSlot < 18)
             {
                 num6 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].handOffSlot > 0 && drawPlayer.armor[i].handOffSlot < 11)
             {
                 num7 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].backSlot > 0 && drawPlayer.armor[i].backSlot < 8)
             {
                 num8 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].frontSlot > 0 && drawPlayer.armor[i].frontSlot < 5)
             {
                 num9 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].shoeSlot > 0 && drawPlayer.armor[i].shoeSlot < 15)
             {
                 num10 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].waistSlot > 0 && drawPlayer.armor[i].waistSlot < 11)
             {
                 num11 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].shieldSlot > 0 && drawPlayer.armor[i].shieldSlot < 5)
             {
                 num12 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].neckSlot > 0 && drawPlayer.armor[i].neckSlot < 7)
             {
                 num13 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].faceSlot > 0 && drawPlayer.armor[i].faceSlot < 8)
             {
                 num14 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].balloonSlot > 0 && drawPlayer.armor[i].balloonSlot < 11)
             {
                 num15 = (int)drawPlayer.dye[num17].dye;
             }
             if (drawPlayer.armor[i].wingSlot > 0 && drawPlayer.armor[i].wingSlot < 25)
             {
                 num16 = (int)drawPlayer.dye[num17].dye;
             }
         }
     }
     int num18 = 0;
     switch (drawPlayer.team)
     {
     case 1:
         num18 = 1;
         break;
     case 2:
         num18 = 5;
         break;
     case 3:
         num18 = 9;
         break;
     case 4:
         num18 = 3;
         break;
     }
     if (num3 == 65)
     {
         num3 = num18;
     }
     if (num4 == 65)
     {
         num4 = num18;
     }
     if (num5 == 65)
     {
         num5 = num18;
     }
     if (num6 == 65)
     {
         num6 = num18;
     }
     if (num7 == 65)
     {
         num7 = num18;
     }
     if (num9 == 65)
     {
         num9 = num18;
     }
     if (num8 == 65)
     {
         num8 = num18;
     }
     if (num10 == 65)
     {
         num10 = num18;
     }
     if (num11 == 65)
     {
         num11 = num18;
     }
     if (num12 == 65)
     {
         num12 = num18;
     }
     if (num13 == 65)
     {
         num13 = num18;
     }
     if (num14 == 65)
     {
         num14 = num18;
     }
     if (num15 == 65)
     {
         num15 = num18;
     }
     if (num16 == 65)
     {
         num16 = num18;
     }
     if (drawPlayer.shadow == 0f)
     {
         drawPlayer.position.Y = drawPlayer.position.Y + drawPlayer.gfxOffY;
     }
     drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y + drawPlayer.gfxOffY;
     SpriteEffects effects = SpriteEffects.None;
     SpriteEffects effects2 = SpriteEffects.FlipHorizontally;
     Color color = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(true));
     Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White));
     Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor));
     Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor));
     Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor));
     Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor));
     Color color6 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor));
     Color color7 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor));
     Color color8 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor));
     Color color9 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor));
     Color color10 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White));
     Color color11 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White));
     Color color12 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White));
     if (drawPlayer.head > 0 && drawPlayer.head < 160)
     {
         this.LoadArmorHead(drawPlayer.head);
     }
     if (drawPlayer.body > 0 && drawPlayer.body < 168)
     {
         this.LoadArmorBody(drawPlayer.body);
     }
     if (drawPlayer.legs > 0 && drawPlayer.legs < 103)
     {
         this.LoadArmorLegs(drawPlayer.legs);
     }
     if (drawPlayer.handon > 0 && drawPlayer.handon < 18)
     {
         this.LoadAccHandsOn((int)drawPlayer.handon);
     }
     if (drawPlayer.handoff > 0 && drawPlayer.handoff < 11)
     {
         this.LoadAccHandsOff((int)drawPlayer.handoff);
     }
     if (drawPlayer.back > 0 && drawPlayer.back < 8)
     {
         this.LoadAccBack((int)drawPlayer.back);
     }
     if (drawPlayer.front > 0 && drawPlayer.front < 5)
     {
         this.LoadAccFront((int)drawPlayer.front);
     }
     if (drawPlayer.shoe > 0 && drawPlayer.shoe < 15)
     {
         this.LoadAccShoes((int)drawPlayer.shoe);
     }
     if (drawPlayer.waist > 0 && drawPlayer.waist < 11)
     {
         this.LoadAccWaist((int)drawPlayer.waist);
     }
     if (drawPlayer.shield > 0 && drawPlayer.shield < 5)
     {
         this.LoadAccShield((int)drawPlayer.shield);
     }
     if (drawPlayer.neck > 0 && drawPlayer.neck < 7)
     {
         this.LoadAccNeck((int)drawPlayer.neck);
     }
     if (drawPlayer.face > 0 && drawPlayer.face < 8)
     {
         this.LoadAccFace((int)drawPlayer.face);
     }
     if (drawPlayer.balloon > 0 && drawPlayer.balloon < 11)
     {
         this.LoadAccBalloon((int)drawPlayer.balloon);
     }
     this.LoadHair(drawPlayer.hair);
     if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47)
     {
         float num19 = (float)Main.mouseTextColor / 200f - 0.3f;
         if (drawPlayer.shadow != 0f)
         {
             num19 = 0f;
         }
         color10.G = (byte)((float)color10.G * num19);
         color11.G = (byte)((float)color11.G * num19);
         color12.G = (byte)((float)color12.G * num19);
         color10.B = (byte)((float)color10.B * num19);
         color10.R = (byte)((float)color10.R * num19);
         color11.B = (byte)((float)color11.B * num19);
         color11.R = (byte)((float)color11.R * num19);
         color12.B = (byte)((float)color12.B * num19);
         color12.R = (byte)((float)color12.R * num19);
     }
     if (drawPlayer.shadow > 0f)
     {
         immuneAlpha = new Color(0, 0, 0, 0);
         color5 = new Color(0, 0, 0, 0);
         color4 = new Color(0, 0, 0, 0);
         color = new Color(0, 0, 0, 0);
         color3 = new Color(0, 0, 0, 0);
         color2 = new Color(0, 0, 0, 0);
     }
     float num20 = 1f;
     float num21 = 1f;
     float num22 = 1f;
     float num23 = 1f;
     if (drawPlayer.honey && Main.rand.Next(30) == 0)
     {
         int num24 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 152, 0f, 0f, 150, default(Color), 1f);
         Main.dust[num24].velocity.Y = 0.3f;
         Dust expr_E3F_cp_0 = Main.dust[num24];
         expr_E3F_cp_0.velocity.X = expr_E3F_cp_0.velocity.X * 0.1f;
         Main.dust[num24].scale += (float)Main.rand.Next(3, 4) * 0.1f;
         Main.dust[num24].alpha = 100;
         Main.dust[num24].noGravity = true;
         Main.dust[num24].velocity += drawPlayer.velocity * 0.1f;
     }
     if (drawPlayer.poisoned)
     {
         if (Main.rand.Next(50) == 0)
         {
             int num25 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 46, 0f, 0f, 150, default(Color), 0.2f);
             Main.dust[num25].noGravity = true;
             Main.dust[num25].fadeIn = 1.9f;
         }
         num20 *= 0.65f;
         num22 *= 0.75f;
     }
     if (drawPlayer.venom)
     {
         if (Main.rand.Next(10) == 0)
         {
             int num26 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 171, 0f, 0f, 100, default(Color), 0.5f);
             Main.dust[num26].noGravity = true;
             Main.dust[num26].fadeIn = 1.5f;
         }
         num21 *= 0.45f;
         num20 *= 0.75f;
     }
     if (drawPlayer.onFire)
     {
         if (Main.rand.Next(4) == 0)
         {
             int num27 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
             Main.dust[num27].noGravity = true;
             Main.dust[num27].velocity *= 1.8f;
             Dust expr_1087_cp_0 = Main.dust[num27];
             expr_1087_cp_0.velocity.Y = expr_1087_cp_0.velocity.Y - 0.5f;
         }
         num22 *= 0.6f;
         num21 *= 0.7f;
     }
     if (drawPlayer.dripping && drawPlayer.shadow == 0f && Main.rand.Next(4) != 0)
     {
         Vector2 position = drawPlayer.position;
         position.X -= 2f;
         position.Y -= 2f;
         if (Main.rand.Next(2) == 0)
         {
             int num28 = Dust.NewDust(position, drawPlayer.width + 4, drawPlayer.height + 2, 211, 0f, 0f, 50, default(Color), 0.8f);
             if (Main.rand.Next(2) == 0)
             {
                 Main.dust[num28].alpha += 25;
             }
             if (Main.rand.Next(2) == 0)
             {
                 Main.dust[num28].alpha += 25;
             }
             Main.dust[num28].noLight = true;
             Main.dust[num28].velocity *= 0.2f;
             Dust expr_11CC_cp_0 = Main.dust[num28];
             expr_11CC_cp_0.velocity.Y = expr_11CC_cp_0.velocity.Y + 0.2f;
             Main.dust[num28].velocity += drawPlayer.velocity;
         }
         else
         {
             int num29 = Dust.NewDust(position, drawPlayer.width + 8, drawPlayer.height + 8, 211, 0f, 0f, 50, default(Color), 1.1f);
             if (Main.rand.Next(2) == 0)
             {
                 Main.dust[num29].alpha += 25;
             }
             if (Main.rand.Next(2) == 0)
             {
                 Main.dust[num29].alpha += 25;
             }
             Main.dust[num29].noLight = true;
             Main.dust[num29].noGravity = true;
             Main.dust[num29].velocity *= 0.2f;
             Dust expr_12C5_cp_0 = Main.dust[num29];
             expr_12C5_cp_0.velocity.Y = expr_12C5_cp_0.velocity.Y + 1f;
             Main.dust[num29].velocity += drawPlayer.velocity;
         }
     }
     if (drawPlayer.ichor)
     {
         num22 = 0f;
     }
     if (drawPlayer.burned)
     {
         int num30 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 2f);
         Main.dust[num30].noGravity = true;
         Main.dust[num30].velocity *= 1.8f;
         Dust expr_13B8_cp_0 = Main.dust[num30];
         expr_13B8_cp_0.velocity.Y = expr_13B8_cp_0.velocity.Y - 0.75f;
         num20 = 1f;
         num22 *= 0.6f;
         num21 *= 0.7f;
     }
     if (drawPlayer.onFrostBurn)
     {
         if (Main.rand.Next(4) == 0)
         {
             int num31 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 135, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
             Main.dust[num31].noGravity = true;
             Main.dust[num31].velocity *= 1.8f;
             Dust expr_14AD_cp_0 = Main.dust[num31];
             expr_14AD_cp_0.velocity.Y = expr_14AD_cp_0.velocity.Y - 0.5f;
         }
         num20 *= 0.5f;
         num21 *= 0.7f;
     }
     if (drawPlayer.onFire2)
     {
         if (Main.rand.Next(4) == 0)
         {
             int num32 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 75, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
             Main.dust[num32].noGravity = true;
             Main.dust[num32].velocity *= 1.8f;
             Dust expr_1598_cp_0 = Main.dust[num32];
             expr_1598_cp_0.velocity.Y = expr_1598_cp_0.velocity.Y - 0.5f;
         }
         num22 *= 0.6f;
         num21 *= 0.7f;
     }
     if (drawPlayer.noItems)
     {
         num21 *= 0.8f;
         num20 *= 0.65f;
     }
     if (drawPlayer.blind)
     {
         num21 *= 0.65f;
         num20 *= 0.7f;
     }
     if (drawPlayer.bleed)
     {
         num21 *= 0.9f;
         num22 *= 0.9f;
         if (!drawPlayer.dead && Main.rand.Next(30) == 0)
         {
             int num33 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 5, 0f, 0f, 0, default(Color), 1f);
             Dust expr_166B_cp_0 = Main.dust[num33];
             expr_166B_cp_0.velocity.Y = expr_166B_cp_0.velocity.Y + 0.5f;
             Main.dust[num33].velocity *= 0.25f;
         }
     }
     if (drawPlayer.shadow == 0f && drawPlayer.palladiumRegen && drawPlayer.statLife < drawPlayer.statLifeMax && base.IsActive && !Main.gamePaused && drawPlayer.miscCounter % 10 == 0)
     {
         Vector2 position2;
         position2.X = drawPlayer.position.X + (float)Main.rand.Next(drawPlayer.width);
         position2.Y = drawPlayer.position.Y + (float)Main.rand.Next(drawPlayer.height);
         position2.X = drawPlayer.position.X + (float)(drawPlayer.width / 2) - 6f;
         position2.Y = drawPlayer.position.Y + (float)(drawPlayer.height / 2) - 6f;
         position2.X -= (float)Main.rand.Next(-10, 11);
         position2.Y -= (float)Main.rand.Next(-20, 21);
         Gore.NewGore(position2, new Vector2((float)Main.rand.Next(-10, 11) * 0.1f, (float)Main.rand.Next(-20, -10) * 0.1f), 331, (float)Main.rand.Next(80, 120) * 0.01f);
     }
     if (num20 != 1f || num21 != 1f || num22 != 1f || num23 != 1f)
     {
         if (drawPlayer.onFire || drawPlayer.onFire2 || drawPlayer.onFrostBurn)
         {
             color2 = drawPlayer.GetImmuneAlpha(Color.White);
             color3 = drawPlayer.GetImmuneAlpha(drawPlayer.eyeColor);
             color = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(true));
             color4 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor);
             color5 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor);
             color6 = drawPlayer.GetImmuneAlpha(drawPlayer.shirtColor);
             color7 = drawPlayer.GetImmuneAlpha(drawPlayer.underShirtColor);
             color8 = drawPlayer.GetImmuneAlpha(drawPlayer.pantsColor);
             color9 = drawPlayer.GetImmuneAlpha(drawPlayer.shoeColor);
             color10 = drawPlayer.GetImmuneAlpha(Color.White);
             color11 = drawPlayer.GetImmuneAlpha(Color.White);
             color12 = drawPlayer.GetImmuneAlpha(Color.White);
         }
         else
         {
             color2 = Main.buffColor(color2, num20, num21, num22, num23);
             color3 = Main.buffColor(color3, num20, num21, num22, num23);
             color = Main.buffColor(color, num20, num21, num22, num23);
             color4 = Main.buffColor(color4, num20, num21, num22, num23);
             color5 = Main.buffColor(color5, num20, num21, num22, num23);
             color6 = Main.buffColor(color6, num20, num21, num22, num23);
             color7 = Main.buffColor(color7, num20, num21, num22, num23);
             color8 = Main.buffColor(color8, num20, num21, num22, num23);
             color9 = Main.buffColor(color9, num20, num21, num22, num23);
             color10 = Main.buffColor(color10, num20, num21, num22, num23);
             color11 = Main.buffColor(color11, num20, num21, num22, num23);
             color12 = Main.buffColor(color12, num20, num21, num22, num23);
         }
     }
     if (drawPlayer.socialGhost)
     {
         color2 = new Color(0, 0, 0, 0);
         color3 = new Color(0, 0, 0, 0);
         color = new Color(0, 0, 0, 0);
         color4 = new Color(0, 0, 0, 0);
         color5 = new Color(0, 0, 0, 0);
         color6 = new Color(0, 0, 0, 0);
         color7 = new Color(0, 0, 0, 0);
         color8 = new Color(0, 0, 0, 0);
         color9 = new Color(0, 0, 0, 0);
         immuneAlpha = new Color(0, 0, 0, 0);
         if (color10.A > Main.gFade)
         {
             color10.A = Main.gFade;
         }
         if (color11.A > Main.gFade)
         {
             color11.A = Main.gFade;
         }
         if (color12.A > Main.gFade)
         {
             color12.A = Main.gFade;
         }
     }
     float num34 = 1f;
     if (drawPlayer.armorSteath)
     {
         float num35 = drawPlayer.stealth;
         if ((double)num35 < 0.03)
         {
             num35 = 0.03f;
         }
         float num36 = (1f + num35 * 10f) / 11f;
         if (num35 < 0f)
         {
             num35 = 0f;
         }
         if (num35 >= 1f - drawPlayer.shadow && drawPlayer.shadow > 0f)
         {
             num35 = drawPlayer.shadow * 0.5f;
         }
         num34 = num36;
         color10 = new Color((int)((byte)((float)color10.R * num35)), (int)((byte)((float)color10.G * num35)), (int)((byte)((float)color10.B * num36)), (int)((byte)((float)color10.A * num35)));
         color11 = new Color((int)((byte)((float)color11.R * num35)), (int)((byte)((float)color11.G * num35)), (int)((byte)((float)color11.B * num36)), (int)((byte)((float)color11.A * num35)));
         color12 = new Color((int)((byte)((float)color12.R * num35)), (int)((byte)((float)color12.G * num35)), (int)((byte)((float)color12.B * num36)), (int)((byte)((float)color12.A * num35)));
         num35 *= num35;
         color2 = new Color((int)((byte)((float)color2.R * num35)), (int)((byte)((float)color2.G * num35)), (int)((byte)((float)color2.B * num35)), (int)((byte)((float)color2.A * num35)));
         color3 = new Color((int)((byte)((float)color3.R * num35)), (int)((byte)((float)color3.G * num35)), (int)((byte)((float)color3.B * num35)), (int)((byte)((float)color3.A * num35)));
         color = new Color((int)((byte)((float)color.R * num35)), (int)((byte)((float)color.G * num35)), (int)((byte)((float)color.B * num35)), (int)((byte)((float)color.A * num35)));
         color4 = new Color((int)((byte)((float)color4.R * num35)), (int)((byte)((float)color4.G * num35)), (int)((byte)((float)color4.B * num35)), (int)((byte)((float)color4.A * num35)));
         color5 = new Color((int)((byte)((float)color5.R * num35)), (int)((byte)((float)color5.G * num35)), (int)((byte)((float)color5.B * num35)), (int)((byte)((float)color5.A * num35)));
         color6 = new Color((int)((byte)((float)color6.R * num35)), (int)((byte)((float)color6.G * num35)), (int)((byte)((float)color6.B * num35)), (int)((byte)((float)color6.A * num35)));
         color7 = new Color((int)((byte)((float)color7.R * num35)), (int)((byte)((float)color7.G * num35)), (int)((byte)((float)color7.B * num35)), (int)((byte)((float)color7.A * num35)));
         color8 = new Color((int)((byte)((float)color8.R * num35)), (int)((byte)((float)color8.G * num35)), (int)((byte)((float)color8.B * num35)), (int)((byte)((float)color8.A * num35)));
         color9 = new Color((int)((byte)((float)color9.R * num35)), (int)((byte)((float)color9.G * num35)), (int)((byte)((float)color9.B * num35)), (int)((byte)((float)color9.A * num35)));
         immuneAlpha = new Color((int)((byte)((float)immuneAlpha.R * num35)), (int)((byte)((float)immuneAlpha.G * num35)), (int)((byte)((float)immuneAlpha.B * num35)), (int)((byte)((float)immuneAlpha.A * num35)));
     }
     if (drawPlayer.gravDir == 1f)
     {
         if (drawPlayer.direction == 1)
         {
             effects = SpriteEffects.None;
             effects2 = SpriteEffects.None;
         }
         else
         {
             effects = SpriteEffects.FlipHorizontally;
             effects2 = SpriteEffects.FlipHorizontally;
         }
         if (!drawPlayer.dead)
         {
             drawPlayer.legPosition.Y = 0f;
             drawPlayer.headPosition.Y = 0f;
             drawPlayer.bodyPosition.Y = 0f;
         }
     }
     else
     {
         if (drawPlayer.direction == 1)
         {
             effects = SpriteEffects.FlipVertically;
             effects2 = SpriteEffects.FlipVertically;
         }
         else
         {
             effects = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);
             effects2 = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);
         }
         if (!drawPlayer.dead)
         {
             drawPlayer.legPosition.Y = 6f;
             drawPlayer.headPosition.Y = 6f;
             drawPlayer.bodyPosition.Y = 6f;
         }
     }
     Vector2 vector = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.75f);
     Vector2 origin = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.5f);
     Vector2 vector2 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.4f);
     if (drawPlayer.merman)
     {
         drawPlayer.headRotation = drawPlayer.velocity.Y * (float)drawPlayer.direction * 0.1f;
         if ((double)drawPlayer.headRotation < -0.3)
         {
             drawPlayer.headRotation = -0.3f;
         }
         if ((double)drawPlayer.headRotation > 0.3)
         {
             drawPlayer.headRotation = 0.3f;
         }
     }
     else
     {
         if (!drawPlayer.dead)
         {
             drawPlayer.headRotation = 0f;
         }
     }
     bool flag3 = false;
     if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106 || drawPlayer.head == 113 || drawPlayer.head == 116 || drawPlayer.head == 119 || drawPlayer.head == 133 || drawPlayer.head == 138 || drawPlayer.head == 139)
     {
         flag3 = true;
     }
     bool flag4 = false;
     if (drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69 || drawPlayer.head == 114 || drawPlayer.head == 121 || drawPlayer.head == 126 || drawPlayer.head == 130 || drawPlayer.head == 136 || drawPlayer.head == 140 || drawPlayer.head == 145 || drawPlayer.head == 158 || drawPlayer.head == 159)
     {
         flag4 = true;
     }
     bool flag5 = false;
     if (drawPlayer.face == 4 || drawPlayer.face == 3 || drawPlayer.face == 2)
     {
         flag5 = true;
     }
     Rectangle bodyFrame = drawPlayer.bodyFrame;
     bodyFrame.Y -= 336;
     if (bodyFrame.Y < 0)
     {
         bodyFrame.Y = 0;
     }
     int height = 26;
     int hair = drawPlayer.hair;
     if (flag5)
     {
         bodyFrame.Height = 0;
     }
     else
     {
         if (hair > 50 && (hair < 56 || hair > 63) && (hair < 74 || hair > 77) && (hair < 88 || hair > 89) && hair != 94 && hair != 100 && hair != 104 && hair != 112 && hair < 116)
         {
             if (drawPlayer.head == -1 || flag3 || drawPlayer.head == 23 || drawPlayer.head == 0)
             {
                 Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f);
             }
             else
             {
                 if (flag4)
                 {
                     Main.spriteBatch.Draw(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f);
                 }
             }
             if (drawPlayer.gravDir == 1f)
             {
                 bodyFrame.Height = height;
             }
         }
     }
     if (drawPlayer.mount == 1)
     {
         int num37 = 23 + (int)num2 - 30;
         int num38;
         if (drawPlayer.direction > 0)
         {
             num38 = 13;
         }
         else
         {
             num38 = -13;
         }
         Main.spriteBatch.Draw(Main.rudolphTexture[0], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num38)), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num37))), new Rectangle?(new Rectangle(0, Main.rudolphTexture[0].Height / 12 * drawPlayer.mountFrame, Main.rudolphTexture[0].Width, Main.rudolphTexture[0].Height / 12)), color11, drawPlayer.bodyRotation, new Vector2((float)(Main.rudolphTexture[0].Width / 2), (float)(Main.rudolphTexture[0].Height / 24)), 1f, effects, 0f);
     }
     if (drawPlayer.carpetFrame >= 0)
     {
         Color color13 = color12;
         float num39 = 0f;
         if (drawPlayer.gravDir == -1f)
         {
             num39 = 10f;
         }
         Main.spriteBatch.Draw(Main.flyingCarpetTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 28f * drawPlayer.gravDir + num39))), new Rectangle?(new Rectangle(0, Main.flyingCarpetTexture.Height / 6 * drawPlayer.carpetFrame, Main.flyingCarpetTexture.Width, Main.flyingCarpetTexture.Height / 6)), color13, drawPlayer.bodyRotation, new Vector2((float)(Main.flyingCarpetTexture.Width / 2), (float)(Main.flyingCarpetTexture.Height / 8)), 1f, effects, 0f);
     }
     bool flag6 = false;
     if ((drawPlayer.wings == 0 || drawPlayer.velocity.Y == 0f) && (drawPlayer.inventory[drawPlayer.selectedItem].type == 1178 || drawPlayer.inventory[drawPlayer.selectedItem].type == 779 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1295 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1910 || drawPlayer.turtleArmor || drawPlayer.body == 106))
     {
         flag6 = true;
         int type = drawPlayer.inventory[drawPlayer.selectedItem].type;
         int num40 = 1;
         float num41 = -4f;
         float num42 = -8f;
         if (drawPlayer.turtleArmor)
         {
             num40 = 4;
         }
         else
         {
             if (drawPlayer.body == 106)
             {
                 num40 = 6;
             }
             else
             {
                 if (type == 1178)
                 {
                     num40 = 1;
                 }
                 else
                 {
                     if (type == 779)
                     {
                         num40 = 2;
                     }
                     else
                     {
                         if (type == 1295)
                         {
                             num40 = 3;
                         }
                         else
                         {
                             if (type == 1910)
                             {
                                 num40 = 5;
                             }
                         }
                     }
                 }
             }
         }
         if (num40 == 4 || num40 == 6)
         {
             Main.spriteBatch.Draw(Main.BackPackTexture[num40], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         }
         else
         {
             Main.spriteBatch.Draw(Main.BackPackTexture[num40], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction))) + num41 * (float)drawPlayer.direction, (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + num42 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, 0, Main.BackPackTexture[num40].Width, Main.BackPackTexture[num40].Height)), color11, drawPlayer.bodyRotation, new Vector2((float)(Main.BackPackTexture[num40].Width / 2), (float)(Main.BackPackTexture[num40].Height / 2)), 1f, effects, 0f);
         }
     }
     if (!flag6 && drawPlayer.back > 0 && drawPlayer.back < 8 && drawPlayer.mount == 0)
     {
         if (drawPlayer.front >= 1 && drawPlayer.front <= 4)
         {
             int num43 = drawPlayer.bodyFrame.Y / 56;
             if (num43 < 1 || num43 > 5)
             {
                 num = 10;
             }
             else
             {
                 if (drawPlayer.front == 1)
                 {
                     num = 0;
                 }
                 if (drawPlayer.front == 2)
                 {
                     num = 8;
                 }
                 if (drawPlayer.front == 3)
                 {
                     num = 0;
                 }
                 if (drawPlayer.front == 4)
                 {
                     num = 8;
                 }
             }
         }
         Main.pixelShader.CurrentTechnique.Passes[num8].Apply();
         Main.spriteBatch.Draw(Main.accBackTexture[(int)drawPlayer.back], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     drawPlayer.position.Y = drawPlayer.position.Y + num2 / 2f;
     if (!flag6 && drawPlayer.wings > 0)
     {
         this.LoadWings(drawPlayer.wings);
         if (drawPlayer.wings == 22)
         {
             if ((drawPlayer.velocity.Y != 0f || drawPlayer.grappling[0] != -1) && drawPlayer.mount == 0)
             {
                 this.LoadItemFlames(1866);
                 Color color14 = color11;
                 int num44 = 24;
                 int num45 = 0;
                 Main.pixelShader.CurrentTechnique.Passes[num16].Apply();
                 if (drawPlayer.shadow == 0f && drawPlayer.grappling[0] == -1)
                 {
                     for (int j = 0; j < 7; j++)
                     {
                         Color color15 = new Color(250 - j * 10, 250 - j * 10, 250 - j * 10, 150 - j * 10);
                         Vector2 vector3 = new Vector2((float)Main.rand.Next(-10, 11) * 0.2f, (float)Main.rand.Next(-10, 11) * 0.2f);
                         num34 *= num34;
                         num34 *= 1f - drawPlayer.shadow;
                         color15 = new Color((int)((float)color15.R * num34), (int)((float)color15.G * num34), (int)((float)color15.B * num34), (int)((float)color15.A * num34));
                         vector3.X = drawPlayer.itemFlamePos[j].X;
                         vector3.Y = -drawPlayer.itemFlamePos[j].Y;
                         vector3 *= 0.5f;
                         Main.spriteBatch.Draw(Main.itemFlameTexture[1866], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num45 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num44 * drawPlayer.gravDir))) + vector3, new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 7 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 7 - 2)), color15, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 14)), 1f, effects, 0f);
                     }
                 }
                 Main.spriteBatch.Draw(Main.wingsTexture[drawPlayer.wings], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num45 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num44 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 7 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 7)), color14, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 14)), 1f, effects, 0f);
                 Main.pixelShader.CurrentTechnique.Passes[0].Apply();
             }
         }
         else
         {
             int num46 = 0;
             int num47 = 0;
             if (drawPlayer.wings == 5)
             {
                 num47 = 4;
                 num46 -= 4;
             }
             Color color16 = color11;
             if (drawPlayer.wings == 9)
             {
                 num34 *= num34;
                 num34 *= 1f - drawPlayer.shadow;
                 color16 = new Color((int)(250f * num34), (int)(250f * num34), (int)(250f * num34), (int)(100f * num34));
             }
             if (drawPlayer.wings == 10)
             {
                 num34 *= num34;
                 num34 *= 1f - drawPlayer.shadow;
                 color16 = new Color((int)(250f * num34), (int)(250f * num34), (int)(250f * num34), (int)(175f * num34));
             }
             if (drawPlayer.wings == 11 && color16.A > Main.gFade)
             {
                 color16.A = Main.gFade;
             }
             Main.pixelShader.CurrentTechnique.Passes[num16].Apply();
             Main.spriteBatch.Draw(Main.wingsTexture[drawPlayer.wings], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num47 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num46 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color16, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, effects, 0f);
             if (drawPlayer.wings == 23)
             {
                 num34 *= num34;
                 num34 *= 1f - drawPlayer.shadow;
                 color16 = new Color((int)(200f * num34), (int)(200f * num34), (int)(200f * num34), (int)(200f * num34));
                 Main.spriteBatch.Draw(Main.FlameTexture[8], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num47 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num46 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color16, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, effects, 0f);
             }
             Main.pixelShader.CurrentTechnique.Passes[0].Apply();
         }
     }
     if (drawPlayer.balloon > 0)
     {
         int num48 = DateTime.Now.Millisecond % 800 / 200;
         Vector2 vector4 = Main.offHandOffsets[drawPlayer.bodyFrame.Y / 56];
         if (drawPlayer.direction != 1)
         {
             vector4.X = (float)drawPlayer.width - vector4.X;
         }
         if (drawPlayer.gravDir != 1f)
         {
             vector4.Y -= (float)drawPlayer.height;
         }
         Main.pixelShader.CurrentTechnique.Passes[num15].Apply();
         Main.spriteBatch.Draw(Main.accBalloonTexture[(int)drawPlayer.balloon], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + vector4.X)), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + vector4.Y * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.accBalloonTexture[(int)drawPlayer.balloon].Height / 4 * num48, Main.accBalloonTexture[(int)drawPlayer.balloon].Width, Main.accBalloonTexture[(int)drawPlayer.balloon].Height / 4)), color11, drawPlayer.bodyRotation, new Vector2((float)(26 + drawPlayer.direction * 4), 28f + drawPlayer.gravDir * 6f), 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     drawPlayer.position.Y = drawPlayer.position.Y - num2 / 2f;
     if (!drawPlayer.invis && drawPlayer.body != 83 && drawPlayer.body != 82 && drawPlayer.body != 93)
     {
         Main.spriteBatch.Draw(Main.skinBodyTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         if (drawPlayer.legs != 67)
         {
             Main.spriteBatch.Draw(Main.skinLegsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.legFrame), immuneAlpha, drawPlayer.legRotation, origin, 1f, effects, 0f);
         }
     }
     if (drawPlayer.wearsRobe)
     {
         goto IL_394A;
     }
     IL_3551:
     if (drawPlayer.legs > 0 && drawPlayer.legs < 103)
     {
         if (!drawPlayer.invis || (drawPlayer.legs != 20 && drawPlayer.legs != 21))
         {
             Main.pixelShader.CurrentTechnique.Passes[num5].Apply();
             Main.spriteBatch.Draw(Main.armorLegTexture[drawPlayer.legs], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color12, drawPlayer.legRotation, vector, 1f, effects, 0f);
             Main.pixelShader.CurrentTechnique.Passes[0].Apply();
         }
     }
     else
     {
         if (!drawPlayer.invis)
         {
             if (!drawPlayer.male)
             {
                 Main.spriteBatch.Draw(Main.femalePantsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color8, drawPlayer.legRotation, vector, 1f, effects, 0f);
                 Main.spriteBatch.Draw(Main.femaleShoesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, vector, 1f, effects, 0f);
             }
             else
             {
                 Main.spriteBatch.Draw(Main.playerPantsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color8, drawPlayer.legRotation, vector, 1f, effects, 0f);
                 Main.spriteBatch.Draw(Main.playerShoesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, vector, 1f, effects, 0f);
             }
         }
     }
     if (drawPlayer.wearsRobe)
     {
         goto IL_3A55;
     }
     IL_394A:
     if (drawPlayer.shoe > 0 && drawPlayer.shoe < 15)
     {
         Main.pixelShader.CurrentTechnique.Passes[num10].Apply();
         Main.spriteBatch.Draw(Main.accShoesTexture[(int)drawPlayer.shoe], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color12, drawPlayer.legRotation, vector, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.wearsRobe)
     {
         goto IL_3551;
     }
     IL_3A55:
     if (drawPlayer.body > 0 && drawPlayer.body < 168)
     {
         Main.pixelShader.CurrentTechnique.Passes[num4].Apply();
         Rectangle bodyFrame2 = drawPlayer.bodyFrame;
         int num49 = num;
         bodyFrame2.X += num49;
         bodyFrame2.Width -= num49;
         if (drawPlayer.direction == -1)
         {
             num49 = 0;
         }
         if (!drawPlayer.invis || (drawPlayer.body != 21 && drawPlayer.body != 22))
         {
             if (!drawPlayer.male)
             {
                 Main.spriteBatch.Draw(Main.femaleBodyTexture[drawPlayer.body], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2)) + num49), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame2), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
             else
             {
                 Main.spriteBatch.Draw(Main.armorBodyTexture[drawPlayer.body], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2)) + num49), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame2), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
         }
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
         if (flag && !drawPlayer.invis)
         {
             Main.spriteBatch.Draw(Main.playerHandsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         }
     }
     else
     {
         if (!drawPlayer.invis)
         {
             if (!drawPlayer.male)
             {
                 Main.spriteBatch.Draw(Main.femaleUnderShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
                 Main.spriteBatch.Draw(Main.femaleShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
             else
             {
                 Main.spriteBatch.Draw(Main.playerUnderShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
                 Main.spriteBatch.Draw(Main.playerShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
             Main.spriteBatch.Draw(Main.playerHandsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         }
     }
     if (drawPlayer.handoff > 0 && drawPlayer.handoff < 11)
     {
         Main.pixelShader.CurrentTechnique.Passes[num7].Apply();
         Main.spriteBatch.Draw(Main.accHandsOffTexture[(int)drawPlayer.handoff], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.waist > 0 && drawPlayer.waist < 11)
     {
         Rectangle legFrame = drawPlayer.legFrame;
         if (legFrame.Y >= 1064)
         {
             legFrame.Y = 0;
         }
         Main.pixelShader.CurrentTechnique.Passes[num11].Apply();
         Main.spriteBatch.Draw(Main.accWaistTexture[(int)drawPlayer.waist], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(legFrame), color12, drawPlayer.legRotation, vector, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.neck > 0 && drawPlayer.neck < 7)
     {
         Main.pixelShader.CurrentTechnique.Passes[num13].Apply();
         Main.spriteBatch.Draw(Main.accNeckTexture[(int)drawPlayer.neck], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (!drawPlayer.invis && drawPlayer.head != 38 && drawPlayer.head != 135)
     {
         Main.spriteBatch.Draw(Main.playerHeadTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         Main.spriteBatch.Draw(Main.playerEyeWhitesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         Main.spriteBatch.Draw(Main.playerEyesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color3, drawPlayer.headRotation, vector2, 1f, effects, 0f);
     }
     if (flag3)
     {
         Main.pixelShader.CurrentTechnique.Passes[num3].Apply();
         Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
         if (!drawPlayer.invis)
         {
             Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         }
     }
     if (flag4 && !drawPlayer.invis)
     {
         Main.spriteBatch.Draw(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f);
     }
     if (drawPlayer.head == 23)
     {
         if (!drawPlayer.invis)
         {
             Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         }
         Main.pixelShader.CurrentTechnique.Passes[num3].Apply();
         Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     else
     {
         if (drawPlayer.head == 14 || drawPlayer.head == 56 || drawPlayer.head == 114 || drawPlayer.head == 158)
         {
             Rectangle bodyFrame3 = drawPlayer.bodyFrame;
             int num50 = 0;
             if (drawPlayer.gravDir == 1f)
             {
                 if (bodyFrame3.Y != 0)
                 {
                     bodyFrame3.Y -= 2;
                     num50 = -2;
                     bodyFrame3.Height -= 8;
                 }
             }
             else
             {
                 if (bodyFrame3.Y != 0)
                 {
                     bodyFrame3.Y -= 2;
                     num50 = 10;
                     bodyFrame3.Height -= 8;
                 }
             }
             Main.pixelShader.CurrentTechnique.Passes[num3].Apply();
             Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f + (float)num50))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame3), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f);
             Main.pixelShader.CurrentTechnique.Passes[0].Apply();
         }
         else
         {
             if (drawPlayer.head > 0 && drawPlayer.head < 160 && drawPlayer.head != 28)
             {
                 if (!drawPlayer.invis || (drawPlayer.head != 39 && drawPlayer.head != 38))
                 {
                     Main.pixelShader.CurrentTechnique.Passes[num3].Apply();
                     if (drawPlayer.head > 0 && drawPlayer.head < 160)
                     {
                         this.LoadArmorHead(drawPlayer.head);
                     }
                     Main.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f);
                     Main.pixelShader.CurrentTechnique.Passes[0].Apply();
                 }
             }
             else
             {
                 if (!drawPlayer.invis && drawPlayer.face != 3 && drawPlayer.face != 2 && drawPlayer.face != 4)
                 {
                     Main.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f);
                 }
             }
         }
     }
     if (drawPlayer.head == 137)
     {
         Main.spriteBatch.Draw(Main.jackHatTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), new Color(255, 255, 255, 255), drawPlayer.headRotation, vector2, 1f, effects, 0f);
         for (int k = 0; k < 7; k++)
         {
             Color color17 = new Color(110 - k * 10, 110 - k * 10, 110 - k * 10, 110 - k * 10);
             Vector2 vector5 = new Vector2((float)Main.rand.Next(-10, 11) * 0.2f, (float)Main.rand.Next(-10, 11) * 0.2f);
             vector5.X = drawPlayer.itemFlamePos[k].X;
             vector5.Y = drawPlayer.itemFlamePos[k].Y;
             vector5 *= 0.5f;
             Main.spriteBatch.Draw(Main.jackHatTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2 + vector5, new Rectangle?(drawPlayer.bodyFrame), color17, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         }
     }
     if (drawPlayer.face > 0 && drawPlayer.face < 8)
     {
         Main.pixelShader.CurrentTechnique.Passes[num14].Apply();
         if (drawPlayer.face == 7)
         {
             Main.spriteBatch.Draw(Main.accFaceTexture[(int)drawPlayer.face], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), new Color(200, 200, 200, 150), drawPlayer.headRotation, vector2, 1f, effects, 0f);
         }
         else
         {
             Main.spriteBatch.Draw(Main.accFaceTexture[(int)drawPlayer.face], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f);
         }
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.mount == 1)
     {
         int num51 = 23 + (int)num2 - 30;
         int num52;
         if (drawPlayer.direction > 0)
         {
             num52 = 13;
         }
         else
         {
             num52 = -13;
         }
         Main.spriteBatch.Draw(Main.rudolphTexture[1], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num52)), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num51))), new Rectangle?(new Rectangle(0, Main.rudolphTexture[0].Height / 12 * drawPlayer.mountFrame, Main.rudolphTexture[0].Width, Main.rudolphTexture[0].Height / 12)), color11, drawPlayer.bodyRotation, new Vector2((float)(Main.rudolphTexture[0].Width / 2), (float)(Main.rudolphTexture[0].Height / 24)), 1f, effects, 0f);
         if (drawPlayer.shadow == 0f)
         {
             Main.spriteBatch.Draw(Main.rudolphTexture[2], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num52)), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num51))), new Rectangle?(new Rectangle(0, Main.rudolphTexture[0].Height / 12 * drawPlayer.mountFrame, Main.rudolphTexture[0].Width, Main.rudolphTexture[0].Height / 12)), new Color(255, 255, 255, 0), drawPlayer.bodyRotation, new Vector2((float)(Main.rudolphTexture[0].Width / 2), (float)(Main.rudolphTexture[0].Height / 24)), 1f, effects, 0f);
         }
     }
     if (drawPlayer.pulley && drawPlayer.itemAnimation == 0)
     {
         if (drawPlayer.pulleyDir == 2)
         {
             int num53 = -26;
             int num54 = 0;
             float rotation = 0f;
             Main.spriteBatch.Draw(Main.pulleyTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num54 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num53 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color10, rotation, new Vector2((float)(Main.pulleyTexture.Width / 2), (float)(Main.pulleyTexture.Height / 4)), 1f, effects, 0f);
         }
         else
         {
             int num55 = -26;
             int num56 = 10;
             float rotation2 = 0.35f * (float)(-(float)drawPlayer.direction);
             Main.spriteBatch.Draw(Main.pulleyTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num56 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num55 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color10, rotation2, new Vector2((float)(Main.pulleyTexture.Width / 2), (float)(Main.pulleyTexture.Height / 4)), 1f, effects, 0f);
         }
     }
     if (drawPlayer.shield > 0 && drawPlayer.shield < 5)
     {
         Main.pixelShader.CurrentTechnique.Passes[num12].Apply();
         Main.spriteBatch.Draw(Main.accShieldTexture[(int)drawPlayer.shield], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.heldProj >= 0)
     {
         Main.projectile[drawPlayer.heldProj].gfxOffY = drawPlayer.gfxOffY;
         this.DrawProj(drawPlayer.heldProj);
     }
     Color newColor = Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0));
     if (drawPlayer.inventory[drawPlayer.selectedItem].type == 678)
     {
         newColor = Color.White;
     }
     if (drawPlayer.armorSteath && drawPlayer.inventory[drawPlayer.selectedItem].ranged)
     {
         float num57 = drawPlayer.stealth;
         if ((double)num57 < 0.03)
         {
             num57 = 0.03f;
         }
         float num58 = (1f + num57 * 10f) / 11f;
         newColor = new Color((int)((byte)((float)newColor.R * num57)), (int)((byte)((float)newColor.G * num57)), (int)((byte)((float)newColor.B * num58)), (int)((byte)((float)newColor.A * num57)));
     }
     if (!drawPlayer.frozen && (drawPlayer.itemAnimation > 0 || (drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley && drawPlayer.mount == 0)) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet))
     {
         string arg_59FB_0 = drawPlayer.name;
         if (drawPlayer.inventory[drawPlayer.selectedItem].type == 662 || drawPlayer.inventory[drawPlayer.selectedItem].type == 663)
         {
             newColor.R = (byte)Main.DiscoR;
             newColor.G = (byte)Main.DiscoG;
             newColor.B = (byte)Main.DiscoB;
             newColor.A = 255;
         }
         if (drawPlayer.inventory[drawPlayer.selectedItem].useStyle == 5)
         {
             if (drawPlayer.inventory[drawPlayer.selectedItem].type == 2188 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1308 || drawPlayer.inventory[drawPlayer.selectedItem].type == 683 || drawPlayer.inventory[drawPlayer.selectedItem].type == 723 || drawPlayer.inventory[drawPlayer.selectedItem].type == 726 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1801 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1931 || (drawPlayer.inventory[drawPlayer.selectedItem].type >= 739 && drawPlayer.inventory[drawPlayer.selectedItem].type <= 744) || drawPlayer.inventory[drawPlayer.selectedItem].type == 788 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1326 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1444 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1445 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1446 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1930)
             {
                 float num59 = drawPlayer.itemRotation + 0.785f * (float)drawPlayer.direction;
                 int num60 = 0;
                 int num61 = 0;
                 Vector2 origin2 = new Vector2(0f, (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height);
                 if (drawPlayer.gravDir == -1f)
                 {
                     if (drawPlayer.direction == -1)
                     {
                         num59 += 1.57f;
                         origin2 = new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, 0f);
                         num60 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width;
                     }
                     else
                     {
                         num59 -= 1.57f;
                         origin2 = new Vector2(0f, 0f);
                     }
                 }
                 else
                 {
                     if (drawPlayer.direction == -1)
                     {
                         origin2 = new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height);
                         num60 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width;
                     }
                 }
                 Main.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.position.X + (float)(drawPlayer.width / 2) - Main.screenPosition.X + origin2.X + (float)num60)), (float)((int)(drawPlayer.position.Y + (float)(drawPlayer.height / 2) - Main.screenPosition.Y + (float)num61))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), num59, origin2, drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
             }
             else
             {
                 Vector2 vector6 = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width / 2), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
                 Vector2 vector7 = this.DrawPlayerItemPos(drawPlayer);
                 int num62 = (int)vector7.X;
                 vector6.Y = vector7.Y;
                 Vector2 origin3 = new Vector2((float)(-(float)num62), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
                 if (drawPlayer.direction == -1)
                 {
                     origin3 = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width + num62), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
                 }
                 Main.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + vector6.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + vector6.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, origin3, drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                 if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color))
                 {
                     Main.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + vector6.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + vector6.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor), drawPlayer.itemRotation, origin3, drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                 }
             }
         }
         else
         {
             if (drawPlayer.gravDir == -1f)
             {
                 Main.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                 if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color))
                 {
                     Main.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                 }
             }
             else
             {
                 if (drawPlayer.inventory[drawPlayer.selectedItem].type == 425 || drawPlayer.inventory[drawPlayer.selectedItem].type == 507)
                 {
                     if (drawPlayer.gravDir == 1f)
                     {
                         if (drawPlayer.direction == 1)
                         {
                             effects2 = SpriteEffects.FlipVertically;
                         }
                         else
                         {
                             effects2 = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically);
                         }
                     }
                     else
                     {
                         if (drawPlayer.direction == 1)
                         {
                             effects2 = SpriteEffects.None;
                         }
                         else
                         {
                             effects2 = SpriteEffects.FlipHorizontally;
                         }
                     }
                 }
                 int type2 = drawPlayer.inventory[drawPlayer.selectedItem].type;
                 Main.spriteBatch.Draw(Main.itemTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                 if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color))
                 {
                     Main.spriteBatch.Draw(Main.itemTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                 }
                 if (drawPlayer.inventory[drawPlayer.selectedItem].flame && drawPlayer.shadow == 0f)
                 {
                     try
                     {
                         this.LoadItemFlames(type2);
                         if (Main.itemFlameTexture[type2] != null)
                         {
                             for (int l = 0; l < 7; l++)
                             {
                                 float x = drawPlayer.itemFlamePos[l].X;
                                 float y = drawPlayer.itemFlamePos[l].Y;
                                 Main.spriteBatch.Draw(Main.itemFlameTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)) + x, (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y)) + y), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), new Color(100, 100, 100, 0), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
                             }
                         }
                     }
                     catch
                     {
                     }
                 }
             }
         }
     }
     if (drawPlayer.body > 0 && drawPlayer.body < 168)
     {
         Rectangle bodyFrame4 = drawPlayer.bodyFrame;
         int num63 = num;
         bodyFrame4.X += num63;
         bodyFrame4.Width -= num63;
         if (drawPlayer.direction == -1)
         {
             num63 = 0;
         }
         if (!drawPlayer.invis || (drawPlayer.body != 21 && drawPlayer.body != 22))
         {
             if (flag && !drawPlayer.invis)
             {
                 int arg_6804_0 = drawPlayer.body;
                 if (flag2)
                 {
                     Main.spriteBatch.Draw(Main.skinArmTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
                 }
                 Main.spriteBatch.Draw(Main.playerHands2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
             Main.pixelShader.CurrentTechnique.Passes[num4].Apply();
             if (drawPlayer.body > 0 && drawPlayer.body < 168)
             {
                 this.LoadArmorBody(drawPlayer.body);
             }
             Main.spriteBatch.Draw(Main.armorArmTexture[drawPlayer.body], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2)) + num63), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame4), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             Main.pixelShader.CurrentTechnique.Passes[0].Apply();
         }
     }
     else
     {
         if (!drawPlayer.invis)
         {
             if (!drawPlayer.male)
             {
                 Main.spriteBatch.Draw(Main.femaleUnderShirt2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
                 Main.spriteBatch.Draw(Main.femaleShirt2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
             else
             {
                 Main.spriteBatch.Draw(Main.playerUnderShirt2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
             }
             Main.spriteBatch.Draw(Main.playerHands2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         }
     }
     if (drawPlayer.handon > 0 && drawPlayer.handon < 18)
     {
         Main.pixelShader.CurrentTechnique.Passes[num6].Apply();
         Main.spriteBatch.Draw(Main.accHandsOnTexture[(int)drawPlayer.handon], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1827 && !drawPlayer.frozen && (drawPlayer.itemAnimation > 0 || (drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley)) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet))
     {
         if (drawPlayer.gravDir == -1f)
         {
             Main.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
         }
         else
         {
             int type3 = drawPlayer.inventory[drawPlayer.selectedItem].type;
             Main.spriteBatch.Draw(Main.itemTexture[type3], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type3].Width, Main.itemTexture[type3].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type3].Width * 0.5f - (float)Main.itemTexture[type3].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type3].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f);
         }
     }
     if (!flag6 && drawPlayer.front > 0 && drawPlayer.front < 5)
     {
         Main.pixelShader.CurrentTechnique.Passes[num9].Apply();
         Main.spriteBatch.Draw(Main.accFrontTexture[(int)drawPlayer.front], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f);
         Main.pixelShader.CurrentTechnique.Passes[0].Apply();
     }
     if (drawPlayer.frozen)
     {
         Color color18 = color11;
         color18.R = (byte)((double)color18.R * 0.55);
         color18.G = (byte)((double)color18.G * 0.55);
         color18.B = (byte)((double)color18.B * 0.55);
         color18.A = (byte)((double)color18.A * 0.55);
         Main.spriteBatch.Draw(Main.frozenTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, 0, Main.frozenTexture.Width, Main.frozenTexture.Height)), color18, drawPlayer.bodyRotation, new Vector2((float)(Main.frozenTexture.Width / 2), (float)(Main.frozenTexture.Height / 2)), 1f, effects, 0f);
     }
     if (drawPlayer.iceBarrier && drawPlayer.shadow == 0f)
     {
         int num64 = this.iceBarrierTexture.Height / 12;
         Color white = Color.White;
         Main.spriteBatch.Draw(this.iceBarrierTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, num64 * (int)drawPlayer.iceBarrierFrame, this.iceBarrierTexture.Width, num64)), white, 0f, new Vector2((float)(Main.frozenTexture.Width / 2), (float)(Main.frozenTexture.Height / 2)), 1f, effects, 0f);
     }
     if (drawPlayer.gem >= 0 && drawPlayer.shadow == 0f)
     {
         Main.spriteBatch.Draw(Main.gemTexture[drawPlayer.gem], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - 80f))), new Rectangle?(new Rectangle(0, 0, Main.gemTexture[drawPlayer.gem].Width, Main.gemTexture[drawPlayer.gem].Height)), new Color(250, 250, 250, (int)(Main.mouseTextColor / 2)), 0f, new Vector2((float)(Main.gemTexture[drawPlayer.gem].Width / 2), (float)(Main.gemTexture[drawPlayer.gem].Height / 2)), (float)Main.mouseTextColor / 1000f + 0.8f, SpriteEffects.None, 0f);
     }
     if (drawPlayer.beetleOffense || drawPlayer.beetleDefense)
     {
         for (int m = 0; m < drawPlayer.beetleOrbs; m++)
         {
             for (int n = 0; n < 5; n++)
             {
                 Color color19 = color11;
                 float num65 = (float)n * 0.1f;
                 num65 = 0.5f - num65;
                 color19.R = (byte)((float)color19.R * num65);
                 color19.G = (byte)((float)color19.G * num65);
                 color19.B = (byte)((float)color19.B * num65);
                 color19.A = (byte)((float)color19.A * num65);
                 Vector2 value = -drawPlayer.beetleVel[m] * (float)n;
                 Main.spriteBatch.Draw(Main.beetleTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2)))) + drawPlayer.beetlePos[m] + value, new Rectangle?(new Rectangle(0, Main.beetleTexture.Height / 3 * drawPlayer.beetleFrame + 1, Main.beetleTexture.Width, Main.beetleTexture.Height / 3 - 2)), color19, 0f, new Vector2((float)(Main.beetleTexture.Width / 2), (float)(Main.beetleTexture.Height / 6)), 1f, effects, 0f);
             }
             Main.spriteBatch.Draw(Main.beetleTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2)))) + drawPlayer.beetlePos[m], new Rectangle?(new Rectangle(0, Main.beetleTexture.Height / 3 * drawPlayer.beetleFrame + 1, Main.beetleTexture.Width, Main.beetleTexture.Height / 3 - 2)), color11, 0f, new Vector2((float)(Main.beetleTexture.Width / 2), (float)(Main.beetleTexture.Height / 6)), 1f, effects, 0f);
         }
     }
     drawPlayer.position.Y = drawPlayer.position.Y + num2;
     if (drawPlayer.shadow == 0f)
     {
         drawPlayer.position.Y = drawPlayer.position.Y - drawPlayer.gfxOffY;
     }
     drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y - drawPlayer.gfxOffY;
 }