diff --git a/CalamityMod.cs b/CalamityMod.cs index bc6af517e9..e5401b7946 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -278,7 +278,14 @@ namespace CalamityMod RipperUI.Load(); AstralArcanumUI.Load(this); + Apollo.LoadHeadIcons(); + Artemis.LoadHeadIcons(); + Polterghast.LoadHeadIcons(); SupremeCalamitas.LoadHeadIcons(); + ThanatosHead.LoadHeadIcons(); + ThanatosBody1.LoadHeadIcons(); + ThanatosBody2.LoadHeadIcons(); + ThanatosTail.LoadHeadIcons(); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax)))); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(255, 83, 48), ((float)player.Calamity().rage / (float)player.Calamity().rageMax)))); diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 9064404d67..e3b0e95312 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -55,7 +55,6 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 200); recipe.AddIngredient(ItemID.FrozenKey); - recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 7bb800ff13..6b2d90b5d0 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -586,7 +586,7 @@ namespace CalamityMod List bosses = new List() { NPCType(), NPCType(), NPCType(), NPCType() }; List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; //List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - string instructions = "By using a high-tech computer thing"; + string instructions = "By using a high-tech computer"; string despawn = CalamityUtils.ColorMessage("An imperfection after all...what a shame.", new Color(0x7F, 0xFF, 0xD4)); //string bossLogTex = "CalamityMod/NPCs/ExoMechs/ExoMechs_BossChecklist"; //AddBoss(bossChecklist, calamity, "ExoMechs", order, bosses, DownedExoMechs, null, loot, collection, instructions, despawn, bossLogTex); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 78fcbb996f..9a54e93586 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -146,6 +146,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + return; } // Set vulnerable to false by default @@ -431,41 +432,40 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; + Vector2 npcCenter = npc.Center; + float targetCenterX = player.Center.X; + float targetCenterY = player.Center.Y; + targetCenterX = (int)(targetCenterX / 16f) * 16; + targetCenterY = (int)(targetCenterY / 16f) * 16; + npcCenter.X = (int)(npcCenter.X / 16f) * 16; + npcCenter.Y = (int)(npcCenter.Y / 16f) * 16; + targetCenterX -= npcCenter.X; + targetCenterY -= npcCenter.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + float distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) { try { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + npcCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + targetCenterX = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - npcCenter.X; + targetCenterY = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - npcCenter.Y; } catch { } - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; + npc.rotation = (float)Math.Atan2(targetCenterY, targetCenterX) + MathHelper.PiOver2; + distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + distanceFromTarget = (distanceFromTarget - npc.width) / distanceFromTarget; + targetCenterX *= distanceFromTarget; + targetCenterY *= distanceFromTarget; npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; + npc.position.X = npc.position.X + targetCenterX; + npc.position.Y = npc.position.Y + targetCenterY; - if (num191 < 0f) + if (targetCenterX < 0f) npc.spriteDirection = -1; - else if (num191 > 0f) + else if (targetCenterX > 0f) npc.spriteDirection = 1; } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 1c49259062..710be48b47 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -146,6 +146,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + return; } // Set vulnerable to false by default @@ -431,44 +432,44 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; + Vector2 npcCenter = npc.Center; + float targetCenterX = player.Center.X; + float targetCenterY = player.Center.Y; + targetCenterX = (int)(targetCenterX / 16f) * 16; + targetCenterY = (int)(targetCenterY / 16f) * 16; + npcCenter.X = (int)(npcCenter.X / 16f) * 16; + npcCenter.Y = (int)(npcCenter.Y / 16f) * 16; + targetCenterX -= npcCenter.X; + targetCenterY -= npcCenter.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; - } catch - { - } + float distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + npcCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + targetCenterX = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - npcCenter.X; + targetCenterY = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - npcCenter.Y; + } + catch + { + } - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; + npc.rotation = (float)Math.Atan2(targetCenterY, targetCenterX) + MathHelper.PiOver2; + distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + distanceFromTarget = (distanceFromTarget - npc.width) / distanceFromTarget; + targetCenterX *= distanceFromTarget; + targetCenterY *= distanceFromTarget; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + targetCenterX; + npc.position.Y = npc.position.Y + targetCenterY; - if (num191 < 0f) - npc.spriteDirection = -1; - else if (num191 > 0f) - npc.spriteDirection = 1; - } - } + if (targetCenterX < 0f) + npc.spriteDirection = -1; + else if (targetCenterX > 0f) + npc.spriteDirection = 1; + } + } public override bool CanHitPlayer(Player target, ref int cooldownSlot) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png index 9c496d1e77..40ebcdb5ea 100644 Binary files a/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png and b/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png index 1c485fcc41..9cd03281e6 100644 Binary files a/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png and b/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png index 45a93ddc59..1a087a283e 100644 Binary files a/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png and b/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index f590452b41..f5bc1f3eea 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -145,6 +145,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + return; } // Set vulnerable to false by default @@ -430,44 +431,44 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; + Vector2 npcCenter = npc.Center; + float targetCenterX = player.Center.X; + float targetCenterY = player.Center.Y; + targetCenterX = (int)(targetCenterX / 16f) * 16; + targetCenterY = (int)(targetCenterY / 16f) * 16; + npcCenter.X = (int)(npcCenter.X / 16f) * 16; + npcCenter.Y = (int)(npcCenter.Y / 16f) * 16; + targetCenterX -= npcCenter.X; + targetCenterY -= npcCenter.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; - } catch - { - } + float distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + npcCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + targetCenterX = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - npcCenter.X; + targetCenterY = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - npcCenter.Y; + } + catch + { + } - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; + npc.rotation = (float)Math.Atan2(targetCenterY, targetCenterX) + MathHelper.PiOver2; + distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + distanceFromTarget = (distanceFromTarget - npc.width) / distanceFromTarget; + targetCenterX *= distanceFromTarget; + targetCenterY *= distanceFromTarget; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + targetCenterX; + npc.position.Y = npc.position.Y + targetCenterY; - if (num191 < 0f) - npc.spriteDirection = -1; - else if (num191 > 0f) - npc.spriteDirection = 1; - } - } + if (targetCenterX < 0f) + npc.spriteDirection = -1; + else if (targetCenterX > 0f) + npc.spriteDirection = 1; + } + } public override bool CanHitPlayer(Player target, ref int cooldownSlot) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png index c45262044c..ff48f58356 100644 Binary files a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png and b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png index f6394a48ae..782e608c43 100644 Binary files a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png and b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png differ diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png index be37ce6997..e34313db93 100644 Binary files a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png and b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png differ diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index ca552a0409..778a105e52 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -467,10 +467,6 @@ namespace CalamityMod.NPCs.Ravager npc.noTileCollide = true; else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))) npc.noTileCollide = false; - - // Prevent falling forever in second phase - if (npc.ai[0] == 2f && npc.velocity.Y > 0f && npc.Top.Y > Main.player[npc.target].Bottom.Y + 16f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - npc.noTileCollide = false; } Vector2 targetVector = player.position; diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index 13ea28b98b..5128f706d0 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -145,9 +146,12 @@ namespace CalamityMod.Projectiles.Boss return; } - // If the Ares Laser Cannon is the owner + // If the Ares Laser Cannon is the owner. bool aresLaserIsOwner = ThingToAttachTo.type == ModContent.NPCType(); + // If Artemis is the owner. + bool artemisIsOwner = ThingToAttachTo.type == ModContent.NPCType(); + // Fade in after telegraphs have faded. if (TelegraphDelay > TelegraphTotalTime) { @@ -187,6 +191,8 @@ namespace CalamityMod.Projectiles.Boss if (aresLaserIsOwner) projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f + Vector2.UnitY * 16f; + else if (artemisIsOwner) + projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f; // Calculate and store the velocity that will be used for laser telegraph rotation and beam firing. Vector2 projectileDestination = Destination - ThingToAttachTo.Center; @@ -215,6 +221,8 @@ namespace CalamityMod.Projectiles.Boss if (aresLaserIsOwner) projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f + Vector2.UnitY * 16f; + else if (artemisIsOwner) + projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f; // Calculate and store the velocity that will be used for laser telegraph rotation and beam firing. Vector2 projectileDestination = Destination - ThingToAttachTo.Center; diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 0901bbb88b..b0b763a4c5 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { projectile.width = 10; - projectile.height = 16; + projectile.height = 10; projectile.friendly = true; projectile.ranged = true; projectile.penetrate = 1; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - int projAmt = Main.rand.Next(2, 4); + int projAmt = Main.rand.Next(1, 3); if (projectile.owner == Main.myPlayer) { for (int i = 0; i < projAmt; i++) diff --git a/Projectiles/Ranged/AquashardSplit.cs b/Projectiles/Ranged/AquashardSplit.cs index 9b0f5db1f6..0ce0ef2bad 100644 --- a/Projectiles/Ranged/AquashardSplit.cs +++ b/Projectiles/Ranged/AquashardSplit.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { projectile.width = 10; - projectile.height = 16; + projectile.height = 10; projectile.friendly = true; projectile.ranged = true; projectile.penetrate = 1;