diff --git a/Items/Weapons/Rogue/DuneHopper.cs b/Items/Weapons/Rogue/DuneHopper.cs index cedc32b005..2b85dea96b 100644 --- a/Items/Weapons/Rogue/DuneHopper.cs +++ b/Items/Weapons/Rogue/DuneHopper.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Dune Hopper"); - Tooltip.SetDefault("Throws a spear that bounces a lot"); + Tooltip.SetDefault(@"Throws a spear that bounces a lot +Stealth strikes throws three high speed spears"); } public override void SafeSetDefaults() @@ -33,5 +35,21 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; item.Calamity().postMoonLordRarity = 22; } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.Calamity().StealthStrikeAvailable()) + { + int numProj = 2; + float rotation = MathHelper.ToRadians(3); + for (int i = 0; i < numProj + 1; i++) + { + Vector2 perturbedSpeed = new Vector2(speedX - 3f, speedY - 3f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); + Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } + return true; + } } } diff --git a/Projectiles/Rogue/DuneHopperProjectile.cs b/Projectiles/Rogue/DuneHopperProjectile.cs index ca4e5498b4..d18a466d48 100644 --- a/Projectiles/Rogue/DuneHopperProjectile.cs +++ b/Projectiles/Rogue/DuneHopperProjectile.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Projectiles.Rogue { public class DuneHopperProjectile : ModProjectile { + public override void SetStaticDefaults() { DisplayName.SetDefault("Scourge"); @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], projectile.Calamity().stealthStrike ? 4 : 2); return false; } }