diff --git a/Items/Weapons/Ranged/CleansingBlaze.cs b/Items/Weapons/Ranged/CleansingBlaze.cs index cc3983083a..2d485f0d6d 100644 --- a/Items/Weapons/Ranged/CleansingBlaze.cs +++ b/Items/Weapons/Ranged/CleansingBlaze.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 130; + Item.damage = 240; Item.DamageType = DamageClass.Ranged; Item.width = 64; Item.height = 32; diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 974dbfc314..209be8de3b 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -4,6 +4,7 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -12,12 +13,15 @@ namespace CalamityMod.Items.Weapons.Ranged public class HalleysInferno : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public static readonly SoundStyle Shoot = new("CalamityMod/Sounds/Item/HalleysInfernoShoot") { Volume = 0.6f }; + public static readonly SoundStyle Hit = new("CalamityMod/Sounds/Item/HalleysInfernoHit") { Volume = 0.5f }; public override void SetDefaults() { - Item.damage = 1125; - Item.knockBack = 5f; + Item.damage = 1205; + Item.knockBack = 5.5f; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 30; + Item.useTime = Item.useAnimation = 39; Item.autoReuse = true; Item.useAmmo = AmmoID.Gel; Item.shootSpeed = 14.6f; @@ -27,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.UseSound = SoundID.Item34; + Item.UseSound = Shoot; Item.value = CalamityGlobalItem.Rarity13BuyPrice; Item.rare = ModContent.RarityType(); } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 8429a9019b..641019c6e7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -549,7 +549,7 @@ HalleysInferno: { DisplayName: Halley's Inferno Tooltip: ''' - Fires a flaming blue comet + Fires a highly concentrated shot of lunar fire Press to zoom out 50% chance to save ammo 'Halley came sooner than expected' diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 35730d2202..0d1c7de1ea 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -18,6 +19,9 @@ namespace CalamityMod.Projectiles.Ranged public static int Fadetime => 90; public ref float Time => ref Projectile.ai[0]; + public bool spawnParticles = true; + public bool spawnDusts = true; + public override void SetDefaults() { Projectile.width = Projectile.height = 10; @@ -37,25 +41,52 @@ namespace CalamityMod.Projectiles.Ranged if (Time > Fadetime) Projectile.velocity *= 0.95f; - if (Time < Fadetime && Main.rand.NextBool(4)) + if ( Time > 6 && Time < Fadetime && Main.rand.NextBool(16)) { - Dust dust = Dust.NewDustDirect(Projectile.Center + Main.rand.NextVector2Circular(60f, 60f) * Utils.Remap(Time, 0f, Lifetime, 0.5f, 1f), 4, 4, (int)CalamityDusts.PurpleCosmilite, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100); - if (Main.rand.NextBool(3)) + Dust dust = Dust.NewDustDirect(Projectile.Center + Main.rand.NextVector2Circular(60f, 60f) * Utils.Remap(Time, 0f, Lifetime, 0.5f, 1f), 4, 4, 295, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100); + if (Main.rand.NextBool(5)) { dust.noGravity = true; dust.scale *= 2f; - dust.velocity *= 2f; + dust.velocity *= 0.8f; } - dust.velocity *= 1.5f; + dust.velocity *= 1.1f; dust.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Fadetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Fadetime * 0.1f, 0.1f, 1f); } + if (spawnParticles && Time > 6 && Main.rand.NextBool(7)) + { + SparkParticle spark = new SparkParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.4f, 0.7f), false, Main.rand.Next(7, 11), Main.rand.NextFloat(0.7f, 1.8f), Main.rand.NextBool(4) ? Color.Magenta : Color.DodgerBlue); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Time == 5) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 295 : 181, Projectile.velocity); + dust.scale = Main.rand.NextFloat(0.9f, 1.7f); + dust.velocity = Projectile.velocity.RotatedByRandom(1) * Main.rand.NextFloat(0.3f, 0.7f); + dust.noGravity = true; + } } // Keeping the flames in place when hitting a block public override bool OnTileCollide(Vector2 oldVelocity) { + if (spawnDusts) + { + for (int i = 0; i <= 8; i++) + { + Vector2 position = Projectile.Center + new Vector2(Main.rand.NextFloat(-13, 13), Main.rand.NextFloat(-13, 13)); + Vector2 velocity = -oldVelocity.RotatedByRandom(1) * Main.rand.NextFloat(0.2f, 2.2f); + float scale = Main.rand.NextFloat(2f, 3.2f); + + Dust dust = Dust.NewDustPerfect(position + velocity, Main.rand.NextBool(3) ? 307 : 295, velocity, 0, default, scale); + dust.noGravity = true; + dust.scale -= 0.4f; + } + spawnDusts = false; + } Projectile.velocity = oldVelocity * 0.95f; Projectile.position -= Projectile.velocity; + spawnParticles = false; return false; } @@ -67,13 +98,13 @@ namespace CalamityMod.Projectiles.Ranged // Shrinks again after fading if (Time > Fadetime) size = (int)Utils.Remap(Time, Fadetime, Lifetime, 40f, 0f); - hitbox.Inflate(size, size); + hitbox.Inflate(size, size); } // Anti-wall hacking checks public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => projHitbox.Intersects(targetHitbox) && Collision.CanHit(Projectile.Center, 0, 0, targetHitbox.Center.ToVector2(), 0, 0) ? null : false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 360); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index bdb9e589ee..2180f1b43c 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -1,6 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria.Audio; +using CalamityMod.Items.Weapons.Ranged; + namespace CalamityMod.Projectiles.Ranged { public class HalleysComet : ModProjectile, ILocalizedModType @@ -8,80 +13,68 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public int Time = 0; public override void SetDefaults() { Projectile.width = Projectile.height = 12; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 4; + Projectile.penetrate = 5; Projectile.extraUpdates = 10; Projectile.timeLeft = 600; } public override void AI() { + Time++; if (Projectile.scale <= 1.5f) { Projectile.scale *= 1.01f; } - - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.45f / 255f); - - if (Projectile.ai[0]++ > 5f) + if (Time > 6 && Time < 180) { - float dustScaleSize = 1f; - if (Projectile.ai[0] == 6f) + SparkParticle spark = new SparkParticle(Projectile.Center, Projectile.velocity, false, 11, 1.9f, Color.MediumBlue); + GeneralParticleHandler.SpawnParticle(spark); + SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity, false, 11, 1f, Color.Aqua); + GeneralParticleHandler.SpawnParticle(spark2); + } + if (Time == 5) + { + Particle pulse = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.75f, Color.Aqua, new Vector2(1f, 2.5f), Projectile.velocity.ToRotation(), 0.4f, 0.05f, 20); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.4f, Color.DodgerBlue, new Vector2(1f, 2.5f), Projectile.velocity.ToRotation(), 0.2f, 0.05f, 35); + GeneralParticleHandler.SpawnParticle(pulse2); + for (int i = 0; i <= 25; i++) { - dustScaleSize = 0.25f; - } - else if (Projectile.ai[0] == 7f) - { - dustScaleSize = 0.5f; - } - else if (Projectile.ai[0] == 8f) - { - dustScaleSize = 0.75f; - } - Projectile.ai[0] += 1f; - int dustType = 176; - for (int i = 0; i < 3; i++) - { - int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 1, default, 1f); - Dust dust = Main.dust[fire]; - if (Main.rand.NextBool(3)) - { - dust.noGravity = true; - dust.scale *= 1.75f; - dust.velocity.X *= 2f; - dust.velocity.Y *= 2f; - } - else - { - dust.scale *= 0.5f; - } - dust.velocity.X *= 1.2f; - dust.velocity.Y *= 1.2f; - dust.scale *= dustScaleSize; - dust.velocity += Projectile.velocity; - if (!dust.noGravity) - { - dust.velocity *= 0.5f; - } + 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.noGravity = true; } } + Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.45f / 255f); + Projectile.rotation += 0.3f * (float)Projectile.direction; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 450); + SoundEngine.PlaySound(HalleysInferno.Hit, Projectile.Center); + for (int i = 0; i <= 13; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 172 : 206, Projectile.velocity); + dust.scale = Main.rand.NextFloat(1.1f, 1.9f); + dust.velocity = Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.2f, 2.1f); + dust.noGravity = true; + } } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 450); } } } diff --git a/Sounds/Item/HalleysInfernoHit.ogg b/Sounds/Item/HalleysInfernoHit.ogg new file mode 100644 index 0000000000..6cb43e1cd9 Binary files /dev/null and b/Sounds/Item/HalleysInfernoHit.ogg differ diff --git a/Sounds/Item/HalleysInfernoShoot.ogg b/Sounds/Item/HalleysInfernoShoot.ogg new file mode 100644 index 0000000000..00ef951e9a Binary files /dev/null and b/Sounds/Item/HalleysInfernoShoot.ogg differ