Untitled

mail@pastecode.io avatar
unknown
csharp
2 years ago
1.1 kB
0
Indexable
Never
public static PlayerLayer MiscEffects = new PlayerLayer("Bluemagic", "MiscEffects", PlayerLayer.MiscEffectsFront, delegate(PlayerDrawInfo drawInfo)
			{
			    if (drawInfo.shadow != 0f)
				{
					return;
				}
				Player drawPlayer = drawInfo.drawPlayer;
				if (drawPlayer.dead)
				{
					return;
				}
				if (modPlayer.purityShieldMount)
				{
					Texture2D texture = mod.GetTexture("Mounts/PurityShield");
					int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X);
					int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y);
					float strength = (player.miscTimer % 30f) / 15f;
					if (strength > 1f)
					{
						strength = 2f - strength;
					}
					strength = 0.4f + strength * 0.2f;
					DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.White * strength, 0f, new Vector2(texture.Width / 2f, texture.Height / 2f), 1f, SpriteEffects.None, 0);
					data.shader = drawInfo.drawPlayer.miscDyes[3].dye;
					Main.playerDrawData.Add(data);
				}
			});