From 316abc970af522c7bd4e03a125a7d4e67cdcbd4e Mon Sep 17 00:00:00 2001 From: DominicKarma Date: Tue, 15 Oct 2019 16:40:46 -0500 Subject: [PATCH] Revert "Fixes to various items" This reverts commit 5f6d1d1a537a9c923f595e27373b9682988a9a92. --- Projectiles/CalamityGlobalProjectile.cs | 9 +++----- Projectiles/Rogue/BlueFlamePillar.cs | 22 +++++++++++++++++++ .../BouncingEyeballProjectileStealthStrike.cs | 6 ++++- .../Rogue/ConsecratedWaterProjectile.cs | 13 ++--------- Projectiles/Typeless/MomentumCapacitorOrb.cs | 2 +- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index b4628e8b1e..9347ce470c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -591,8 +591,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].Calamity().dragonScales && rogue && projectile.friendly && projectile.type != mod.ProjectileType("Nanotech") && - projectile.type != mod.ProjectileType("DragonShit")) + if (Main.player[projectile.owner].Calamity().dragonScales && rogue && projectile.friendly && projectile.type != mod.ProjectileType("Nanotech")) { if (counter % 50 == 0) { @@ -600,7 +599,7 @@ namespace CalamityMod.Projectiles { //spawn a dust that does 1/5th of the original damage int projectileID = Projectile.NewProjectile(projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi), mod.ProjectileType("DragonShit"), - Math.Max((int)((double)projectile.damage * 0.2), 50), 0f, projectile.owner, 0f, 0f); + (int)((double)projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); } } } @@ -631,9 +630,7 @@ namespace CalamityMod.Projectiles //will always be friendly and rogue if it has this boost if (Main.player[projectile.owner].Calamity().momentumCapacitor && projectile.Calamity().momentumCapacitatorBoost) { - if (projectile.type != mod.ProjectileType("Malachite") && projectile.type != mod.ProjectileType("ScourgeoftheDesert2") && - projectile.velocity.Length() < 3f) - projectile.velocity *= 1.025f; + projectile.velocity *= 1.025f; } if (Main.player[projectile.owner].Calamity().theBeeDamage > 0 && projectile.owner == Main.myPlayer && projectile.friendly && projectile.damage > 0 && diff --git a/Projectiles/Rogue/BlueFlamePillar.cs b/Projectiles/Rogue/BlueFlamePillar.cs index db8da3da92..4d36f2b02d 100644 --- a/Projectiles/Rogue/BlueFlamePillar.cs +++ b/Projectiles/Rogue/BlueFlamePillar.cs @@ -22,11 +22,33 @@ namespace CalamityMod.Projectiles.Rogue projectile.alpha = 255; projectile.Calamity().rogue = true; } + /// + /// Checks if a tile is below a designated Vector2 + /// + /// The position to check + /// If the position provided is in tile coordinates or not + /// + public static bool SolidTileBelow(Vector2 position, bool usingTileCoords = false) + { + //if not in tile coordinates + if (!usingTileCoords) + { + //convert them accordingly + position = position.ToTileCoordinates().ToVector2(); + } + int x = (int)position.X; + int y = (int)position.Y; + return Main.tile[x, y + 1].active() && Main.tileSolid[Main.tile[x, y + 1].type]; + } public override void AI() { if (projectile.localAI[0] == 0f) { projectile.position.Y -= projectile.height / 2; //position adjustments + if (!SolidTileBelow(projectile.Bottom)) + { + projectile.Kill(); + } projectile.localAI[0] = 1f; } float max = (float)(projectile.width * projectile.height) / 222f; diff --git a/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs b/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs index da18e21f69..cf2597d5c5 100644 --- a/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs +++ b/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs @@ -34,7 +34,11 @@ namespace CalamityMod.Projectiles.Rogue projectile.rotation = projectile.velocity.ToRotation(); if (Math.Abs(projectile.velocity.X) > 43f) { - projectile.velocity = Vector2.Clamp(projectile.velocity, new Vector2(-23f), new Vector2(23f)); + projectile.velocity.X = Math.Sign(projectile.velocity.X) * 43f; + } + if (Math.Abs(projectile.velocity.Y) > 43f) + { + projectile.velocity.Y = Math.Sign(projectile.velocity.Y) * 43f; } } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/ConsecratedWaterProjectile.cs b/Projectiles/Rogue/ConsecratedWaterProjectile.cs index e0459b4969..f8a938ea53 100644 --- a/Projectiles/Rogue/ConsecratedWaterProjectile.cs +++ b/Projectiles/Rogue/ConsecratedWaterProjectile.cs @@ -3,7 +3,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.World.Generation; namespace CalamityMod.Projectiles.Rogue { @@ -44,11 +43,7 @@ namespace CalamityMod.Projectiles.Rogue //normal if (projectile.ai[1] == 0f) { - Point result; - if (WorldUtils.Find(projectile.Top.ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result)) - { - Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, mod.ProjectileType("BlueFlamePillar"), ConsecratedWater.BaseDamage, 2f, projectile.owner); - } + Projectile.NewProjectile(projectile.Bottom, Vector2.Zero, mod.ProjectileType("BlueFlamePillar"), ConsecratedWater.BaseDamage, 2f, projectile.owner); } //stealth strike else if (projectile.ai[1] == 1f) @@ -56,11 +51,7 @@ namespace CalamityMod.Projectiles.Rogue //3 pillars instead of 1 for (float i = -1f; i <= 1f; i += 1f) { - Point result; - if (WorldUtils.Find((projectile.Top + i * Main.rand.NextFloat(56f, 108f) * Vector2.UnitX).ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result)) - { - Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, mod.ProjectileType("BlueFlamePillar"), ConsecratedWater.BaseDamage, 2f, projectile.owner); - } + Projectile.NewProjectile(projectile.Bottom + i * Main.rand.NextFloat(56f, 108f) * Vector2.UnitX, Vector2.Zero, mod.ProjectileType("BlueFlamePillar"), ConsecratedWater.BaseDamage, 2f, projectile.owner); } } } diff --git a/Projectiles/Typeless/MomentumCapacitorOrb.cs b/Projectiles/Typeless/MomentumCapacitorOrb.cs index f7b9c3ee88..ad36e8eeb5 100644 --- a/Projectiles/Typeless/MomentumCapacitorOrb.cs +++ b/Projectiles/Typeless/MomentumCapacitorOrb.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless for (int k = 0; k < Main.projectile.Length; k++) { if (Main.projectile[k].type == mod.ProjectileType("SlickCaneProjectile")) continue; - if (Main.projectile[k].owner == projectile.owner && Main.projectile[k].Calamity().rogue && + if (Main.projectile[k].owner == projectile.owner && Main.projectile[k].Calamity().rogue && !Main.projectile[k].Calamity().momentumCapacitatorBoost && Main.projectile[k].friendly) { Main.projectile[k].damage = (int)(Main.projectile[k].damage * 1.15f);