From 67971ca7899bf01fdc64b8bc8b899d66b91ef8dd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 13 Aug 2020 11:55:13 -0400 Subject: [PATCH] turbulance sell price fix, sky stabber cleanup --- Items/Weapons/Ranged/Barinade.cs | 4 +-- Items/Weapons/Rogue/Turbulance.cs | 2 +- Projectiles/Rogue/SkyStabberProj.cs | 45 +++++++---------------------- 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index 82a464a341..5e6b65ff19 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = 2; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = ProjectileID.PurificationPowder; + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; - item.useAmmo = 40; + item.useAmmo = AmmoID.Arrow; } /*public void OverhaulInit() diff --git a/Items/Weapons/Rogue/Turbulance.cs b/Items/Weapons/Rogue/Turbulance.cs index 89847b3b9d..0d02193358 100644 --- a/Items/Weapons/Rogue/Turbulance.cs +++ b/Items/Weapons/Rogue/Turbulance.cs @@ -30,7 +30,7 @@ Stealth strikes are trailed by homing wind slashes"); item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 14; - item.value = Item.buyPrice(0, 2, 0, 0); + item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Projectiles/Rogue/SkyStabberProj.cs b/Projectiles/Rogue/SkyStabberProj.cs index 20df737d5f..64cb49d15f 100644 --- a/Projectiles/Rogue/SkyStabberProj.cs +++ b/Projectiles/Rogue/SkyStabberProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.killSpikyBalls == true) + if (modPlayer.killSpikyBalls) { projectile.active = false; projectile.netUpdate = true; @@ -70,46 +70,21 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, 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; - } - } - } + OnHitEffects(target.Center); + } public override void OnHitPvp(Player target, int damage, bool crit) { - if (projectile.Calamity().stealthStrike == true) + OnHitEffects(target.Center); + } + + private void OnHitEffects(Vector2 targetPos) + { + if (projectile.Calamity().stealthStrike) { 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; + CalamityUtils.ProjectileRain(targetPos, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack * 0.25f, projectile.owner, 5); } } }