Blood Boiler Rework and minor improved visuals for others

Blood Boiler:
Fires a dual stream of bloodfire that returns to you and has a chance to heal for either one HP or 2/3 HP if you hit an enemy before it returns
Uses your health as ammo (one HP 40% of the time when it fires)
bloodfire does 12% less damage with each pierce
This commit is contained in:
Xyk committed 2023-10-16 22:53:49 -07:00
1 parent 9f3202a362
commit cddca9347f
8 files changed
+149 -90

No files matched your search

+9 -5
View File
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Ranged;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -12,17 +13,20 @@ namespace CalamityMod.Items.Weapons.Ranged
public class BloodBoiler : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public static readonly SoundStyle Heartbeat = new("CalamityMod/Sounds/Item/Heartbeat") { PitchVariance = 0.2f, Volume = 0.55f };
public bool shotReturn = false;
public override void SetDefaults()
{
Item.damage = 145;
Item.damage = 185;
Item.DamageType = DamageClass.Ranged;
Item.width = 60;
Item.height = 30;
Item.useTime = 5;
Item.useAnimation = 15;
Item.useAnimation = 20;
Item.autoReuse = true;
Item.UseSound = Heartbeat;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 4f;
@@ -37,8 +41,8 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
shotReturn = !shotReturn;
if (Main.rand.NextFloat() > 0.75f)
player.statLife -= (Main.rand.NextBool(3) ? 2 : 1);
if (Main.rand.NextFloat() > 0.60f)
player.statLife -= 1;
if (player.statLife <= 0)
{
PlayerDeathReason pdr = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BloodBoiler" + Main.rand.Next(1, 2 + 1)).Format(player.name));
@@ -162,7 +162,7 @@ BloodBoiler: {
DisplayName: Blood Boiler
Tooltip:
'''
Fires a stream of lifestealing bloodfire that returns to you
Fires a dual stream of lifestealing bloodfire that returns to you
Uses your health as ammo
'''
}
@@ -0,0 +1,58 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace CalamityMod.Particles.Metaballs
{
public class Blood : BloodBoilerParticleSets
{
public override Color BorderColor => Color.DarkRed * 0.8f;
}
public abstract class BloodBoilerParticleSets : BaseFusableParticleSet
{
public override float BorderSize => 12f;
public override bool BorderShouldBeSolid => false;
private float opacity;
public override List<Effect> BackgroundShaders => new()
{
GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"].Shader,
};
public override List<Texture2D> BackgroundTextures => new()
{
ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value,
};
public override FusableParticle SpawnParticle(Vector2 center, float sizeStrength)
{
Particles.Add(new FusableParticle(center, sizeStrength));
return Particles.Last();
}
public override void UpdateBehavior(FusableParticle particle)
{
opacity = 0.65f;
particle.Size = MathHelper.Clamp(particle.Size - 0.1f, 0f, 200f) * 0.91f;
if (particle.Size < 20f)
particle.Size = particle.Size * 0.8f - 1f;
}
public override void DrawParticles()
{
Texture2D fusableParticleBase = ModContent.Request<Texture2D>("CalamityMod/Particles/Metaballs/FusableParticleBase").Value;
foreach (FusableParticle particle in Particles)
{
Vector2 drawPosition = particle.Center - Main.screenPosition;
Vector2 origin = fusableParticleBase.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / fusableParticleBase.Size();
Color drawColor = Color.Lerp(BorderColor, new Color(0f, 0f, 1f), Utils.GetLerpValue(50f, 100f, particle.Size, true) * 0.1f) * 1.2f;
Main.spriteBatch.Draw(fusableParticleBase, drawPosition, null, drawColor * opacity, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
}
}
+4 -4
View File
@@ -41,14 +41,14 @@ namespace CalamityMod.Projectiles.Ranged
{
Time++;
Projectile.rotation += Main.rand.NextFloat(0.2f, 0.9f);
if (Time > 6 && Time < 540 && Main.rand.NextBool(4 + Time / 6))
if (Time > 6 && Time < 540 && Main.rand.NextBool(2 + Time / 7))
{
DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center + Main.rand.NextVector2Circular(10 + Time * 0.5f, 10 + Time * 0.5f), Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.03f, 0.09f) + Time * 0.00055f, 0f, 25);
GeneralParticleHandler.SpawnParticle(pulse);
}
if (Time > 6 && Time < 135 && !postTileHit && !postEnemyHit && Main.rand.NextBool(3 + Time / 5))
if (Time > 6 && Time < 150 && !postTileHit && !postEnemyHit && Main.rand.NextBool(3 + Time / 7))
{
SmallSmokeParticle smoke = new SmallSmokeParticle(Projectile.Center + Main.rand.NextVector2Circular(5 + Time * 0.2f, 5 + Time * 0.2f), -Projectile.velocity * 0.05f, Color.Chartreuse, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Lime, Main.rand.NextFloat(0.5f, 1.8f) + Time * 0.00555f, 60);
MediumMistParticle smoke = new MediumMistParticle(Projectile.Center + Main.rand.NextVector2Circular(5 + Time * 0.2f, 5 + Time * 0.2f), -Projectile.velocity * 0.05f, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Lime, Color.Black, Main.rand.NextFloat(0.3f, 0.8f) + Time * 0.013f, 160);
GeneralParticleHandler.SpawnParticle(smoke);
}
if (Time == 8)
@@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Ranged
for (int i = 0; i <= 3; i++)
{
SmallSmokeParticle smoke = new SmallSmokeParticle(Projectile.Center + Main.rand.NextVector2Circular(5 + Time * 0.2f, 5 + Time * 0.2f), new Vector2(Main.rand.NextFloat(2, 6), Main.rand.NextFloat(2, 6)).RotatedByRandom(60), Color.Chartreuse, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Lime, Main.rand.NextFloat(1.2f, 2.8f), 60);
MediumMistParticle smoke = new MediumMistParticle(Projectile.Center + Main.rand.NextVector2Circular(5 + Time * 0.2f, 5 + Time * 0.2f), new Vector2(Main.rand.NextFloat(2, 6), Main.rand.NextFloat(2, 6)).RotatedByRandom(60), Main.rand.NextBool(3) ? Color.LimeGreen : Color.Lime, Color.Black, Main.rand.NextFloat(1.2f, 2.3f), 140);
GeneralParticleHandler.SpawnParticle(smoke);
}
if (!postTileHit && !postEnemyHit)
+69 -76
View File
@@ -7,17 +7,20 @@ using Terraria.ModLoader;
using Terraria.Audio;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.Particles;
using CalamityMod.Particles.Metaballs;
namespace CalamityMod.Projectiles.Ranged
{
public class BloodBoilerFire : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/Ranged/BloodFlames";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
private bool playedSound = false;
public int Time = 0;
public float particleSize = 15;
public Vector2 bloodCloudReturn;
public bool improvedHeal = false;
public override void SetDefaults()
{
Projectile.width = 43;
@@ -27,63 +30,54 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.DamageType = DamageClass.Ranged;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.extraUpdates = 2;
Projectile.extraUpdates = 4;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 5;
Projectile.timeLeft = 300;
Projectile.alpha = 255;
}
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10;
ProjectileID.Sets.TrailingMode[Projectile.type] = 3;
}
public override void AI()
{
if (Projectile.ai[1] == 0f)
Time++;
if (Projectile.timeLeft > 220) // Main visual size changes
particleSize += 0.5f;
else
Time -= 3;
Projectile.rotation += 3 * Projectile.direction;
if (Projectile.timeLeft == 295)
{
Projectile.scale = 0.04f;
if (Main.rand.NextBool())
{
int bloodLifetime = Main.rand.Next(22, 36);
float bloodScale = Main.rand.NextFloat(0.6f, 0.8f);
Color bloodColor = Main.rand.NextBool() ? Color.Firebrick : Color.Red;
particleSize -= 1f;
float randomSpeedMultiplier = Main.rand.NextFloat(0.8f, 1.55f);
Vector2 bloodVelocity = Projectile.velocity.RotatedByRandom(0.5) * randomSpeedMultiplier;
BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
GeneralParticleHandler.SpawnParticle(blood);
Time++;
if (Projectile.timeLeft == 295) // Blood produced from the muzzle when firing the weapon
{
int bloodLifetime = Main.rand.Next(22, 36);
float bloodScale = Main.rand.NextFloat(0.6f, 0.8f);
Color bloodColor = Main.rand.NextBool() ? Color.Firebrick : Color.Red;
float randomSpeedMultiplier = Main.rand.NextFloat(0.8f, 1.55f);
Vector2 bloodVelocity = Projectile.velocity.RotatedByRandom(0.5) * randomSpeedMultiplier + new Vector2 (0, -3);
BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
GeneralParticleHandler.SpawnParticle(blood);
}
if (Projectile.timeLeft < 296) // The main visual of the projectile and the blood mist it produces before turning around
{
FusableParticleManager.GetParticleSetByType<Blood>()?.SpawnParticle(Projectile.Center, particleSize * 2);
if (Main.rand.NextBool(6) && Projectile.ai[1] == 0f)
{
Color smokeColor = Main.rand.NextBool() ? Color.Red : Color.Firebrick;
Vector2 smokePosition = Projectile.Center + Main.rand.NextVector2Circular(5 + Time * 0.3f, 5 + Time * 0.3f);
float smokeScale = Main.rand.NextFloat(0.5f, 1.6f);
float smokeOpacity = 170 + -Time * 0.6f;
Particle smoke = new MediumMistParticle(smokePosition, Vector2.Zero, smokeColor, Color.Black, smokeScale, smokeOpacity, Main.rand.NextFloat(0.2f, -0.2f));
GeneralParticleHandler.SpawnParticle(smoke);
}
}
if (Projectile.timeLeft == 296)
if (Projectile.ai[1] == 0f) // Blood pulses on the projectile before it turns around
{
Projectile.alpha = 80;
}
if (Projectile.timeLeft < 296 && Main.rand.NextBool(5))
{
Color smokeColor = Main.rand.NextBool() ? Color.Red : Color.Firebrick;
Vector2 smokePosition = Projectile.Center + Main.rand.NextVector2Circular(5 + Time * 0.3f, 5 + Time * 0.3f);
float smokeScale = Projectile.ai[1] == 1 ? Main.rand.NextFloat(0.1f, 0.35f) + Time * 0.01f : Main.rand.NextFloat(0.5f, 1.6f);
float smokeOpacity = Projectile.ai[1] == 1 ? 120 + Time * 0.9f : 170 + -Time * 0.7f;
Particle smoke = new MediumMistParticle(smokePosition, Projectile.ai[1] == 1 ? Projectile.velocity * 0.5f : Vector2.Zero, smokeColor, Color.Black, smokeScale, smokeOpacity, Main.rand.NextFloat(0.2f, -0.2f));
GeneralParticleHandler.SpawnParticle(smoke);
}
if (Projectile.ai[1] == 0f)
{
if (Main.rand.NextBool(7))
if (Main.rand.NextBool(9))
{
DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center + Main.rand.NextVector2Circular(7 + Time * 0.4f, 7 + Time * 0.4f), Vector2.Zero, Main.rand.NextBool(3) ? Color.Red : Color.Firebrick, new Vector2(1, 1), 0, Main.rand.NextFloat(0.02f, 0.07f) + Time * 0.0006f, 0f, 35);
GeneralParticleHandler.SpawnParticle(pulse);
}
Projectile.scale += 0.006f;
}
else if (Projectile.scale > 0.01)
Projectile.scale -= 0.01f;
if (!playedSound)
{
SoundEngine.PlaySound(SoundID.Item34, Projectile.position);
@@ -91,6 +85,8 @@ namespace CalamityMod.Projectiles.Ranged
}
Lighting.AddLight(Projectile.Center, 1f, 0f, 0f);
// A bunch of small things mostly for visuals when the projectile starts turning around before it homes on the player
if (Projectile.timeLeft == 235)
bloodCloudReturn = Projectile.velocity;
if (Projectile.timeLeft <= 235 && Projectile.ai[1] == 0f)
@@ -100,25 +96,29 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.velocity = -bloodCloudReturn.RotatedBy(Projectile.ai[2] == 5 ? -0.7f : 0.7f) * 1.2f;
for (int i = 0; i <= 5; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(40, 40), Main.rand.NextBool(3) ? 60 : 90, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(2f)) * Main.rand.NextFloat(0.3f, 2.2f));
Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity * 2 + Main.rand.NextVector2Circular(35, 35), Main.rand.NextBool(3) ? 60 : 296, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(0.5f)) * Main.rand.NextFloat(1.7f, 3.2f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(1.2f, 2f);
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(40, 40), Main.rand.NextBool(3) ? 60 : 90, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.2f));
Dust dust2 = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity * 2 + Main.rand.NextVector2Circular(35, 35), Main.rand.NextBool(3) ? 60 : 296, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.7f));
dust2.noGravity = true;
dust2.scale = Main.rand.NextFloat(1.2f, 2f);
}
}
if (Projectile.timeLeft == 209)
if (Projectile.timeLeft == 209) // Begin returning to player
{
Projectile.ai[1] = 1f;
}
if (Projectile.ai[1] == 1f)
if (Projectile.ai[1] == 1f) // Dusts as the projectile homes back in on the player
{
Projectile.extraUpdates = 3;
Projectile.alpha = 160;
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), Main.rand.NextBool(3) ? 60 : 5);
dust.scale = Main.rand.NextFloat(0.4f, 0.7f);
Projectile.extraUpdates = 5;
bool dustEffect = Main.rand.NextBool(3) ? false : true;
int dustColor = dustEffect ? 296 : 60;
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(dustEffect ? 0 : 5, dustEffect ? 0 : 5), dustColor);
dust.scale = dustEffect ? Main.rand.NextFloat(1.1f, 1.45f) : Main.rand.NextFloat(0.9f, 1.2f);
dust.velocity = dustEffect ? Vector2.Zero : Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(0.7f, 1.2f);
dust.alpha = 100;
dust.noLight = true;
dust.noGravity = true;
Player player = Main.player[Projectile.owner];
@@ -138,29 +138,30 @@ namespace CalamityMod.Projectiles.Ranged
// Home back in on the player.
if (Projectile.velocity.X < xDist)
{
Projectile.velocity.X = Projectile.velocity.X + 0.1f;
Projectile.velocity.X = Projectile.velocity.X + 0.3f;
if (Projectile.velocity.X < 0f && xDist > 0f)
Projectile.velocity.X += 0.1f;
Projectile.velocity.X += 0.3f;
}
else if (Projectile.velocity.X > xDist)
{
Projectile.velocity.X = Projectile.velocity.X - 0.1f;
Projectile.velocity.X = Projectile.velocity.X - 0.3f;
if (Projectile.velocity.X > 0f && xDist < 0f)
Projectile.velocity.X -= 0.1f;
Projectile.velocity.X -= 0.3f;
}
if (Projectile.velocity.Y < yDist)
{
Projectile.velocity.Y = Projectile.velocity.Y + 0.1f;
Projectile.velocity.Y = Projectile.velocity.Y + 0.3f;
if (Projectile.velocity.Y < 0f && yDist > 0f)
Projectile.velocity.Y += 0.1f;
Projectile.velocity.Y += 0.3f;
}
else if (Projectile.velocity.Y > yDist)
{
Projectile.velocity.Y = Projectile.velocity.Y - 0.1f;
Projectile.velocity.Y = Projectile.velocity.Y - 0.3f;
if (Projectile.velocity.Y > 0f && yDist < 0f)
Projectile.velocity.Y -= 0.1f;
Projectile.velocity.Y -= 0.3f;
}
if (Projectile.timeLeft == 5) // Absolutely make sure the player gets the chance to heal
Projectile.Center = playerCenter;
// Delete the projectile if it touches its owner. Has a chance to heal the player again
if (Main.myPlayer == Projectile.owner)
{
@@ -168,8 +169,9 @@ namespace CalamityMod.Projectiles.Ranged
{
if (Main.rand.NextBool(4) && !Main.player[Projectile.owner].moonLeech)
{
player.statLife += 1;
player.HealEffect(1);
int bonusHeal = Main.rand.NextBool(3) ? 3 : 2;
player.statLife += improvedHeal ? bonusHeal : 1;
player.HealEffect(improvedHeal ? bonusHeal : 1);
}
Projectile.Kill();
}
@@ -179,23 +181,14 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<BurningBlood>(), 240);
if (!target.canGhostHeal || Main.player[Projectile.owner].moonLeech)
return;
Player player = Main.player[Projectile.owner];
if (Main.rand.NextBool(3))
{
int healAmt = Main.rand.Next(1, 4);
player.statLife += healAmt;
player.HealEffect(healAmt);
}
target.AddBuff(ModContent.BuffType<BurningBlood>(), 600);
improvedHeal = true;
}
public override bool PreDraw(ref Color lightColor)
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/BloodFlames").Value);
return false;
Projectile.damage = (int)(Projectile.damage * 0.88f); // 12% damage nerf for every enemy hit
if (Projectile.damage < 1)
Projectile.damage = 1;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

+8 -4
View File
@@ -41,16 +41,20 @@ namespace CalamityMod.Projectiles.Ranged
}
else if (Time == 5f)
{
Particle pulse = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.75f, Color.Aqua, new Vector2(1f, 2.5f), Projectile.rotation, 0.4f, 0.05f, 20);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.75f, Color.Aqua, new Vector2(1f, 2.5f), Projectile.rotation, 0.2f, 0.03f, 20);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.4f, Color.DodgerBlue, new Vector2(1f, 2.5f), Projectile.rotation, 0.2f, 0.05f, 35);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.4f, Color.DodgerBlue, new Vector2(1f, 2.5f), Projectile.rotation, 0.1f, 0.025f, 35);
GeneralParticleHandler.SpawnParticle(pulse2);
for (int i = 0; i <= 25; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 172 : 206, Projectile.velocity);
dust.scale = Main.rand.NextFloat(1.5f, 2.3f);
dust.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 2.1f);
dust.scale = Main.rand.NextFloat(1.6f, 2.5f);
dust.velocity = Projectile.velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.3f, 1.6f);
dust.noGravity = true;
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 172 : 206, Projectile.velocity);
dust2.scale = Main.rand.NextFloat(1.35f, 2.1f);
dust2.velocity = Projectile.velocity.RotatedByRandom(0.06f) * Main.rand.NextFloat(0.8f, 3.1f);
dust2.noGravity = true;
}
}
Binary file not shown.