diff --git a/Cooldowns/SandsmokeBomb.cs b/Cooldowns/SandsmokeBomb.cs index 2a0133e02c..d88d444ffe 100644 --- a/Cooldowns/SandsmokeBomb.cs +++ b/Cooldowns/SandsmokeBomb.cs @@ -25,17 +25,18 @@ namespace CalamityMod.Cooldowns public override Color OutlineColor => new Color(255, 299, 156); public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(204, 181, 72), new Color(169, 142, 16), PowerPercent) : new Color(204, 181, 72); public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(204, 181, 72), new Color(169, 142, 16), PowerPercent) : new Color(169, 142, 16); - //public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/SandsmokeBombRecharge"); + public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombReload"); public override void OnCompleted() { - for (int i = 0; i < 6; i++) + for (int i = 0; i < 16; i++) { - Vector2 dustDirection = Main.rand.NextVector2CircularEdge(1f, 1f); - Dust d = Dust.NewDustPerfect(instance.player.Center + dustDirection * Main.rand.NextFloat(0.4f, 10f), 226, dustDirection * Main.rand.NextFloat(1f, 4f), 100, Color.Transparent, Main.rand.NextFloat(0.8f, 1.2f)); - d.noGravity = true; - d.noLight = true; - d.fadeIn = 1f; + Vector2 dustDisplace = Main.rand.NextVector2Circular(80f, 50f); + Vector2 dustPosition = instance.player.MountedCenter + dustDisplace; + Vector2 dustSpeed = Main.rand.NextVector2Circular(0.5f, 0.5f) + instance.player.velocity / 8f - Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * 0.06f; + dustSpeed.X += 1.4f * (float)Math.Sin(((dustDisplace.X + 80f) / 160f) * MathHelper.Pi) * (Main.rand.NextBool() ? -1 : 1); + Particle dust = new SandyDustParticle(dustPosition, dustSpeed, Color.White, Main.rand.NextFloat(0.7f, 1.2f), Main.rand.Next(20, 50), 0.03f, Vector2.UnitY * 0.03f); + GeneralParticleHandler.SpawnParticle(dust); } } diff --git a/Dusts/GasDust.cs b/Dusts/GasDust.cs deleted file mode 100644 index ce2c48741b..0000000000 --- a/Dusts/GasDust.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Dusts -{ - public class GasDust : ModDust - { - public override string Texture => "CalamityMod/Dusts/GasDust"; - public override void OnSpawn(Dust dust) - { - dust.noGravity = true; - dust.alpha = 210; - dust.scale *= Main.rand.NextFloat(0.8f, 2f); - } - - public override Color? GetAlpha(Dust dust, Color lightColor) - { - Color color = lightColor.MultiplyRGB(dust.color * 0.995f); - return color * 0.4f * ((255 - dust.alpha) / 255f); - } - - public override bool Update(Dust dust) - { - dust.velocity *= 0.99f; - dust.position += dust.velocity; - dust.alpha += 3; - if (dust.alpha >= 255) - dust.active = false; - - return false; - } - } -} diff --git a/Dusts/GasDust.png b/Dusts/GasDust.png deleted file mode 100644 index 16e45b74c7..0000000000 Binary files a/Dusts/GasDust.png and /dev/null differ diff --git a/Items/Armor/DesertProwler/DesertProwlerSet.cs b/Items/Armor/DesertProwler/DesertProwlerSet.cs index 38faa3a40d..101c005368 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -14,14 +14,19 @@ using CalamityMod.Items.Weapons.Melee; using Terraria.Audio; using Terraria.DataStructures; using CalamityMod.Dusts; +using ReLogic.Utilities; namespace CalamityMod.Items.Armor.DesertProwler { [AutoloadEquip(EquipType.Head)] public class DesertProwlerHat : ModItem { + public static readonly SoundStyle SmokeBombSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBomb"); + public static readonly SoundStyle SmokeBombEndSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombEnd"); + public static int SmokeCooldown = 25 * 60; public static int SmokeDuration = 5 * 60; + public static int FreeCrit = 200; public static bool ShroudedInSmoke(Player player, out CooldownInstance cd) { @@ -87,47 +92,40 @@ namespace CalamityMod.Items.Armor.DesertProwler if (ShroudedInSmoke(player, out var cd)) { if (cd.timeLeft == SmokeCooldown + SmokeDuration) - { - //Vfx and noises - } - + armorPlayer.SetBonusStartEffect(); + player.moveSpeed *= 1.5f; player.invis = true; - player.GetCritChance(DamageClass.Ranged) += 300; - - //Visuals - Vector2 smokePos = player.MountedCenter + Main.rand.NextVector2Square(-player.height / 2, player.height / 2); - - /* - for (int i = 0; i < 5; i++) + player.GetCritChance(DamageClass.Ranged) += FreeCrit; + for (int i = 0; i < 2; i++) { - Dust dust = Dust.NewDustDirect(player.MountedCenter, 0, 0, DustType()); - dust.position += Main.rand.NextVector2Square(-player.height / 2, player.height / 2); - dust.velocity = Main.rand.NextVector2Circular(1, 1) + player.velocity / 2; - dust.scale = 2.4f; - dust.color = new Color(217, 154, 154); - } - */ - - for (int i = 0; i < 15; i++) - { - Particle dust = new SandyDustParticle(player.MountedCenter + Main.rand.NextVector2Square(-player.height * 0.8f, player.height * 0.8f), Main.rand.NextVector2Circular(1, 1) + player.velocity / 2, Color.White, Main.rand.NextFloat(0.7f, 1.2f), Main.rand.Next(10, 40), rotationSpeed:0.03f); + Vector2 dustDisplace = Main.rand.NextVector2Circular(80f, 50f); + Vector2 dustPosition = player.MountedCenter + dustDisplace; + Vector2 dustSpeed = Main.rand.NextVector2Circular(0.5f, 0.5f) + player.velocity / 8f - Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * 0.06f; + dustSpeed.X += 1.4f * (float)Math.Sin(((dustDisplace.X + 80f) / 160f) * MathHelper.Pi) * (Main.rand.NextBool() ? -1 : 1); + Particle dust = new SandyDustParticle(dustPosition, dustSpeed, Color.White, Main.rand.NextFloat(0.7f, 1.2f), Main.rand.Next(20, 50), 0.03f, Vector2.UnitY * 0.03f); GeneralParticleHandler.SpawnParticle(dust); } - - - Color startColor = new Color(173, 156, 112); - Color endColor = new Color(143, 120, 63); - if (Main.rand.NextBool()) + int sandSmokeCount = Main.rand.Next(2, 3); + for (int i = 0; i < sandSmokeCount; i++) { - startColor = new Color(173, 139, 100); - endColor = new Color(149, 106, 50); - } + Color startColor = new Color(173, 156, 112); + Color endColor = new Color(143, 120, 63); + if (Main.rand.NextBool()) + { + startColor = new Color(173, 139, 100); + endColor = new Color(149, 106, 50); + } - Particle smoke = new TimedSmokeParticle(smokePos, Main.rand.NextVector2Circular(2f, 1f) - Vector2.UnitY * 1f + player.velocity * 0.5f, startColor, endColor, Main.rand.NextFloat(0.7f, 2.2f), Main.rand.NextFloat(0.6f, 0.85f), Main.rand.Next(40, 76), 0.01f); - GeneralParticleHandler.SpawnParticle(smoke); - + Vector2 smokeRandomPos = Main.rand.NextVector2Circular(40f, player.height); + Vector2 smokePos = player.MountedCenter + smokeRandomPos; + float burstAngle = MathHelper.Pi - ((smokeRandomPos.X + 40) / 80f) * MathHelper.Pi; + Vector2 smokeSpeed = Main.rand.NextVector2Circular(1f, 0.5f) - Vector2.UnitY * 0.05f + player.velocity * 0.5f + burstAngle.ToRotationVector2() * ((1 - (float)Math.Sin(burstAngle)) * 0.9f + 0.1f) * 1.5f; + smokeSpeed.X += (float)Math.Sin(((smokeRandomPos.X + 40) / 80f) * MathHelper.Pi) * (Main.rand.NextBool() ? -1 : 1); + Particle smoke = new TimedSmokeParticle(smokePos, smokeSpeed, startColor, endColor, Main.rand.NextFloat(0.7f, 1.6f), Main.rand.NextFloat(0.4f, 0.55f), Main.rand.Next(20, 36), 0.01f); + GeneralParticleHandler.SpawnParticle(smoke); + } // Dust Vector2 dustDirection = Main.rand.NextVector2CircularEdge(1f, 1f); @@ -160,7 +158,7 @@ namespace CalamityMod.Items.Armor.DesertProwler setBonus2.OverrideColor = new Color(204, 181, 72); tooltips.Insert(setBonusIndex + 2, setBonus2); - TooltipLine setBonus3 = new TooltipLine(item.Mod, "CalamityMod:SetBonus3", "Attacking instantly dispels the sand cloak, but guarantees a supercrit for 200% damage"); + TooltipLine setBonus3 = new TooltipLine(item.Mod, "CalamityMod:SetBonus3", $"Attacking instantly dispels the sand cloak, but guarantees a supercrit for {FreeCrit}% damage\nDispeling the sand cloak with a shot also bounces you upwards"); setBonus3.OverrideColor = new Color(204, 181, 72); tooltips.Insert(setBonusIndex + 3, setBonus3); } @@ -272,6 +270,7 @@ namespace CalamityMod.Items.Armor.DesertProwler public static int BastionShootDamage = 10; public static float BastionShootSpeed = 18f; public static int BastionShootTime = 10; + internal SlotId SmokeBombSoundSlot; public bool desertProwlerSet = false; @@ -300,15 +299,67 @@ namespace CalamityMod.Items.Armor.DesertProwler } } + public void SetBonusStartEffect() + { + SmokeBombSoundSlot = SoundEngine.PlaySound(DesertProwlerHat.SmokeBombSound, Player.Center); + //vfx + } + public void SetBonusEndEffect() { - //SoundStyle endSound = DesertProwlerHat.SmokeBombEndSound; + if (SoundEngine.TryGetActiveSound(SmokeBombSoundSlot, out var sound)) + { + sound.Stop(); + SmokeBombSoundSlot = SlotId.Invalid; + } + //Dust } + //BANDIT RISK OF RAIN 2! JAce would b e proud + public void SetBonusBounceEffect() + { + SoundEngine.PlaySound(DesertProwlerHat.SmokeBombEndSound, Player.Center); + Player.velocity.Y = Math.Min(-6f, Player.velocity.Y - 6f); + Player.jump = Player.jumpHeight / 2; + + for (int i = 0; i < 30; i++) + { + Vector2 dustDisplace = Main.rand.NextVector2Circular(80f, 30f); + Vector2 dustPosition = Player.MountedCenter + Vector2.UnitY * Player.height * 0.5f + dustDisplace; + Vector2 dustSpeed = Main.rand.NextVector2Circular(0.5f, 0.5f) + Player.velocity / 8f - Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * 0.06f; + dustSpeed.X += 1.4f * (float)Math.Sin(((dustDisplace.X + 80f) / 160f) * MathHelper.Pi) * (Main.rand.NextBool() ? -1 : 1); + Particle dust = new SandyDustParticle(dustPosition, dustSpeed, Color.White, Main.rand.NextFloat(0.7f, 1.2f), Main.rand.Next(20, 50), 0.03f, Vector2.UnitY * 0.03f); + GeneralParticleHandler.SpawnParticle(dust); + } + + + if (!Main.dedServ) + { + for (int i = 0; i < 10; i++) + { + float dustOrientation = i / 10f * MathHelper.TwoPi + MathHelper.PiOver4 * 0.6f; + Vector2 dustDirection = Vector2.UnitX * (float)Math.Sin(dustOrientation) + Vector2.UnitY * (float)Math.Cos(dustOrientation) * 0.2f; + + Vector2 dustPos = Player.MountedCenter + Vector2.UnitY * Player.height / 2f + dustDirection * 20f; + Vector2 dustVel = Player.velocity * 0.3f + dustDirection * 1.4f; + + int sandstormJump = Gore.NewGore(Player.GetSource_Misc("Jump"), dustPos, dustVel, Main.rand.Next(220, 223), 1f); + Main.gore[sandstormJump].velocity = dustVel; + Main.gore[sandstormJump].alpha = 100; + + + for (int j = 0; j < 1; j++) + { + Dust miniDust = Dust.NewDustDirect(dustPos, 32, 32, 124, dustVel.X, dustVel.Y * 0.3f, 150, default(Color), 1f); + miniDust.fadeIn = 1.5f; + } + } + } + } + public override void PostUpdateMiscEffects() { - //This shouldn't ever be possible since the power mode prevents you from using or moving items around if (!desertProwlerSet && DesertProwlerHat.ShroudedInSmoke(Player, out var cd)) { cd.timeLeft = DesertProwlerHat.SmokeCooldown; @@ -320,14 +371,16 @@ namespace CalamityMod.Items.Armor.DesertProwler { public override void OnSpawn(Projectile projectile, IEntitySource source) { - DesertProwlerHat.SmokeCooldown = 20; + DesertProwlerHat.SmokeCooldown = 120; if (projectile.damage > 0) { - if (projectile.owner >= 0 && DesertProwlerHat.ShroudedInSmoke(Main.player[projectile.owner], out var cd)) + if (projectile.owner >= 0 && DesertProwlerHat.ShroudedInSmoke(Main.player[projectile.owner], out var cd) && projectile.DamageType.CountsAsClass(DamageClass.Ranged)) { projectile.Calamity().canSupercrit = true; cd.timeLeft = DesertProwlerHat.SmokeCooldown; + + Main.player[projectile.owner].GetModPlayer().SetBonusBounceEffect(); } } } diff --git a/Particles/MiniSmoke.png b/Particles/MiniSmoke.png new file mode 100644 index 0000000000..ea65dcf059 Binary files /dev/null and b/Particles/MiniSmoke.png differ diff --git a/Particles/SandyDustParticle.cs b/Particles/SandyDustParticle.cs index f5e4a4d9ed..06b561e5cc 100644 --- a/Particles/SandyDustParticle.cs +++ b/Particles/SandyDustParticle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Particles public class SandyDustParticle : Particle { public override string Texture => "CalamityMod/Particles/SandyDust"; - public override bool UseHalfTransparency => true; //Doesn't actually use half transparency, but guarantees that it gets drawn above the bigger smoke clouds + public override bool UseHalfTransparency => false; //Doesn't actually use half transparency, but guarantees that it gets drawn above the bigger smoke clouds public override bool UseCustomDraw => true; public override bool SetLifetime => true; @@ -18,7 +18,7 @@ namespace CalamityMod.Particles private Vector2 Gravity; public Rectangle Frame; - public SandyDustParticle(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, float rotationSpeed = 1f, bool bigSize = false, bool emitsLight = false, Vector2? gravity = null) + public SandyDustParticle(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, float rotationSpeed = 1f, Vector2? gravity = null) { Position = position; Velocity = velocity; @@ -28,14 +28,14 @@ namespace CalamityMod.Particles Rotation = Main.rand.NextFloat(MathHelper.TwoPi); Spin = rotationSpeed; Gravity = (Vector2)(gravity == null ? Vector2.Zero : gravity); - Variant = Main.rand.Next(18); - Frame = new Rectangle(Variant % 6 * 12, Variant / 6 * 12, 10, 10); + Variant = Main.rand.Next(12); + Frame = new Rectangle(Variant % 6 * 12, 12 + Variant / 6 * 12, 10, 10); } public override void Update() { Velocity += Gravity; - opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi); + opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.PiOver2 + MathHelper.PiOver2); Velocity *= 0.95f; Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f); diff --git a/Particles/TimedSmokeParticle.cs b/Particles/TimedSmokeParticle.cs index 842bfcaa0c..445bbcbdf6 100644 --- a/Particles/TimedSmokeParticle.cs +++ b/Particles/TimedSmokeParticle.cs @@ -6,8 +6,10 @@ namespace CalamityMod.Particles { public class TimedSmokeParticle : Particle { - public override string Texture => "CalamityMod/Particles/SmallSmoke"; + public override string Texture => "CalamityMod/Particles/MediumSmoke"; public override bool SetLifetime => true; + public override int FrameVariants => 3; + private float Opacity; private Color ColorStart; @@ -25,6 +27,8 @@ namespace CalamityMod.Particles Rotation = Main.rand.NextFloat(MathHelper.TwoPi); Spin = rotationSpeed; Lifetime = timeleft; + + Variant = Main.rand.Next(3); } public override void Update() diff --git a/Projectiles/Ranged/MidasBlast.cs b/Projectiles/Ranged/MidasBlast.cs index e406d73f90..56490fc627 100644 --- a/Projectiles/Ranged/MidasBlast.cs +++ b/Projectiles/Ranged/MidasBlast.cs @@ -249,6 +249,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { + Projectile.numHits++; target.AddBuff(BuffID.Midas, 60); Projectile.velocity = Vector2.Zero; Projectile.timeLeft = Math.Min((Lifetime - Projectile.timeLeft), TrailLenght); diff --git a/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBomb.ogg b/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBomb.ogg new file mode 100644 index 0000000000..886cdaecef Binary files /dev/null and b/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBomb.ogg differ diff --git a/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombEnd.ogg b/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombEnd.ogg new file mode 100644 index 0000000000..7024a28213 Binary files /dev/null and b/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombEnd.ogg differ diff --git a/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombReload.ogg b/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombReload.ogg new file mode 100644 index 0000000000..1fae571b7d Binary files /dev/null and b/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombReload.ogg differ