added glowmasks to black hawks and viper jets

This commit is contained in:
termigator1359 committed 2020-05-31 12:47:29 -04:00
1 parent bc31b39673
commit d6d5bc4490
4 files changed
+44 -5

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

+27
View File
@@ -2,6 +2,7 @@ using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
@@ -267,5 +268,31 @@ namespace CalamityMod.Projectiles.Summon
//Does no contact damage
public override bool CanDamage() => false;
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture = Main.projectileTexture[projectile.type];
int frameHeight = texture.Height / Main.projFrames[projectile.type];
int y6 = frameHeight * projectile.frame;
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f);
return false;
}
//Pretty glowmask
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/BlackHawkGlow");
int frameHeight = texture.Height / Main.projFrames[projectile.type];
int y6 = frameHeight * projectile.frame;
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

+17 -5
View File
@@ -268,19 +268,31 @@ namespace CalamityMod.Projectiles.Summon
}
}
public override bool CanDamage() => false;
public override bool CanDamage() => false;
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture = Main.projectileTexture[projectile.type];
int frameHeight = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
int frameHeight = texture.Height / Main.projFrames[projectile.type];
int y6 = frameHeight * projectile.frame;
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f);
return false;
return false;
}
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/CosmicViperGlow");
int frameHeight = texture.Height / Main.projFrames[projectile.type];
int y6 = frameHeight * projectile.frame;
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f);
}
}
}