Actually Blunder Booster has reduced opacity instead of being entirely disabled

This commit is contained in:
CongratsIsTrash committed 2024-07-21 00:01:52 -04:00
1 parent 9b349b3d73
commit b33ecdab1a
2 files changed
+2 -31

No files matched your search

@@ -359,7 +359,7 @@ BlunderBooster: {
12% increased rogue damage and 15% increased rogue projectile velocity
Stealth generates 10% faster
Summons a red lightning aura around the player that electrifies nearby enemies
The aura's appearance can be toggled with visibility
The aura has reduced opacity if visibility is disabled
Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards diagonal dash
This dash leaves a trail of red lightning bolts
This effect has a 1 second cooldown before it can be used again
+1 -30
View File
@@ -86,42 +86,13 @@ namespace CalamityMod.Projectiles.Typeless
public override bool PreDraw(ref Color lightColor)
{
// Don't draw the aura at all if visibility is toggled off
if (!Main.player[Projectile.owner].Calamity().blunderBoosterVisibility)
return false;
Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Color drawColour = Color.White;
Rectangle sourceRect = new Rectangle(Projectile.width * (int)Projectile.localAI[1], Projectile.height * (int)Projectile.localAI[0], Projectile.width, Projectile.height);
Vector2 origin = new Vector2(Projectile.width / 2, Projectile.height / 2);
float opacity = 1f;
int sparkCount = 0;
int fadeTime = 20;
if (Projectile.timeLeft < fadeTime)
{
opacity = Projectile.timeLeft * (1f / fadeTime);
sparkCount = fadeTime - Projectile.timeLeft;
}
for (int i = 0; i < sparkCount * 2; i++)
{
int dustType = 132;
if (Main.rand.NextBool())
{
dustType = 264;
}
float rangeDiff = 2f;
Vector2 dustPos = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
dustPos.Normalize();
dustPos *= radius + Main.rand.NextFloat(-rangeDiff, rangeDiff);
int dust = Dust.NewDust(Projectile.Center + dustPos, 1, 1, dustType, 0, 0, 0, default, 0.75f);
Main.dust[dust].noGravity = true;
}
float opacity = Main.player[Projectile.owner].Calamity().blunderBoosterVisibility ? 1f : 0.25f;
Main.EntitySpriteDraw(sprite, Projectile.Center - Main.screenPosition, sourceRect, drawColour * opacity, Projectile.rotation, origin, 1f, SpriteEffects.None, 0);
return false;