public virtual void Apply(DrawData? drawData = null)
		{
			this._shader.Parameters["uColor"].SetValue(this._uColor);
			this._shader.Parameters["uSaturation"].SetValue(this._uSaturation);
			this._shader.Parameters["uSecondaryColor"].SetValue(this._uSecondaryColor);
			this._shader.Parameters["uTime"].SetValue(Main.GlobalTime);
			this._shader.Parameters["uOpacity"].SetValue(this._uOpacity);
			if (drawData.HasValue)
			{
				DrawData value = drawData.Value;
				Vector4 value2 = new Vector4((float)value.sourceRect.Value.X, (float)value.sourceRect.Value.Y, (float)value.sourceRect.Value.Width, (float)value.sourceRect.Value.Height);
				this._shader.Parameters["uSourceRect"].SetValue(value2);
				this._shader.Parameters["uWorldPosition"].SetValue(Main.screenPosition + value.position);
				this._shader.Parameters["uImageSize0"].SetValue(new Vector2((float)value.texture.Width, (float)value.texture.Height));
			}
			else
			{
				this._shader.Parameters["uSourceRect"].SetValue(new Vector4(0f, 0f, 4f, 4f));
			}
			if (this._uImage != null)
			{
				Main.graphics.GraphicsDevice.Textures[1] = this._uImage.Value;
				this._shader.Parameters["uImageSize1"].SetValue(new Vector2((float)this._uImage.Value.Width, (float)this._uImage.Value.Height));
			}
			base.Apply();
		}
Ejemplo n.º 2
0
        public virtual void Apply(Entity entity, DrawData? drawData = null)
        {
            _shader.Parameters["uColor"].SetValue(_uColor);
            _shader.Parameters["uSaturation"].SetValue(_uSaturation);
            _shader.Parameters["uSecondaryColor"].SetValue(_uSecondaryColor);
            _shader.Parameters["uTime"].SetValue(Main.GlobalTime);
            _shader.Parameters["uOpacity"].SetValue(_uOpacity);
            if (drawData.HasValue)
            {
                DrawData drawData1 = drawData.Value;
                _shader.Parameters["uSourceRect"].SetValue(!drawData1.sourceRect.HasValue ? new Vector4(0.0f, 0.0f, (float)drawData1.texture.Width,
                    (float)drawData1.texture.Height) : new Vector4((float)drawData1.sourceRect.Value.X, (float)drawData1.sourceRect.Value.Y,
                        (float)drawData1.sourceRect.Value.Width, (float)drawData1.sourceRect.Value.Height));
                _shader.Parameters["uWorldPosition"].SetValue(Main.screenPosition + drawData1.position);
                _shader.Parameters["uImageSize0"].SetValue(new Vector2((float)drawData1.texture.Width, (float)drawData1.texture.Height));
                _shader.Parameters["uRotation"].SetValue(drawData1.rotation * (drawData1.effect.HasFlag(SpriteEffects.FlipHorizontally) ? -1f : 1f));
                _shader.Parameters["uDirection"].SetValue(drawData1.effect.HasFlag(SpriteEffects.FlipHorizontally) ? -1 : 1);
            }
            else
            {
                _shader.Parameters["uSourceRect"].SetValue(new Vector4(0.0f, 0.0f, 4f, 4f));
                _shader.Parameters["uRotation"].SetValue(0.0f);
            }

            if (_uImage != null)
            {
                Main.graphics.GraphicsDevice.Textures[1] = _uImage.Value;
                _shader.Parameters["uImageSize1"].SetValue(new Vector2((float)_uImage.Value.Width, (float)_uImage.Value.Height));
            }

            if (entity != null)
                _shader.Parameters["uDirection"].SetValue((float)entity.direction);
            Apply();
        }
Ejemplo n.º 3
0
        public virtual void Apply(DrawData? drawData = null)
        {
            _shader.Parameters["uColor"].SetValue(_uColor);
            _shader.Parameters["uSaturation"].SetValue(_uSaturation);
            _shader.Parameters["uSecondaryColor"].SetValue(_uSecondaryColor);
            _shader.Parameters["uTime"].SetValue(Main.GlobalTime);
            _shader.Parameters["uOpacity"].SetValue(_uOpacity);
            if (drawData.HasValue)
            {
                DrawData drawData1 = drawData.Value;
                _shader.Parameters["uSourceRect"].SetValue(new Vector4((float)drawData1.sourceRect.Value.X, (float)drawData1.sourceRect.Value.Y,
                    (float)drawData1.sourceRect.Value.Width, (float)drawData1.sourceRect.Value.Height));
                _shader.Parameters["uWorldPosition"].SetValue(Main.screenPosition + drawData1.position);
                _shader.Parameters["uImageSize0"].SetValue(new Vector2((float)drawData1.texture.Width, (float)drawData1.texture.Height));
            }
            else
                _shader.Parameters["uSourceRect"].SetValue(new Vector4(0.0f, 0.0f, 4f, 4f));

            if (_uImage != null)
            {
                Main.graphics.GraphicsDevice.Textures[1] = _uImage.Value;
                _shader.Parameters["uImageSize1"].SetValue(new Vector2((float)_uImage.Value.Width, (float)_uImage.Value.Height));
            }
            Apply();
        }
 public static DrawData DrawData_DrawLine(Vector2 pointA, Vector2 pointB, Color color, int width = 1)
 {
     Vector2 line = pointB - pointA;
     float rotation = (float)Math.Atan2(line.Y, line.X);
     DrawData data = new DrawData(oneByOne, new Rectangle((int)pointA.X, (int)pointA.Y, (int)line.Length(), width), null, color, rotation, new Vector2(0, 0), SpriteEffects.None, 0);
     data.ignorePlayerRotation = true;
     return data;
 }
		public override void Apply(Entity entity, DrawData? drawData)
		{
			Player player = entity as Player;
			if (player == null || player.team == 0)
			{
				TeamArmorShaderData.dustShaderData[0].Apply(player, drawData);
				return;
			}
			base.UseColor(Main.teamColor[player.team]);
			base.Apply(player, drawData);
		}
Ejemplo n.º 6
0
 public override void Apply(Entity entity, DrawData? drawData)
 {
     Player player = entity as Player;
     if (player == null || player.team == 0)
         dustShaderData[0].Apply(player, drawData);
     else
     {
         this.UseColor(Main.teamColor[player.team]);
         base.Apply(player, drawData);
     }
 }
		public override void Apply(Entity entity, DrawData? drawData)
		{
			if (entity == null)
			{
				this._shader.Parameters["uLightSource"].SetValue(Vector3.Zero);
			}
			else
			{
				float num = 0f;
				if (drawData.HasValue)
				{
					num = drawData.Value.rotation;
				}
				Vector2 value = entity.position;
				float num2 = (float)entity.width;
				float num3 = (float)entity.height;
				value += new Vector2(num2, num3) * 0.1f;
				num2 *= 0.8f;
				num3 *= 0.8f;
				Vector3 subLight = Lighting.GetSubLight(value + new Vector2(num2 * 0.5f, 0f));
				Vector3 subLight2 = Lighting.GetSubLight(value + new Vector2(0f, num3 * 0.5f));
				Vector3 subLight3 = Lighting.GetSubLight(value + new Vector2(num2, num3 * 0.5f));
				Vector3 subLight4 = Lighting.GetSubLight(value + new Vector2(num2 * 0.5f, num3));
				float num4 = subLight.X + subLight.Y + subLight.Z;
				float num5 = subLight2.X + subLight2.Y + subLight2.Z;
				float num6 = subLight3.X + subLight3.Y + subLight3.Z;
				float num7 = subLight4.X + subLight4.Y + subLight4.Z;
				Vector2 vector = new Vector2(num6 - num5, num7 - num4);
				float num8 = vector.Length();
				if (num8 > 1f)
				{
					num8 = 1f;
					vector /= num8;
				}
				if (entity.direction == -1)
				{
					vector.X *= -1f;
				}
				vector = vector.RotatedBy((double)(-(double)num), default(Vector2));
				Vector3 value2 = new Vector3(vector, 1f - (vector.X * vector.X + vector.Y * vector.Y));
				value2.X *= 2f;
				value2.Y -= 0.15f;
				value2.Y *= 2f;
				value2.Normalize();
				value2.Z *= 0.6f;
				this._shader.Parameters["uLightSource"].SetValue(value2);
			}
			base.Apply(entity, drawData);
		}
        public override void Apply(Entity entity, DrawData? drawData)
        {
            if (entity == null)
                _shader.Parameters["uLightSource"].SetValue(Vector3.Zero);
            else
            {
                float num1 = 0.0f;
                if (drawData.HasValue)
                    num1 = drawData.Value.rotation;

                Vector2 vector2_1 = entity.position;
                float x1 = (float)entity.width;
                float y1 = (float)entity.height;
                Vector2 vector2_2 = vector2_1 + new Vector2(x1, y1) * 0.1f;
                float x2 = x1 * 0.8f;
                float y2 = y1 * 0.8f;
                Vector3 subLight1 = Lighting.GetSubLight(vector2_2 + new Vector2(x2 * 0.5f, 0.0f));
                Vector3 subLight2 = Lighting.GetSubLight(vector2_2 + new Vector2(0.0f, y2 * 0.5f));
                Vector3 subLight3 = Lighting.GetSubLight(vector2_2 + new Vector2(x2, y2 * 0.5f));
                Vector3 subLight4 = Lighting.GetSubLight(vector2_2 + new Vector2(x2 * 0.5f, y2));
                float num2 = subLight1.X + subLight1.Y + subLight1.Z;
                float num3 = subLight2.X + subLight2.Y + subLight2.Z;
                float num4 = subLight3.X + subLight3.Y + subLight3.Z;
                float num5 = subLight4.X + subLight4.Y + subLight4.Z;
                Vector2 spinningpoint = new Vector2(num4 - num3, num5 - num2);
                if ((double)spinningpoint.Length() > 1.0)
                {
                    float num6 = 1f;
                    spinningpoint /= num6;
                }

                if (entity.direction == -1)
                    spinningpoint.X *= -1f;

                spinningpoint = Utils.RotatedBy(spinningpoint, -(double)num1, new Vector2());
                Vector3 vector3 = new Vector3(spinningpoint, (float)(1.0 - ((double)spinningpoint.X * (double)spinningpoint.X + (double)spinningpoint.Y * (double)spinningpoint.Y)));
                vector3.X *= 2f;
                vector3.Y -= 0.15f;
                vector3.Y *= 2f;
                vector3.Normalize();
                vector3.Z *= 0.6f;
                _shader.Parameters["uLightSource"].SetValue(vector3);
            }
            base.Apply(entity, drawData);
        }
		public virtual void Apply(Entity entity, DrawData? drawData = null)
		{
			this._shader.Parameters["uColor"].SetValue(this._uColor);
			this._shader.Parameters["uSaturation"].SetValue(this._uSaturation);
			this._shader.Parameters["uSecondaryColor"].SetValue(this._uSecondaryColor);
			this._shader.Parameters["uTime"].SetValue(Main.GlobalTime);
			this._shader.Parameters["uOpacity"].SetValue(this._uOpacity);
			if (drawData.HasValue)
			{
				DrawData value = drawData.Value;
				Vector4 value2;
				if (value.sourceRect.HasValue)
				{
					value2 = new Vector4((float)value.sourceRect.Value.X, (float)value.sourceRect.Value.Y, (float)value.sourceRect.Value.Width, (float)value.sourceRect.Value.Height);
				}
				else
				{
					value2 = new Vector4(0f, 0f, (float)value.texture.Width, (float)value.texture.Height);
				}
				this._shader.Parameters["uSourceRect"].SetValue(value2);
				this._shader.Parameters["uWorldPosition"].SetValue(Main.screenPosition + value.position);
				this._shader.Parameters["uImageSize0"].SetValue(new Vector2((float)value.texture.Width, (float)value.texture.Height));
				this._shader.Parameters["uRotation"].SetValue(value.rotation * (value.effect.HasFlag(SpriteEffects.FlipHorizontally) ? -1f : 1f));
				this._shader.Parameters["uDirection"].SetValue(value.effect.HasFlag(SpriteEffects.FlipHorizontally) ? -1 : 1);
			}
			else
			{
				this._shader.Parameters["uSourceRect"].SetValue(new Vector4(0f, 0f, 4f, 4f));
				this._shader.Parameters["uRotation"].SetValue(0f);
			}
			if (this._uImage != null)
			{
				Main.graphics.GraphicsDevice.Textures[1] = this._uImage.Value;
				this._shader.Parameters["uImageSize1"].SetValue(new Vector2((float)this._uImage.Value.Width, (float)this._uImage.Value.Height));
			}
			if (entity != null)
			{
				this._shader.Parameters["uDirection"].SetValue((float)entity.direction);
			}
			this.Apply();
		}
Ejemplo n.º 10
0
        public static void SetShaderForData(Player player, int cHead, ref DrawData cdd)
        {
            UnpackShader(cdd.shader, out int localShaderIndex, out ShaderConfiguration shaderType);
            switch (shaderType)
            {
            case ShaderConfiguration.ArmorShader:
                GameShaders.Hair.Apply(0, player, cdd);
                GameShaders.Armor.Apply(localShaderIndex, player, cdd);
                break;

            case ShaderConfiguration.HairShader:
                if (player.head == 0)
                {
                    GameShaders.Hair.Apply(0, player, cdd);
                    GameShaders.Armor.Apply(cHead, player, cdd);
                }
                else
                {
                    GameShaders.Armor.Apply(0, player, cdd);
                    GameShaders.Hair.Apply((short)localShaderIndex, player, cdd);
                }
                break;

            case ShaderConfiguration.TileShader:
                Main.tileShader.CurrentTechnique.Passes[localShaderIndex].Apply();
                break;

            case ShaderConfiguration.TilePaintID:
            {
                if (localShaderIndex == 31)
                {
                    GameShaders.Armor.Apply(0, player, cdd);
                    break;
                }
                int index = Main.ConvertPaintIdToTileShaderIndex(localShaderIndex, isUsedForPaintingGrass: false, useWallShaderHacks: false);
                Main.tileShader.CurrentTechnique.Passes[index].Apply();
                break;
            }
            }
        }
Ejemplo n.º 11
0
        public static void SetShaderForData(Player player, int cHead, ref DrawData cdd)
        {
            int localShaderIndex;

            PlayerDrawHelper.ShaderConfiguration shaderType;
            PlayerDrawHelper.UnpackShader(cdd.shader, out localShaderIndex, out shaderType);
            switch (shaderType)
            {
            case PlayerDrawHelper.ShaderConfiguration.ArmorShader:
                GameShaders.Hair.Apply((short)0, player, new DrawData?(cdd));
                GameShaders.Armor.Apply(localShaderIndex, (Entity)player, new DrawData?(cdd));
                break;

            case PlayerDrawHelper.ShaderConfiguration.HairShader:
                if (player.head == 0)
                {
                    GameShaders.Hair.Apply((short)0, player, new DrawData?(cdd));
                    GameShaders.Armor.Apply(cHead, (Entity)player, new DrawData?(cdd));
                    break;
                }
                GameShaders.Armor.Apply(0, (Entity)player, new DrawData?(cdd));
                GameShaders.Hair.Apply((short)localShaderIndex, player, new DrawData?(cdd));
                break;

            case PlayerDrawHelper.ShaderConfiguration.TileShader:
                Main.tileShader.CurrentTechnique.Passes[localShaderIndex].Apply();
                break;

            case PlayerDrawHelper.ShaderConfiguration.TilePaintID:
                if (localShaderIndex == 31)
                {
                    GameShaders.Armor.Apply(0, (Entity)player, new DrawData?(cdd));
                    break;
                }
                Main.tileShader.CurrentTechnique.Passes[Main.ConvertPaintIdToTileShaderIndex(localShaderIndex, false, false)].Apply();
                break;
            }
        }
        public static void DrawPlayer_RenderAllLayers(PlayerDrawHeadSet drawinfo)
        {
            List <DrawData> drawData    = drawinfo.DrawData;
            Effect          pixelShader = Main.pixelShader;

            _ = Main.projectile;
            SpriteBatch spriteBatch = Main.spriteBatch;

            for (int i = 0; i < drawData.Count; i++)
            {
                DrawData cdd = drawData[i];
                if (!cdd.sourceRect.HasValue)
                {
                    cdd.sourceRect = cdd.texture.Frame();
                }
                PlayerDrawHelper.SetShaderForData(drawinfo.drawPlayer, drawinfo.cHead, cdd);
                if (cdd.texture != null)
                {
                    cdd.Draw(spriteBatch);
                }
            }
            pixelShader.CurrentTechnique.Passes[0].Apply();
        }
Ejemplo n.º 13
0
        public static void DrawPlayer_RenderAllLayers(ref PlayerDrawHeadSet drawinfo)
        {
            List <DrawData> drawData    = drawinfo.DrawData;
            Effect          pixelShader = Main.pixelShader;

            Projectile[] projectile  = Main.projectile;
            SpriteBatch  spriteBatch = Main.spriteBatch;

            for (int index = 0; index < drawData.Count; ++index)
            {
                DrawData cdd = drawData[index];
                if (!cdd.sourceRect.HasValue)
                {
                    cdd.sourceRect = new Rectangle?(cdd.texture.Frame(1, 1, 0, 0, 0, 0));
                }
                PlayerDrawHelper.SetShaderForData(drawinfo.drawPlayer, drawinfo.cHead, ref cdd);
                if (cdd.texture != null)
                {
                    cdd.Draw(spriteBatch);
                }
            }
            pixelShader.CurrentTechnique.Passes[0].Apply();
        }
Ejemplo n.º 14
0
		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;
		}
Ejemplo n.º 15
0
 public void Draw(List<DrawData> playerDrawData, int drawType, Player drawPlayer, Vector2 Position, Color drawColor, SpriteEffects playerEffect, float shadow)
 {
     if (playerDrawData == null)
     {
         return;
     }
     Texture2D texture2D;
     Texture2D texture2D2;
     switch (drawType)
     {
     case 0:
         texture2D = this._data.backTexture;
         texture2D2 = this._data.backTextureGlow;
         break;
     case 1:
         texture2D = this._data.backTextureExtra;
         texture2D2 = this._data.backTextureExtraGlow;
         break;
     case 2:
         if (this._type == 0 && this._idleTime >= this._idleTimeNext)
         {
             return;
         }
         texture2D = this._data.frontTexture;
         texture2D2 = this._data.frontTextureGlow;
         break;
     case 3:
         texture2D = this._data.frontTextureExtra;
         texture2D2 = this._data.frontTextureExtraGlow;
         break;
     default:
         texture2D = null;
         texture2D2 = null;
         break;
     }
     if (texture2D == null)
     {
         return;
     }
     int type = this._type;
     if ((type == 0 || type == 9) && drawType == 3 && shadow != 0f)
     {
         return;
     }
     int num = this.XOffset;
     int num2 = this.YOffset + this.PlayerOffset;
     if (drawPlayer.direction <= 0 && (!this.Cart || !this.Directional))
     {
         num *= -1;
     }
     Position.X = (float)((int)(Position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) + (float)num));
     Position.Y = (float)((int)(Position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + (float)num2));
     int type2 = this._type;
     int num3;
     if (type2 != 5)
     {
         if (type2 == 9)
         {
             switch (drawType)
             {
             case 0:
                 num3 = this._frame;
                 goto IL_1D6;
             case 2:
                 num3 = this._frameExtra;
                 goto IL_1D6;
             case 3:
                 num3 = this._frameExtra;
                 goto IL_1D6;
             }
             num3 = 0;
         }
         else
         {
             num3 = this._frame;
         }
     }
     else
     {
         switch (drawType)
         {
         case 0:
             num3 = this._frame;
             break;
         case 1:
             num3 = this._frameExtra;
             break;
         default:
             num3 = 0;
             break;
         }
     }
     IL_1D6:
     int num4 = this._data.textureHeight / this._data.totalFrames;
     Rectangle value = new Rectangle(0, num4 * num3, this._data.textureWidth, num4);
     int type3 = this._type;
     if (type3 != 0)
     {
         switch (type3)
         {
         case 7:
             if (drawType == 3)
             {
                 drawColor = new Color(250, 250, 250, 255) * drawPlayer.stealth * (1f - shadow);
             }
             break;
         case 9:
             if (drawType == 3)
             {
                 if (this._abilityCharge == 0)
                 {
                     return;
                 }
                 drawColor = Color.Multiply(Color.White, (float)this._abilityCharge / (float)this._data.abilityChargeMax);
                 drawColor.A = 0;
             }
             break;
         }
     }
     else if (drawType == 3)
     {
         drawColor = Color.White;
     }
     Color color = new Color(drawColor.ToVector4() * 0.25f + new Vector4(0.75f));
     switch (this._type)
     {
     case 11:
         if (drawType == 2)
         {
             color = Color.White;
             color.A = 127;
         }
         break;
     case 12:
         if (drawType == 0)
         {
             float scale = MathHelper.Clamp(drawPlayer.MountFishronSpecialCounter / 60f, 0f, 1f);
             color = Colors.CurrentLiquidColor;
             if (color == Color.Transparent)
             {
                 color = Color.White;
             }
             color.A = 127;
             color *= scale;
         }
         break;
     }
     float num5 = 0f;
     switch (this._type)
     {
     case 7:
         num5 = drawPlayer.fullRotation;
         break;
     case 8:
     {
         Mount.DrillMountData drillMountData = (Mount.DrillMountData)this._mountSpecificData;
         if (drawType == 0)
         {
             num5 = drillMountData.outerRingRotation - num5;
         }
         else if (drawType == 3)
         {
             num5 = drillMountData.diodeRotation - num5 - drawPlayer.fullRotation;
         }
         break;
     }
     }
     Vector2 origin = this.Origin;
     int type4 = this._type;
     float scale2 = 1f;
     SpriteEffects effect;
     switch (this._type)
     {
     case 6:
     case 13:
         effect = (this._flipDraw ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
         goto IL_454;
     case 7:
         effect = SpriteEffects.None;
         goto IL_454;
     case 8:
         effect = ((drawPlayer.direction == 1 && drawType == 2) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
         goto IL_454;
     case 11:
         effect = ((Math.Sign(drawPlayer.velocity.X) == -drawPlayer.direction) ? (playerEffect ^ SpriteEffects.FlipHorizontally) : playerEffect);
         goto IL_454;
     }
     effect = playerEffect;
     IL_454:
     bool flag = false;
     int type5 = this._type;
     if (!flag)
     {
         DrawData item = new DrawData(texture2D, Position, new Rectangle?(value), drawColor, num5, origin, scale2, effect, 0);
         item.shader = Mount.currentShader;
         playerDrawData.Add(item);
         if (texture2D2 != null)
         {
             item = new DrawData(texture2D2, Position, new Rectangle?(value), color, num5, origin, scale2, effect, 0);
             item.shader = Mount.currentShader;
         }
         playerDrawData.Add(item);
     }
     int type6 = this._type;
     if (type6 != 8)
     {
         return;
     }
     if (drawType == 3)
     {
         Mount.DrillMountData drillMountData2 = (Mount.DrillMountData)this._mountSpecificData;
         Rectangle value2 = new Rectangle(0, 0, 1, 1);
         Vector2 vector = Mount.drillDiodePoint1.RotatedBy((double)drillMountData2.diodeRotation, default(Vector2));
         Vector2 vector2 = Mount.drillDiodePoint2.RotatedBy((double)drillMountData2.diodeRotation, default(Vector2));
         for (int i = 0; i < drillMountData2.beams.Length; i++)
         {
             Mount.DrillBeam drillBeam = drillMountData2.beams[i];
             if (!(drillBeam.curTileTarget == Point16.NegativeOne))
             {
                 for (int j = 0; j < 2; j++)
                 {
                     Vector2 value3 = new Vector2((float)(drillBeam.curTileTarget.X * 16 + 8), (float)(drillBeam.curTileTarget.Y * 16 + 8)) - Main.screenPosition - Position;
                     Vector2 vector3;
                     Color color2;
                     if (j == 0)
                     {
                         vector3 = vector;
                         color2 = Color.CornflowerBlue;
                     }
                     else
                     {
                         vector3 = vector2;
                         color2 = Color.LightGreen;
                     }
                     color2.A = 128;
                     color2 *= 0.5f;
                     Vector2 v = value3 - vector3;
                     float num6 = v.ToRotation();
                     float y = v.Length();
                     Vector2 scale3 = new Vector2(2f, y);
                     DrawData item = new DrawData(Main.magicPixel, vector3 + Position, new Rectangle?(value2), color2, num6 - 1.57079637f, Vector2.Zero, scale3, SpriteEffects.None, 0);
                     item.ignorePlayerRotation = true;
                     item.shader = Mount.currentShader;
                     playerDrawData.Add(item);
                 }
             }
         }
     }
 }
Ejemplo n.º 16
0
 public void Draw(List<DrawData> playerDrawData, int drawType, Player drawPlayer, Vector2 Position, Color drawColor, SpriteEffects playerEffect, float shadow)
 {
     if (playerDrawData == null)
         return;
     Texture2D texture1;
     Texture2D texture2;
     switch (drawType)
     {
         case 0:
             texture1 = this._data.backTexture;
             texture2 = this._data.backTextureGlow;
             break;
         case 1:
             texture1 = this._data.backTextureExtra;
             texture2 = this._data.backTextureExtraGlow;
             break;
         case 2:
             if (this._type == 0 && this._idleTime >= this._idleTimeNext)
                 return;
             texture1 = this._data.frontTexture;
             texture2 = this._data.frontTextureGlow;
             break;
         case 3:
             texture1 = this._data.frontTextureExtra;
             texture2 = this._data.frontTextureExtraGlow;
             break;
         default:
             texture1 = (Texture2D)null;
             texture2 = (Texture2D)null;
             break;
     }
     if (texture1 == null)
         return;
     switch (this._type)
     {
         case 0:
         case 9:
             if (drawType == 3 && (double)shadow != 0.0)
                 return;
             break;
     }
     int xoffset = this.XOffset;
     int num1 = this.YOffset + this.PlayerOffset;
     if (drawPlayer.direction <= 0 && (!this.Cart || !this.Directional))
         xoffset *= -1;
     Position.X = (float)(int)((double)Position.X - (double)Main.screenPosition.X + (double)(drawPlayer.width / 2) + (double)xoffset);
     Position.Y = (float)(int)((double)Position.Y - (double)Main.screenPosition.Y + (double)(drawPlayer.height / 2) + (double)num1);
     int num2;
     switch (this._type)
     {
         case 5:
             switch (drawType)
             {
                 case 0:
                     num2 = this._frame;
                     break;
                 case 1:
                     num2 = this._frameExtra;
                     break;
                 default:
                     num2 = 0;
                     break;
             }
             break;
         case 9:
             switch (drawType)
             {
                 case 0:
                     num2 = this._frame;
                     break;
                 case 2:
                     num2 = this._frameExtra;
                     break;
                 case 3:
                     num2 = this._frameExtra;
                     break;
                 default:
                     num2 = 0;
                     break;
             }
             break;
         default:
             num2 = this._frame;
             break;
     }
     int height = this._data.textureHeight / this._data.totalFrames;
     Rectangle rectangle1 = new Rectangle(0, height * num2, this._data.textureWidth, height);
     switch (this._type)
     {
         case 0:
             if (drawType == 3)
             {
                 drawColor = Color.White;
                 break;
             }
             break;
         case 7:
             if (drawType == 3)
             {
                 drawColor = new Color(250, 250, 250, (int)byte.MaxValue);
                 break;
             }
             break;
         case 9:
             if (drawType == 3)
             {
                 if (this._abilityCharge == 0)
                     return;
                 drawColor = Color.Multiply(Color.White, (float)this._abilityCharge / (float)this._data.abilityChargeMax);
                 drawColor.A = (byte)0;
                 break;
             }
             break;
     }
     Color color1 = new Color(drawColor.ToVector4() * 0.25f + new Vector4(0.75f));
     switch (this._type)
     {
         case 11:
             if (drawType == 2)
             {
                 color1 = Color.White;
                 color1.A = (byte)127;
                 break;
             }
             break;
         case 12:
             if (drawType == 0)
             {
                 float num3 = MathHelper.Clamp(drawPlayer.MountFishronSpecialCounter / 60f, 0.0f, 1f);
                 Color color2 = Colors.CurrentLiquidColor;
                 if (color2 == Color.Transparent)
                     color2 = Color.White;
                 color2.A = (byte)127;
                 color1 = color2 * num3;
                 break;
             }
             break;
     }
     float rotation = 0.0f;
     switch (this._type)
     {
         case 7:
             rotation = drawPlayer.fullRotation;
             break;
         case 8:
             Mount.DrillMountData drillMountData1 = (Mount.DrillMountData)this._mountSpecificData;
             if (drawType == 0)
             {
                 rotation = drillMountData1.outerRingRotation - rotation;
                 break;
             }
             if (drawType == 3)
             {
                 rotation = drillMountData1.diodeRotation - rotation - drawPlayer.fullRotation;
                 break;
             }
             break;
     }
     Vector2 origin = this.Origin;
     int num4 = this._type;
     float scale1 = 1f;
     SpriteEffects effect;
     switch (this._type)
     {
         case 6:
         case 13:
             effect = this._flipDraw ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
             break;
         case 7:
             effect = SpriteEffects.None;
             break;
         case 8:
             effect = drawPlayer.direction != 1 || drawType != 2 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
             break;
         case 11:
             effect = Math.Sign(drawPlayer.velocity.X) == -drawPlayer.direction ? playerEffect ^ SpriteEffects.FlipHorizontally : playerEffect;
             break;
         default:
             effect = playerEffect;
             break;
     }
     bool flag = false;
     int num5 = this._type;
     DrawData drawData;
     if (!flag)
     {
         drawData = new DrawData(texture1, Position, new Rectangle?(rectangle1), drawColor, rotation, origin, scale1, effect, 0);
         drawData.shader = Mount.currentShader;
         playerDrawData.Add(drawData);
         if (texture2 != null)
         {
             drawData = new DrawData(texture2, Position, new Rectangle?(rectangle1), color1, rotation, origin, scale1, effect, 0);
             drawData.shader = Mount.currentShader;
         }
         playerDrawData.Add(drawData);
     }
     if (this._type != 8 || drawType != 3)
         return;
     Mount.DrillMountData drillMountData2 = (Mount.DrillMountData)this._mountSpecificData;
     Rectangle rectangle2 = new Rectangle(0, 0, 1, 1);
     Vector2 vector2_1 = Utils.RotatedBy(Mount.drillDiodePoint1, (double)drillMountData2.diodeRotation, new Vector2());
     Vector2 vector2_2 = Utils.RotatedBy(Mount.drillDiodePoint2, (double)drillMountData2.diodeRotation, new Vector2());
     for (int index1 = 0; index1 < drillMountData2.beams.Length; ++index1)
     {
         Mount.DrillBeam drillBeam = drillMountData2.beams[index1];
         if (!(drillBeam.curTileTarget == Point16.NegativeOne))
         {
             for (int index2 = 0; index2 < 2; ++index2)
             {
                 Vector2 vector2_3 = new Vector2((float)((int)drillBeam.curTileTarget.X * 16 + 8), (float)((int)drillBeam.curTileTarget.Y * 16 + 8)) - Main.screenPosition - Position;
                 Vector2 vector2_4;
                 Color color2;
                 if (index2 == 0)
                 {
                     vector2_4 = vector2_1;
                     color2 = Color.CornflowerBlue;
                 }
                 else
                 {
                     vector2_4 = vector2_2;
                     color2 = Color.LightGreen;
                 }
                 color2.A = Convert.ToByte(-128);
                 Color color3 = color2 * 0.5f;
                 Vector2 v = vector2_3 - vector2_4;
                 float num3 = Utils.ToRotation(v);
                 Vector2 scale2 = new Vector2(2f, v.Length());
                 drawData = new DrawData(Main.magicPixel, vector2_4 + Position, new Rectangle?(rectangle2), color3, num3 - 1.570796f, Vector2.Zero, scale2, SpriteEffects.None, 0);
                 drawData.ignorePlayerRotation = true;
                 drawData.shader = Mount.currentShader;
                 playerDrawData.Add(drawData);
             }
         }
     }
 }