diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 268e7f16e4..cf26698eb5 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Mounts mountData.blockExtraJumps = false; mountData.totalFrames = 15; mountData.constantJump = false; - int baseYOffset = 24; + int baseYOffset = 26; int[] array = new int[mountData.totalFrames]; for (int l = 0; l < array.Length; l++) { @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Mounts mountData.playerYOffsets = array; mountData.xOffset = -4; mountData.bodyFrame = 3; - mountData.yOffset = 7; //-8 + mountData.yOffset = 5; //-8 mountData.playerHeadOffset = 36; //30 mountData.standingFrameCount = 1; mountData.standingFrameDelay = 12; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index c5acce5e78..eae2d63e46 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -37,6 +35,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); + // Timer to prevent Thanatos from dealing contact damage for a bit + private int noContactDamageTimer = 0; + private const float timeToOpenAndFireLasers = 36f; private const float segmentCloseTimerDecrement = 0.2f; @@ -94,6 +95,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); + writer.Write(noContactDamageTimer); writer.Write(vulnerable); writer.Write(npc.localAI[0]); writer.Write(npc.localAI[1]); @@ -106,6 +108,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { npc.chaseable = reader.ReadBoolean(); npc.dontTakeDamage = reader.ReadBoolean(); + noContactDamageTimer = reader.ReadInt32(); vulnerable = reader.ReadBoolean(); npc.localAI[0] = reader.ReadSingle(); npc.localAI[1] = reader.ReadSingle(); @@ -167,13 +170,24 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { + if (noContactDamageTimer > 0) + noContactDamageTimer--; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } + else + { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + } } else { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + npc.Opacity -= 0.05f; if (npc.Opacity < 0f) npc.Opacity = 0f; @@ -402,14 +416,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + // Do not deal contact damage for 5 seconds after spawning + if (npc.Calamity().newAI[2] == 0f) + noContactDamageTimer = 300; + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) npc.Calamity().newAI[2] += 1f; - // Deal no contact damage for the first 5 seconds - npc.damage = npc.defDamage; - if (npc.Calamity().newAI[2] < 300f) - npc.damage = 0; - // Homing only works if vulnerable is true npc.chaseable = vulnerable; @@ -513,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (dist4 < minDist) minDist = dist4; - return minDist <= 50f && npc.Opacity == 1f; + return minDist <= 50f && npc.Opacity == 1f && noContactDamageTimer <= 0; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 98ff6eafcc..c198d5813d 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -37,6 +35,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); + // Timer to prevent Thanatos from dealing contact damage for a bit + private int noContactDamageTimer = 0; + private const float timeToOpenAndFireLasers = 36f; private const float segmentCloseTimerDecrement = 0.2f; @@ -94,6 +95,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); + writer.Write(noContactDamageTimer); writer.Write(vulnerable); writer.Write(npc.localAI[0]); writer.Write(npc.localAI[1]); @@ -106,6 +108,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { npc.chaseable = reader.ReadBoolean(); npc.dontTakeDamage = reader.ReadBoolean(); + noContactDamageTimer = reader.ReadInt32(); vulnerable = reader.ReadBoolean(); npc.localAI[0] = reader.ReadSingle(); npc.localAI[1] = reader.ReadSingle(); @@ -167,13 +170,24 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { + if (noContactDamageTimer > 0) + noContactDamageTimer--; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } + else + { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + } } else { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + npc.Opacity -= 0.05f; if (npc.Opacity < 0f) npc.Opacity = 0f; @@ -402,14 +416,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + // Do not deal contact damage for 5 seconds after spawning + if (npc.Calamity().newAI[2] == 0f) + noContactDamageTimer = 300; + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) npc.Calamity().newAI[2] += 1f; - // Deal no contact damage for the first 5 seconds - npc.damage = npc.defDamage; - if (npc.Calamity().newAI[2] < 300f) - npc.damage = 0; - // Homing only works if vulnerable is true npc.chaseable = vulnerable; @@ -514,7 +527,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (dist4 < minDist) minDist = dist4; - return minDist <= 50f && npc.Opacity == 1f; + return minDist <= 50f && npc.Opacity == 1f && noContactDamageTimer <= 0; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index f73ea3bee6..258e69cab7 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1,8 +1,6 @@ using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; -using CalamityMod.NPCs.ExoMechs.Apollo; -using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -64,6 +62,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); + // Timer to prevent Thanatos from dealing contact damage for a bit + private int noContactDamageTimer = 0; + // Invincibility time for the first 10 seconds public const float immunityTime = 600f; @@ -158,6 +159,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); + writer.Write(noContactDamageTimer); writer.Write(chargeVelocityScalar); writer.Write(vulnerable); writer.Write(npc.localAI[0]); @@ -172,6 +174,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { npc.chaseable = reader.ReadBoolean(); npc.dontTakeDamage = reader.ReadBoolean(); + noContactDamageTimer = reader.ReadInt32(); chargeVelocityScalar = reader.ReadSingle(); vulnerable = reader.ReadBoolean(); npc.localAI[0] = reader.ReadSingle(); @@ -353,12 +356,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.dontTakeDamage = invisiblePhase; if (!invisiblePhase) { + if (noContactDamageTimer > 0) + noContactDamageTimer--; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } else { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + npc.Opacity -= 0.05f; if (npc.Opacity < 0f) npc.Opacity = 0f; @@ -804,14 +813,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos break; } + // Do not deal contact damage for 5 seconds after spawning + if (npc.localAI[3] == 0f) + noContactDamageTimer = 300; + if (npc.localAI[3] < immunityTime) npc.localAI[3] += 1f; - // Deal no contact damage for the first 5 seconds - npc.damage = npc.defDamage; - if (npc.localAI[3] < 300f) - npc.damage = 0; - // Homing only works if vulnerable is true npc.chaseable = vulnerable; @@ -890,7 +898,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (dist4 < minDist) minDist = dist4; - return minDist <= 50f && npc.Opacity == 1f; + return minDist <= 50f && npc.Opacity == 1f && noContactDamageTimer <= 0; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index f605b70dd5..39eaaf3dfb 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -36,6 +35,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); + // Timer to prevent Thanatos from dealing contact damage for a bit + private int noContactDamageTimer = 0; + private const float timeToOpenAndFireLasers = 36f; private const float segmentCloseTimerDecrement = 0.2f; @@ -93,6 +95,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { writer.Write(npc.chaseable); writer.Write(npc.dontTakeDamage); + writer.Write(noContactDamageTimer); writer.Write(vulnerable); writer.Write(npc.localAI[0]); writer.Write(npc.localAI[1]); @@ -105,6 +108,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { npc.chaseable = reader.ReadBoolean(); npc.dontTakeDamage = reader.ReadBoolean(); + noContactDamageTimer = reader.ReadInt32(); vulnerable = reader.ReadBoolean(); npc.localAI[0] = reader.ReadSingle(); npc.localAI[1] = reader.ReadSingle(); @@ -166,13 +170,24 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.npc[(int)npc.ai[1]].Opacity > 0.5f) { + if (noContactDamageTimer > 0) + noContactDamageTimer--; + npc.Opacity += 0.2f; if (npc.Opacity > 1f) npc.Opacity = 1f; } + else + { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + } } else { + // Deal no contact damage for 3 seconds after becoming visible + noContactDamageTimer = 185; + npc.Opacity -= 0.05f; if (npc.Opacity < 0f) npc.Opacity = 0f; @@ -401,14 +416,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + // Do not deal contact damage for 5 seconds after spawning + if (npc.Calamity().newAI[2] == 0f) + noContactDamageTimer = 300; + if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) npc.Calamity().newAI[2] += 1f; - // Deal no contact damage for the first 5 seconds - npc.damage = npc.defDamage; - if (npc.Calamity().newAI[2] < 300f) - npc.damage = 0; - // Homing only works if vulnerable is true npc.chaseable = vulnerable; @@ -513,7 +527,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (dist4 < minDist) minDist = dist4; - return minDist <= 45f && npc.Opacity == 1f; + return minDist <= 45f && npc.Opacity == 1f && noContactDamageTimer <= 0; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)