diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3fb6226dde..85760226d7 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4833,6 +4833,7 @@ namespace CalamityMod.CalPlayer } #endregion } + #region Dragon Scale Logic public override void PostBuyItem(NPC vendor, Item[] shopInventory, Item item) { @@ -4841,6 +4842,7 @@ namespace CalamityMod.CalPlayer CalamityWorld.dragonScalesBought = true; } } + public override bool CanBuyItem(NPC vendor, Item[] shopInventory, Item item) { if (item.type == ModContent.ItemType()) @@ -4850,6 +4852,7 @@ namespace CalamityMod.CalPlayer return base.CanBuyItem(vendor, shopInventory, item); } #endregion + public override void PostUpdateRunSpeeds() { #region SpeedBoosts @@ -5272,7 +5275,7 @@ namespace CalamityMod.CalPlayer { if (item.melee || item.ranged || item.magic || item.Calamity().rogue) { - double useTimeBeeMultiplier = (double)(item.useTime * item.useAnimation) / 3600.0; //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 = 21.7% boost + double useTimeBeeMultiplier = (double)(item.useTime * item.useAnimation) / 3600D; //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 = 21.7% boost if (item.type == ModContent.ItemType()) { if (useTimeBeeMultiplier > 0.1) @@ -6192,7 +6195,15 @@ namespace CalamityMod.CalPlayer { if (isTrueMelee && soaring) { - player.wingTime = player.wingTimeMax; + double useTimeMultiplier = 0.85 + ((double)(item.useTime * item.useAnimation) / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost + double wingTimeFraction = (double)player.wingTimeMax / 20D; + double meleeStatMultiplier = (double)(player.meleeDamage * (float)((double)player.meleeCrit / 10D)); + + if (player.wingTime < player.wingTimeMax) + player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); + + if (player.wingTime > player.wingTimeMax) + player.wingTime = player.wingTimeMax; } if (item.melee && !item.noMelee && !item.noUseGraphic) { @@ -6257,7 +6268,7 @@ namespace CalamityMod.CalPlayer { bloodflareMeleeHits++; } - if (player.whoAmI == Main.myPlayer) + if (player.whoAmI == Main.myPlayer && target.canGhostHeal) { int healAmount = Main.rand.Next(3) + 1; player.statLife += healAmount; @@ -6320,9 +6331,19 @@ namespace CalamityMod.CalPlayer bool isSummon = proj.minion || proj.sentry || CalamityMod.projectileMinionList.Contains(proj.type); bool hasClassType = proj.melee || proj.ranged || proj.magic || isSummon || proj.Calamity().rogue; + Item heldItem = player.inventory[player.selectedItem]; + if (isTrueMelee && soaring) { - player.wingTime = player.wingTimeMax; + double useTimeMultiplier = 0.85 + ((double)(heldItem.useTime * heldItem.useAnimation) / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost + double wingTimeFraction = (double)player.wingTimeMax / 20D; + double meleeStatMultiplier = (double)(player.meleeDamage * (float)((double)player.meleeCrit / 10D)); + + if (player.wingTime < player.wingTimeMax) + player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); + + if (player.wingTime > player.wingTimeMax) + player.wingTime = player.wingTimeMax; } if (proj.Calamity().rogue) @@ -6334,16 +6355,10 @@ namespace CalamityMod.CalPlayer double damageMult = 1.0; if (isSummon) { - if (player.inventory[player.selectedItem].type > 0) + if (heldItem.type > 0) { - if ((player.inventory[player.selectedItem].summon && - !player.inventory[player.selectedItem].melee && - !player.inventory[player.selectedItem].ranged && - !player.inventory[player.selectedItem].magic && - !player.inventory[player.selectedItem].Calamity().rogue) || - player.inventory[player.selectedItem].hammer > 0 || - player.inventory[player.selectedItem].pick > 0 || - player.inventory[player.selectedItem].axe > 0) + if ((heldItem.summon && !heldItem.melee && !heldItem.ranged && !heldItem.magic && !heldItem.Calamity().rogue) || + heldItem.hammer > 0 || heldItem.pick > 0 || heldItem.axe > 0) { damageMult += 0.1; } @@ -6483,16 +6498,11 @@ namespace CalamityMod.CalPlayer #region MultiplicativeReductions if (isSummon) { - if (player.inventory[player.selectedItem].type > 0) + if (heldItem.type > 0) { - if (!player.inventory[player.selectedItem].summon && - (player.inventory[player.selectedItem].melee || - player.inventory[player.selectedItem].ranged || - player.inventory[player.selectedItem].magic || - player.inventory[player.selectedItem].Calamity().rogue) && - player.inventory[player.selectedItem].hammer == 0 && - player.inventory[player.selectedItem].pick == 0 && - player.inventory[player.selectedItem].axe == 0) + if (!heldItem.summon && + (heldItem.melee || heldItem.ranged || heldItem.magic || heldItem.Calamity().rogue) && + heldItem.hammer == 0 && heldItem.pick == 0 && heldItem.axe == 0) { damage = (int)((double)damage * 0.75); } @@ -6649,7 +6659,7 @@ namespace CalamityMod.CalPlayer { bloodflareMeleeHits++; } - if (player.whoAmI == Main.myPlayer) + if (player.whoAmI == Main.myPlayer && target.canGhostHeal) { int healAmount = Main.rand.Next(3) + 1; player.statLife += healAmount; diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 63d8e40d3c..95f6da9503 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -12,7 +12,8 @@ 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"); + "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"); } public override void SetDefaults() 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/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 5040cf24fe..0a149053ae 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -70,6 +70,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { if (target.type == NPCID.TargetDummy || !target.canGhostHeal) return; + Player player = Main.player[projectile.owner]; player.statLife += 1; player.HealEffect(1); 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++) {