From b3c6ca514ecd2f1fdade83a51021cfd8c86c5682 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 25 Oct 2019 21:08:43 -0500 Subject: [PATCH] y u hef mad? --- Items/Potions/SoaringPotion.cs | 2 +- Items/Weapons/Melee/ElementalExcalibur.cs | 8 ++- .../PlaguebringerGoliath.cs | 66 +++++++------------ UI/BossHealthBarManager.cs | 37 ++--------- Utilities/CalamityUtils.cs | 5 -- World/WorldGenerationMethods.cs | 4 +- 6 files changed, 40 insertions(+), 82 deletions(-) diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index baaab7e4aa..95f6da9503 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Potions { DisplayName.SetDefault("Soaring Potion"); Tooltip.SetDefault("Increases flight time and horizontal flight speed by 10%\n" + - "Sets your wing flight time to max whenever you strike an enemy with a true melee weapon\n" + + "Restores a fraction of your wing flight time whenever you strike an enemy with a true melee weapon\n" + "The amount of flight time restored scales with your melee stats and weapon swing speed"); } diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index bbed56fc1c..40cd650559 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -74,17 +74,21 @@ namespace CalamityMod.Items.Weapons.Melee { item.shoot = 0; item.shootSpeed = 0f; - item.damage = BaseDamage * 3; } else { item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - item.damage = BaseDamage; } return base.CanUseItem(player); } + public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) + { + if (player.altFunctionUse == 2) + damage *= 2; + } + public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(4)) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 4ce0b89bbe..5870e7b9e5 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -272,16 +272,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.ai[1] += 1f; npc.ai[2] = 0f; - float num1044 = revenge ? 24f : 22f; + float num1044 = revenge ? 28f : 26f; if (aboveGroundEnrage) num1044 += 6f; - if ((double)npc.life < (double)npc.lifeMax * 0.75 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.66 || CalamityWorld.bossRushActive) num1044 += 2f; - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - num1044 += 2f; - if ((double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) - num1044 += 2f; - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.33 || CalamityWorld.bossRushActive) num1044 += 2f; if (npc.Calamity().enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) num1044 += 2f; @@ -304,27 +300,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath charging = false; - float num1048 = revenge ? 16f : 14f; - float num1049 = revenge ? 0.2f : 0.18f; - if ((double)npc.life < (double)npc.lifeMax * 0.75 || CalamityWorld.bossRushActive) - { - num1048 += 1f; - num1049 += 0.05f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - num1048 += 1f; - num1049 += 0.05f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) + float num1048 = revenge ? 18f : 16f; + float num1049 = revenge ? 0.35f : 0.32f; + if ((double)npc.life < (double)npc.lifeMax * 0.66 || CalamityWorld.bossRushActive) { num1048 += 2f; num1049 += 0.05f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.33 || CalamityWorld.bossRushActive) { num1048 += 2f; - num1049 += 0.1f; + num1049 += 0.05f; } if (npc.Calamity().enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) { @@ -368,21 +354,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.spriteDirection = npc.direction; - int num1050 = 600; + int num1050 = revenge ? 525 : 550; if (npc.Calamity().enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) num1050 = 250; - else if (aboveGroundEnrage) + else if (aboveGroundEnrage || CalamityWorld.bossRushActive) num1050 = 350; - else if (CalamityWorld.death || CalamityWorld.bossRushActive) - num1050 = 400; - else if ((double)npc.life < (double)npc.lifeMax * 0.1) + else if ((double)npc.life < (double)npc.lifeMax * 0.33) num1050 = revenge ? 425 : 450; - else if ((double)npc.life < (double)npc.lifeMax * 0.25) - num1050 = revenge ? 450 : 475; - else if ((double)npc.life < (double)npc.lifeMax * 0.5) - num1050 = 500; - else if ((double)npc.life < (double)npc.lifeMax * 0.75) - num1050 = 550; + else if ((double)npc.life < (double)npc.lifeMax * 0.66) + num1050 = revenge ? 475 : 500; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + num1050 -= 25; int num1051 = 1; if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) @@ -404,17 +386,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.velocity *= 0.9f; float num1052 = revenge ? 0.12f : 0.1f; - if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.8 || CalamityWorld.bossRushActive) { npc.velocity *= 0.9f; num1052 += 0.05f; } - if (npc.life < npc.lifeMax / 3 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.6 || CalamityWorld.bossRushActive) { npc.velocity *= 0.9f; num1052 += 0.05f; } - if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.4 || CalamityWorld.bossRushActive) { npc.velocity *= 0.9f; num1052 += 0.05f; @@ -864,17 +846,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (npc.velocity.Y > 0f) npc.velocity.Y = npc.velocity.Y * 0.98f; - npc.velocity.Y = npc.velocity.Y - (CalamityWorld.bossRushActive ? 0.15f : 0.1f); - if (npc.velocity.Y > 4f) - npc.velocity.Y = 4f; + npc.velocity.Y = npc.velocity.Y - (CalamityWorld.bossRushActive ? 0.2f : 0.15f); + if (npc.velocity.Y > 5f) + npc.velocity.Y = 5f; } else if (npc.position.Y < Main.player[npc.target].position.Y - yPos2) { if (npc.velocity.Y < 0f) npc.velocity.Y = npc.velocity.Y * 0.98f; - npc.velocity.Y = npc.velocity.Y + (CalamityWorld.bossRushActive ? 0.15f : 0.1f); - if (npc.velocity.Y < -4f) - npc.velocity.Y = -4f; + npc.velocity.Y = npc.velocity.Y + (CalamityWorld.bossRushActive ? 0.2f : 0.15f); + if (npc.velocity.Y < -5f) + npc.velocity.Y = -5f; } if (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + xPos) { diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index b4f6d55f31..ca7c2ab801 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -451,8 +451,7 @@ namespace CalamityMod.UI Ceaseless, Perforator, Ravage, - SlimeCore, - MoonCore + SlimeCore } private int _npcLocation; @@ -481,11 +480,7 @@ namespace CalamityMod.UI //EDITABLE public void SetupForType(int type) { - if (type == NPCID.MoonLordCore) - { - _special2 = SpecialType2.MoonCore; - } - else if (type == ModContent.NPCType()) + if (type == ModContent.NPCType()) { _special2 = SpecialType2.SlimeCore; } @@ -612,9 +607,11 @@ namespace CalamityMod.UI { if (Main.npc[i].active && Main.npc[i].life > 0 && _arrayOfIds.Contains(Main.npc[i].type)) { - if ((Main.npc[i].type == NPCID.MoonLordHead || Main.npc[i].type == NPCID.MoonLordHand || Main.npc[i].type == NPCID.MoonLordCore) && - Main.npc[i].ai[0] == -2f) + if ((Main.npc[i].type == NPCID.MoonLordHead && (Main.npc[i].ai[0] == -2f || Main.npc[i].ai[0] == -3f || Main.npc[i].Calamity().newAI[0] == 1f)) || + (Main.npc[i].type == NPCID.MoonLordHand && (Main.npc[i].ai[0] == -2f || Main.npc[i].Calamity().newAI[0] == 1f)) || + (Main.npc[i].type == NPCID.MoonLordCore && Main.npc[i].ai[0] == 2f)) continue; + currentLife += Main.npc[i].life; maxLife += Main.npc[i].lifeMax; } @@ -729,13 +726,6 @@ namespace CalamityMod.UI NPC.CountNPCS(ModContent.NPCType()); _specialData2[4] = count5; break; - case SpecialType2.MoonCore: - if (NPC.CountNPCS(NPCID.MoonLordFreeEye) > 3) - { - int count6 = NPC.CountNPCS(NPCID.MoonLordFreeEye) - 3; - _specialData2[5] = count6; - } - break; } } public void Draw(SpriteBatch sb, int x, int y) @@ -875,13 +865,7 @@ namespace CalamityMod.UI Vector2 countSize5 = Main.fontItemStack.MeasureString(count5) * textScale; float countX5 = Math.Max(x, x + mainBarWidth - countSize5.X); DrawBorderStringEightWay(sb, Main.fontItemStack, count5, new Vector2(countX5, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale); - return; - case SpecialType2.MoonCore: - string count7 = "(Vulnerable Eyes left: " + _specialData2[5] + ")"; - Vector2 countSize7 = Main.fontItemStack.MeasureString(count7) * textScale; - float countX7 = Math.Max(x, x + mainBarWidth - countSize7.X); - DrawBorderStringEightWay(sb, Main.fontItemStack, count7, new Vector2(countX7, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale); - return; + return; } string actualLife = "(" + _npc.life + " / " + _npc.lifeMax + ")"; @@ -1019,13 +1003,6 @@ namespace CalamityMod.UI DrawBorderStringEightWay(sb, Main.fontItemStack, count5, new Vector2(countX5, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale); _openAnimCounter--; return; - case SpecialType2.MoonCore: - string count7 = "(Vulnerable Eyes left: " + _specialData2[5] + ")"; - Vector2 countSize7 = Main.fontItemStack.MeasureString(count7) * textScale; - float countX7 = Math.Max(x, x + mainBarWidth - countSize7.X); - DrawBorderStringEightWay(sb, Main.fontItemStack, count7, new Vector2(countX7, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale); - _openAnimCounter--; - return; } string actualLife = "(" + _npc.life + " / " + _npc.lifeMax + ")"; diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 8565603320..feece6252e 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -85,11 +85,6 @@ namespace CalamityMod { npc.lifeMax = revengeance.Value; } - if (npc.boss) - { - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); - } } /// /// Detects nearby hostile NPCs from a given point diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 7218483784..01d36165df 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -560,9 +560,9 @@ namespace CalamityMod.World } } } - int num52 = 8400 - 20; + int num52 = Main.maxTilesX - 20; int num53 = 20; - int num54 = 2400 - 20; + int num54 = Main.maxTilesY - 20; int num55 = 20; for (int num56 = 0; num56 < num2; num56++) {