diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index 0dede440c8..d1eb4f8b2c 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Xeroc Pitchfork"); + Tooltip.SetDefault("Stealth strikes leave homing stars in their wake"); } public override void SafeSetDefaults() @@ -34,6 +37,17 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + 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 stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs index 2280da17b4..425d9234ec 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -40,6 +41,17 @@ namespace CalamityMod.Projectiles.Rogue { projectile.rotation -= 1.57f; } + if (projectile.timeLeft % 12 == 0) + { + if (projectile.owner == Main.myPlayer) + { + if (projectile.Calamity().stealthStrike) + { + int star = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[star].Calamity().rogue = true; + } + } + } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)