From 08af2a5c4dacf6bdf614db20a4c31b8a6adfc469 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 18 Jan 2020 19:33:02 -0500 Subject: [PATCH] most rogue projectiles activate on hit effects in pvp --- Projectiles/Rogue/AccretionDisk2.cs | 8 ++++ Projectiles/Rogue/AccretionDiskProj.cs | 8 ++++ Projectiles/Rogue/AlphaSeeker.cs | 5 +++ Projectiles/Rogue/AlphaVirusProjectile.cs | 21 ++++++++++ Projectiles/Rogue/BallisticPoisonBombProj.cs | 6 +++ Projectiles/Rogue/BallisticPoisonBombSpike.cs | 5 +++ Projectiles/Rogue/BarrelShrapnel.cs | 5 +++ Projectiles/Rogue/BloodsoakedCrashax.cs | 21 ++++++++++ Projectiles/Rogue/BrackishFlaskProj.cs | 6 +++ Projectiles/Rogue/BrackishWater.cs | 6 +++ Projectiles/Rogue/BrackishWaterBlast.cs | 6 +++ Projectiles/Rogue/Brimblade2.cs | 9 +++++ Projectiles/Rogue/BrimbladeProj.cs | 19 +++++++++ Projectiles/Rogue/BurningStrifeProj.cs | 12 ++++++ Projectiles/Rogue/ButcherKnife.cs | 6 +++ Projectiles/Rogue/CarvingFork.cs | 6 +++ Projectiles/Rogue/Celestus2.cs | 13 ++++++ Projectiles/Rogue/CelestusBoomerang.cs | 28 +++++++++++++ Projectiles/Rogue/Crushax.cs | 5 +++ Projectiles/Rogue/CrystalPiercerProjectile.cs | 5 +++ Projectiles/Rogue/CursedDaggerProj.cs | 5 +++ Projectiles/Rogue/DeepSeaDumbbell1.cs | 40 +++++++++++++++++++ Projectiles/Rogue/DeepSeaDumbbell2.cs | 40 +++++++++++++++++++ Projectiles/Rogue/DeepSeaDumbbell3.cs | 34 ++++++++++++++++ Projectiles/Rogue/DeepSeaDumbbellWeight.cs | 5 +++ Projectiles/Rogue/DeepWounderProjectile.cs | 10 +++++ Projectiles/Rogue/DesecratedBubble.cs | 9 +++++ Projectiles/Rogue/DestructionStar.cs | 5 +++ Projectiles/Rogue/DukesDecapitatorProj.cs | 2 +- Projectiles/Rogue/EclipsesFallMain.cs | 19 +++++++++ Projectiles/Rogue/EmpyreanKnife.cs | 16 ++++++++ .../Rogue/EpidemicShredderProjectile.cs | 11 +++++ Projectiles/Rogue/EquanimityProj.cs | 21 ++++++++++ Projectiles/Rogue/EradicatorProjectile.cs | 6 +++ Projectiles/Rogue/ExecutionersBladeProj.cs | 5 +++ Projectiles/Rogue/ExplosiveSun.cs | 5 +++ Projectiles/Rogue/FlameScytheProjectile.cs | 10 +++++ Projectiles/Rogue/Fork.cs | 7 ++++ Projectiles/Rogue/FossilShardThrown.cs | 5 +++ Projectiles/Rogue/FrostyFlareProj.cs | 6 +++ Projectiles/Rogue/GelDartProjectile.cs | 5 +++ Projectiles/Rogue/GodsParanoiaDart.cs | 5 +++ Projectiles/Rogue/GodsParanoiaProj.cs | 5 +++ Projectiles/Rogue/HeavenfallenEnergy.cs | 5 +++ .../Rogue/HeavenfallenStardiskBoomerang.cs | 5 +++ Projectiles/Rogue/HellsSunProj.cs | 5 +++ Projectiles/Rogue/Honeycomb.cs | 26 ++++++++++++ Projectiles/Rogue/HypothermiaChunk.cs | 5 +++ Projectiles/Rogue/HypothermiaShard.cs | 5 +++ Projectiles/Rogue/IceStarProjectile.cs | 27 ++++++++++++- Projectiles/Rogue/IchorSpearProj.cs | 5 +++ Projectiles/Rogue/IllustriousKnife.cs | 17 ++++++++ Projectiles/Rogue/InfernalKrisCinder.cs | 5 +++ Projectiles/Rogue/InfernalKrisExplosion.cs | 5 +++ Projectiles/Rogue/InfernalKrisProjectile.cs | 22 ++++++++++ Projectiles/Rogue/InkBombProjectile.cs | 5 +++ Projectiles/Rogue/InkCloud.cs | 5 +++ Projectiles/Rogue/InkCloud2.cs | 5 +++ Projectiles/Rogue/InkCloud3.cs | 5 +++ Projectiles/Rogue/JawsProjectile.cs | 12 ++++++ Projectiles/Rogue/JawsShockwave.cs | 5 +++ Projectiles/Rogue/Knife.cs | 6 +++ Projectiles/Rogue/LeviathanTooth.cs | 5 +++ Projectiles/Rogue/LeviathanTooth2.cs | 5 +++ Projectiles/Rogue/LeviathanTooth3.cs | 5 +++ Projectiles/Rogue/LionfishProj.cs | 5 +++ Projectiles/Rogue/LuminousStrikerProj.cs | 18 +++++++++ Projectiles/Rogue/MalachiteBolt.cs | 32 +++++++++++++++ .../Rogue/MangroveChakramProjectile.cs | 5 +++ Projectiles/Rogue/MeteorFistProj.cs | 5 +++ Projectiles/Rogue/MoltenAmputatorProj.cs | 24 +++++++++++ Projectiles/Rogue/NightsGazeProjectile.cs | 27 +++++++++++++ Projectiles/Rogue/NightsGazeSpark.cs | 5 +++ Projectiles/Rogue/NightsGazeStar.cs | 5 +++ Projectiles/Rogue/OPHammer.cs | 10 +++++ Projectiles/Rogue/PhantasmalRuinProj.cs | 21 ++++++++++ Projectiles/Rogue/PlaguedFuelPackCloud.cs | 5 +++ Projectiles/Rogue/PlaguenadeBee.cs | 5 +++ Projectiles/Rogue/PlaguenadeProj.cs | 5 +++ Projectiles/Rogue/PoisonBol.cs | 5 +++ Projectiles/Rogue/ProfanedPartisanproj.cs | 5 +++ Projectiles/Rogue/ProfanedPartisanspear.cs | 15 +++++++ Projectiles/Rogue/Quasar2.cs | 5 +++ Projectiles/Rogue/QuasarKnife.cs | 5 +++ Projectiles/Rogue/RadiantExplosion.cs | 34 ++++++++++++++++ Projectiles/Rogue/RadiantStar2.cs | 5 +++ Projectiles/Rogue/RadiantStarKnife.cs | 5 +++ Projectiles/Rogue/ReaperProjectile.cs | 5 +++ Projectiles/Rogue/RegulusEnergy.cs | 5 +++ Projectiles/Rogue/RegulusRiotProj.cs | 5 +++ Projectiles/Rogue/ScarletDevilProjectile.cs | 19 ++++++++- Projectiles/Rogue/ScourgeVenomCloud.cs | 9 +++++ Projectiles/Rogue/ScourgeoftheDesertProj.cs | 16 +++++++- .../Rogue/ScourgeoftheSeasProjectile.cs | 9 +++++ Projectiles/Rogue/ShatteredExplosion.cs | 5 +++ Projectiles/Rogue/ShatteredSunKnife.cs | 6 +++ .../Rogue/ShatteredSunScorchedBlade.cs | 30 ++++++++++++++ Projectiles/Rogue/ShinobiBladeProjectile.cs | 8 ++++ Projectiles/Rogue/ShockGrenadeBolt.cs | 5 +++ Projectiles/Rogue/ShockGrenadeExplosion.cs | 5 +++ Projectiles/Rogue/ShockTeslaAura.cs | 5 +++ Projectiles/Rogue/ShroomerangProj.cs | 7 ++++ Projectiles/Rogue/SkyStabberProj.cs | 30 ++++++++++---- Projectiles/Rogue/SpearofDestinyProjectile.cs | 5 +++ Projectiles/Rogue/SpearofPaleolithProj.cs | 5 +++ Projectiles/Rogue/StickyBol.cs | 5 +++ Projectiles/Rogue/SupernovaBomb.cs | 13 ++++++ Projectiles/Rogue/SupernovaBoom.cs | 13 ++++++ Projectiles/Rogue/SupernovaHoming.cs | 13 ++++++ Projectiles/Rogue/SupernovaSpike.cs | 13 ++++++ Projectiles/Rogue/SylvanSlash.cs | 5 +++ Projectiles/Rogue/SylvanSlashAttack.cs | 25 ++++++++++++ Projectiles/Rogue/TheSyringeCinder.cs | 5 +++ Projectiles/Rogue/TheSyringeProj.cs | 5 +++ Projectiles/Rogue/TheSyringeS1.cs | 5 +++ Projectiles/Rogue/TotalityFire.cs | 5 +++ Projectiles/Rogue/TotalityTar.cs | 5 +++ Projectiles/Rogue/TriactisOPHammer.cs | 27 +++++++++++++ Projectiles/Rogue/TurbulanceProjectile.cs | 18 +++++++++ Projectiles/Rogue/UmbraphileBoom.cs | 5 +++ Projectiles/Rogue/UrchinStingerProj.cs | 7 +++- Projectiles/Rogue/ValariBoomerang.cs | 27 +++++++++++++ Projectiles/Rogue/Valaricicle.cs | 5 +++ Projectiles/Rogue/Valaricicle2.cs | 5 +++ Projectiles/Rogue/ValedictionBoomerang.cs | 5 +++ Projectiles/Rogue/WebBallBol.cs | 12 ++++++ Projectiles/Rogue/XerocPitchforkProjectile.cs | 10 +++++ 127 files changed, 1316 insertions(+), 13 deletions(-) diff --git a/Projectiles/Rogue/AccretionDisk2.cs b/Projectiles/Rogue/AccretionDisk2.cs index 7c8f0c35c2..c063b9bb0e 100644 --- a/Projectiles/Rogue/AccretionDisk2.cs +++ b/Projectiles/Rogue/AccretionDisk2.cs @@ -49,6 +49,14 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); diff --git a/Projectiles/Rogue/AccretionDiskProj.cs b/Projectiles/Rogue/AccretionDiskProj.cs index 0065ad261c..d3154692e5 100644 --- a/Projectiles/Rogue/AccretionDiskProj.cs +++ b/Projectiles/Rogue/AccretionDiskProj.cs @@ -113,6 +113,14 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); diff --git a/Projectiles/Rogue/AlphaSeeker.cs b/Projectiles/Rogue/AlphaSeeker.cs index 9fb5b760a6..ccdb2e9490 100644 --- a/Projectiles/Rogue/AlphaSeeker.cs +++ b/Projectiles/Rogue/AlphaSeeker.cs @@ -118,5 +118,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 180); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } } } diff --git a/Projectiles/Rogue/AlphaVirusProjectile.cs b/Projectiles/Rogue/AlphaVirusProjectile.cs index 0002a9aae4..f439c76d03 100644 --- a/Projectiles/Rogue/AlphaVirusProjectile.cs +++ b/Projectiles/Rogue/AlphaVirusProjectile.cs @@ -86,6 +86,27 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + float dist1 = Vector2.Distance(projectile.Center, target.Hitbox.TopLeft()); + float dist2 = Vector2.Distance(projectile.Center, target.Hitbox.TopRight()); + float dist3 = Vector2.Distance(projectile.Center, target.Hitbox.BottomLeft()); + float dist4 = Vector2.Distance(projectile.Center, target.Hitbox.BottomRight()); + + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; + + if (minDist <= projectile.width) + { + target.AddBuff(ModContent.BuffType(), 120); + } + } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (target.type == ModContent.NPCType() || target.type == ModContent.NPCType() || target.type == ModContent.NPCType()) diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index e855c52f52..a7ebd15eee 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -188,5 +188,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 240); projectile.Kill(); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + projectile.Kill(); + } } } diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.cs b/Projectiles/Rogue/BallisticPoisonBombSpike.cs index e137e3d520..ebafbf335f 100644 --- a/Projectiles/Rogue/BallisticPoisonBombSpike.cs +++ b/Projectiles/Rogue/BallisticPoisonBombSpike.cs @@ -49,6 +49,11 @@ namespace CalamityMod.Projectiles.Rogue target.immune[projectile.owner] = 1; } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/BarrelShrapnel.cs b/Projectiles/Rogue/BarrelShrapnel.cs index 35b3bb5761..693c76591e 100644 --- a/Projectiles/Rogue/BarrelShrapnel.cs +++ b/Projectiles/Rogue/BarrelShrapnel.cs @@ -49,5 +49,10 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 60 * 4); projectile.Kill(); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 60 * 4); + projectile.Kill(); + } } } diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 05fc50cae0..0820425fb0 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -109,6 +109,27 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + grind += 5; //THE GRIND NEVER STOPS + if (grind >= 10) + { + grind = 10; + } + Player player = Main.player[projectile.owner]; + target.AddBuff(ModContent.BuffType(), 300); + if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer && grind >= 1) //stealth strike attack + { + int stealth = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[stealth].Calamity().forceRogue = true; + } + if (Main.rand.NextBool(2)) + { + player.statLife += 1; //Trello said 2 hp per hit. Sounds like a fat balancing problem. + player.HealEffect(1); + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) //afterimages { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/BrackishFlaskProj.cs b/Projectiles/Rogue/BrackishFlaskProj.cs index 7deb4e36f0..2df36976cc 100644 --- a/Projectiles/Rogue/BrackishFlaskProj.cs +++ b/Projectiles/Rogue/BrackishFlaskProj.cs @@ -62,5 +62,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 300); target.AddBuff(BuffID.Poisoned, 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.Poisoned, 300); + } } } diff --git a/Projectiles/Rogue/BrackishWater.cs b/Projectiles/Rogue/BrackishWater.cs index 97a496126e..c63f5ad0c3 100644 --- a/Projectiles/Rogue/BrackishWater.cs +++ b/Projectiles/Rogue/BrackishWater.cs @@ -62,5 +62,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 300); target.AddBuff(BuffID.Poisoned, 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.Poisoned, 300); + } } } diff --git a/Projectiles/Rogue/BrackishWaterBlast.cs b/Projectiles/Rogue/BrackishWaterBlast.cs index 8049f1d6cc..5e97031360 100644 --- a/Projectiles/Rogue/BrackishWaterBlast.cs +++ b/Projectiles/Rogue/BrackishWaterBlast.cs @@ -105,5 +105,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 300); target.AddBuff(BuffID.Poisoned, 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.Poisoned, 300); + } } } diff --git a/Projectiles/Rogue/Brimblade2.cs b/Projectiles/Rogue/Brimblade2.cs index b008e59ac0..2a61fe7b72 100644 --- a/Projectiles/Rogue/Brimblade2.cs +++ b/Projectiles/Rogue/Brimblade2.cs @@ -30,5 +30,14 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } } } diff --git a/Projectiles/Rogue/BrimbladeProj.cs b/Projectiles/Rogue/BrimbladeProj.cs index 7dfbf4b56e..2d6273b8a6 100644 --- a/Projectiles/Rogue/BrimbladeProj.cs +++ b/Projectiles/Rogue/BrimbladeProj.cs @@ -41,5 +41,24 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + int numProj = 2; + float rotation = MathHelper.ToRadians(20); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj + 1; i++) + { + Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X * 0.25f, perturbedSpeed.Y * 0.25f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + } + } + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } } } diff --git a/Projectiles/Rogue/BurningStrifeProj.cs b/Projectiles/Rogue/BurningStrifeProj.cs index e7c29e1d39..a25122b7c7 100644 --- a/Projectiles/Rogue/BurningStrifeProj.cs +++ b/Projectiles/Rogue/BurningStrifeProj.cs @@ -64,6 +64,18 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + if (projectile.Calamity().stealthStrike && projectile.penetrate != 1) + { + Main.PlaySound(2, projectile.Center, 103); + int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner); + Main.projectile[proj].Center = projectile.Center; + Main.projectile[proj].Calamity().rogue = true; + } + } + public override void Kill(int timeLeft) { int proj; diff --git a/Projectiles/Rogue/ButcherKnife.cs b/Projectiles/Rogue/ButcherKnife.cs index 207de21529..fc18820bee 100644 --- a/Projectiles/Rogue/ButcherKnife.cs +++ b/Projectiles/Rogue/ButcherKnife.cs @@ -130,6 +130,12 @@ namespace CalamityMod.Projectiles.Rogue player.AddBuff(BuffID.WellFed, 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + Player player = Main.player[projectile.owner]; + player.AddBuff(BuffID.WellFed, 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/CarvingFork.cs b/Projectiles/Rogue/CarvingFork.cs index 082f5156b7..54ce3829da 100644 --- a/Projectiles/Rogue/CarvingFork.cs +++ b/Projectiles/Rogue/CarvingFork.cs @@ -45,6 +45,12 @@ namespace CalamityMod.Projectiles.Rogue player.AddBuff(BuffID.WellFed, 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + Player player = Main.player[projectile.owner]; + player.AddBuff(BuffID.WellFed, 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/Celestus2.cs b/Projectiles/Rogue/Celestus2.cs index dc773fbcd3..06090a0883 100644 --- a/Projectiles/Rogue/Celestus2.cs +++ b/Projectiles/Rogue/Celestus2.cs @@ -63,6 +63,19 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Ichor, 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/CelestusBoomerang.cs b/Projectiles/Rogue/CelestusBoomerang.cs index bd4476a69a..d3a9547e54 100644 --- a/Projectiles/Rogue/CelestusBoomerang.cs +++ b/Projectiles/Rogue/CelestusBoomerang.cs @@ -142,6 +142,34 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + if (projectile.owner == Main.myPlayer) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)(projectile.damage* 0.7f), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index 8b5fc2459a..42c14c09d5 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -96,5 +96,10 @@ namespace CalamityMod.Projectiles.Rogue target.immune[projectile.owner] = 7; target.AddBuff(ModContent.BuffType(), 240); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } } } diff --git a/Projectiles/Rogue/CrystalPiercerProjectile.cs b/Projectiles/Rogue/CrystalPiercerProjectile.cs index 3bea1fbd26..3b3aaef03d 100644 --- a/Projectiles/Rogue/CrystalPiercerProjectile.cs +++ b/Projectiles/Rogue/CrystalPiercerProjectile.cs @@ -63,5 +63,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Frostburn, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 120); + } } } diff --git a/Projectiles/Rogue/CursedDaggerProj.cs b/Projectiles/Rogue/CursedDaggerProj.cs index b772952452..d0cc15d3fb 100644 --- a/Projectiles/Rogue/CursedDaggerProj.cs +++ b/Projectiles/Rogue/CursedDaggerProj.cs @@ -58,5 +58,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.CursedInferno, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 120); + } } } diff --git a/Projectiles/Rogue/DeepSeaDumbbell1.cs b/Projectiles/Rogue/DeepSeaDumbbell1.cs index 51e6f06c4f..d8a8a822b7 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell1.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell1.cs @@ -111,5 +111,45 @@ namespace CalamityMod.Projectiles.Rogue projectile.Kill(); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + + projectile.velocity.X = -projectile.velocity.X; + projectile.velocity.Y = -projectile.velocity.Y; + + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), + (int)((double)projectile.damage * 0.75), projectile.knockBack * 0.75f, Main.myPlayer, 0f, 0f); + + float num628 = (float)Main.rand.Next(-35, 36) * 0.01f; + float num629 = (float)Main.rand.Next(-35, 36) * 0.01f; + int num3; + for (int num627 = 0; num627 < 2; num627 = num3 + 1) + { + if (num627 == 1) + { + num628 *= 10f; + num629 *= 10f; + } + else + { + num628 *= -10f; + num629 *= -10f; + } + + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), + (int)((double)projectile.damage * 0.25), projectile.knockBack * 0.25f, Main.myPlayer, 0f, 0f); + + num3 = num627; + } + } + + projectile.Kill(); + } } } diff --git a/Projectiles/Rogue/DeepSeaDumbbell2.cs b/Projectiles/Rogue/DeepSeaDumbbell2.cs index bc82c50c14..2ec13e5b9a 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell2.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell2.cs @@ -152,5 +152,45 @@ namespace CalamityMod.Projectiles.Rogue projectile.Kill(); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + + projectile.velocity.X = -projectile.velocity.X; + projectile.velocity.Y = -projectile.velocity.Y; + + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), + (int)((double)projectile.damage * 0.75), projectile.knockBack * 0.75f, Main.myPlayer, 0f, 0f); + + float num628 = (float)Main.rand.Next(-35, 36) * 0.01f; + float num629 = (float)Main.rand.Next(-35, 36) * 0.01f; + int num3; + for (int num627 = 0; num627 < 2; num627 = num3 + 1) + { + if (num627 == 1) + { + num628 *= 10f; + num629 *= 10f; + } + else + { + num628 *= -10f; + num629 *= -10f; + } + + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), + (int)((double)projectile.damage * 0.25), projectile.knockBack * 0.25f, Main.myPlayer, 0f, 0f); + + num3 = num627; + } + } + + projectile.Kill(); + } } } diff --git a/Projectiles/Rogue/DeepSeaDumbbell3.cs b/Projectiles/Rogue/DeepSeaDumbbell3.cs index 50a3fa6de7..1d8069a60c 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell3.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell3.cs @@ -138,5 +138,39 @@ namespace CalamityMod.Projectiles.Rogue projectile.Kill(); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + + if (projectile.owner == Main.myPlayer) + { + float num628 = (float)Main.rand.Next(-35, 36) * 0.01f; + float num629 = (float)Main.rand.Next(-35, 36) * 0.01f; + int num3; + for (int num627 = 0; num627 < 2; num627 = num3 + 1) + { + if (num627 == 1) + { + num628 *= 10f; + num629 *= 10f; + } + else + { + num628 *= -10f; + num629 *= -10f; + } + + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType(), + (int)((double)projectile.damage * 0.25), projectile.knockBack * 0.25f, Main.myPlayer, 0f, 0f); + + num3 = num627; + } + } + + projectile.Kill(); + } } } diff --git a/Projectiles/Rogue/DeepSeaDumbbellWeight.cs b/Projectiles/Rogue/DeepSeaDumbbellWeight.cs index 96bc07d5b0..2a33889ff7 100644 --- a/Projectiles/Rogue/DeepSeaDumbbellWeight.cs +++ b/Projectiles/Rogue/DeepSeaDumbbellWeight.cs @@ -63,5 +63,10 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } } } diff --git a/Projectiles/Rogue/DeepWounderProjectile.cs b/Projectiles/Rogue/DeepWounderProjectile.cs index 74f0f8e029..163f98fac5 100644 --- a/Projectiles/Rogue/DeepWounderProjectile.cs +++ b/Projectiles/Rogue/DeepWounderProjectile.cs @@ -60,6 +60,16 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + if (projectile.Calamity().stealthStrike) + { + target.AddBuff(ModContent.BuffType(), 120); + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/DesecratedBubble.cs b/Projectiles/Rogue/DesecratedBubble.cs index 4e8c86ecb1..c61e6b2801 100644 --- a/Projectiles/Rogue/DesecratedBubble.cs +++ b/Projectiles/Rogue/DesecratedBubble.cs @@ -106,6 +106,15 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.ai[0] == 1f) + { + target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.CursedInferno, 180); + } + } + // Cannot deal damage for the first several frames of existence. public override bool CanDamage() { diff --git a/Projectiles/Rogue/DestructionStar.cs b/Projectiles/Rogue/DestructionStar.cs index 0b4d0762f4..e4fd1c3719 100644 --- a/Projectiles/Rogue/DestructionStar.cs +++ b/Projectiles/Rogue/DestructionStar.cs @@ -47,6 +47,11 @@ namespace CalamityMod.Projectiles.Rogue hitCount++; } + public override void OnHitPvp(Player target, int damage, bool crit) + { + hitCount++; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/DukesDecapitatorProj.cs b/Projectiles/Rogue/DukesDecapitatorProj.cs index d795b8305a..dac6e26dfb 100644 --- a/Projectiles/Rogue/DukesDecapitatorProj.cs +++ b/Projectiles/Rogue/DukesDecapitatorProj.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity(); + CalamityPlayer modPlayer = Main.player[projectile.owner].Calamity(); if(projectile.velocity.X != 0 || projectile.velocity.Y != 0){ projectile.velocity.X *= 0.99f; projectile.velocity.Y *= 0.99f; diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index 61f596b1ba..02279b02aa 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -59,6 +59,25 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + for (int n = 0; n < Main.rand.Next(3, 6); n++) //3 to 5 spears + { + float x = target.position.X + (float)Main.rand.Next(-400, 400); + float y = target.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = target.position.X + (float)(target.width / 2) - vector.X; + float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.1 * Main.rand.Next(4, 7)), (int)((double)projectile.knockBack * 0.1 * Main.rand.Next(7, 10)), projectile.owner, 0f, 0f); + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/EmpyreanKnife.cs b/Projectiles/Rogue/EmpyreanKnife.cs index 51b4908c05..a8139055b9 100644 --- a/Projectiles/Rogue/EmpyreanKnife.cs +++ b/Projectiles/Rogue/EmpyreanKnife.cs @@ -146,6 +146,22 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, 305, 0, 0f, projectile.owner, (float)num2, num); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + float num = (float)damage * 0.005f; + if ((int)num == 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; + int num2 = projectile.owner; + Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, 305, 0, 0f, projectile.owner, (float)num2, num); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/EpidemicShredderProjectile.cs b/Projectiles/Rogue/EpidemicShredderProjectile.cs index 6d6e910706..c29e3b83a7 100644 --- a/Projectiles/Rogue/EpidemicShredderProjectile.cs +++ b/Projectiles/Rogue/EpidemicShredderProjectile.cs @@ -88,5 +88,16 @@ namespace CalamityMod.Projectiles.Rogue } target.AddBuff(ModContent.BuffType(), 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.ai[0] == 0f) + { + int projectileIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25f), 2f, projectile.owner); + Main.projectile[projectileIndex].Calamity().forceRogue = true; + projectile.ai[0] = 12f; //0.2th of a second cooldown + } + target.AddBuff(ModContent.BuffType(), 300); + } } } diff --git a/Projectiles/Rogue/EquanimityProj.cs b/Projectiles/Rogue/EquanimityProj.cs index 9f46ef762d..1e6aca684b 100644 --- a/Projectiles/Rogue/EquanimityProj.cs +++ b/Projectiles/Rogue/EquanimityProj.cs @@ -89,6 +89,27 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Confused, 30); + + if (!recall) + { + int shardCount = Main.rand.Next(1, 3); + for (int i = 0; i <= shardCount; i++) + { + Vector2 shardVelocity = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)); + shardVelocity.Normalize(); + shardVelocity *= 5f; + Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.1f), 0f, projectile.owner); + if (projectile.Calamity().stealthStrike) + { + Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.1f), 0f, projectile.owner); + } + } + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 3); diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index fd7e91008d..027216cc98 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -105,5 +105,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Frostburn, 600); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + target.AddBuff(BuffID.Frostburn, 600); + } } } diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index a5da92e799..e13ee53103 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -83,6 +83,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 300); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/ExplosiveSun.cs b/Projectiles/Rogue/ExplosiveSun.cs index 755fc2bee3..73f6c06918 100644 --- a/Projectiles/Rogue/ExplosiveSun.cs +++ b/Projectiles/Rogue/ExplosiveSun.cs @@ -58,6 +58,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs index c2fdf98bc6..c7dc2bd9af 100644 --- a/Projectiles/Rogue/FlameScytheProjectile.cs +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -54,5 +54,15 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[proj].Calamity().forceRogue = true; } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 300); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].Calamity().forceRogue = true; + } + } } } diff --git a/Projectiles/Rogue/Fork.cs b/Projectiles/Rogue/Fork.cs index 7424788be2..b61f788977 100644 --- a/Projectiles/Rogue/Fork.cs +++ b/Projectiles/Rogue/Fork.cs @@ -38,6 +38,13 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Player player = Main.player[projectile.owner]; + target.AddBuff(ModContent.BuffType(), 300); + player.AddBuff(BuffID.WellFed, 180); + } + + public override void OnHitPvp(Player target, int damage, bool crit) { Player player = Main.player[projectile.owner]; target.AddBuff(BuffID.Bleeding, 300); diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index 8031639502..faf5b1beba 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -33,6 +33,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 60); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 60); + } + public override void Kill(int timeLeft) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index cb30ebea05..6228dba971 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -121,6 +121,12 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool CanDamage() { return projectile.ai[0] == 0f; diff --git a/Projectiles/Rogue/GelDartProjectile.cs b/Projectiles/Rogue/GelDartProjectile.cs index dd881ae174..0d5359f72a 100644 --- a/Projectiles/Rogue/GelDartProjectile.cs +++ b/Projectiles/Rogue/GelDartProjectile.cs @@ -66,5 +66,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Slimed, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Slimed, 120); + } } } diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 97b91cb260..8db253cfb5 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -84,6 +84,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (projectile.timeLeft > 595) diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index a47f751f5b..b777df0ca0 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -244,5 +244,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Rogue/HeavenfallenEnergy.cs b/Projectiles/Rogue/HeavenfallenEnergy.cs index 3e5e127569..fedd5dce3b 100644 --- a/Projectiles/Rogue/HeavenfallenEnergy.cs +++ b/Projectiles/Rogue/HeavenfallenEnergy.cs @@ -48,5 +48,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 180); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } } } diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index 261daf12f5..6ce4616ad5 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -171,6 +171,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item10, projectile.position); diff --git a/Projectiles/Rogue/HellsSunProj.cs b/Projectiles/Rogue/HellsSunProj.cs index c7d78dfdb1..68490b11db 100644 --- a/Projectiles/Rogue/HellsSunProj.cs +++ b/Projectiles/Rogue/HellsSunProj.cs @@ -91,5 +91,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } } } diff --git a/Projectiles/Rogue/Honeycomb.cs b/Projectiles/Rogue/Honeycomb.cs index bbb6ed729c..f1bf30e1bd 100644 --- a/Projectiles/Rogue/Honeycomb.cs +++ b/Projectiles/Rogue/Honeycomb.cs @@ -106,6 +106,32 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + projectile.velocity.X = -projectile.velocity.X; + projectile.velocity.Y = -projectile.velocity.Y; + int split = 0; + while (split < 3) + { + //Calculate the velocity of the projectile + float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f); + float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f; + //Prevents the projectile speed from being too low + if (shardspeedX < 2f && shardspeedX > -2f) + { + shardspeedX += -projectile.velocity.X; + } + if (shardspeedY > 2f && shardspeedY < 2f) + { + shardspeedY += -projectile.velocity.Y; + } + + //Spawn the projectile + Projectile.NewProjectile(projectile.position.X + shardspeedX, projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 2f, projectile.owner, Main.rand.Next(3), 0f); + split += 1; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index 31163095d0..33e5b33a16 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -78,6 +78,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Frostburn, 300); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 300); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index de4796b2b4..583d5f1aca 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -78,6 +78,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Frostburn, 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { //Changes the texture of the projectile diff --git a/Projectiles/Rogue/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs index 9fbdf11008..37fdea1ec1 100644 --- a/Projectiles/Rogue/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -100,7 +100,32 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if(initStealth) + if (initStealth) + { + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 15) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f), + ModContent.ProjectileType(), projectile.damage / 8, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f), + ModContent.ProjectileType(), projectile.damage / 8, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); + } + } + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (initStealth) { if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 15) { diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index 59c00622a5..607bcc2111 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -58,5 +58,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Ichor, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Ichor, 120); + } } } diff --git a/Projectiles/Rogue/IllustriousKnife.cs b/Projectiles/Rogue/IllustriousKnife.cs index 1412de9036..2c7926c5e3 100644 --- a/Projectiles/Rogue/IllustriousKnife.cs +++ b/Projectiles/Rogue/IllustriousKnife.cs @@ -115,6 +115,23 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + float num = (float)damage * 0.015f; + if ((int)num == 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; + int num2 = projectile.owner; + Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/InfernalKrisCinder.cs b/Projectiles/Rogue/InfernalKrisCinder.cs index a24570f36c..841488275a 100644 --- a/Projectiles/Rogue/InfernalKrisCinder.cs +++ b/Projectiles/Rogue/InfernalKrisCinder.cs @@ -53,6 +53,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { // If this is a stealth strike, make the blade glow orange diff --git a/Projectiles/Rogue/InfernalKrisExplosion.cs b/Projectiles/Rogue/InfernalKrisExplosion.cs index a621627ea2..b09ece65db 100644 --- a/Projectiles/Rogue/InfernalKrisExplosion.cs +++ b/Projectiles/Rogue/InfernalKrisExplosion.cs @@ -57,6 +57,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index 7e733e70e3..b5b3341b02 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -82,6 +82,28 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + + if (projectile.Calamity().stealthStrike) + { + int sparkCount = Main.rand.Next(3, 7); + for (int i = 0; i < sparkCount; i++) + { + int sparkScatter = 1; + Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter - 2, sparkScatter + 2)); + + sparkVelocity.Normalize(); + sparkVelocity *= 3; + + Projectile.NewProjectile(projectile.Center, sparkVelocity, ModContent.ProjectileType(), 10, 0, projectile.owner, 0, 0); + } + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 10, 0, projectile.owner, 0, 0); + Main.PlaySound(2, projectile.position, 74); + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (projectile.Calamity().stealthStrike) diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index c3efd19575..2419ac2a88 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -38,6 +38,11 @@ namespace CalamityMod.Projectiles.Rogue CreateInk(); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + CreateInk(); + } + public override bool OnTileCollide(Vector2 oldVelocity) { CreateInk(); diff --git a/Projectiles/Rogue/InkCloud.cs b/Projectiles/Rogue/InkCloud.cs index 1fde0895e1..8695c1ff9d 100644 --- a/Projectiles/Rogue/InkCloud.cs +++ b/Projectiles/Rogue/InkCloud.cs @@ -41,5 +41,10 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Confused, 300); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Confused, 300); + } } } diff --git a/Projectiles/Rogue/InkCloud2.cs b/Projectiles/Rogue/InkCloud2.cs index 5a59e811f6..3355a4778f 100644 --- a/Projectiles/Rogue/InkCloud2.cs +++ b/Projectiles/Rogue/InkCloud2.cs @@ -41,5 +41,10 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Confused, 300); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Confused, 300); + } } } diff --git a/Projectiles/Rogue/InkCloud3.cs b/Projectiles/Rogue/InkCloud3.cs index a47c864003..21f67db423 100644 --- a/Projectiles/Rogue/InkCloud3.cs +++ b/Projectiles/Rogue/InkCloud3.cs @@ -41,5 +41,10 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Confused, 300); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Confused, 300); + } } } diff --git a/Projectiles/Rogue/JawsProjectile.cs b/Projectiles/Rogue/JawsProjectile.cs index 020ad9086e..58892e10eb 100644 --- a/Projectiles/Rogue/JawsProjectile.cs +++ b/Projectiles/Rogue/JawsProjectile.cs @@ -185,6 +185,18 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 240); + if (projectile.Calamity().stealthStrike) + { + target.AddBuff(ModContent.BuffType(), 240); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 100, 10f, projectile.owner, 0, 0); + } + } + public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); diff --git a/Projectiles/Rogue/JawsShockwave.cs b/Projectiles/Rogue/JawsShockwave.cs index be4a9209a5..60e41af77f 100644 --- a/Projectiles/Rogue/JawsShockwave.cs +++ b/Projectiles/Rogue/JawsShockwave.cs @@ -65,6 +65,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 240); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); diff --git a/Projectiles/Rogue/Knife.cs b/Projectiles/Rogue/Knife.cs index 8e4270efaf..2a8c6a3d25 100644 --- a/Projectiles/Rogue/Knife.cs +++ b/Projectiles/Rogue/Knife.cs @@ -43,6 +43,12 @@ namespace CalamityMod.Projectiles.Rogue player.AddBuff(BuffID.WellFed, 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + Player player = Main.player[projectile.owner]; + player.AddBuff(BuffID.WellFed, 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index 98c992d595..8f8d471518 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -162,6 +162,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 240); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/LeviathanTooth2.cs b/Projectiles/Rogue/LeviathanTooth2.cs index 0d1feb5bc3..ac98bf39e8 100644 --- a/Projectiles/Rogue/LeviathanTooth2.cs +++ b/Projectiles/Rogue/LeviathanTooth2.cs @@ -162,6 +162,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 240); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/LeviathanTooth3.cs b/Projectiles/Rogue/LeviathanTooth3.cs index bc4bb757fa..fa853deb98 100644 --- a/Projectiles/Rogue/LeviathanTooth3.cs +++ b/Projectiles/Rogue/LeviathanTooth3.cs @@ -162,6 +162,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 240); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 18fe2c12ff..da948b6884 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -219,5 +219,10 @@ namespace CalamityMod.Projectiles.Rogue } target.AddBuff(BuffID.Venom, 240); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + } } } diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 5f91aaf29f..db78492bf1 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -87,6 +87,24 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 7; i++) + { + Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (speed.X == 0f && speed.Y == 0f) + { + speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + } + speed.Normalize(); + speed *= ((float)Main.rand.Next(30, 61) * 0.1f) * 2f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + public override void Kill(int timeLeft) { for (int i = 0; i <= 10; i++) diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index d0e8841437..012000e6bd 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -94,6 +94,38 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.penetrate <= 1) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 160; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + for (int num621 = 0; num621 < 70; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 40; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.7f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f); + Main.dust[num624].velocity *= 2f; + } + } + } + public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index 822dce4e95..61a9ebd082 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -46,5 +46,10 @@ namespace CalamityMod.Projectiles.Rogue target.immune[projectile.owner] = 6; target.AddBuff(BuffID.CursedInferno, 240); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 240); + } } } diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index cadbf31485..f97b62824a 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -192,5 +192,10 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[p].Calamity().stealthStrike = true; } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + } } } diff --git a/Projectiles/Rogue/MoltenAmputatorProj.cs b/Projectiles/Rogue/MoltenAmputatorProj.cs index 0aa6730bef..427e263cb9 100644 --- a/Projectiles/Rogue/MoltenAmputatorProj.cs +++ b/Projectiles/Rogue/MoltenAmputatorProj.cs @@ -58,5 +58,29 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + int num251 = Main.rand.Next(1, 3); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + 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; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + for (int k = 0; k < 10; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } } } diff --git a/Projectiles/Rogue/NightsGazeProjectile.cs b/Projectiles/Rogue/NightsGazeProjectile.cs index 8723fe072d..b4de86c7f2 100644 --- a/Projectiles/Rogue/NightsGazeProjectile.cs +++ b/Projectiles/Rogue/NightsGazeProjectile.cs @@ -76,6 +76,33 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), projectile.timeLeft); + + int starCount = 6; + int starFrequency = 3; + float spread = 20f; + for (int i = 0; i < starCount; i++) + { + int projectileDamage = (int)(projectile.damage * 0.75f); + int projectileType = ModContent.ProjectileType(); + if (Main.rand.Next(starCount) < starFrequency) + { + projectileType = ModContent.ProjectileType(); + } + Vector2 velocity = projectile.oldVelocity.RotateRandom(MathHelper.ToRadians(spread)); + float speed = Main.rand.NextFloat(1.5f, 2f); + float moveDuration = Main.rand.Next(5, 15); + + Projectile.NewProjectile(projectile.Center, velocity * speed, projectileType, projectileDamage, 5f, projectile.owner, 0f, moveDuration); + } + + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.6f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68, 0.2f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); + } + public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); diff --git a/Projectiles/Rogue/NightsGazeSpark.cs b/Projectiles/Rogue/NightsGazeSpark.cs index 9d9d449286..596befdf11 100644 --- a/Projectiles/Rogue/NightsGazeSpark.cs +++ b/Projectiles/Rogue/NightsGazeSpark.cs @@ -71,6 +71,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); diff --git a/Projectiles/Rogue/NightsGazeStar.cs b/Projectiles/Rogue/NightsGazeStar.cs index efd5239624..6be167463e 100644 --- a/Projectiles/Rogue/NightsGazeStar.cs +++ b/Projectiles/Rogue/NightsGazeStar.cs @@ -101,6 +101,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); diff --git a/Projectiles/Rogue/OPHammer.cs b/Projectiles/Rogue/OPHammer.cs index 52ff08fa08..ed4389cc8b 100644 --- a/Projectiles/Rogue/OPHammer.cs +++ b/Projectiles/Rogue/OPHammer.cs @@ -122,6 +122,16 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].Calamity().forceRogue = true; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/PhantasmalRuinProj.cs b/Projectiles/Rogue/PhantasmalRuinProj.cs index ceccfe47a1..7e84508b96 100644 --- a/Projectiles/Rogue/PhantasmalRuinProj.cs +++ b/Projectiles/Rogue/PhantasmalRuinProj.cs @@ -84,5 +84,26 @@ namespace CalamityMod.Projectiles.Rogue } } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 8) + { + for (i = 0; i < 8; i++) + { + float ai1 = Main.rand.NextFloat() + 0.5f; + float randomSpeed = (float)Main.rand.Next(1, 7); + float randomSpeed2 = (float)Main.rand.Next(1, 7); + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int num23 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.05), 0f, projectile.owner, 1f, ai1); + int num24 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.05), 0f, projectile.owner, 1f, ai1); + } + } + } } } diff --git a/Projectiles/Rogue/PlaguedFuelPackCloud.cs b/Projectiles/Rogue/PlaguedFuelPackCloud.cs index ffa477409d..5097d841f6 100644 --- a/Projectiles/Rogue/PlaguedFuelPackCloud.cs +++ b/Projectiles/Rogue/PlaguedFuelPackCloud.cs @@ -48,6 +48,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 300); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + public override void Kill(int timeLeft) { if (timeLeft != 0) diff --git a/Projectiles/Rogue/PlaguenadeBee.cs b/Projectiles/Rogue/PlaguenadeBee.cs index 783ab3ef03..9bac794afc 100644 --- a/Projectiles/Rogue/PlaguenadeBee.cs +++ b/Projectiles/Rogue/PlaguenadeBee.cs @@ -160,5 +160,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } } } diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 0211e6e3b5..17a9ec5815 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -144,5 +144,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 600); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } } } diff --git a/Projectiles/Rogue/PoisonBol.cs b/Projectiles/Rogue/PoisonBol.cs index 6bb93446fd..1423a4bd95 100644 --- a/Projectiles/Rogue/PoisonBol.cs +++ b/Projectiles/Rogue/PoisonBol.cs @@ -69,6 +69,11 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Poisoned, 240); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Poisoned, 240); + } } } diff --git a/Projectiles/Rogue/ProfanedPartisanproj.cs b/Projectiles/Rogue/ProfanedPartisanproj.cs index ef6754dbe9..aec928321c 100644 --- a/Projectiles/Rogue/ProfanedPartisanproj.cs +++ b/Projectiles/Rogue/ProfanedPartisanproj.cs @@ -108,5 +108,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Rogue/ProfanedPartisanspear.cs b/Projectiles/Rogue/ProfanedPartisanspear.cs index 3f36d0ee09..8f9af9bf4e 100644 --- a/Projectiles/Rogue/ProfanedPartisanspear.cs +++ b/Projectiles/Rogue/ProfanedPartisanspear.cs @@ -67,6 +67,21 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + if (projectile.ai[1] != 1f) + { + projectile.velocity.X = -projectile.velocity.X; + projectile.velocity.Y = -projectile.velocity.Y; + projectile.ai[1] = 1f; + projectile.ai[0] = 1f; + projectile.extraUpdates = 2; + if (projectile.timeLeft > 280) + projectile.timeLeft = 280; + } + } + public override void AI() { projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Rogue/Quasar2.cs b/Projectiles/Rogue/Quasar2.cs index 82701db2bc..81e6cb4ea5 100644 --- a/Projectiles/Rogue/Quasar2.cs +++ b/Projectiles/Rogue/Quasar2.cs @@ -73,6 +73,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/QuasarKnife.cs b/Projectiles/Rogue/QuasarKnife.cs index 2bf844fb6b..6b71e68cd6 100644 --- a/Projectiles/Rogue/QuasarKnife.cs +++ b/Projectiles/Rogue/QuasarKnife.cs @@ -96,6 +96,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/RadiantExplosion.cs b/Projectiles/Rogue/RadiantExplosion.cs index 7c0e7fb023..8be2b8a395 100644 --- a/Projectiles/Rogue/RadiantExplosion.cs +++ b/Projectiles/Rogue/RadiantExplosion.cs @@ -93,5 +93,39 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[num17].Calamity().forceRogue = true; } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + for (int n = 0; n < 3; n++) + { + float x = target.position.X + (float)Main.rand.Next(-400, 400); + float y = target.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = target.position.X + (float)(target.width / 2) - vector.X; + float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 25; + int projectileType = Main.rand.Next(3); + if (projectileType == 0) + { + projectileType = ModContent.ProjectileType(); + } + else if (projectileType == 1) + { + projectileType = ProjectileID.HallowStar; + } + else + { + projectileType = ProjectileID.FallingStar; + } + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, projectileType, (int)((double)projectile.damage * 0.75), 5f, projectile.owner, 2f, 0f); + Main.projectile[num17].Calamity().forceRogue = true; + } + } } } diff --git a/Projectiles/Rogue/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index 91111078c6..08e5034d68 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -114,6 +114,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/RadiantStarKnife.cs b/Projectiles/Rogue/RadiantStarKnife.cs index d229136e6e..8f319b8abe 100644 --- a/Projectiles/Rogue/RadiantStarKnife.cs +++ b/Projectiles/Rogue/RadiantStarKnife.cs @@ -103,6 +103,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 6e28b23f4d..e946070476 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -178,6 +178,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } + public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); diff --git a/Projectiles/Rogue/RegulusEnergy.cs b/Projectiles/Rogue/RegulusEnergy.cs index 8d19eb0c78..591845f492 100644 --- a/Projectiles/Rogue/RegulusEnergy.cs +++ b/Projectiles/Rogue/RegulusEnergy.cs @@ -122,5 +122,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 60); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 60); + } } } diff --git a/Projectiles/Rogue/RegulusRiotProj.cs b/Projectiles/Rogue/RegulusRiotProj.cs index af588d197c..d4260e90ac 100644 --- a/Projectiles/Rogue/RegulusRiotProj.cs +++ b/Projectiles/Rogue/RegulusRiotProj.cs @@ -147,6 +147,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 73a67fdea6..f4893e151c 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -83,8 +83,23 @@ namespace CalamityMod.Projectiles.Rogue { return; } - Main.player[Main.myPlayer].statLife += 120; - Main.player[Main.myPlayer].HealEffect(120); + Main.player[projectile.owner].statLife += 120; + Main.player[projectile.owner].HealEffect(120); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 150; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); + if (!lifesteal) + { + return; + } + Main.player[projectile.owner].statLife += 120; + Main.player[projectile.owner].HealEffect(120); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/ScourgeVenomCloud.cs b/Projectiles/Rogue/ScourgeVenomCloud.cs index dfce172f12..c874e06e43 100644 --- a/Projectiles/Rogue/ScourgeVenomCloud.cs +++ b/Projectiles/Rogue/ScourgeVenomCloud.cs @@ -75,5 +75,14 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 240); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 240); + if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer) //stealth strike attack + { + target.AddBuff(ModContent.BuffType(), 240); + } + } } } diff --git a/Projectiles/Rogue/ScourgeoftheDesertProj.cs b/Projectiles/Rogue/ScourgeoftheDesertProj.cs index c86a7c6749..4751fbcba8 100644 --- a/Projectiles/Rogue/ScourgeoftheDesertProj.cs +++ b/Projectiles/Rogue/ScourgeoftheDesertProj.cs @@ -36,7 +36,21 @@ namespace CalamityMod.Projectiles.Rogue { if (StealthDamageCap == 0) { - BaseDamage = damage; + BaseDamage = projectile.damage; + } + + projectile.damage = (int)((BaseDamage * ((StealthDamageCap > 10 ? 10 : StealthDamageCap) * 20) / 100) + BaseDamage); //20% damage boost per hit, max of 200% + StealthDamageCap++; + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.Calamity().stealthStrike) + { + if (StealthDamageCap == 0) + { + BaseDamage = projectile.damage; } projectile.damage = (int)((BaseDamage * ((StealthDamageCap > 10 ? 10 : StealthDamageCap) * 20) / 100) + BaseDamage); //20% damage boost per hit, max of 200% diff --git a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs index 094c5b51f6..2f15fa01ce 100644 --- a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs +++ b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs @@ -58,6 +58,15 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 600); + if (projectile.Calamity().stealthStrike == true) //stealth strike attack + { + target.AddBuff(ModContent.BuffType(), 600); + } + } + public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); diff --git a/Projectiles/Rogue/ShatteredExplosion.cs b/Projectiles/Rogue/ShatteredExplosion.cs index 3c884c0e99..b703e7395f 100644 --- a/Projectiles/Rogue/ShatteredExplosion.cs +++ b/Projectiles/Rogue/ShatteredExplosion.cs @@ -43,5 +43,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 180); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } } } diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index 6176fbc5ae..00f8634c56 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -98,6 +98,12 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + } + public override bool OnTileCollide(Vector2 oldVelocity) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index eb97637f81..71e6745f93 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -178,6 +178,36 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (multiplier < 0.5f) + multiplier = 0.5f; + damage = stealthOrigin ? damage : (int)((double)damage * multiplier); + if (projectile.Calamity().stealthStrike) + { + int numProj = 2; + float rotation = MathHelper.ToRadians(10); + if (projectile.owner == Main.myPlayer) + { + Player owner = Main.player[projectile.owner]; + Vector2 correctedVelocity = target.Center - owner.Center; + correctedVelocity.Normalize(); + correctedVelocity *= 10f; + int spread = 6; + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedspeed = new Vector2(correctedVelocity.X, correctedVelocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); + + int proj = Projectile.NewProjectile(owner.Center.X, owner.Center.Y - 10, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.55), 1f, projectile.owner, 0f, 0f); + spread -= Main.rand.Next(2, 6); + Main.projectile[proj].ai[0] = 1f; + } + projectile.Kill(); + } + } + target.AddBuff(ModContent.BuffType(), 180); + } + public override void Kill(int timeLeft) { diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index bbde2b1584..7e6bf22403 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -60,6 +60,14 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (target.statLife <= 0) + { + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0, Main.myPlayer, 0, 10); + } + } + public override void Kill(int timeLeft) { for (int i = 0; i < 5; i++) diff --git a/Projectiles/Rogue/ShockGrenadeBolt.cs b/Projectiles/Rogue/ShockGrenadeBolt.cs index de530a3594..37b47c3a44 100644 --- a/Projectiles/Rogue/ShockGrenadeBolt.cs +++ b/Projectiles/Rogue/ShockGrenadeBolt.cs @@ -92,6 +92,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Electrified, 180); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Electrified, 180); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D sprite; diff --git a/Projectiles/Rogue/ShockGrenadeExplosion.cs b/Projectiles/Rogue/ShockGrenadeExplosion.cs index 0727c02962..1ff1ac7f1d 100644 --- a/Projectiles/Rogue/ShockGrenadeExplosion.cs +++ b/Projectiles/Rogue/ShockGrenadeExplosion.cs @@ -56,6 +56,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Electrified, 300); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Electrified, 300); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); diff --git a/Projectiles/Rogue/ShockTeslaAura.cs b/Projectiles/Rogue/ShockTeslaAura.cs index 513c09bf92..f028321828 100644 --- a/Projectiles/Rogue/ShockTeslaAura.cs +++ b/Projectiles/Rogue/ShockTeslaAura.cs @@ -115,6 +115,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Electrified, 300); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Electrified, 300); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); diff --git a/Projectiles/Rogue/ShroomerangProj.cs b/Projectiles/Rogue/ShroomerangProj.cs index 940f04969f..b3abd416ab 100644 --- a/Projectiles/Rogue/ShroomerangProj.cs +++ b/Projectiles/Rogue/ShroomerangProj.cs @@ -64,5 +64,12 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike == true) player.AddBuff(ModContent.BuffType(), 720); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + Player player = Main.player[projectile.owner]; + if (projectile.Calamity().stealthStrike == true) + player.AddBuff(ModContent.BuffType(), 720); + } } } diff --git a/Projectiles/Rogue/SkyStabberProj.cs b/Projectiles/Rogue/SkyStabberProj.cs index 3af2149df0..29bf4dc1e3 100644 --- a/Projectiles/Rogue/SkyStabberProj.cs +++ b/Projectiles/Rogue/SkyStabberProj.cs @@ -69,13 +69,6 @@ namespace CalamityMod.Projectiles.Rogue return false; } - /* Part of my fiasco in "how do I destroy existing stabbers with right click" - public void OnRightClick() - { - projectile.active = false; - projectile.netUpdate = true; - }*/ - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { if (projectile.Calamity().stealthStrike == true) @@ -98,5 +91,28 @@ namespace CalamityMod.Projectiles.Rogue } } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.Calamity().stealthStrike == true) + { + for (int n = 0; n < 4; n++) + { + float x = target.Center.X + (float)Main.rand.Next(-400, 400); + float y = target.Center.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = target.Center.X + (float)(target.width / 2) - vector.X; + float num14 = target.Center.Y + (float)(target.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 20; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), 1f, projectile.owner, 0f, 0f); + Main.projectile[num17].Calamity().forceRogue = true; + } + } + } } } diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 574a8aa5f2..24526ffae5 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -93,5 +93,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Ichor, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Ichor, 120); + } } } diff --git a/Projectiles/Rogue/SpearofPaleolithProj.cs b/Projectiles/Rogue/SpearofPaleolithProj.cs index 5558a3cf95..cd09f4a137 100644 --- a/Projectiles/Rogue/SpearofPaleolithProj.cs +++ b/Projectiles/Rogue/SpearofPaleolithProj.cs @@ -80,5 +80,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index c42fce74e2..6d4862eec9 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -222,5 +222,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Slimed, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Slimed, 120); + } } } diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 98959ed258..557c7b2300 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -187,6 +187,19 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Ichor, 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs index 1fefd543c7..16123f4924 100644 --- a/Projectiles/Rogue/SupernovaBoom.cs +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -108,5 +108,18 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } } } diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs index e618733d48..8b0cf83d00 100644 --- a/Projectiles/Rogue/SupernovaHoming.cs +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -127,5 +127,18 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } } } diff --git a/Projectiles/Rogue/SupernovaSpike.cs b/Projectiles/Rogue/SupernovaSpike.cs index 89f0d54553..ba04b3fab6 100644 --- a/Projectiles/Rogue/SupernovaSpike.cs +++ b/Projectiles/Rogue/SupernovaSpike.cs @@ -74,6 +74,19 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Ichor, 120); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + internal static void Visuals(Projectile projectile, ref Color c) { CalamityUtils.IterateDisco(ref c, ref projectile.localAI[0], 15); diff --git a/Projectiles/Rogue/SylvanSlash.cs b/Projectiles/Rogue/SylvanSlash.cs index ec98876169..ab28bb66b4 100644 --- a/Projectiles/Rogue/SylvanSlash.cs +++ b/Projectiles/Rogue/SylvanSlash.cs @@ -75,5 +75,10 @@ namespace CalamityMod.Projectiles.Rogue { projectile.velocity *= 0.5f; } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + projectile.velocity *= 0.5f; + } } } diff --git a/Projectiles/Rogue/SylvanSlashAttack.cs b/Projectiles/Rogue/SylvanSlashAttack.cs index f484ffbc25..3f78662bd1 100644 --- a/Projectiles/Rogue/SylvanSlashAttack.cs +++ b/Projectiles/Rogue/SylvanSlashAttack.cs @@ -124,5 +124,30 @@ namespace CalamityMod.Projectiles.Rogue } } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (projectile.owner == Main.myPlayer) + { + if (cooldown == 5) + { + if (modPlayer.wearingRogueArmor && modPlayer.rogueStealthMax != 0) + { + if (modPlayer.rogueStealth < modPlayer.rogueStealthMax) + modPlayer.rogueStealth += 0.01f; + cooldown = 0; + } + } + if (Main.rand.NextBool(8)) + { + float speedMult = Main.rand.Next(3,6); + Vector2 vector1 = new Vector2(projectile.Center.X - player.Center.X, projectile.Center.Y - player.Center.Y); + vector1.Normalize(); + Projectile.NewProjectile(player.Center.X, player.Center.Y, -vector1.X * speedMult, -vector1.Y * speedMult, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } } } diff --git a/Projectiles/Rogue/TheSyringeCinder.cs b/Projectiles/Rogue/TheSyringeCinder.cs index b10793366f..b7218845ce 100644 --- a/Projectiles/Rogue/TheSyringeCinder.cs +++ b/Projectiles/Rogue/TheSyringeCinder.cs @@ -125,5 +125,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index d637628af5..e4a68a8069 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -49,6 +49,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } + public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/TheSyringeS1.cs b/Projectiles/Rogue/TheSyringeS1.cs index 52aca14319..9b785666e5 100644 --- a/Projectiles/Rogue/TheSyringeS1.cs +++ b/Projectiles/Rogue/TheSyringeS1.cs @@ -52,5 +52,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Rogue/TotalityFire.cs b/Projectiles/Rogue/TotalityFire.cs index 4a5c406334..10efec023b 100644 --- a/Projectiles/Rogue/TotalityFire.cs +++ b/Projectiles/Rogue/TotalityFire.cs @@ -128,5 +128,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.OnFire, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 120); + } } } diff --git a/Projectiles/Rogue/TotalityTar.cs b/Projectiles/Rogue/TotalityTar.cs index e0ddaaadba..103b13c6ea 100644 --- a/Projectiles/Rogue/TotalityTar.cs +++ b/Projectiles/Rogue/TotalityTar.cs @@ -76,6 +76,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 240); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.OnFire, 240); + } + public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); diff --git a/Projectiles/Rogue/TriactisOPHammer.cs b/Projectiles/Rogue/TriactisOPHammer.cs index b5ddf393fe..be35c91d5c 100644 --- a/Projectiles/Rogue/TriactisOPHammer.cs +++ b/Projectiles/Rogue/TriactisOPHammer.cs @@ -139,6 +139,33 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 70; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/TurbulanceProjectile.cs b/Projectiles/Rogue/TurbulanceProjectile.cs index 336f48e222..91a3065856 100644 --- a/Projectiles/Rogue/TurbulanceProjectile.cs +++ b/Projectiles/Rogue/TurbulanceProjectile.cs @@ -94,6 +94,24 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < 4; num252++) + { + 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; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, (crit ? 1f /*homing*/: 0f/*not homing*/)); + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) { if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Rogue/UmbraphileBoom.cs b/Projectiles/Rogue/UmbraphileBoom.cs index 493fd021ab..d7ae0e87ae 100644 --- a/Projectiles/Rogue/UmbraphileBoom.cs +++ b/Projectiles/Rogue/UmbraphileBoom.cs @@ -93,5 +93,10 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Daybreak, 180); target.AddBuff(ModContent.BuffType(), 180); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } } } diff --git a/Projectiles/Rogue/UrchinStingerProj.cs b/Projectiles/Rogue/UrchinStingerProj.cs index 99abcfeb49..0f1b447414 100644 --- a/Projectiles/Rogue/UrchinStingerProj.cs +++ b/Projectiles/Rogue/UrchinStingerProj.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue { Vector2 projspeed = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)); int proj = Projectile.NewProjectile(projectile.Center, projspeed, ModContent.ProjectileType(), (int)(projdmg * 0.5f), 1f, projectile.owner, 0f, 0f); - Main.projectile[proj].Calamity().rogue = true; + Main.projectile[proj].Calamity().forceRogue = true; } return false; } @@ -85,6 +85,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Venom, 360); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Venom, 360); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 93fdfef95e..15eb040599 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -152,6 +152,33 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 60); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + //Start homing at player if you hit someone + projectile.ai[0] = 1; + + int num251 = Main.rand.Next(2, 4); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + 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 shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), projectile.damage / 3, 0f, projectile.owner, 0f, 0f); + } + } + + target.AddBuff(BuffID.Frostburn, 240); + target.AddBuff(ModContent.BuffType(), 240); + if (Main.rand.NextBool(5)) + target.AddBuff(ModContent.BuffType(), 60); + } + public override bool OnTileCollide(Vector2 oldVelocity) { //Bounce off tiles and start homing on player if it hits a tile diff --git a/Projectiles/Rogue/Valaricicle.cs b/Projectiles/Rogue/Valaricicle.cs index 6a5b790f3f..c6c1eb26cb 100644 --- a/Projectiles/Rogue/Valaricicle.cs +++ b/Projectiles/Rogue/Valaricicle.cs @@ -45,5 +45,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Frostburn, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 120); + } } } diff --git a/Projectiles/Rogue/Valaricicle2.cs b/Projectiles/Rogue/Valaricicle2.cs index 219365e519..9269977e2a 100644 --- a/Projectiles/Rogue/Valaricicle2.cs +++ b/Projectiles/Rogue/Valaricicle2.cs @@ -45,5 +45,10 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Frostburn, 120); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 120); + } } } diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index 776556fcee..07cf60313d 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -154,6 +154,11 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } + public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); diff --git a/Projectiles/Rogue/WebBallBol.cs b/Projectiles/Rogue/WebBallBol.cs index c5d5588be8..e93beaa2cb 100644 --- a/Projectiles/Rogue/WebBallBol.cs +++ b/Projectiles/Rogue/WebBallBol.cs @@ -43,6 +43,18 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Webbed, 60); } } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (projectile.Calamity().stealthStrike == true) + { + target.AddBuff(BuffID.Webbed, 180); + } + else + { + target.AddBuff(BuffID.Webbed, 60); + } + } } } diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs index eed58b6fb5..09f4138bb0 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -66,5 +66,15 @@ namespace CalamityMod.Projectiles.Rogue target.immune[projectile.owner] = 2; target.AddBuff(BuffID.CursedInferno, 300); } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + projectile.damage /= 2; + if (projectile.damage < 1) + { + projectile.damage = 1; + } + target.AddBuff(BuffID.CursedInferno, 300); + } } }