From 5fa63b4545f9de2559592b99f0e3849fc218dca5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 20 Apr 2020 15:10:04 -0400 Subject: [PATCH] valediction stealth strike --- Items/Weapons/Rogue/Valediction.cs | 15 ++++++++- Projectiles/Magic/NuclearFuryProjectile.cs | 13 ++++++-- Projectiles/Rogue/MoltenAmputatorProj.cs | 2 +- Projectiles/Rogue/SandDollarStealth.cs | 20 +++++++++++ Projectiles/Rogue/ValedictionBoomerang.cs | 39 ++++++++++++++++++++++ 5 files changed, 85 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Rogue/Valediction.cs b/Items/Weapons/Rogue/Valediction.cs index f0143e8a4f..e285772213 100644 --- a/Items/Weapons/Rogue/Valediction.cs +++ b/Items/Weapons/Rogue/Valediction.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("Valediction"); - Tooltip.SetDefault("Throws a homing reaper scythe"); + Tooltip.SetDefault("Throws a homing reaper scythe\n" + + "Stealth strikes spawn razorblade typhoons on enemy hits"); } public override void SafeSetDefaults() @@ -33,5 +35,16 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; item.Calamity().customRarity = CalamityRarity.PureGreen; } + + 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()) //setting the stealth strike + { + 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; + } } } diff --git a/Projectiles/Magic/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs index 84b2f51767..9f58a84dfc 100644 --- a/Projectiles/Magic/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.extraUpdates = 2; projectile.ignoreWater = true; - aiType = ProjectileID.Typhoon; } public override void Kill(int timeLeft) @@ -50,9 +49,19 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.immune[projectile.owner] = 5; + target.buffImmune[BuffID.Wet] = false; //I'm not sorry + target.AddBuff(BuffID.Wet, 600); + if (projectile.ai[1] != 1f) //Nuclear Fury + { + target.immune[projectile.owner] = 5; + } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Wet, 600); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/MoltenAmputatorProj.cs b/Projectiles/Rogue/MoltenAmputatorProj.cs index 95530d599a..f6b823de35 100644 --- a/Projectiles/Rogue/MoltenAmputatorProj.cs +++ b/Projectiles/Rogue/MoltenAmputatorProj.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue } iAmSpeed.Normalize(); iAmSpeed *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, iAmSpeed.X, iAmSpeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, iAmSpeed.X, iAmSpeed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); } } diff --git a/Projectiles/Rogue/SandDollarStealth.cs b/Projectiles/Rogue/SandDollarStealth.cs index 92ebb4e89e..7eb1499c78 100644 --- a/Projectiles/Rogue/SandDollarStealth.cs +++ b/Projectiles/Rogue/SandDollarStealth.cs @@ -46,6 +46,26 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + int coralAmt = Main.rand.Next(1, 4); + if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) + { + for (int coralCount = 0; coralCount < coralAmt; coralCount++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int coral = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + Main.projectile[coral].Calamity().forceRogue = true; + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.ai[0] += 0.1f; diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index e8321440d7..dd0936ca98 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -121,11 +122,49 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 600); + int typhoonAmt = 3; + if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 84); + for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int typhoon = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + Main.projectile[typhoon].Calamity().forceRogue = true; + Main.projectile[typhoon].usesLocalNPCImmunity = true; + Main.projectile[typhoon].localNPCHitCooldown = 10; + } + } } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 600); + int typhoonAmt = 3; + if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 84); + for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int typhoon = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, 0f, projectile.owner, 0f, 1f); + Main.projectile[typhoon].Calamity().forceRogue = true; + Main.projectile[typhoon].usesLocalNPCImmunity = true; + Main.projectile[typhoon].localNPCHitCooldown = 10; + } + } } public override void Kill(int timeLeft)