From 2520570fa62165048bc039da55fc040a4ff3360c Mon Sep 17 00:00:00 2001 From: FyloZ Date: Wed, 10 Jun 2020 19:35:55 -0400 Subject: [PATCH] Added Wasp Necklace --- Content/DecimationPlayer.cs | 45 ++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/Content/DecimationPlayer.cs b/Content/DecimationPlayer.cs index fd3e692..1321765 100644 --- a/Content/DecimationPlayer.cs +++ b/Content/DecimationPlayer.cs @@ -349,24 +349,7 @@ namespace Decimation.Content if (this.HasEquippedAccessory(ModContent.ItemType())) { player.AddBuff(BuffID.Panic, 300); - - // Wasps - int waspsCount = 1; - for (int i = 0; i < 3; i++) - { - if (Main.rand.NextBool(3)) - waspsCount++; - } - - Vector2 position = player.position; - Vector2 speed = new Vector2(Main.rand.Next(-35, 36) * 0.02f, Main.rand.Next(-35, 36) * 0.02f); - int damages = 10 + Main.rand.Next(1, 4); - const float kb = 0.5f; - - for (int i = 0; i < waspsCount; i++) - { - Projectile.NewProjectile(position, speed, ProjectileID.Wasp, damages, kb, player.whoAmI); - } + SpawnWaspNecklaceWasps(); } } @@ -410,6 +393,12 @@ namespace Decimation.Content if (AmuletSlotItem.type == ModContent.ItemType() && Main.rand.NextBool(25)) CrystalAmuletEffect(); + + if (this.HasEquippedAccessory(ModContent.ItemType())) + { + player.AddBuff(BuffID.Panic, 300); + SpawnWaspNecklaceWasps(); + } } public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) @@ -422,6 +411,26 @@ namespace Decimation.Content _amuletSlotAmulet?.Synergy.OnPlayerHit(this, ref damage); } + private void SpawnWaspNecklaceWasps() + { + int waspsCount = 1; + for (int i = 0; i < 3; i++) + { + if (Main.rand.NextBool(3)) + waspsCount++; + } + + Vector2 position = player.position; + Vector2 speed = new Vector2(Main.rand.Next(-35, 36) * 0.02f, Main.rand.Next(-35, 36) * 0.02f); + int damages = 10 + Main.rand.Next(1, 4); + const float kb = 0.5f; + + for (int i = 0; i < waspsCount; i++) + { + Projectile.NewProjectile(position, speed, ProjectileID.Wasp, damages, kb, player.whoAmI); + } + } + public void DashMovement() { if (dash == 2 && ttDash > 0)