From 7d877b98f98c187d57fff7bbacfe69d9897fd6ac Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Fri, 3 Dec 2021 10:08:37 -0500 Subject: [PATCH] Fixed several Eidolon Staff issues added challenge drop label damage and knockback now scale properly with bonuses --- Items/Weapons/Magic/StardustStaff.cs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Items/Weapons/Magic/StardustStaff.cs b/Items/Weapons/Magic/StardustStaff.cs index 5936bd5feb..b3fcb550b0 100644 --- a/Items/Weapons/Magic/StardustStaff.cs +++ b/Items/Weapons/Magic/StardustStaff.cs @@ -35,35 +35,31 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; + item.Calamity().challengeDrop = true; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + public override Vector2? HoldoutOrigin() => new Vector2(15, 15); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); int i = Main.myPlayer; float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - int num130 = 6; + int stardustAmt = 6; if (Main.rand.NextBool(3)) { - num130++; + stardustAmt++; } if (Main.rand.NextBool(4)) { - num130++; + stardustAmt++; } if (Main.rand.NextBool(5)) { - num130++; + stardustAmt++; } if (Main.rand.NextBool(3)) { @@ -75,15 +71,15 @@ namespace CalamityMod.Items.Weapons.Magic num133 *= num80; float x2 = vector2.X; float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 1f); + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), damage, knockBack, i, 0f, 1f); } else { - for (int num131 = 0; num131 < num130; num131++) + for (int i = 0; i < stardustAmt; i++) { float num132 = num78; float num133 = num79; - float num134 = 0.05f * (float)num131; + float num134 = 0.05f * (float)i; num132 += (float)Main.rand.Next(-155, 156) * num134; num133 += (float)Main.rand.Next(-155, 156) * num134; num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); @@ -92,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Magic num133 *= num80; float x2 = vector2.X; float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); + Projectile.NewProjectile(x2, y2, num132, num133, ModContent.ProjectileType(), damage, knockBack, i, 0f, 0f); } } return false;