diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 691dc109cd..652589a71b 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -169,6 +169,11 @@ namespace CalamityMod.Balancing #endregion Astrum Deus + #region Moon Lord + // 30% resist to the shockwave attunement from the True biome blade. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.3f, ProjectileType(), ProjectileType(), ProjectileType())))); + #endregion + #region Ceaseless Void / Dark Energies // 50% resist to true melee. @@ -249,8 +254,8 @@ namespace CalamityMod.Balancing #region Thanatos - // 83.75% resist to Seraphim lasers. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.1625f, ProjectileType())))); + // 95% resist to Seraphim lasers (what the actual fuck?). + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.05f, ProjectileType())))); // 75% resist to Celestus. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 049802374e..13ddffba79 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -53,10 +53,10 @@ namespace CalamityMod.Items.Weapons.Melee public static float PolarisAttunement_ShotDamageBoost = 0.8f; //The shots fired if the dash connects public static float PolarisAttunement_ShredChargeupGain = 1.1f; //How much charge is gainted per second. - public static int AndromedaAttunement_BaseDamage = 2100; - public static int AndromedaAttunement_DashHitIFrames = 30; - public static float AndromedaAttunement_FullChargeBoost = 4f; //The EXTRA damage boost. So putting 1 here will make it deal double damage. Putting 0.5 here will make it deal 1.5x the damage. - public static float AndromedaAttunement_MonolithDamageBoost = 1.75f; + public static int AndromedaAttunement_BaseDamage = 2200; + public static int AndromedaAttunement_DashHitIFrames = 20; + public static float AndromedaAttunement_FullChargeBoost = 3.5f; //The EXTRA damage boost. So putting 1 here will make it deal double damage. Putting 0.5 here will make it deal 1.5x the damage. + public static float AndromedaAttunement_MonolithDamageBoost = 1.2f; public static float AndromedaAttunement_BoltsDamageReduction = 0.2f; //The shots fired as it charges public static int AriesAttunement_BaseDamage = 950; diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index ed8d47c8ef..5b9f8b125a 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -56,12 +56,12 @@ namespace CalamityMod.Items.Weapons.Melee public static int SuperPogoAttunement_PassiveLifeSteal = 10; - public static int ShockwaveAttunement_BaseDamage = 720; - public static int ShockwaveAttunement_DashHitIFrames = 30; - public static float ShockwaveAttunement_FullChargeBoost = 4f; //The EXTRA damage boost. So putting 1 here will make it deal double damage. Putting 0.5 here will make it deal 1.5x the damage. - public static float ShockwaveAttunement_MonolithDamageBoost = 1.25f; - public static float ShockwaveAttunement_MonolithDamageFalloff = 0.6f; //Damage multiplier for all subsequent hits after the first one. - public static float ShockwaveAttunement_BlastDamageReduction = 0.6f; + public static int ShockwaveAttunement_BaseDamage = 550; + public static int ShockwaveAttunement_DashHitIFrames = 20; + public static float ShockwaveAttunement_FullChargeBoost = 2.5f; //The EXTRA damage boost. So putting 1 here will make it deal double damage. Putting 0.5 here will make it deal 1.5x the damage. + public static float ShockwaveAttunement_MonolithDamageBoost = 1.1f; + public static float ShockwaveAttunement_MonolithDamageFalloff = 0.15f; //Damage multiplier for all subsequent hits after the first one. + public static float ShockwaveAttunement_BlastDamageReduction = 0.8f; public static int ShockwaveAttunement_PassiveBaseDamage = 200; diff --git a/Items/Weapons/Rogue/Seraphim.cs b/Items/Weapons/Rogue/Seraphim.cs index 9e0cb8baa5..f190284c95 100644 --- a/Items/Weapons/Rogue/Seraphim.cs +++ b/Items/Weapons/Rogue/Seraphim.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue public class Seraphim : RogueWeapon { public const int SplitDaggerCount = 6; - public const int StealthStrikeLightCount = 9; + public const int StealthStrikeLightCount = 7; public override void SetStaticDefaults() { DisplayName.SetDefault("Seraphim"); @@ -25,11 +25,11 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 82; item.height = 82; - item.damage = 332; + item.damage = 300; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 12; - item.useTime = 12; + item.useAnimation = 13; + item.useTime = 13; item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index 4f10acb8dd..2882a07978 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -287,6 +287,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.ai[0] == 2f) { npc.dontTakeDamage = true; + npc.Calamity().ShouldCloseHPBar = true; Vector2 value6 = new Vector2(npc.direction, -0.5f); npc.velocity = Vector2.Lerp(npc.velocity, value6, 0.98f); diff --git a/Projectiles/Boss/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index 650ef58051..514b669866 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -167,6 +167,11 @@ namespace CalamityMod.Projectiles.Boss if (projectile.velocity == Vector2.Zero) return false; + // Don't draw the laser if its scale is too low, as that could lead to an infinite loop and out of memory crash. + // This has happened in multiplayer historically, so this check is important. + if (projectile.scale < 0.001f) + return false; + 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); diff --git a/Projectiles/Typeless/ArtifactOfResilienceShards.cs b/Projectiles/Typeless/ArtifactOfResilienceShards.cs index 39d8212372..0319e169ff 100644 --- a/Projectiles/Typeless/ArtifactOfResilienceShards.cs +++ b/Projectiles/Typeless/ArtifactOfResilienceShards.cs @@ -2,11 +2,13 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Damageable; using Microsoft.Xna.Framework; +using System.IO; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { + // TODO -- Make this one projectile with multiple frames instead of multiple projectiles with one frame. public class ArtifactOfResilienceShard1 : ModProjectile { public int Timer = 0; @@ -34,6 +36,19 @@ namespace CalamityMod.Projectiles.Typeless projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 20; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.frameCounter); + writer.WriteVector2(StartingPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.frameCounter = reader.ReadInt32(); + StartingPosition = reader.ReadVector2(); + } + public static void ArtifactOfResilienceShardAI(Projectile projectile, ref Vector2 StartingPosition, ref int Timer) { // Spinning @@ -42,6 +57,7 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.localAI[0] == 0f) { StartingPosition = projectile.Center; + projectile.netUpdate = true; projectile.localAI[0] = 1f; } Timer++; @@ -145,6 +161,19 @@ namespace CalamityMod.Projectiles.Typeless projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.frameCounter); + writer.WriteVector2(StartingPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.frameCounter = reader.ReadInt32(); + StartingPosition = reader.ReadVector2(); + } + public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void AI() => ArtifactOfResilienceShard1.ArtifactOfResilienceShardAI(projectile, ref StartingPosition, ref Timer); } @@ -171,6 +200,18 @@ namespace CalamityMod.Projectiles.Typeless projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.frameCounter); + writer.WriteVector2(StartingPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.frameCounter = reader.ReadInt32(); + StartingPosition = reader.ReadVector2(); + } public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void AI() => ArtifactOfResilienceShard1.ArtifactOfResilienceShardAI(projectile, ref StartingPosition, ref Timer); } @@ -197,6 +238,18 @@ namespace CalamityMod.Projectiles.Typeless projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.frameCounter); + writer.WriteVector2(StartingPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.frameCounter = reader.ReadInt32(); + StartingPosition = reader.ReadVector2(); + } public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void AI() => ArtifactOfResilienceShard1.ArtifactOfResilienceShardAI(projectile, ref StartingPosition, ref Timer); } @@ -223,6 +276,18 @@ namespace CalamityMod.Projectiles.Typeless projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.frameCounter); + writer.WriteVector2(StartingPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.frameCounter = reader.ReadInt32(); + StartingPosition = reader.ReadVector2(); + } public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void AI() => ArtifactOfResilienceShard1.ArtifactOfResilienceShardAI(projectile, ref StartingPosition, ref Timer); } @@ -249,6 +314,18 @@ namespace CalamityMod.Projectiles.Typeless projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.frameCounter); + writer.WriteVector2(StartingPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.frameCounter = reader.ReadInt32(); + StartingPosition = reader.ReadVector2(); + } public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void AI() => ArtifactOfResilienceShard1.ArtifactOfResilienceShardAI(projectile, ref StartingPosition, ref Timer); } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index faab6cc191..edd81501b1 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -165,8 +165,9 @@ namespace CalamityMod.Tiles } Player player = Main.LocalPlayer; - if (player is null) + if (player is null || !player.active) return; + if (player.Calamity().reaverExplore && !fail) { player.breath += 20; diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 4c8e63b064..1c789231dc 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -147,8 +147,6 @@ namespace CalamityMod.UI OneToMany[NPCID.PirateShipCannon] = Ship; int[] MoonLord = new int[] { NPCID.MoonLordHead, NPCID.MoonLordHand, NPCID.MoonLordCore }; - OneToMany[NPCID.MoonLordHead] = MoonLord; - OneToMany[NPCID.MoonLordHand] = MoonLord; OneToMany[NPCID.MoonLordCore] = MoonLord; int[] Void = new int[] { NPCType(), NPCType() }; @@ -319,6 +317,28 @@ namespace CalamityMod.UI return life; }); + + SpecialHPRequirements.Add(npc => npc.type == NPCID.MoonLordCore, (npc, checkingForMaxLife) => + { + long life = checkingForMaxLife ? npc.lifeMax : npc.life; + if (npc.ai[0] == 2f) + life = 0L; + + for (int i = 0; i < Main.maxNPCs; i++) + { + bool isMoonLordPiece = Main.npc[i].type == NPCID.MoonLordHand || Main.npc[i].type == NPCID.MoonLordHead; + if (!Main.npc[i].active || !isMoonLordPiece || Main.npc[i].ai[3] != npc.whoAmI) + continue; + + // Don't count HP towards the total if the NPC is in its dead state. + if (Main.npc[i].Calamity().newAI[0] == 1f) + continue; + + life += checkingForMaxLife ? Main.npc[i].lifeMax : Main.npc[i].life; + } + + return life; + }); } #pragma warning restore IDE0028 // Simplify collection initialization