From 70befdb8553e1970e45c08bb360bb1cdf113d8db Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 10 Dec 2019 17:20:29 -0500 Subject: [PATCH] updated sylvan slasher --- Items/Weapons/Rogue/SylvanSlasher.cs | 3 ++- Projectiles/Rogue/SylvanSlash.cs | 2 +- Projectiles/Rogue/SylvanSlashAttack.cs | 24 ++++++++---------------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Items/Weapons/Rogue/SylvanSlasher.cs b/Items/Weapons/Rogue/SylvanSlasher.cs index 052c86c567..20f6eeb81a 100644 --- a/Items/Weapons/Rogue/SylvanSlasher.cs +++ b/Items/Weapons/Rogue/SylvanSlasher.cs @@ -8,7 +8,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Sylvan Slasher"); - Tooltip.SetDefault(@"Summons sword waves and builds stealth on enemy hits + Tooltip.SetDefault(@"Summons a slash attack at the cursor's position +Enemy hits build stealth and cause sword waves to fire from the player in the opposite direction Does not consume stealth and cannot stealth strike"); } diff --git a/Projectiles/Rogue/SylvanSlash.cs b/Projectiles/Rogue/SylvanSlash.cs index b8e0046a4f..7b7ff3fb5a 100644 --- a/Projectiles/Rogue/SylvanSlash.cs +++ b/Projectiles/Rogue/SylvanSlash.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); projectile.localAI[0] += 1f; } - Lighting.AddLight(projectile.Center, 0f, 0.2f, 0.4f); + Lighting.AddLight(projectile.Center, 0.1f, 1f, 2f); projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; projectile.velocity.Y += projectile.ai[0]; if (Main.rand.NextBool(2)) diff --git a/Projectiles/Rogue/SylvanSlashAttack.cs b/Projectiles/Rogue/SylvanSlashAttack.cs index f6cd1e6e00..6b71ca220b 100644 --- a/Projectiles/Rogue/SylvanSlashAttack.cs +++ b/Projectiles/Rogue/SylvanSlashAttack.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = -1; projectile.tileCollide = false; projectile.Calamity().rogue = true; - projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; } @@ -75,14 +74,14 @@ namespace CalamityMod.Projectiles.Rogue } } Vector2 vector14 = projectile.Center + projectile.velocity * 3f; - Lighting.AddLight(vector14, 3f, 0.2f, 0.2f); + Lighting.AddLight(vector14, 0.2f, 2f, 3f); if (Main.rand.NextBool(3)) { int num30 = Dust.NewDust(vector14 - projectile.Size / 2f, projectile.width, projectile.height, 111, projectile.velocity.X, projectile.velocity.Y, 100, default, 2f); Main.dust[num30].noGravity = true; Main.dust[num30].position -= projectile.velocity; } - projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; + projectile.position = player.RotatedRelativePoint(Main.MouseWorld, true) - projectile.Size / 2f; projectile.rotation = projectile.velocity.ToRotation() + num; projectile.spriteDirection = projectile.direction; projectile.timeLeft = 2; @@ -95,7 +94,8 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity(); + Player player = Main.player[Main.myPlayer]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.owner == Main.myPlayer) { if ((target.damage > 5 || target.boss) && !target.SpawnedFromStatue) @@ -108,18 +108,10 @@ namespace CalamityMod.Projectiles.Rogue } if (Main.rand.NextBool(8)) { - if (Main.rand.NextBool(3)) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, Main.rand.Next(-3,-1), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); - } - else if (Main.rand.NextBool(2)) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Main.rand.Next(2,4), 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); - } - else - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Main.rand.Next(-3,-1), 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); - } + 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); } } }