From 06fe2c4a02f28bf50b7985dccefdef47df6f85f9 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 20 Apr 2024 08:39:19 -0500 Subject: [PATCH] 1 - I'm going to tear my hair out. 2 - Made the player always heal to full on respawn. --- CalPlayer/CalamityPlayer.cs | 7 +---- CalPlayer/CalamityPlayerMiscEffects.cs | 4 +-- Items/Pets/HermitsBoxofOneHundredMedicines.cs | 31 ------------------- .../en-US/Mods.CalamityMod.Misc.hjson | 2 -- ModSupport/ModCalls.cs | 6 ---- .../Bosses/WallOfFleshAI.cs | 10 +++--- 6 files changed, 9 insertions(+), 51 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ab0614aa70..435a7f659f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -306,7 +306,6 @@ namespace CalamityMod.CalPlayer #region Pet public bool thirdSage = false; - public bool thirdSageH = false; public bool perfmini = false; public bool akato = false; public bool yharonPet = false; @@ -1235,7 +1234,6 @@ namespace CalamityMod.CalPlayer adrenalineBoostThree = false; drawBossHPBar = true; shouldDrawSmallText = true; - healToFull = false; newMerchantInventory = false; newPainterInventory = false; @@ -1288,7 +1286,6 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("adrenalineThree", adrenalineBoostThree); boost.AddWithCondition("bossHPBar", drawBossHPBar); boost.AddWithCondition("drawSmallText", shouldDrawSmallText); - boost.AddWithCondition("fullHPRespawn", healToFull); boost.AddWithCondition("newMerchantInventory", newMerchantInventory); boost.AddWithCondition("newPainterInventory", newPainterInventory); @@ -1379,7 +1376,6 @@ namespace CalamityMod.CalPlayer adrenalineBoostThree = boost.Contains("adrenalineThree"); drawBossHPBar = boost.Contains("bossHPBar"); shouldDrawSmallText = boost.Contains("drawSmallText"); - healToFull = boost.Contains("fullHPRespawn"); newMerchantInventory = boost.Contains("newMerchantInventory"); newPainterInventory = boost.Contains("newPainterInventory"); @@ -3735,8 +3731,7 @@ namespace CalamityMod.CalPlayer #region On Respawn public override void OnRespawn() { - if (healToFull) - thirdSageH = true; + healToFull = true; // The player rotation can be off if the player dies at the right time when using Final Dawn. Player.fullRotation = 0f; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 7f57930ad9..6f8ae66cbe 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2962,9 +2962,9 @@ namespace CalamityMod.CalPlayer // The player's true max life value with Calamity adjustments actualMaxLife = Player.statLifeMax2; - if (thirdSageH && !Player.dead && healToFull) + if (!Player.dead && healToFull) { - thirdSageH = false; + healToFull = false; Player.statLife = actualMaxLife; } diff --git a/Items/Pets/HermitsBoxofOneHundredMedicines.cs b/Items/Pets/HermitsBoxofOneHundredMedicines.cs index 1359bfb19b..629e1afcc0 100644 --- a/Items/Pets/HermitsBoxofOneHundredMedicines.cs +++ b/Items/Pets/HermitsBoxofOneHundredMedicines.cs @@ -33,37 +33,6 @@ namespace CalamityMod.Items.Pets public override bool AltFunctionUse(Player player) => true; - public override void UseStyle(Player player, Rectangle heldItemFrame) - { - if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5) && Main.myPlayer == player.whoAmI) - { - if (player.altFunctionUse == 2) - { - if (!player.Calamity().healToFull) - { - player.Calamity().healToFull = true; - string key = "Mods.CalamityMod.Misc.ThirdSageBlessingText"; - Color messageColor = Color.Violet; - Main.NewText(Language.GetTextValue(key), messageColor); - } - else - { - player.Calamity().healToFull = false; - string key2 = "Mods.CalamityMod.Misc.ThirdSageBlessingText2"; - Color messageColor2 = Color.Violet; - Main.NewText(Language.GetTextValue(key2), messageColor2); - } - } - else - { - if (player.whoAmI == Main.myPlayer && player.itemTime == 0) - { - player.AddBuff(Item.buffType, 3600, true); - } - } - } - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) => false; } } diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 3983dd1d0d..9a650f9ea6 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -52,8 +52,6 @@ SevensBust: Bust! SevensDoubles: Doubles! SevensTriples: Triples! StylishHammerHit: Stylish! -ThirdSageBlessingText: You have been blessed by the Third Sage! -ThirdSageBlessingText2: The Third Sage has rescinded its blessing... GenericConsumedText: "[c/8A8A8A:You have already consumed this item]" BloodOrangeText: You have already consumed a Blood Orange. Eating any more would make your blood too thick to flow. MiracleFruitText: You have already consumed a Miracle Fruit. It would take a miracle to put you back together if you ate another. diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index ca2be1f1bb..71d46643ad 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -1001,9 +1001,6 @@ namespace CalamityMod "StarlightFuelCell" => player.Calamity().adrenalineBoostTwo, "Ectoheart" => player.Calamity().adrenalineBoostThree, - "HermitsBox" => player.Calamity().healToFull, - "HermitsBoxofOneHundredMedicines" => player.Calamity().healToFull, - "CelestialOnion" => player.Calamity().extraAccessoryML, _ => false, // Return false if no case is found @@ -1033,9 +1030,6 @@ namespace CalamityMod case "StarlightFuelCell": player.Calamity().adrenalineBoostTwo = value; break; case "Ectoheart": player.Calamity().adrenalineBoostThree = value; break; - case "HermitsBox": player.Calamity().healToFull = value; break; - case "HermitsBoxofOneHundredMedicines": player.Calamity().healToFull = value; break; - case "CelestialOnion": player.Calamity().extraAccessoryML = value; break; }; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index ff620848ac..8c5b95b78b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -136,11 +136,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.Fireball; damage = npc.GetProjectileDamage(type); int numProj = 3; - int spread = 30; + int spread = 15; float rotation = MathHelper.ToRadians(spread); for (int j = 0; j < numProj; j++) { - Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(2f, 2f); + Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(1.5f, 1.5f); Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))) + randomVelocity; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 50f, perturbedSpeed, type, damage, 0f, Main.myPlayer); } @@ -600,9 +600,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float distanceAboveTarget = 240f * npc.ai[0]; float distanceAwayFromTargetX = 560f; + float distanceAwayFromTargetXLeeway = 40f; float distanceAwayFromTargetY = Main.player[npc.target].Center.Y - npc.Center.Y; - float distanceAwayFromTargetYLeeway = 48f; - bool tooFarX = Math.Abs(Main.player[npc.target].Center.X - npc.Center.X) > distanceAwayFromTargetX; + float distanceAwayFromTargetYLeeway = 40f; + float absoluteDistanceX = Math.Abs(Main.player[npc.target].Center.X - npc.Center.X); + bool tooFarX = absoluteDistanceX > distanceAwayFromTargetX + distanceAwayFromTargetXLeeway || absoluteDistanceX < distanceAwayFromTargetX - distanceAwayFromTargetXLeeway; bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway; bool tooFar = tooFarX || tooFarY; if (tooFar)