From 4ae09dd3870dededc3a7abfea28ba3294fcce6b7 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:31:30 -0500 Subject: [PATCH 01/78] Buffed Prismalline stealth strikes --- Items/Weapons/Rogue/Prismalline.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index af6fb5a4b7..923092e91f 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.15f), knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; return false; From 4309513218b2118721861a92434efa2ca640235e Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:32:33 -0500 Subject: [PATCH 02/78] Buffed Ichor Spear stealth strikes --- Items/Weapons/Rogue/IchorSpear.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index 6ac896daf4..77da55eeb0 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.6), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].Calamity().stealthStrike = true; From b9dd8507926b2a9896a4cfcb51cb4a6b510c6e2e Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:34:47 -0500 Subject: [PATCH 03/78] Buffed Burning Strife stealth strikes --- Items/Weapons/Rogue/BurningStrife.cs | 3 ++- Projectiles/Rogue/BurningStrifeProj.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index 950405d6a8..1c72194fb9 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -46,7 +46,8 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) { speedMult = 1.25f; - } + damage = (int)(damage * 1.3f); + } int proj = Projectile.NewProjectile(position, new Vector2(speedX * speedMult, speedY * speedMult), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) { diff --git a/Projectiles/Rogue/BurningStrifeProj.cs b/Projectiles/Rogue/BurningStrifeProj.cs index ab9272292e..a827763f13 100644 --- a/Projectiles/Rogue/BurningStrifeProj.cs +++ b/Projectiles/Rogue/BurningStrifeProj.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Projectiles.Rogue { Main.PlaySound(SoundID.Item, projectile.Center, 103); int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.33), projectile.knockBack, projectile.owner); + Main.projectile[proj].timeLeft += 20; Main.projectile[proj].Center = projectile.Center; Main.projectile[proj].Calamity().rogue = true; } @@ -72,6 +73,7 @@ namespace CalamityMod.Projectiles.Rogue { Main.PlaySound(SoundID.Item, projectile.Center, 103); int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.33), projectile.knockBack, projectile.owner); + Main.projectile[proj].timeLeft += 20; Main.projectile[proj].Center = projectile.Center; Main.projectile[proj].Calamity().rogue = true; } From aae2882e35ac436ab98eb34c8c90a9d1da48224b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:36:01 -0500 Subject: [PATCH 04/78] Buffed Palladium Javelin stealth strikes --- Items/Weapons/Rogue/PalladiumJavelin.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/PalladiumJavelin.cs b/Items/Weapons/Rogue/PalladiumJavelin.cs index 13a6ecd2cb..fd4e8e5326 100644 --- a/Items/Weapons/Rogue/PalladiumJavelin.cs +++ b/Items/Weapons/Rogue/PalladiumJavelin.cs @@ -38,7 +38,10 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.425f); + + int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (javelin.WithinBounds(Main.maxProjectiles)) { Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); From a31641062ed27738c91c8a36f213fcac26391090 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:36:51 -0500 Subject: [PATCH 05/78] Buffed Cobalt Kunai stealth strike damage --- Items/Weapons/Rogue/CobaltKunai.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Items/Weapons/Rogue/CobaltKunai.cs b/Items/Weapons/Rogue/CobaltKunai.cs index bcd696302c..f532b471c0 100644 --- a/Items/Weapons/Rogue/CobaltKunai.cs +++ b/Items/Weapons/Rogue/CobaltKunai.cs @@ -38,17 +38,19 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.Calamity().StealthStrikeAvailable()) - { - for (int i = -6; i <= 6; i += 6) - { - Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - } - return false; - } - return true; + { + damage = (int)(damage * 1.4f); + + for (int i = -6; i <= 6; i += 6) + { + Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); + int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + if (stealth.WithinBounds(Main.maxProjectiles)) + Main.projectile[stealth].Calamity().stealthStrike = true; + } + return false; + } + return true; } public override void AddRecipes() From 330d06cd26e9cc44c89e3f38f14a23d472328f01 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:37:48 -0500 Subject: [PATCH 06/78] Buffed Blazing Star stealth strike damage --- Items/Weapons/Rogue/BlazingStar.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index f25b3fe360..c7abf343cb 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -47,6 +47,8 @@ namespace CalamityMod.Items.Weapons.Rogue { if (item.stack != 1) { + damage = (int)(damage * 1.55f); + for (int i = 0; i < item.stack; i++) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-MathHelper.ToRadians(8f), MathHelper.ToRadians(8f), i / (float)(item.stack - 1))); From f1876779505120101a89fd7b724e2583d1444631 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:40:14 -0500 Subject: [PATCH 07/78] Made Blast Barrel more lenient with its falling --- Items/Weapons/Rogue/BlastBarrel.cs | 4 ++-- Projectiles/Rogue/BlastBarrelProjectile.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Rogue/BlastBarrel.cs b/Items/Weapons/Rogue/BlastBarrel.cs index 22e0d7b90f..e4162e3b86 100644 --- a/Items/Weapons/Rogue/BlastBarrel.cs +++ b/Items/Weapons/Rogue/BlastBarrel.cs @@ -38,10 +38,10 @@ namespace CalamityMod.Items.Weapons.Rogue } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - speedY *= 0.7f; //since the barrel is heavy + speedY *= 0.85f; Vector2 initialVelocity = new Vector2(speedX, speedY); - //unitY additive is do it doesn't exploe initially + // A vertical offset is added to ensure that the barrel does not immediately collide with tiles and explode. int p = Projectile.NewProjectile(position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 2aaa0865be..6d635d9efd 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.localAI[0] = 1f; } projectile.rotation += Math.Sign(projectile.velocity.X) * MathHelper.ToRadians(8f); - if (projectile.velocity.Y < 15f) - projectile.velocity.Y += 0.3f; + if (projectile.velocity.Y < 10f) + projectile.velocity.Y += 0.2f; if (CollideX && BounceEffectCooldown == 0) { From f5c1e7194729275b583b43a5390993fe28efbdb4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:41:15 -0500 Subject: [PATCH 08/78] Buffed Epidemic Shredder damage to 80 --- Items/Weapons/Rogue/EpidemicShredder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/EpidemicShredder.cs b/Items/Weapons/Rogue/EpidemicShredder.cs index 04a7efacc8..b29f3fe296 100644 --- a/Items/Weapons/Rogue/EpidemicShredder.cs +++ b/Items/Weapons/Rogue/EpidemicShredder.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 34; item.height = 34; - item.damage = 52; + item.damage = 80; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; From 34d6aaac0ef0905f5df5b144d4fe8b5a572ced1d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:42:31 -0500 Subject: [PATCH 09/78] Buffed Subduction Slicer stealth flamebursts --- Projectiles/Rogue/FlameScytheProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs index be8a2ab3ab..bc8bb1fd7e 100644 --- a/Projectiles/Rogue/FlameScytheProjectile.cs +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue 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, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner, 1f); + Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 1.5f), 2f, projectile.owner, 1f); projectile.localAI[0] = 30f; } } From f123958a560cbb1a379dc02073ea095bdd20d629 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:43:40 -0500 Subject: [PATCH 10/78] Buffed Shock Grenade shoot speed --- Items/Weapons/Rogue/ShockGrenade.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/ShockGrenade.cs b/Items/Weapons/Rogue/ShockGrenade.cs index 2a40f95ca2..4be340d1d9 100644 --- a/Items/Weapons/Rogue/ShockGrenade.cs +++ b/Items/Weapons/Rogue/ShockGrenade.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = Item.buyPrice(0, 1, 0, 0); item.rare = ItemRarityID.Yellow; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 7.5f; + item.shootSpeed = 12.5f; item.Calamity().rogue = true; } From 71f03297cc15eaf7935dff9688b68d9c2a500c04 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:44:26 -0500 Subject: [PATCH 11/78] Buffed Phantom Lance stealth strike damage --- Items/Weapons/Rogue/PhantomLance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs index f9a67c76b0..390129866a 100644 --- a/Items/Weapons/Rogue/PhantomLance.cs +++ b/Items/Weapons/Rogue/PhantomLance.cs @@ -47,7 +47,7 @@ Stealth strikes don't slow down and souls always deal full damage"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.75f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From 46480a565722d2e014160bf253a4c2b895aae06e Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:45:15 -0500 Subject: [PATCH 12/78] Buffed Cranium Smasher stealth strike damage --- Items/Weapons/Rogue/CraniumSmasher.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index d6c294e09f..e6b20c1e8a 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { + damage = (int)(damage * 1.75f); type = ModContent.ProjectileType(); } else if (Main.rand.NextBool(5)) From 52db4f3d8326293e73a2d47f2480e401218fa627 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:46:27 -0500 Subject: [PATCH 13/78] Increased Corpus Avertor speed/stealth strike damage --- Items/Weapons/Rogue/CorpusAvertor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index ff44328602..ba5ee592f6 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.rare = ItemRarityID.Yellow; item.Calamity().donorItem = true; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 5f; + item.shootSpeed = 8.5f; item.Calamity().rogue = true; } @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int dagger = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage * 2, knockBack * 2f, player.whoAmI); + int dagger = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 3.5f), knockBack * 2f, player.whoAmI); if (dagger.WithinBounds(Main.maxProjectiles)) Main.projectile[dagger].Calamity().stealthStrike = true; return false; From 10cf9b5463856a96a4e8b00884795c8d57565407 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:47:08 -0500 Subject: [PATCH 14/78] Buffed the Syringe stealth strike damage --- Items/Weapons/Rogue/TheSyringe.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/TheSyringe.cs b/Items/Weapons/Rogue/TheSyringe.cs index 03f23ab638..0beac46880 100644 --- a/Items/Weapons/Rogue/TheSyringe.cs +++ b/Items/Weapons/Rogue/TheSyringe.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.2f), knockBack, player.whoAmI, 0f, 1f); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From 91165f4a9641288fa8dffda442cd8ea897dd22c4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:47:40 -0500 Subject: [PATCH 15/78] Buffed Malachite's stealth strike damage --- Items/Weapons/Rogue/Malachite.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index b82323811f..a45d0f2d37 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (float i = -6.5f; i <= 6.5f; i += 6.5f) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - int stealth = Projectile.NewProjectile(position, perturbedSpeed, type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, perturbedSpeed, type, damage * 2, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; } From 751c9a6fa6f5796775c12b9a78e94a2aa067cb4f Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:53:35 -0500 Subject: [PATCH 16/78] System bane damage has diminishing returns --- Projectiles/DraedonsArsenal/SystemBaneProjectile.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs b/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs index 5379190720..437c7a12aa 100644 --- a/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs +++ b/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs @@ -60,9 +60,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // Every so often, generate some lightning at a nearby enemy, if one exists. if (Time % LightningFireRate == 0f && Main.myPlayer == projectile.owner) { + int lightningDamage = projectile.damage; + int totalSystemBanes = Main.player[projectile.owner].ownedProjectileCounts[projectile.type]; + + // Make the damage of the lightning have diminishing returns depending on how many systems are present. + lightningDamage = (int)Math.Ceiling(lightningDamage / Math.Pow(totalSystemBanes, 1D / 3D)); + NPC potentialTarget = projectile.Center.ClosestNPCAt(900f); if (potentialTarget != null) - Projectile.NewProjectile(projectile.Center, projectile.SafeDirectionTo(potentialTarget.Center) * 15f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + Projectile.NewProjectile(projectile.Center, projectile.SafeDirectionTo(potentialTarget.Center) * 15f, ModContent.ProjectileType(), lightningDamage, projectile.knockBack, projectile.owner); } // Sometimes generate lightning from the outside of the energy field if the projectile was spawned by a stealth strike. From 5d89e201fe1da78048195706e46576eb03147bef Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:54:32 -0500 Subject: [PATCH 17/78] Buffed Duke's Decapitator stealth strike damage --- Items/Weapons/Rogue/DukesDecapitator.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Items/Weapons/Rogue/DukesDecapitator.cs b/Items/Weapons/Rogue/DukesDecapitator.cs index 632515a33c..67ca6cbe35 100644 --- a/Items/Weapons/Rogue/DukesDecapitator.cs +++ b/Items/Weapons/Rogue/DukesDecapitator.cs @@ -38,6 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.2f); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (Main.projectile.IndexInRange(proj)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); From 3e9a988bb366ccd65b541f9debb7d890c819dadb Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:15:01 -0500 Subject: [PATCH 18/78] Made Shard of Antumbra go farther before falling --- Items/Weapons/Rogue/XerocPitchfork.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index cb7e081ce6..416e77f6a5 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = 10000; item.rare = ItemRarityID.Cyan; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 16f; + item.shootSpeed = 24f; item.Calamity().rogue = true; } @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.5f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; } From 7adfd8ab1cc5f9df75556aba6e0d5fd30220aafa Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:15:40 -0500 Subject: [PATCH 19/78] Nerfed Star of Destruction stealth strike damage --- Items/Weapons/Rogue/StarofDestruction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 7a71be96c9..06ed8ee1ef 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.8f), knockBack, player.whoAmI, 0f, 1f); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From fc788bfbef473e7a9affd6fef0c336deeb3096dd Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:17:16 -0500 Subject: [PATCH 20/78] Increased Luminous Striker pierce --- Items/Weapons/Rogue/LuminousStriker.cs | 2 +- Projectiles/Rogue/LuminousStrikerProj.cs | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index c4e48f7c47..bc8cfc463c 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.25f), knockBack, player.whoAmI); if (Main.projectile.IndexInRange(proj)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 424654f468..a61564046a 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -19,15 +19,17 @@ namespace CalamityMod.Projectiles.Rogue ProjectileID.Sets.TrailingMode[projectile.type] = 0; } - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 120; - projectile.Calamity().rogue = true; + projectile.penetrate = 4; + projectile.localNPCHitCooldown = 13; + projectile.usesLocalNPCImmunity = true; + projectile.timeLeft = 120; + projectile.Calamity().rogue = true; } public override void AI() From 1fce110478b7772cb973d52d1f80604ca9530c7c Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:18:04 -0500 Subject: [PATCH 21/78] Buffed Regulus Riot stealth strike damage --- Items/Weapons/Rogue/RegulusRiot.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs index 0f1218dee1..550b3013a4 100644 --- a/Items/Weapons/Rogue/RegulusRiot.cs +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -42,7 +42,7 @@ Stealth strikes explode into energy stars"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.2f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From 6f4d75e285b47eba4662d7761af2d2f96bfffde6 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:19:00 -0500 Subject: [PATCH 22/78] Nerfed Fantasy Talisman stealth strike damage --- Items/Weapons/Rogue/FantasyTalisman.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index 50296d545c..aad0095869 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -43,7 +43,7 @@ Stealth strikes release more souls and leave behind souls as they travel"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 0.8f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From 135f09622c90239f5c968d14cfff09a43f676edd Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:20:25 -0500 Subject: [PATCH 23/78] Buffed Frostcrush Valari stealth strike damage --- Items/Weapons/Rogue/FrostcrushValari.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 0df481b21d..7b1a4edaea 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -54,7 +54,7 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl for (int i = 0; i < 3; i++) { Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread)); - int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max(damage / 3, 1), knockBack / 3f, player.whoAmI, 0f, 1f); + int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max((int)(damage / 2.7272f), 1), knockBack / 3f, player.whoAmI, 0f, 1f); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; spread -= 10; @@ -64,7 +64,7 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl for (int i = 0; i < icicleAmt; i++) { Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2)); - Projectile.NewProjectile(position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), Math.Max(damage / 3, 1), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()), Math.Max((int)(damage / 2.7272f), 1), 0f, player.whoAmI, 0f, 0f); spread2 -= Main.rand.Next(1,4); } return false; From c8f665de2c833574c6084c7a65bfcb8e32ef0f0b Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:22:29 -0500 Subject: [PATCH 24/78] Buffed Mangrove Chakram stealth strike damage --- Items/Weapons/Rogue/MangroveChakram.cs | 3 +++ Projectiles/Rogue/MangroveChakramProjectile.cs | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index f97f8811a0..e3790b1745 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -37,6 +37,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.25f); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index db5b73d2c1..a7d3ca2287 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -35,14 +35,18 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); if (projectile.Calamity().stealthStrike) { + // Die early. + if (projectile.timeLeft < 240) + projectile.Kill(); + projectile.localAI[0] += Main.rand.Next(0,3); - if (projectile.localAI[0] >= 10f) - { + if (projectile.localAI[0] >= 10f) + { projectile.localAI[0] = 0f; - Projectile.NewProjectile(projectile.Center + new Vector2(Main.rand.NextFloat(-10f,10f), Main.rand.NextFloat(-10f,10f)), - (projectile.velocity).RotatedByRandom(0.1f) * 0.25f, - ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner); - } + Vector2 flowerSpawnPosition = projectile.Center + Main.rand.NextVector2Square(-10f, 10f); + Vector2 flowerShootVelocity = projectile.velocity.RotatedByRandom(0.1f) * 0.25f; + Projectile.NewProjectile(flowerSpawnPosition, flowerShootVelocity, ModContent.ProjectileType(), projectile.damage / 4, 0f, projectile.owner); + } } } From 3d91a9679639828b371fdfe77a57f4acb48743eb Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:22:51 -0500 Subject: [PATCH 25/78] Buffed Totality Breaker stealth strike damage --- Items/Weapons/Rogue/TotalityBreakers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index 61a77c1623..f28e76971c 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -41,7 +41,7 @@ Stealth strikes leak tar as they fly"); { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.15f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From d06ee29576e4f35c95a01943e5c592c2630c760b Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:27:03 -0500 Subject: [PATCH 26/78] Buffed Defective Sphere stealth strike damage --- Items/Weapons/Rogue/DefectiveSphere.cs | 39 +++++++++++--------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index b85c1dfc67..9f19678db6 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -71,30 +71,25 @@ Stealth strikes launch all 4 sphere types at once"); ProjectileType() }); - //Kinda ugly but idk how to make it cleaner - float SpeedX = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedX2 = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY2 = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedX3 = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY3 = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedX4 = speedX + Main.rand.NextFloat(-30, 30) * 0.05f; - float SpeedY4 = speedY + Main.rand.NextFloat(-30, 30) * 0.05f; - if (player.Calamity().StealthStrikeAvailable()) { - int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage / 2, knockBack, player.whoAmI); - int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ProjectileType(), damage / 2, knockBack, player.whoAmI); - int stealth3 = Projectile.NewProjectile(position.X, position.Y, SpeedX3, SpeedY3, ProjectileType(), damage / 2, knockBack, player.whoAmI); - int stealth4 = Projectile.NewProjectile(position.X, position.Y, SpeedX4, SpeedY4, ProjectileType(), damage / 2, knockBack, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - if (stealth2.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth2].Calamity().stealthStrike = true; - if (stealth3.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth3].Calamity().stealthStrike = true; - if (stealth4.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth4].Calamity().stealthStrike = true; + // This is done to allow looping when creating projectiles, instead of having to create many projectile/velocity variables all at once, + // which this shoot code used to do. + int[] projectilesToShoot = new int[] + { + type, + ProjectileType(), + ProjectileType(), + ProjectileType() + }; + + foreach (int projectileType in projectilesToShoot) + { + Vector2 shootVelocity = new Vector2(speedX, speedY) + Main.rand.NextVector2Square(-1.5f, 1.5f); + int stealth = Projectile.NewProjectile(position, shootVelocity, projectileType, (int)(damage * 0.625f), knockBack, player.whoAmI); + if (stealth.WithinBounds(Main.maxProjectiles)) + Main.projectile[stealth].Calamity().stealthStrike = true; + } } else { From fee05f253b037bbb5baaa485344f99cdb59d915a Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:27:36 -0500 Subject: [PATCH 27/78] Nerfed Terra Disk stealth strike damage --- Items/Weapons/Rogue/TerraDisk.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs index 4bdb033c8b..333446397c 100644 --- a/Items/Weapons/Rogue/TerraDisk.cs +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -64,11 +64,12 @@ Stealth strikes travel slower and are rapidly orbited by the smaller disks"); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.Calamity().StealthStrikeAvailable()) - { - speedX *= 0.75f; - speedY *= 0.75f; - } + if (player.Calamity().StealthStrikeAvailable()) + { + speedX *= 0.75f; + speedY *= 0.75f; + damage = (int)(damage * 0.9f); + } int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) { From 1065496ada323465144be73ed6916e77f5b911e2 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:28:19 -0500 Subject: [PATCH 28/78] Buffed Auroradical Throw stealth strike damage --- Items/Weapons/Rogue/AuroradicalThrow.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Items/Weapons/Rogue/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 10c429bc35..f3a1b695be 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -39,6 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 1.2f); + int star = Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (star.WithinBounds(Main.maxProjectiles)) Main.projectile[star].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); From 0577354ef20bb812e27244288ea5c736c23aa443 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:29:41 -0500 Subject: [PATCH 29/78] Buffed Lonid Progenitor stealth strike damage --- Items/Weapons/Rogue/LeonidProgenitor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index f9c4b2476c..7f1ed8ac65 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -68,9 +68,11 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + float stealthDamageFactor = player.Calamity().StealthStrikeAvailable() ? 1.25f : 1f; + if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) { - int bomb = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int bomb = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * stealthDamageFactor), knockBack, player.whoAmI); if (bomb.WithinBounds(Main.maxProjectiles)) Main.projectile[bomb].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; @@ -81,7 +83,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (float i = -2.5f; i < 3f; ++i) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(position, perturbedSpeed, type, (int)(damage * dmgMult), knockBack, player.whoAmI); + Projectile.NewProjectile(position, perturbedSpeed, type, (int)(damage * dmgMult * stealthDamageFactor), knockBack, player.whoAmI); } } return false; From 9aebde5379284505479d389e25e5c1e84f141b68 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:30:17 -0500 Subject: [PATCH 30/78] Buffed Stellar Knife stealth strike damage --- Items/Weapons/Rogue/StellarKnife.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index 5c7c901bf0..0f6b0f662c 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -45,15 +45,17 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[item.shoot] < knifeLimit) { - int knifeAmt = knifeCount; - if ((player.ownedProjectileCounts[item.shoot] + knifeCount) >= knifeLimit) - knifeAmt = knifeLimit - player.ownedProjectileCounts[item.shoot]; - if (knifeAmt <= 0) - { + damage = (int)(damage * 1.1f); + + int knifeAmt = knifeCount; + if ((player.ownedProjectileCounts[item.shoot] + knifeCount) >= knifeLimit) + knifeAmt = knifeLimit - player.ownedProjectileCounts[item.shoot]; + if (knifeAmt <= 0) + { int knife = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - if (knife.WithinBounds(Main.maxProjectiles)) - Main.projectile[knife].Calamity().stealthStrike = true; - } + if (knife.WithinBounds(Main.maxProjectiles)) + Main.projectile[knife].Calamity().stealthStrike = true; + } int spread = 20; for (int i = 0; i < knifeCount; i++) @@ -61,9 +63,9 @@ namespace CalamityMod.Items.Weapons.Rogue speedX *= 0.9f; Vector2 perturbedspeed = new Vector2(speedX, speedY + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); int knife2 = Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI, 1f, i % 5 == 0 ? 1f : 0f); - if (knife2.WithinBounds(Main.maxProjectiles)) - Main.projectile[knife2].Calamity().stealthStrike = true; - spread -= Main.rand.Next(1, 3); + if (knife2.WithinBounds(Main.maxProjectiles)) + Main.projectile[knife2].Calamity().stealthStrike = true; + spread -= Main.rand.Next(1, 3); } return false; } From 757db4c3851c77efb830da363eafc724f2ce05f7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:30:49 -0500 Subject: [PATCH 31/78] Buffed Heavenfallen Stardisk stealth strike damage --- Items/Weapons/Rogue/HeavenfallenStardisk.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 0b5634d03f..c244a5884e 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int proj = Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI); + int proj = Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, (int)(damage * 1.25f), knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; } From 2f4a116a1afebe35eac88dffd59caa8c98ac8e65 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:31:24 -0500 Subject: [PATCH 32/78] Nerfed Brackish Flask stealth strike damage --- Items/Weapons/Rogue/BrackishFlask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/BrackishFlask.cs b/Items/Weapons/Rogue/BrackishFlask.cs index cce83ac787..e34a9a68e2 100644 --- a/Items/Weapons/Rogue/BrackishFlask.cs +++ b/Items/Weapons/Rogue/BrackishFlask.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.85f), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; return false; From 15c36a3d60ec6374d1240e54010bd893f90a463e Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:31:59 -0500 Subject: [PATCH 33/78] Buffed Leviathan Teeth stealth strike damage --- Items/Weapons/Rogue/LeviathanTeeth.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index e4fcf30d0a..c3bc789cdd 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { teethCount = 3; stealthStrike = true; + damage = (int)(damage * 1.3f); } else { From a0fe1982b064d4eb1b3956b018951a1a86fa93e4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 15:36:04 -0500 Subject: [PATCH 34/78] Nerfed Nychthemeron stealth strike damage --- Items/Weapons/Rogue/Nychthemeron.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index 63a17cf9d2..6ecca8420f 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons.Rogue p.Calamity().stealthStrike = true; int pID = p.identity; - CreateOrbs(position, (int)(orbDamage * 0.75f), knockBack, pID, player, true); + CreateOrbs(position, (int)(orbDamage * 0.675f), knockBack, pID, player, true); } } else From 53218f2df8f873b78d19c9735adb2ccdc4f2ad28 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:05:38 -0500 Subject: [PATCH 35/78] Buffed Stormfront Razor stealth strike damage --- Items/Weapons/Rogue/StormfrontRazor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index 1bc0993b65..227cf0c359 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position, new Vector2(speedX * 1.6f, speedY * 1.6f), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0, 40f); + int p = Projectile.NewProjectile(position, new Vector2(speedX, speedY) * 1.6f, ModContent.ProjectileType(), (int)(damage * 1.1f), knockBack, player.whoAmI, 0, 40f); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; return false; From 53bc31ee4db8c68e571d346d335037fd7146a968 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:06:26 -0500 Subject: [PATCH 36/78] Buffed Terror Talons stealth strike damage God this is a lot --- Items/Weapons/Rogue/TerrorTalons.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 27eed3b4d3..121506e8b8 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - float stealthDamageMult = 3.25f; + float stealthDamageMult = 4.875f; int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * stealthDamageMult), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; From 842d0c77a41e6f1bea4a41fd1fcc46dff92ccf5d Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:07:49 -0500 Subject: [PATCH 37/78] Nerfed Frequency Manipulator stealth strike damage --- Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index 703bc5730c..80221e0500 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -56,6 +56,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 0.9f); + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); From b6f275f58a2176077db167640d859396c164fc0b Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:08:33 -0500 Subject: [PATCH 38/78] Nerfed Frosty Flare stealth strike damage --- Items/Weapons/Rogue/FrostyFlare.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/FrostyFlare.cs b/Items/Weapons/Rogue/FrostyFlare.cs index dcfd43e0c2..d48f0bc7d1 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int flare = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + int flare = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 0.9f), knockBack, player.whoAmI); if (flare.WithinBounds(Main.maxProjectiles)) Main.projectile[flare].Calamity().stealthStrike = true; return false; From 86502c0dff53e5eb93f150b47300e9293fee891b Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:09:02 -0500 Subject: [PATCH 39/78] Buffed Exorcism stealth strike damage --- Items/Weapons/Rogue/Exorcism.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 641dd164e2..f913a33b83 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 2f, damage); + int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.15f), knockBack, player.whoAmI, 2f, damage); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; } From 09bd0ba11328fb4701b73ac5f4175312db11ac01 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:10:13 -0500 Subject: [PATCH 40/78] Fixed Crushsaw Crasher iframe problems --- Projectiles/Rogue/Crushax.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index 26c1194e50..59fae30002 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 2; projectile.aiStyle = 2; projectile.timeLeft = 300; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 14; aiType = ProjectileID.ThrowingKnife; projectile.Calamity().rogue = true; } From 8946dccab7bba85909f120db55027b42b132e693 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 28 Oct 2021 17:47:16 -0500 Subject: [PATCH 41/78] Buffed Apoctolith stealth strike damage --- Items/Weapons/Rogue/Apoctolith.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index edfd680d6f..bd64dda5fe 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue //Check if stealth is full if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.25f), knockBack, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; return false; From 3fdc08e1145a4a48b5c364fd9015a514c650d7be Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 19:55:31 -0500 Subject: [PATCH 42/78] Another fucking Locus fix Yes, the particles are offset slightly. No, I don't care. Not at this point --- Items/CalamityGlobalItem.cs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 362e5dfba2..2e289d69ca 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2347,13 +2347,9 @@ namespace CalamityMod.Items public override bool PreDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - void drawItemManually(Color color, float generalScale) - { - Texture2D itemTexture = Main.itemTexture[item.type]; - Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture); - Vector2 itemOrigin = frame.Size() * 0.5f; - spriteBatch.Draw(itemTexture, position, itemFrame, color, 0f, itemOrigin, scale * generalScale, SpriteEffects.None, 0f); - } + // I want to strangle somebody. + Texture2D itemTexture = Main.itemTexture[item.type]; + Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture); if (!EnchantmentManager.ItemUpgradeRelationship.ContainsKey(item.type) || !Main.LocalPlayer.InventoryHas(ModContent.ItemType())) return true; @@ -2364,19 +2360,11 @@ namespace CalamityMod.Items if (calamitasNPCIndex != -1) currentPower = Utils.InverseLerp(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true); - // Adjust the offset of the position. This vector does not have any specific static member that can be referenced and it is not - // as simply computable as a texture.Size() * 0.5f. - position += new Vector2(14f, 16f) * Main.inventoryScale; + Vector2 particleDrawCenter = position + new Vector2(12f, 16f) * Main.inventoryScale; EnchantmentEnergyParticles.InterpolationSpeed = MathHelper.Lerp(0.035f, 0.1f, currentPower); - EnchantmentEnergyParticles.DrawSet(position + Main.screenPosition); - - float pulse = Main.GlobalTime * 0.79f % 1f; - float pulseFade = Utils.InverseLerp(0.87f, 0.27f, pulse, true); - float pulseScale = scale * MathHelper.Lerp(1.6f, 1f, pulseFade) / scale; - Color pulseColor = Color.Lerp(drawColor, Color.BlueViolet, pulseFade) * pulseFade; - drawItemManually(pulseColor, pulseScale); - drawItemManually(drawColor, 1f); + EnchantmentEnergyParticles.DrawSet(particleDrawCenter + Main.screenPosition); + spriteBatch.Draw(itemTexture, position, itemFrame, drawColor, 0f, origin, scale, SpriteEffects.None, 0f); return false; } From ecc9b59d7caa63c0905344e3b00a310c8958446c Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 19:58:52 -0500 Subject: [PATCH 43/78] Reload error fix --- Events/BossRushEvent.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 256147d88a..64bdddc0b0 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -97,6 +97,7 @@ namespace CalamityMod.Events #region Loading and Unloading public static void Load() { + BossIDsAfterDeath = new Dictionary(); Bosses = new List() { new Boss(NPCID.QueenBee), From 2ec19f29326829851f44a1a81a1a69a00fda2141 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 20:00:29 -0500 Subject: [PATCH 44/78] SCal altar break fix --- Tiles/CalamityGlobalTile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 9f5abbd653..467e88821f 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -589,7 +589,8 @@ namespace CalamityMod.Tiles { ModContent.TileType(), ModContent.TileType(), - ModContent.TileType() + ModContent.TileType(), + ModContent.TileType() }; Tile checkTile = CalamityUtils.ParanoidTileRetrieval(x, y); From 0cd518e471afc69552cc24be1ff5f4ed164834aa Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 20:05:21 -0500 Subject: [PATCH 45/78] T1000 offset fix --- Projectiles/Magic/T1000Proj.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Projectiles/Magic/T1000Proj.cs b/Projectiles/Magic/T1000Proj.cs index ba4cb99c21..9b0e6ede7b 100644 --- a/Projectiles/Magic/T1000Proj.cs +++ b/Projectiles/Magic/T1000Proj.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = 80; - projectile.height = 34; + projectile.width = 58; + projectile.height = 94; projectile.friendly = true; projectile.penetrate = -1; projectile.tileCollide = false; @@ -113,7 +113,8 @@ namespace CalamityMod.Projectiles.Magic } } projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; - projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + projectile.velocity.SafeNormalize(Vector2.UnitX * player.direction) * 6f; + projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + projectile.velocity.SafeNormalize(Vector2.UnitX * player.direction) * 8f; + projectile.position.Y -= 8f; projectile.spriteDirection = projectile.direction; projectile.timeLeft = 2; player.ChangeDir(projectile.direction); From 8a34487a6ccb576066314b3292cd262aeff0a442 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 20:07:07 -0500 Subject: [PATCH 46/78] Item size changes --- Items/Accessories/TheCommunity.cs | 4 ++-- Items/Weapons/Summon/BlightedEyeStaff.cs | 4 ++-- Items/Weapons/Summon/StaffoftheMechworm.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index a8f7186d5d..cc0af1c17a 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 34; + item.height = 64; item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; item.accessory = true; diff --git a/Items/Weapons/Summon/BlightedEyeStaff.cs b/Items/Weapons/Summon/BlightedEyeStaff.cs index 7a59a8a330..9a8c4511f9 100644 --- a/Items/Weapons/Summon/BlightedEyeStaff.cs +++ b/Items/Weapons/Summon/BlightedEyeStaff.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = 40; item.mana = 10; - item.width = 62; - item.height = 62; + item.width = 52; + item.height = 52; item.useTime = item.useAnimation = 25; item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 5c7d172699..addae8e27e 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = BaseDamage; item.mana = 10; - item.width = 58; - item.height = 58; + item.width = 68; + item.height = 68; item.useTime = item.useAnimation = 10; // 9 because of useStyle 1 item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; From edd40fb57c8e5e2eaba577cd117651caa14ecc03 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 20:10:39 -0500 Subject: [PATCH 47/78] Thanatos reticle fix --- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index fae843acce..068eadd1ea 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1031,7 +1031,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // A general factor for the aura. // Used to cause fade-ins/outs as the attack starts/stops. float auraGeneralPower = Utils.InverseLerp(0f, deathrayTelegraphDuration * 0.333f, npc.Calamity().newAI[2], true); - auraGeneralPower *= Utils.InverseLerp(deathrayTelegraphDuration + deathrayDuration, deathrayTelegraphDuration + deathrayDuration - 40f, npc.Calamity().newAI[2], true); + auraGeneralPower *= Utils.InverseLerp(deathrayTelegraphDuration + deathrayDuration, deathrayTelegraphDuration + deathrayDuration, npc.Calamity().newAI[2], true); // Determine the characteristics of the aura. This requires intermediate computations to determine if Thanatos is in its final phase as well as for pulsing. bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); From 5765320b8e217c9d2238b92cd25a9999e0a8c42f Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 20:54:37 -0500 Subject: [PATCH 48/78] Crag lava works on the inferior color settings --- ILEditing/ILChanges.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index ccd80b7dee..2533770d31 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -137,6 +137,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.DoDraw += DrawFusableParticles; IL.Terraria.Main.DrawTiles += DrawCustomLava; IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw += DrawCustomLava2; + IL.Terraria.Main.oldDrawWater += DrawCustomLava3; IL.Terraria.WaterfallManager.DrawWaterfall += DrawCustomLavafalls; // Ravager platform fall fix @@ -203,6 +204,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Main.DoDraw -= DrawFusableParticles; IL.Terraria.Main.DrawTiles -= DrawCustomLava; IL.Terraria.GameContent.Liquid.LiquidRenderer.InternalDraw -= DrawCustomLava2; + IL.Terraria.Main.oldDrawWater -= DrawCustomLava3; IL.Terraria.WaterfallManager.DrawWaterfall -= DrawCustomLavafalls; // Ravager platform fall fix @@ -708,6 +710,37 @@ namespace CalamityMod.ILEditing }); } + private static void DrawCustomLava3(ILContext il) + { + ILCursor cursor = new ILCursor(il); + + // Select the lava color. + if (!cursor.TryGotoNext(MoveType.After, c => c.MatchCallOrCallvirt("get_NotRetro"))) + { + LogFailure("Custom Lava Drawing", "Could not locate the retro style check."); + return; + } + + // Pass the texture in so that the method can ensure it is not messing around with non-lava textures. + cursor.Emit(OpCodes.Ldloc, 13); + cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("liquidTexture")); + cursor.Emit(OpCodes.Ldloc, 15); + cursor.Emit(OpCodes.Ldelem_Ref); + cursor.EmitDelegate>((initialColor, initialTexture) => SelectLavaColor(initialTexture, initialColor)); + cursor.Emit(OpCodes.Stloc, 13); + + // Go back to the start and change textures as necessary. + cursor.Index = 0; + + while (cursor.TryGotoNext(c => c.MatchLdsfld
("liquidTexture"))) + { + // While this may seem crazy, under no circumstances should there not be a load after exactly 3 instructions. + // The order is load is texture array field -> load index -> load the reference to the texture at that index. + cursor.Index += 3; + cursor.EmitDelegate>(initialTexture => SelectLavaTexture(initialTexture, true)); + } + } + private static void DrawCustomLavafalls(ILContext il) { ILCursor cursor = new ILCursor(il); From 8f07c24c135625c4d4a5bd5b92462c7f679b4460 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 30 Oct 2021 23:14:04 -0500 Subject: [PATCH 49/78] Dyes affect Apollo/Artemis mask and Demonshade extension --- CalPlayer/CalamityPlayerDrawEffects.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 5dedb23914..f863735c15 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -427,6 +427,7 @@ namespace CalamityMod.CalPlayer Texture2D extraPieceTexture = ModContent.GetTexture("CalamityMod/Items/Armor/Vanity/ApolloMask_Extra"); DrawData pieceDrawData = new DrawData(extraPieceTexture, headDrawPosition, drawPlayer.bodyFrame, drawInfo.eyeColor, 0f, origin, 1f, drawInfo.spriteEffects, 0); + pieceDrawData.shader = dyeShader; Main.playerDrawData.Add(pieceDrawData); } }); @@ -456,6 +457,7 @@ namespace CalamityMod.CalPlayer Rectangle headFrame = extraPieceTexture.Frame(1, 20, 0, headVerticalFrame); DrawData pieceDrawData = new DrawData(extraPieceTexture, headDrawPosition, headFrame, drawInfo.eyeColor, drawPlayer.fullRotation, origin, 1f, drawInfo.spriteEffects, 0); + pieceDrawData.shader = dyeShader; Main.playerDrawData.Add(pieceDrawData); } }); From b9848fc2328c389c4766735ae998ae85b667ef57 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 31 Oct 2021 03:48:54 -0500 Subject: [PATCH 50/78] Null check --- Waters/CustomLavaManagement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Waters/CustomLavaManagement.cs b/Waters/CustomLavaManagement.cs index 27559c1a17..4ca4c1929c 100644 --- a/Waters/CustomLavaManagement.cs +++ b/Waters/CustomLavaManagement.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Waters internal static void Unload() { foreach (CustomLavaStyle lavaStyle in CustomLavaStyles) - lavaStyle.Unload(); + lavaStyle?.Unload(); CustomLavaStyles = null; LavaBlockTexture = null; From 11e81fcf88da5380a9ee9faee9c4509c7f1dcd1f Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 31 Oct 2021 19:25:29 -0500 Subject: [PATCH 51/78] Persecuted updates --- CalPlayer/CalamityPlayer.cs | 9 ++++++++- CalPlayer/CalamityPlayerMiscEffects.cs | 9 ++++++++- UI/CalamitasEnchantments/EnchantmentManager.cs | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 13a09385d9..1e8fe2fef1 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7537,7 +7537,14 @@ namespace CalamityMod.CalPlayer // Summon a portal if needed. if (player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) { - Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int tries = 0; + Vector2 spawnPosition; + do + { + spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + tries++; + } + while (Collision.SolidCollision(spawnPosition - Vector2.One * 48f, 24, 24) && tries < 100); CalamityNetcode.NewNPC_ClientSide(spawnPosition, ModContent.NPCType(), player); } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1aa1b92ac6..551b2d320b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1267,7 +1267,14 @@ namespace CalamityMod.CalPlayer modPlayer.persecutedEnchantSummonTimer = 0; if (Main.myPlayer == player.whoAmI && player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) { - Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int tries = 0; + Vector2 spawnPosition; + do + { + spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + tries++; + } + while (Collision.SolidCollision(spawnPosition - Vector2.One * 48f, 24, 24) && tries < 100); CalamityNetcode.NewNPC_ClientSide(spawnPosition, ModContent.NPCType(), player); } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 7c3007e6af..ca8effd9c9 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -254,7 +254,7 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().witheringWeaponEnchant = true, item => item.IsEnchantable() && item.damage > 0 && !item.summon), - new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you.", + new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you. They become angered if a portal is damaged.", 1100, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted", null, From da26beab611c351e36953d0a5fadf16d9dc2667d Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 31 Oct 2021 19:27:21 -0500 Subject: [PATCH 52/78] Fuck --- CalPlayer/CalamityPlayer.cs | 2 +- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1e8fe2fef1..5b7475a1b5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7544,7 +7544,7 @@ namespace CalamityMod.CalPlayer spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); tries++; } - while (Collision.SolidCollision(spawnPosition - Vector2.One * 48f, 24, 24) && tries < 100); + while (Collision.SolidCollision(spawnPosition - Vector2.One * 24f, 48, 24) && tries < 100); CalamityNetcode.NewNPC_ClientSide(spawnPosition, ModContent.NPCType(), player); } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 551b2d320b..639db275f0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1274,7 +1274,7 @@ namespace CalamityMod.CalPlayer spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); tries++; } - while (Collision.SolidCollision(spawnPosition - Vector2.One * 48f, 24, 24) && tries < 100); + while (Collision.SolidCollision(spawnPosition - Vector2.One * 24f, 48, 24) && tries < 100); CalamityNetcode.NewNPC_ClientSide(spawnPosition, ModContent.NPCType(), player); } } From 30361a7a6728df8ca27ba19e7e8cd50a83efe6c1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 31 Oct 2021 23:16:21 -0500 Subject: [PATCH 53/78] Tainted arm texture fix --- ExtraTextures/TaintedArm.png | Bin 932 -> 507 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ExtraTextures/TaintedArm.png b/ExtraTextures/TaintedArm.png index f8796f05e787355d2b6fa65e383341523fbba80f..7c9f360390a4128494bd0848464cf7d588186d54 100644 GIT binary patch delta 464 zcmV;>0Wbcf2m1q%83+Ra004E2=68`HAb%uKOjJcH6Bh~!4N);caWgzbAt*d68}Gt@ zj&m=*kvC^hDE;WV00017jqol2000bhQchF<|NsC0|NsC0|Nj6I-_Fhe000SaNLh0L z01m$Z01m$aI0aKA0003D^szvZzgPG;If;6rEHJ%2>9 z_5~q>!|_mfs27^NK#Uoh~mB0*e!4Rri|w00^U^ z_O_}s0$`rN^ROPkkXL9Nz_j@My1ak}6Ckv?RU-gpYcvPwplrL%t(pPej`;&nLkEE8 z05v%QJF5Q%)Z{XN@z(${X$JV_+J7TAP)iqp^SI`K^S~9QF+fZICSZeJ184#eLaL%Z z4yZ|t+cpERG%@FWp94}VReMz_vi(3xIb))f1i!R+3y>NhlOeaQ6d#b1ZOWF;O=AF- ziW2$0-|rwEpcIy7i@e}%qb2eJSUIyrA^z8ixS<2e$Qkkcw^=Cr!*@Uwkj6)u7l`hrc;sB4*TS;C03!n@hF$lLI8F9xw;e z=7hI7km!I$%*to$C$1IJ-&J5DV{``ntR(f@@Yex_>zgoQo}c>p11&A#IG}T^5u3du z_m61^$AKg?M_lpG0aLkL_ICq&htN#LW7Vq%e{-PTbxmAXg})9Yk#AmywtrN@b)ZqK z48Y$3xK_la;{Oz|BG!AiOJXGnR|c?r2jIG&SUwKubAv14J8<~W3AB0%&jIdsA3nZ~ zMqIOA3C97~EKj={!pnh1?+e0npwVPLfdAfTQ+=P0U z1F0R@(^G=>ZYx5`@WA@`C}RB4cj$|^^H7bP`0K!dzAkheAB=uAfBo(k)CMDcHdTQV zI!64>0YJalrcg2eClKpYOhH1?i-5C)+H`;c~>P$EeFakzsdk3KXj99OyLzz2}H~=$p)6B>@ zdKdV8UT?$y9N_w#7@_UqHLMjT!xbj4ONJ%2-z%l!p7Kjf2q SwwNUV0000 Date: Mon, 1 Nov 2021 17:10:46 -0500 Subject: [PATCH 54/78] Ares HP bar enrage integration --- NPCs/ExoMechs/Ares/AresBody.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index e2253cc9d1..c7ab46af88 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -360,10 +360,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Rotation npc.rotation = npc.velocity.X * 0.003f; - // Light + // Light and enrage check if (EnragedState == (float)Enraged.Yes) { Lighting.AddLight(npc.Center, 0.5f * npc.Opacity, 0f, 0f); + npc.Calamity().CurrentlyEnraged = true; } else { From ae723f50baa8b2a350c7406751ae3a80cc49967c Mon Sep 17 00:00:00 2001 From: Merkalto Date: Tue, 2 Nov 2021 11:08:40 -0500 Subject: [PATCH 55/78] fixed void condenser issues --- .../CraftingStations/VoidCondenser.cs | 2 +- .../CraftingStations/VoidCondenser.png | Bin 6313 -> 4420 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Tiles/Furniture/CraftingStations/VoidCondenser.cs b/Tiles/Furniture/CraftingStations/VoidCondenser.cs index eb66374f5f..8be86fd500 100644 --- a/Tiles/Furniture/CraftingStations/VoidCondenser.cs +++ b/Tiles/Furniture/CraftingStations/VoidCondenser.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations ModTranslation name = CreateMapEntryName(); name.SetDefault("Void Condenser"); AddMapEntry(new Color(191, 142, 111), name); - animationFrameHeight = 54; + animationFrameHeight = 46; } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/Furniture/CraftingStations/VoidCondenser.png b/Tiles/Furniture/CraftingStations/VoidCondenser.png index d3c0bf9005d2c18f1d6e4c947fce8c38456fcdf7..96dcece8350f81aec014e493cc5c0bfab46c56a5 100644 GIT binary patch literal 4420 zcmbtY3p~?%|92^;3}qN%IVU#JFjGiH7q^)^(-@hJ{Bw_p2o-q ztl6Yp9PVuh(9`@9(wW>-+m$-k zlcb1P8=06Nuy(Re=_Un+p>&Kj)OB}RU)R@+)7ymGtcvjB&qXdQfX7F}oASU# z=9sg+%gXORA{MP9cfl{~!>rvSzys~Vuc*RSn?wE8467E5p%f)wyr+O{NdzmM3;;=+QQe|&TD(sGqw zuBq9Pb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-x!- z5(Z*1O`6A9rsv+}<&&m*Xw~79okPEcO_0J(`P541yt}->G|eBXGs1aG2ln}tv3HF- z>?a#dH7}luECCeDh6Z^N<=qlnCOc1%C7x!bJZi!mJXHjyYs5kCA`We3Kmph(@9n{O z2#O=gecrj1If%O*KA@>Nju2Xil zTpvOITfot9CN#Lo|6ydAsYitTy|@rz`ugXK`}^aU$K$m&RcQg&XST2I+fBxu z!*<+x)z)7&24~wlk{1r`pU)758=Ft-DR}Rnjaf4D)j0LpO}-^>LnWSD<`@0`PTPqU zoMx}ShtX?f_bu=rB0i1Tu_DFGPh-T*BOl1MXCK{1X3y}BRYTh^AXb*C`P%R0yQTly zn3L07Z7^2|-7NFVmq2rjOT!UJ38yXo;`PAQ~}@7#L#ujK z*UCSSzkAD-s&pIQpDmYQ758{LtDU7c5qv`h#`$U z(S@GHGX%l;G~L5{=HK?=XA}m^P3VGlL35@3vX4G~S$)B8dCUZMbQQvx za8lI>c-U_L9z$&o`{52y57R7I2MZ*CiOuyk2uu+?8MBjpLsys~nc-z;`x_^wY z{iN=D8a`>yl}&WPiOzCxBy(mbJKIUmVkMaJT6x#${=%6M7jEl)(iXd;}~@;%cNHu2d2jIxVhGpwIA1JMA+&WMN=o}Q$P z7quGE1qj8IJd}@2q)CitnLXT<~69OW>-giM9 Y5z&8dst~qEctpI@#>M)Um4EDC09(NM_5c6? From 9d2482ce7da63f9acbac61047ead124d50f0c008 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 2 Nov 2021 17:47:30 -0500 Subject: [PATCH 56/78] DoG's P1 portal works on the inferior light modes --- Effects/CalamityShaders.cs | 4 +-- Effects/ScreenShaders/DoGPortalShader.fx | 41 ++++++++-------------- Effects/ScreenShaders/DoGPortalShader.xnb | Bin 4120 -> 2796 bytes NPCs/DevourerofGods/DevourerofGodsBody.cs | 2 +- Projectiles/Boss/DoGP1EndPortal.cs | 30 ++++++++-------- 5 files changed, 34 insertions(+), 43 deletions(-) diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 0144599507..87f39b619a 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -61,8 +61,6 @@ namespace CalamityMod.Effects Filters.Scene["CalamityMod:LightBurst"] = new Filter(new ScreenShaderData(new Ref(LightShader), "BurstPass"), EffectPriority.VeryHigh); Filters.Scene["CalamityMod:LightBurst"].Load(); - Filters.Scene["CalamityMod:DoGPortal"] = new Filter(new ScreenShaderData(new Ref(DoGPortalShader), "ScreenPass"), EffectPriority.VeryHigh); - Filters.Scene["CalamityMod:DoGPortal"].Load(); GameShaders.Misc["CalamityMod:FireMouse"] = new MiscShaderData(new Ref(SCalMouseShader), "DyePass"); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); @@ -81,6 +79,8 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"] = new MiscShaderData(new Ref(BaseFusableParticleEdgeShader), "ParticlePass"); GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"] = new MiscShaderData(new Ref(AdditiveFusableParticleEdgeShader), "ParticlePass"); + + GameShaders.Misc["CalamityMod:DoGPortal"] = new MiscShaderData(new Ref(DoGPortalShader), "ScreenPass"); } } } diff --git a/Effects/ScreenShaders/DoGPortalShader.fx b/Effects/ScreenShaders/DoGPortalShader.fx index 3769fa5e08..412a346aa0 100644 --- a/Effects/ScreenShaders/DoGPortalShader.fx +++ b/Effects/ScreenShaders/DoGPortalShader.fx @@ -1,47 +1,36 @@ sampler uImage0 : register(s0); sampler uImage1 : register(s1); -sampler uImage2 : register(s2); -sampler uImage3 : register(s3); float3 uColor; float3 uSecondaryColor; -float2 uScreenResolution; -float2 uScreenPosition; -float2 uTargetPosition; -float2 uDirection; -float uOpacity; -float uTime; -float uIntensity; -float uProgress; -float2 uImageSize1; -float2 uImageSize2; -float2 uImageSize3; -float2 uImageOffset; +float uOpacity : register(C0); float uSaturation; +float uRotation; +float uTime; float4 uSourceRect; -float2 uZoom; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; float4 PixelShaderFunction(float4 position : SV_POSITION, float2 coords : TEXCOORD0) : COLOR0 { - // Calculate relative screen values. - float2 targetUVCoords = (uTargetPosition - uScreenPosition) / uScreenResolution; - float2 centerOffset = (coords - targetUVCoords) * (uScreenResolution / uScreenResolution.y); - float distanceFromTargetPosition = distance(coords, targetUVCoords) / uZoom; + float distanceFromTargetPosition = distance(coords, 0.5); // Calculate the swirl coordinates. - float2 centeredCoords = (targetUVCoords - coords) * (uScreenResolution / uScreenResolution.y); - float swirlRotation = length(centeredCoords) * 21.2 - uTime * 6; + float2 centeredCoords = coords - 0.5; + float swirlRotation = length(centeredCoords) * 41.2 - uTime * 6; float swirlSine = sin(swirlRotation); float swirlCosine = cos(swirlRotation); float2x2 swirlRotationMatrix = float2x2(swirlCosine, -swirlSine, swirlSine, swirlCosine); float2 swirlCoordinates = mul(centeredCoords, swirlRotationMatrix) + 0.5; // Calculate fade, swirl arm colors, and draw the portal to the screen. - float4 color = tex2D(uImage0, coords); - float swirlColorFade = saturate(distanceFromTargetPosition * 3) / (uProgress + 0.0001); + float swirlColorFade = saturate(distanceFromTargetPosition * 3) / (uOpacity + 0.0001); float3 swirlBaseColor = lerp(uColor, uSecondaryColor, pow(swirlColorFade, 0.33)); - float4 swirlNoiseColor = tex2D(uImage1, swirlCoordinates) * (1 - swirlColorFade); - float4 endColor = lerp(float4(swirlBaseColor, 0.1), color, swirlColorFade); - return lerp(color, endColor * (1 + (1 - swirlColorFade) * 2), saturate(swirlNoiseColor.r)); + float4 swirlNoiseColor = tex2D(uImage0, swirlCoordinates) * (1 - swirlColorFade); + float4 endColor = lerp(float4(swirlBaseColor, 0.1), 0, swirlColorFade); + return lerp(0, endColor * (1 + (1 - swirlColorFade) * 2), saturate(swirlNoiseColor.r)); } technique Technique1 diff --git a/Effects/ScreenShaders/DoGPortalShader.xnb b/Effects/ScreenShaders/DoGPortalShader.xnb index 1341782d57918122e685cbc0c33dc937e92381dc..3b21a28dc0037527283f19b4453f80f8e1a6b978 100644 GIT binary patch literal 2796 zcmcgtPiP!f7=N?LCL5Ew0R?*qxDYXcmv*|DG($H#adw6_ z;$e!H2p%f+;K9QNdI-Ch9I6#8Z9y+WiuD$#$31w+p%+0xvi^Sa=4~FS0rlXw`R0AU z?|uL0%}eR+nagpp|AY|6=f+!h*>!5pikB``&GejWu348I_fk6NR6VQerO&RcSY>a~ zGM6oPICY%$>#n)JYL{!nsrM|mW;@mC@$?9P!>OEK@qE{su3En5nw8OFR4IYxP^GrbU z=hw`O)`(Cx+0L#M4sAw77gPq=(`=MZQ;A*xKj%~&S9E-~HG{wNVeNjwDm&F>)7_BH zv?Ki@m+;B_WKtj4e`nn++ujDTvL8?e(CPLAv@e*Lu<2p!9s8+c>^T#E(eb49Vf@N5 z_C2&;vezuEs>d6eE#H9#fh5Vg9N#Tli#R_W-#yKkuTp~|3GBb`xRvDvr)G!kbov>H z-aDhyNBQ;BXV!L+gY9?n%xd@ynH&R#h?o!CpE>{?cJ!K~GUAYQV{t5y3$-x?L-NnrL(Kc?e)60GPngee8E z=E18P4j_M};oFe+G`tTvp#}?i2y#ZldC038z5@9R4c~YQd-91eosYM&4d4$`?^?I zJXIH-D7KHTU3FjAMurj%aksHcwpB(BWy2$Tfzi+Wdxc(+K_A0~gy zK1|Nv6CyYRzDs=^dYIn@i~GCJ&3y95sXNs7g!*junOi?+zW;6e)%&}<)71A$`>c#X zFBv}py>a5f*Jl4Wx0;O?U-@)%bCULb&^H?mURie{pEJ+Ok^^+K6Uo;^BFQ;nWL?m= zcJTSvKM33DCJs3+igol2vu@x7Q^pcnCaks}r6moa+~gZX2kH$c60+8dDR&-%NdQZ literal 4120 zcmeHKO>9(E6u$3uN~g4BDq=zmiBE$`HFeUKmXttYU;wFB89Oa$2nijguXI8?Z+tTo zKoc`Y7MQTW$U=>aN5VqeO-)objgrVh6O1g_u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#d& z6ORK2U3~WGmxn+2>xF|*4-s#dcq;Y7A732&`QE)@a)@tL{FEAlsKPsdTifn`lk52Q z_Ts|J`#-#Tbszbiz!w)5cwK)N`W$+W<${3~FNOMb5l;kKx1fW7XRHOB`d4T{>zZA& zVV{<1i?Lre?12Dzf?EvsLJj*X(oqZO@mgF=1jrA6Bu9uw4U^n7vA9?W;-V2eZTOr0 zm;>`n1TSI`+?8^i4#d+L#)zA@W{HVf8^&PFwy|g!ym9PbLc6JQW7jyI9;j9X97^5p5W& z9*~T;6mbjGrjA(avfoDi+L1&2jTdW?YoCxg()?.AttemptingToEnterPortal ?? false) { Projectile portal = Main.projectile[Main.npc[(int)npc.ai[2]].ModNPC().PortalIndex]; - float newOpacity = 1f - Utils.InverseLerp(150f, 70f, npc.Distance(portal.Center), true); + float newOpacity = 1f - Utils.InverseLerp(130f, 80f, npc.Distance(portal.Center), true); if (Main.netMode != NetmodeID.MultiplayerClient && newOpacity > 0f && npc.Opacity > newOpacity) { npc.Opacity = newOpacity; diff --git a/Projectiles/Boss/DoGP1EndPortal.cs b/Projectiles/Boss/DoGP1EndPortal.cs index 0ac8788825..23cf4ea922 100644 --- a/Projectiles/Boss/DoGP1EndPortal.cs +++ b/Projectiles/Boss/DoGP1EndPortal.cs @@ -1,9 +1,9 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; using Terraria; -using Terraria.Graphics.Effects; -using Terraria.ID; +using Terraria.Graphics.Shaders; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.ignoreWater = true; projectile.timeLeft = 60000; + projectile.hide = true; } public override void AI() @@ -44,24 +45,25 @@ namespace CalamityMod.Projectiles.Boss projectile.Kill(); } - public override void Kill(int timeLeft) + public override void DrawBehind(int index, List drawCacheProjsBehindNPCsAndTiles, List drawCacheProjsBehindNPCs, List drawCacheProjsBehindProjectiles, List drawCacheProjsOverWiresUI) { - if (Main.netMode != NetmodeID.Server && Filters.Scene["CalamityMod:DoGPortal"].IsActive()) - Filters.Scene["CalamityMod:DoGPortal"].Deactivate(); + drawCacheProjsOverWiresUI.Add(index); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - // Manage a screen shader that acts as the projectile. - if (Filters.Scene["CalamityMod:DoGPortal"].IsActive()) - Filters.Scene["CalamityMod:DoGPortal"].Deactivate(); + spriteBatch.EnterShaderRegion(); - Filters.Scene.Activate("CalamityMod:DoGPortal", projectile.Center).GetShader().UseTargetPosition(projectile.Center); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseImage("Images/Misc/Perlin"); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseColor(Color.Cyan); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseSecondaryColor(Color.Fuchsia); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseImage(ModContent.GetTexture("CalamityMod/ExtraTextures/VoronoiShapes")); - Filters.Scene["CalamityMod:DoGPortal"].GetShader().UseProgress(projectile.scale); + Texture2D noiseTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/VoronoiShapes"); + Vector2 drawPosition = projectile.Center - Main.screenPosition; + Vector2 origin = noiseTexture.Size() * 0.5f; + GameShaders.Misc["CalamityMod:DoGPortal"].UseOpacity(projectile.scale); + GameShaders.Misc["CalamityMod:DoGPortal"].UseColor(Color.Cyan); + GameShaders.Misc["CalamityMod:DoGPortal"].UseSecondaryColor(Color.Fuchsia); + GameShaders.Misc["CalamityMod:DoGPortal"].Apply(); + + spriteBatch.Draw(noiseTexture, drawPosition, null, Color.White, 0f, origin, 3.5f, SpriteEffects.None, 0f); + spriteBatch.ExitShaderRegion(); return false; } From 6816eab80d3563c65bd25c803adbae6f295e7604 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 2 Nov 2021 17:55:14 -0500 Subject: [PATCH 57/78] Fixed Daawnlight killing light pets --- Buffs/Pets/DaawnlightSpiritOriginBuff.cs | 1 - Projectiles/Pets/DaawnlightSpiritOriginMinion.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/Buffs/Pets/DaawnlightSpiritOriginBuff.cs b/Buffs/Pets/DaawnlightSpiritOriginBuff.cs index a50f62b09b..fe321f59de 100644 --- a/Buffs/Pets/DaawnlightSpiritOriginBuff.cs +++ b/Buffs/Pets/DaawnlightSpiritOriginBuff.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Buffs.Pets DisplayName.SetDefault("Archer of Lunamoon"); Description.SetDefault("You have a personal spotter"); Main.buffNoTimeDisplay[Type] = true; - Main.lightPet[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs b/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs index 695d6ce68b..612c42e69e 100644 --- a/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs +++ b/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Pets { DisplayName.SetDefault("Daawnlight"); Main.projFrames[projectile.type] = 12; - Main.projPet[projectile.type] = true; } public override void SetDefaults() From c075ab2a8b3689277b6a96d9454c991b0a86afbf Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 2 Nov 2021 18:00:42 -0500 Subject: [PATCH 58/78] Gael's is a legendary drop and a dev item --- Items/CalamityGlobalItemTooltip.cs | 4 ++-- Items/Weapons/Melee/GaelsGreatsword.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 1441609e96..0384eac4a9 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -125,8 +125,6 @@ namespace CalamityMod.Items nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); if (item.type == ModContent.ItemType()) nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); - if (item.type == ModContent.ItemType()) - nameLine.overrideColor = new Color(146, 0, 0); if (item.type == ModContent.ItemType()) nameLine.overrideColor = new Color(129, 29, 149); if (item.type == ModContent.ItemType()) @@ -233,6 +231,8 @@ namespace CalamityMod.Items legendaryColor = CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 3f); if (item.type == ModContent.ItemType()) legendaryColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); + if (item.type == ModContent.ItemType()) + legendaryColor = new Color(146, 0, 0); Color lineColor = legendaryColor.GetValueOrDefault(CalamityUtils.ChallengeDropColor); string text = legendaryColor.HasValue ? "- Legendary Challenge Drop -" : "- Challenge Drop -"; diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 0539848f88..a2dc794549 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; item.Calamity().devItem = true; + item.Calamity().challengeDrop = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; From 05f22e3c7c028d7da00549997fda0ac0d174a968 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 2 Nov 2021 22:20:00 -0500 Subject: [PATCH 59/78] Rancor nerf/pierce stuff --- Items/Weapons/Magic/Rancor.cs | 2 +- Projectiles/Magic/RancorHoldout.cs | 1 + Projectiles/Magic/RancorLaserbeam.cs | 2 ++ Projectiles/Magic/RancorMagicCircle.cs | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Magic/Rancor.cs b/Items/Weapons/Magic/Rancor.cs index cbec0ae36f..8b618d1f30 100644 --- a/Items/Weapons/Magic/Rancor.cs +++ b/Items/Weapons/Magic/Rancor.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 2222; + item.damage = 444; item.magic = true; item.noUseGraphic = true; item.channel = true; diff --git a/Projectiles/Magic/RancorHoldout.cs b/Projectiles/Magic/RancorHoldout.cs index 38cb815bb4..26059112dd 100644 --- a/Projectiles/Magic/RancorHoldout.cs +++ b/Projectiles/Magic/RancorHoldout.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Magic projectile.magic = true; projectile.ignoreWater = true; projectile.hide = true; + projectile.timeLeft = 90000; } public override void AI() diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index c157e31b61..e658a20d20 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -48,6 +48,8 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.ignoreWater = true; projectile.hide = true; + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; } public override void AI() diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 52e4af83a2..284c344de7 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.magic = true; projectile.ignoreWater = true; + projectile.timeLeft = 90000; } public override void AI() From 1c47329f02defdc4d34924d3557484eafedacee3 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 2 Nov 2021 22:48:41 -0500 Subject: [PATCH 60/78] Gruesome Eminence hitbox shit --- Projectiles/Magic/SpiritCongregation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 14dd4dd41e..b8e04f6890 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -331,7 +331,7 @@ namespace CalamityMod.Projectiles.Magic { for (int i = 0; i < projectile.oldPos.Length; i++) { - float hitboxRadius = CongregationDiameter * MathHelper.Lerp(0.45f, 0.17f, i / (float)projectile.oldPos.Length); + float hitboxRadius = CongregationDiameter * MathHelper.Lerp(0.45f, 0.17f, i / (float)projectile.oldPos.Length) * 1.4f; Vector2 hitboxCircle = Vector2.One * hitboxRadius; if (CalamityUtils.CircularHitboxCollision(projectile.oldPos[i] + hitboxCircle * 0.5f, hitboxRadius, targetHitbox)) return true; From 7c0f853dcdb554ad0625ebeb4b2d0b335301f6f6 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:18:29 -0500 Subject: [PATCH 61/78] Yharon Kindle Staff requires 5 slots --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/Weapons/Summon/AngryChickenStaff.cs | 2 +- Projectiles/Summon/SonOfYharon.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1aa1b92ac6..4cb99a673e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3409,7 +3409,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.gArtifact) { - player.maxMinions += 8; + player.maxMinions += 10; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index c8194c0193..01509f8bab 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Yharon's Kindle Staff"); Tooltip.SetDefault("Summons the Son of Yharon to fight for you\n" + - "Requires 4 minion slots to use"); + "Requires 5 minion slots to use"); } public override void SetDefaults() diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index db813805f7..88c37a128f 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = projectile.MaxUpdates * 9; - projectile.minionSlots = 4f; + projectile.minionSlots = 5f; projectile.timeLeft = 90000; projectile.penetrate = -1; projectile.tileCollide = false; From 1f8dea38cd972735552c22a30e2267171f7cc8ba Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:26:13 -0500 Subject: [PATCH 62/78] Made Drat a bit more consistent --- Items/Weapons/Ranged/Drataliornus.cs | 2 +- Projectiles/Ranged/DrataliornusBow.cs | 2 +- Projectiles/Ranged/DrataliornusFlame.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index 43d9633703..d9854cea93 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -24,7 +24,7 @@ Right click to fire two devastating barrages of five empowered fireballs. public override void SetDefaults() { - item.damage = 80; + item.damage = 124; item.knockBack = 1f; item.shootSpeed = 18f; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Projectiles/Ranged/DrataliornusBow.cs b/Projectiles/Ranged/DrataliornusBow.cs index 17987e2d85..4204c9b125 100644 --- a/Projectiles/Ranged/DrataliornusBow.cs +++ b/Projectiles/Ranged/DrataliornusBow.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged } } - int baseUseTime = 35; + int baseUseTime = 38; int modifier = 3; bool timeToFire = false; if (projectile.ai[1] <= 0f) diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index 2b3f442c45..19ceee081d 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged } projectile.localAI[0]++; - if (projectile.localAI[0] > 30f) //dragon dust trail counter, but only empowered proj spawns it + if (projectile.localAI[0] > 60f) //dragon dust trail counter, but only empowered proj spawns it { projectile.localAI[0] = 0f; @@ -231,7 +231,7 @@ namespace CalamityMod.Projectiles.Ranged vel.X += Main.rand.Next(-100, 101); vel.Normalize(); vel *= 30f; - Projectile.NewProjectile(pos, vel + target.velocity, ModContent.ProjectileType(), projectile.damage * 3, projectile.knockBack * 5f, projectile.owner); + Projectile.NewProjectile(pos, vel + target.velocity, ModContent.ProjectileType(), (int)(projectile.damage * 1.5f), projectile.knockBack * 5f, projectile.owner); } } } From 2f0fb957934621d472bdbbd79339ac2e2dbb74eb Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:31:11 -0500 Subject: [PATCH 63/78] Made True Melee Ataraxia shots more sharply home --- Projectiles/Melee/AtaraxiaHoming.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Projectiles/Melee/AtaraxiaHoming.cs b/Projectiles/Melee/AtaraxiaHoming.cs index fc6928c060..3395c4efe4 100644 --- a/Projectiles/Melee/AtaraxiaHoming.cs +++ b/Projectiles/Melee/AtaraxiaHoming.cs @@ -1,8 +1,11 @@ +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { + // TODO - Abstract away most of the direct vector math away in here into things like SafeDirectionTo calls. public class AtaraxiaHoming : ModProjectile { private static int NumAnimationFrames = 5; @@ -106,11 +109,14 @@ namespace CalamityMod.Projectiles.Melee dx *= homingFactor; dy *= homingFactor; - // The projectile loses 1/6th of its current velocity and replaces it with homing power. - float homingStrength = 6f; + // The projectile loses 1/5th of its current velocity and replaces it with homing power. + float homingStrength = 5f; projectile.velocity.X = (projectile.velocity.X * (homingStrength - 1f) + dx) / homingStrength; projectile.velocity.Y = (projectile.velocity.Y * (homingStrength - 1f) + dy) / homingStrength; + // And then approaches the homing velocity by an increment of 0.3. + projectile.velocity = projectile.velocity.MoveTowards(new Vector2(dx, dy), 0.3f); + // Re-scale resulting velocity to the projectile's set maximum speed projectile.velocity.Normalize(); projectile.velocity *= speed; From a682c679f9ff8102eea69ab5611e8b6c5253e061 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:35:32 -0500 Subject: [PATCH 64/78] Perdition has a longer shoot period --- Projectiles/Summon/PerditionBeacon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Summon/PerditionBeacon.cs b/Projectiles/Summon/PerditionBeacon.cs index c216d38ac1..1b0756a967 100644 --- a/Projectiles/Summon/PerditionBeacon.cs +++ b/Projectiles/Summon/PerditionBeacon.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Summon cinder.scale = 1f + cinder.velocity.Length() * 0.17f; cinder.noGravity = true; - int shootRate = (int)MathHelper.Lerp(24f, 3f, Utils.InverseLerp(0f, 300f, AttackTime, true)); + int shootRate = (int)MathHelper.Lerp(24f, 6f, Utils.InverseLerp(0f, 300f, AttackTime, true)); AttackTimer++; if (AttackTimer < shootRate || Main.myPlayer != projectile.owner) From 0b7ba2022415e4f710cb4b2f7cf43931d0663634 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:37:06 -0500 Subject: [PATCH 65/78] Nerfed Yharim's Crystal damage to 88 --- Items/Weapons/Magic/YharimsCrystal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index e69c022965..220cde3e0e 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 125; + item.damage = 88; item.magic = true; item.mana = 15; item.width = 16; From ad365de3949565f2f06f5d2caf68d353275dda55 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:37:21 -0500 Subject: [PATCH 66/78] Buffed Void Vortex's damage to 88 --- Items/Weapons/Magic/VoidVortex.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index 9b3873fc9a..2f52d5a79e 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 82; + item.damage = 88; item.magic = true; item.mana = 60; item.width = 130; From 0f44abc3b14b1f3f73736f89d1f4c03585585980 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:38:14 -0500 Subject: [PATCH 67/78] Small Astral Pile fix --- Tiles/Astral/AstralNormalSmallPiles.png | Bin 924 -> 398 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Tiles/Astral/AstralNormalSmallPiles.png b/Tiles/Astral/AstralNormalSmallPiles.png index c87da05a9cbc2c623120bd28fa1247563e6969fc..381ab3ac5b938406527b52f6fa29171510efc5d8 100644 GIT binary patch delta 382 zcmbQk-p4#avYwfNf#FC*mMf5AEDmyaV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@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:05:56 -0500 Subject: [PATCH 68/78] Boss Checklist loot fixes --- ModSupport/WeakReferenceSupport.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 8b195dc7ab..1b79982a92 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -494,8 +494,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("CeaselessVoid", out float order); List bosses = new List() { NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Dungeon"; string despawn = CalamityUtils.ColorMessage("The rift in time and space has moved away from your reach.", new Color(0x4B, 0x00, 0x82)); AddBoss(bossChecklist, calamity, "Ceaseless Void", order, bosses, DownedCeaselessVoid, summon, loot, collection, instructions, despawn); @@ -506,8 +506,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("StormWeaver", out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in Space"; string despawn = CalamityUtils.ColorMessage("Storm Weaver hid itself once again within the stormfront.", new Color(0xEE, 0x82, 0xEE)); string bossLogTex = "CalamityMod/NPCs/StormWeaver/StormWeaver_BossChecklist"; @@ -519,8 +519,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("Signus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Underworld"; string despawn = CalamityUtils.ColorMessage("The Devourer's assassin has finished its easy task.", new Color(0xBA, 0x55, 0xD3)); AddBoss(bossChecklist, calamity, "Signus", order, type, DownedSignus, summon, loot, collection, instructions, despawn); @@ -556,7 +556,7 @@ namespace CalamityMod int type = NPCType(); int summon = ItemType(); List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The Devourer of Gods has slain everyone and feasted on their essence.", new Color(0x00, 0xFF, 0xFF)); string bossLogTex = "CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist"; @@ -597,8 +597,8 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); AddBoss(bossChecklist, calamity, "Supreme Calamitas", order, type, DownedSCal, summon, loot, collection, instructions, despawn); From a130d5663a9e6b199d06f7c51900b91edd8694c3 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:11:28 -0500 Subject: [PATCH 69/78] Little Light is in Boss Checklist --- ModSupport/WeakReferenceSupport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 1b79982a92..f0be6537aa 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -506,7 +506,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("StormWeaver", out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in Space"; string despawn = CalamityUtils.ColorMessage("Storm Weaver hid itself once again within the stormfront.", new Color(0xEE, 0x82, 0xEE)); From 9ca2f6a7640b3110b029466c634f611cb9aa71aa Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:15:39 -0500 Subject: [PATCH 70/78] Fixed Phaseslayer arm rotation problems --- Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index ad16e2d76b..d5b0f4e29a 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal player.ChangeDir(projectile.direction); player.itemTime = 2; player.itemAnimation = 2; - player.itemRotation = projectile.rotation * projectile.direction; + player.itemRotation = CalamityUtils.WrapAngle90Degrees(projectile.rotation); } private void OnShrinkEffects() From 7f53a29214a541dd5a5d6ea63f8623e4117e8075 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:25:34 -0500 Subject: [PATCH 71/78] Aflame affects true melee strikes --- CalPlayer/CalamityPlayer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 79e0f79eb5..48e356982f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4958,6 +4958,9 @@ namespace CalamityMod.CalPlayer if (witheringWeaponEnchant) witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); + if (flamingItemEnchant) + target.AddBuff(ModContent.BuffType(), 120); + switch (item.type) { case ItemID.CobaltSword: From 8395d689ee7ce3f3a6433f73c35de2a5a01ffc20 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:50:14 -0500 Subject: [PATCH 72/78] Made Aflame's debuff a bit harsher --- CalPlayer/CalamityPlayerLifeRegen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 2d68f6c4cd..13a65a2b90 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -101,7 +101,7 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; player.lifeRegenTime = 0; - lifeRegenLost += 5; + lifeRegenLost += 7; } if (modPlayer.bFlames) From a0bdf7a485010b1968824bf2f359d688ca7ce37c Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:51:09 -0500 Subject: [PATCH 73/78] Nerfed Vigilance damage to 150 --- Items/Weapons/Summon/Vigilance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 250df5d6c7..32b29fbe31 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 333; + item.damage = 150; item.mana = 10; item.width = item.height = 32; item.useTime = item.useAnimation = 10; From 8b3613406ca94a7f932810fa96554e0ba32f506f Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:52:08 -0500 Subject: [PATCH 74/78] Nerfed Cosmic Kunai damage to 92 --- Items/Weapons/Rogue/CosmicKunai.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 712da3373d..b2de0e331e 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 26; - item.damage = 114; + item.damage = 92; item.noMelee = true; item.noUseGraphic = true; item.useTime = 2; From 57feed8d432fe3e3074327e5fddf49f50669aaf4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:53:40 -0500 Subject: [PATCH 75/78] Buffed Deific Thunderbolt damage to 466 --- Items/Weapons/Rogue/DeificThunderbolt.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/DeificThunderbolt.cs b/Items/Weapons/Rogue/DeificThunderbolt.cs index 3f97e89f68..02867ed53b 100644 --- a/Items/Weapons/Rogue/DeificThunderbolt.cs +++ b/Items/Weapons/Rogue/DeificThunderbolt.cs @@ -20,7 +20,7 @@ Stealth strikes summon more lightning and travel faster"); public override void SafeSetDefaults() { - item.damage = 457; + item.damage = 466; item.knockBack = 10f; item.width = 56; From 134af92b2a547c07f21defa3c38226f84822b995 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:54:26 -0500 Subject: [PATCH 76/78] Buffed Sealed Singularity damage to 260 --- Items/Weapons/Rogue/SealedSingularity.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 1f7f5c83d6..29ecb86a76 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 150; + item.damage = 260; item.knockBack = 5f; item.useAnimation = item.useTime = 25; item.useStyle = ItemUseStyleID.SwingThrow; @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - // Directly nerf stealth strikes by 20%, but only stealth strikes. - int stealthDamage = (int)(damage * 0.8f); + // Directly nerf stealth strikes by 32%, but only stealth strikes. + int stealthDamage = (int)(damage * 0.72f); int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, stealthDamage, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; From 713479cd2e9415461b9764a0b64b600ac2fd8f65 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:27:49 -0500 Subject: [PATCH 77/78] Ohio beam draw fixes --- Projectiles/Boss/ArtemisLaserBeamStart.cs | 270 +++++++++------------- Projectiles/Magic/FabBolt.cs | 2 +- Projectiles/Magic/FabRay.cs | 2 +- 3 files changed, 113 insertions(+), 161 deletions(-) diff --git a/Projectiles/Boss/ArtemisLaserBeamStart.cs b/Projectiles/Boss/ArtemisLaserBeamStart.cs index 74d081c072..327808bbfa 100644 --- a/Projectiles/Boss/ArtemisLaserBeamStart.cs +++ b/Projectiles/Boss/ArtemisLaserBeamStart.cs @@ -1,33 +1,36 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.World; +using CalamityMod.NPCs.ExoMechs.Artemis; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; +using System.Linq; using Terraria; -using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class ArtemisLaserBeamStart : ModProjectile + public class ArtemisLaserBeamStart : BaseLaserbeamProjectile { + public int OwnerIndex + { + get => (int)projectile.ai[0]; + set => projectile.ai[0] = value; + } + public override float MaxScale => 1f; + public override float MaxLaserLength => 4800f; + public override float Lifetime => 600; + public override Color LaserOverlayColor => new Color(250, 180, 100, 100); + public override Color LightCastColor => Color.White; + public override Texture2D LaserBeginTexture => Main.projectileTexture[projectile.type]; + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd"); public override string Texture => "CalamityMod/Projectiles/Boss/AresLaserBeamStart"; - public NPC ThingToAttachTo => Main.npc.IndexInRange((int)projectile.ai[0]) ? Main.npc[(int)projectile.ai[0]] : null; - public ref float RotationDirection => ref projectile.ai[1]; - public ref float Time => ref projectile.localAI[0]; - public ref float LengthOfLaser => ref projectile.localAI[1]; - public const int Lifetime = 180; - public const float BeamPosOffset = 16f; - private const int maxFrames = 5; - private int frameDrawn = 0; - public override void SetStaticDefaults() { DisplayName.SetDefault("Ohio Beam"); + Main.projFrames[projectile.type] = 5; // This is its serious name // DisplayName.SetDefault("Exothermal Artemis Beam"); } @@ -47,179 +50,128 @@ namespace CalamityMod.Projectiles.Boss public override void SendExtraAI(BinaryWriter writer) { - writer.Write(frameDrawn); - writer.Write(Time); - writer.Write(LengthOfLaser); + writer.Write(projectile.localAI[0]); + writer.Write(projectile.localAI[1]); } public override void ReceiveExtraAI(BinaryReader reader) { - frameDrawn = reader.ReadInt32(); - Time = reader.ReadSingle(); - LengthOfLaser = reader.ReadSingle(); + projectile.localAI[0] = reader.ReadSingle(); + projectile.localAI[1] = reader.ReadSingle(); } - public override void AI() + public override void AttachToSomething() { - // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || malice; - bool revenge = CalamityWorld.revenge || malice; - bool expertMode = Main.expertMode || malice; + if (Main.npc[OwnerIndex].active && Main.npc[OwnerIndex].type == ModContent.NPCType()) + { + Vector2 fireFrom = Main.npc[OwnerIndex].Center + Vector2.UnitY * Main.npc[OwnerIndex].gfxOffY; + fireFrom += projectile.velocity.SafeNormalize(Vector2.UnitY) * 78f; + projectile.Center = fireFrom; + } - // Die if the thing to attach to disappears. - if (ThingToAttachTo is null || !ThingToAttachTo.active || ThingToAttachTo.Calamity().newAI[0] != 3f) + // Die of the owner is invalid in some way. + else { projectile.Kill(); return; } - projectile.rotation = ThingToAttachTo.rotation; + // Die if the owner is not performing Artemis' deathray attack. + if (Main.npc[OwnerIndex].Calamity().newAI[0] != (float)Artemis.Phase.Deathray) + { + projectile.Kill(); + return; + } + } + + public override float DetermineLaserLength() + { + float[] sampledLengths = new float[10]; + Collision.LaserScan(projectile.Center, projectile.velocity, projectile.width * projectile.scale, MaxLaserLength, sampledLengths); + + float newLaserLength = sampledLengths.Average(); + + // Fire laser through walls at max length if target is behind tiles. + if (!Collision.CanHitLine(Main.npc[OwnerIndex].Center, 1, 1, Main.player[Main.npc[OwnerIndex].target].Center, 1, 1)) + newLaserLength = MaxLaserLength; + + return newLaserLength; + } + + public override void UpdateLaserMotion() + { + projectile.rotation = Main.npc[OwnerIndex].rotation; projectile.velocity = (projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); + } - // Offset to move the beam forward so that it starts in Artemis' focus jewel thing. - float beamStartForwardsOffset = 80f; - - // Set the starting location of the beam to the center of the NPC. - projectile.Center = ThingToAttachTo.Center; - // Add a fixed offset to align with the NPC's spritesheet (?) - projectile.position += projectile.velocity * BeamPosOffset + new Vector2(0f, -ThingToAttachTo.gfxOffY); - // Add the forwards offset, measured in pixels. - projectile.position += projectile.velocity * beamStartForwardsOffset; - - Time++; - if (Time >= Lifetime) - { - projectile.Kill(); - return; - } - - float scale = 1f; - projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; - if (projectile.scale > scale) - projectile.scale = scale; - - float arraySize = 3f; - Vector2 samplingPoint = projectile.Center; - float[] samples = new float[(int)arraySize]; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 4800f, samples); - float laserLength = 0f; - for (int i = 0; i < samples.Length; i++) - { - laserLength += samples[i]; - } - laserLength /= arraySize; - - // Fire laser through walls at max length if target cannot be seen - if (!Collision.CanHitLine(ThingToAttachTo.Center, 1, 1, Main.player[ThingToAttachTo.target].Center, 1, 1)) - laserLength = 4800f; - - float amount = 0.5f; - LengthOfLaser = MathHelper.Lerp(LengthOfLaser, laserLength, amount); - - // Spawn dust at the end of the beam - int dustType = (int)CalamityDusts.Brimstone; - Vector2 dustPos = projectile.Center + projectile.velocity * (LengthOfLaser - 14f); - for (int i = 0; i < 2; i++) - { - float dustRot = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * MathHelper.PiOver2; - float dustVelMult = (float)Main.rand.NextDouble() * 2f + 2f; - Vector2 dustVel = new Vector2((float)Math.Cos(dustRot) * dustVelMult, (float)Math.Sin(dustRot) * dustVelMult); - int dust = Dust.NewDust(dustPos, 0, 0, dustType, dustVel.X, dustVel.Y, 0, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].scale = 1.7f; - } - - if (Main.rand.NextBool(5)) - { - Vector2 dustRot = projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; - int dust = Dust.NewDust(dustPos + dustRot - Vector2.One * 4f, 8, 8, dustType, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].velocity *= 0.5f; - Main.dust[dust].velocity.Y = -Math.Abs(Main.dust[dust].velocity.Y); - } - - DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + public override void PostAI() + { + // Determine frames. + projectile.frameCounter++; + if (projectile.frameCounter % 5f == 0f) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + // This should never happen, but just in case. if (projectile.velocity == Vector2.Zero) return false; - Texture2D beamStart = Main.projectileTexture[projectile.type]; - Texture2D beamMiddle = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle"); - Texture2D beamEnd = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd"); + Color beamColor = LaserOverlayColor; + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); - float drawLength = LengthOfLaser; - Color color = new Color(250, 180, 100, 100); + // Start texture drawing. + spriteBatch.Draw(LaserBeginTexture, + projectile.Center - Main.screenPosition, + startFrameArea, + beamColor, + projectile.rotation, + LaserBeginTexture.Size() / 2f, + projectile.scale, + SpriteEffects.FlipVertically, + 0f); - if (Time % 5 == 0) + // Prepare things for body drawing. + float laserBodyLength = LaserLength + middleFrameArea.Height; + Vector2 centerOnLaser = projectile.Center + projectile.velocity * projectile.scale * 5f; + + // Body drawing. + if (laserBodyLength > 0f) { - frameDrawn++; - if (frameDrawn >= maxFrames) - frameDrawn = 0; - } - - // Draw start of beam - Vector2 vector = projectile.Center - Main.screenPosition; - Rectangle? sourceRectangle = new Rectangle(0, beamStart.Height / maxFrames * frameDrawn, beamStart.Width, beamStart.Height / maxFrames); - spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, new Vector2(beamStart.Width, beamStart.Height / maxFrames) / 2f, projectile.scale, SpriteEffects.None, 0f); - - // Draw middle of beam - drawLength -= (beamStart.Height / maxFrames / 2 + beamEnd.Height / maxFrames) * projectile.scale; - Vector2 center = projectile.Center; - center += projectile.velocity * projectile.scale * beamStart.Height / maxFrames / 2f; - if (drawLength > 0f) - { - float i = 0f; - int middleFrameDrawn = frameDrawn; - while (i + 1f < drawLength) + float laserOffset = middleFrameArea.Height * projectile.scale; + float incrementalBodyLength = 0f; + while (incrementalBodyLength + 1f < laserBodyLength) { - Rectangle rectangle = new Rectangle(0, beamMiddle.Height / maxFrames * middleFrameDrawn, beamMiddle.Width, beamMiddle.Height / maxFrames); - - if (drawLength - i < rectangle.Height) - rectangle.Height = (int)(drawLength - i); - - spriteBatch.Draw(beamMiddle, center - Main.screenPosition, rectangle, color, projectile.rotation, new Vector2(rectangle.Width / 2f, 0f), projectile.scale, SpriteEffects.None, 0f); - - middleFrameDrawn++; - if (middleFrameDrawn >= maxFrames) - middleFrameDrawn = 0; - - i += rectangle.Height * projectile.scale; - center += projectile.velocity * rectangle.Height * projectile.scale; - - rectangle.Y += beamMiddle.Height / maxFrames; - if (rectangle.Y + rectangle.Height > beamMiddle.Height / maxFrames) - rectangle.Y = 0; + spriteBatch.Draw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + middleFrameArea, + beamColor, + projectile.rotation, + LaserMiddleTexture.Size() * 0.5f, + projectile.scale, + SpriteEffects.None, + 0f); + incrementalBodyLength += laserOffset; + centerOnLaser += projectile.velocity * laserOffset; + middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[projectile.type]; + if (middleFrameArea.Y + middleFrameArea.Height > LaserMiddleTexture.Height) + middleFrameArea.Y = 0; } } - // Draw end of beam - Vector2 vector2 = center - Main.screenPosition; - sourceRectangle = new Rectangle(0, beamEnd.Height / maxFrames * frameDrawn, beamEnd.Width, beamEnd.Height / maxFrames); - spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, new Vector2(beamEnd.Width, beamEnd.Height / maxFrames) / 2f, projectile.scale, SpriteEffects.None, 0f); - - return false; - } - - public override void CutTiles() - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * LengthOfLaser, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (projHitbox.Intersects(targetHitbox)) - return true; - - float collisionPoint = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 30f * projectile.scale, ref collisionPoint)) - return true; - + Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; + spriteBatch.Draw(LaserEndTexture, + laserEndCenter, + endFrameArea, + beamColor, + projectile.rotation, + LaserEndTexture.Size() * 0.5f, + projectile.scale, + SpriteEffects.FlipVertically, + 0f); return false; } diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index 99420e8491..f36a057da4 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Magic TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 120, projectile.oldRot); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 80, projectile.oldRot); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 137015fad6..02ca07f9ee 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Magic TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 76); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 32); return false; } From df4983b2198f23eacaebfdc4e868a971d521195e Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:32:08 -0500 Subject: [PATCH 78/78] Reduced some lag on the town NPC name resetting --- CalamityMod.cs | 133 ++++++++++++++++++---------------- NPCs/CalamityGlobalNPC.cs | 2 - NPCs/CalamityGlobalTownNPC.cs | 2 +- 3 files changed, 70 insertions(+), 67 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 3085466fa5..de032a2486 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -85,7 +85,7 @@ namespace CalamityMod public static ModHotKey SpectralVeilHotKey; public static ModHotKey PlaguePackHotKey; public static ModHotKey AngelicAllianceHotKey; - public static ModHotKey GodSlayerDashHotKey; + public static ModHotKey GodSlayerDashHotKey; public static ModHotKey ExoChairSpeedupHotkey; // Boss Spawners @@ -113,21 +113,21 @@ namespace CalamityMod public const float velocityScaleMin = 0.5f; public const float bitingEnemeyVelocityScale = 0.8f; - // Life steal cap - public const int lifeStealCap = 10; + // Life steal cap + public const int lifeStealCap = 10; - // Debuff immunities, these are used in the NPCDebuffs file - public static int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned }; - public static int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, ModContent.BuffType(), ModContent.BuffType() }; - public static int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; - public static int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; - public static int[] abyssEnemyImmunities = new int[1] { ModContent.BuffType() }; - public static int[] cragEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; - public static int[] astralEnemyImmunities = new int[2] { BuffID.Poisoned, ModContent.BuffType() }; - public static int[] plagueEnemyImmunities = new int[3] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType() }; - public static int[] holyEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; + // Debuff immunities, these are used in the NPCDebuffs file + public static int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned }; + public static int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, ModContent.BuffType(), ModContent.BuffType() }; + public static int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; + public static int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; + public static int[] abyssEnemyImmunities = new int[1] { ModContent.BuffType() }; + public static int[] cragEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; + public static int[] astralEnemyImmunities = new int[2] { BuffID.Poisoned, ModContent.BuffType() }; + public static int[] plagueEnemyImmunities = new int[3] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType() }; + public static int[] holyEnemyImmunities = new int[3] { BuffID.OnFire, ModContent.BuffType(), ModContent.BuffType() }; - internal static CalamityMod Instance; + internal static CalamityMod Instance; internal Mod musicMod = null; // This is Calamity's official music mod, CalamityModMusic internal bool MusicAvailable => !(musicMod is null); internal Mod ancientsAwakened = null; @@ -169,10 +169,10 @@ namespace CalamityMod carpetOriginal = Main.flyingCarpetTexture; Mount.mounts[Mount.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower; Mount.mounts[Mount.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].dashSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].runSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].dashSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].runSpeed *= CalamityPlayer.MechanicalCartSpeedNerfPower; - NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z"); + NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z"); RageHotKey = RegisterHotKey("Rage Mode", "V"); AdrenalineHotKey = RegisterHotKey("Adrenaline Mode", "B"); AegisHotKey = RegisterHotKey("Elysian Guard", "N"); @@ -184,7 +184,7 @@ namespace CalamityMod SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z"); PlaguePackHotKey = RegisterHotKey("Booster Dash", "Q"); AngelicAllianceHotKey = RegisterHotKey("Angelic Alliance Blessing", "G"); - GodSlayerDashHotKey = RegisterHotKey("God Slayer Dash", "H"); + GodSlayerDashHotKey = RegisterHotKey("God Slayer Dash", "H"); ExoChairSpeedupHotkey = RegisterHotKey("Exo Chair Speed Up", "LeftShift"); if (!Main.dedServ) @@ -262,10 +262,10 @@ namespace CalamityMod Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); - Filters.Scene["CalamityMod:AdultEidolonWyrm"] = new Filter(new AEWScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.25f).UseOpacity(0.35f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:AdultEidolonWyrm"] = new AEWSky(); + Filters.Scene["CalamityMod:AdultEidolonWyrm"] = new Filter(new AEWScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.25f).UseOpacity(0.35f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:AdultEidolonWyrm"] = new AEWSky(); - Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); + Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); Filters.Scene["CalamityMod:BossRush"] = new Filter(new BossRushScreenShader("FilterMiniTower").UseColor(BossRushSky.GeneralColor).UseOpacity(0.75f), EffectPriority.VeryHigh); @@ -287,13 +287,13 @@ namespace CalamityMod Apollo.LoadHeadIcons(); Artemis.LoadHeadIcons(); - DevourerofGodsHead.LoadHeadIcons(); - DevourerofGodsBody.LoadHeadIcons(); - DevourerofGodsTail.LoadHeadIcons(); - HiveMind.LoadHeadIcons(); + DevourerofGodsHead.LoadHeadIcons(); + DevourerofGodsBody.LoadHeadIcons(); + DevourerofGodsTail.LoadHeadIcons(); + HiveMind.LoadHeadIcons(); Polterghast.LoadHeadIcons(); - StormWeaverHead.LoadHeadIcons(); - SupremeCalamitas.LoadHeadIcons(); + StormWeaverHead.LoadHeadIcons(); + SupremeCalamitas.LoadHeadIcons(); ThanatosHead.LoadHeadIcons(); ThanatosBody1.LoadHeadIcons(); ThanatosBody2.LoadHeadIcons(); @@ -335,8 +335,8 @@ namespace CalamityMod SandCloakHotkey = null; SpectralVeilHotKey = null; PlaguePackHotKey = null; - AngelicAllianceHotKey = null; - GodSlayerDashHotKey = null; + AngelicAllianceHotKey = null; + GodSlayerDashHotKey = null; AstralCactusTexture = null; AstralCactusGlowTexture = null; @@ -379,10 +379,10 @@ namespace CalamityMod } Mount.mounts[Mount.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower; Mount.mounts[Mount.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].dashSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; - Mount.mounts[Mount.MinecartMech].runSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].dashSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; + Mount.mounts[Mount.MinecartMech].runSpeed /= CalamityPlayer.MechanicalCartSpeedNerfPower; - heartOriginal2 = null; + heartOriginal2 = null; heartOriginal = null; rainOriginal = null; manaOriginal = null; @@ -604,8 +604,8 @@ namespace CalamityMod { ModContent.NPCType(), 5400 }, { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 14400 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 1200 }, + { ModContent.NPCType(), 10800 }, + { ModContent.NPCType(), 1200 }, { ModContent.NPCType(), 8100 }, { ModContent.NPCType(), 8100 }, { ModContent.NPCType(), 8100 }, @@ -617,19 +617,19 @@ namespace CalamityMod { ModContent.NPCType(), 14400 }, { ModContent.NPCType(), 15300 }, { ModContent.NPCType(), 18000 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 18000 } - }; + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 21600 }, + { ModContent.NPCType(), 18000 } + }; } #endregion @@ -745,14 +745,14 @@ namespace CalamityMod { ModContent.NPCType(), velocityScaleMin }, { ModContent.NPCType(), velocityScaleMin }, { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), velocityScaleMin }, // Increases in phase 2 + { ModContent.NPCType(), velocityScaleMin }, // Increases in phase 2 { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), bitingEnemeyVelocityScale }, - { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), velocityScaleMin }, - { ModContent.NPCType(), bitingEnemeyVelocityScale } - }; + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale } + }; } #endregion @@ -760,7 +760,7 @@ namespace CalamityMod // This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available. public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? (int?)musicMod.GetSoundSlot(SoundType.Music, "Sounds/Music/" + songFilename) : null; - + public override void UpdateMusic(ref int music, ref MusicPriority priority) { if (Main.musicVolume != 0) @@ -855,11 +855,11 @@ namespace CalamityMod } } } - #endregion + #endregion - #region Lighting Effects - public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor) - { + #region Lighting Effects + public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor) + { if (Main.gameMenu) BossRushEvent.StartTimer = 0; @@ -877,10 +877,10 @@ namespace CalamityMod tileColor = Color.Lerp(tileColor, Color.Black, intensity * 0.3f); } } - #endregion + #endregion - #region Mod Support - public override void PostSetupContent() => WeakReferenceSupport.Setup(); + #region Mod Support + public override void PostSetupContent() => WeakReferenceSupport.Setup(); public override object Call(params object[] args) => ModCalls.Call(args); #endregion @@ -973,7 +973,7 @@ namespace CalamityMod CalamitasEnchantUI.Draw(Main.spriteBatch); return true; }, InterfaceScaleType.None)); - + // Codebreaker UI. layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Codebreaker Decryption GUI", () => { @@ -1550,7 +1550,12 @@ namespace CalamityMod #endregion #region Tile Entity Time Handler - public override void MidUpdateTimeWorld() => TileEntityTimeHandler.Update(); + public override void MidUpdateTimeWorld() => TileEntityTimeHandler.Update(); + #endregion + + #region Post NPC Updating + // TODO - Apply caching to this process. For now most of the looping issues should be eradicated but it can be reduced further. + public override void MidUpdateNPCGore() => CalamityGlobalTownNPC.ResetTownNPCNameBools(); #endregion } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index af1a53d1e9..a46b9c0f82 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -759,8 +759,6 @@ namespace CalamityMod.NPCs ResetSavedIndex(ref adultEidolonWyrmHead, NPCType()); - CalamityGlobalTownNPC.ResetTownNPCNameBools(npc, mod); - // Reset the enraged state every frame. The expectation is that bosses will continuously set it back to true if necessary. CurrentlyEnraged = false; CanHaveBossHealthBar = false; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 08162d1ccc..719a9a0067 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs #endregion #region Town NPC Names - public static void ResetTownNPCNameBools(NPC npc, Mod mod) + public static void ResetTownNPCNameBools() { void ResetName(int npcID, ref bool nameBool) {