From fdfdd6410c56e0ddef4fb886c3052f736c145944 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 30 Jun 2021 05:12:29 -0500 Subject: [PATCH] 1 - T Hanos adjustments. 2 - Fixed some laser issues. --- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 7 ++-- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 7 ++-- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 34 +++++++++++-------- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 7 ++-- Projectiles/Boss/BirbAura.cs | 4 +-- Projectiles/Boss/BrimstoneRay.cs | 4 +-- Projectiles/Boss/ExoDestroyerBeamStart.cs | 32 ++++++++--------- Projectiles/Boss/ExoDestroyerBeamTelegraph.cs | 2 +- Projectiles/Boss/ExoDestroyerLaser.cs | 2 +- Projectiles/Boss/ProvidenceHolyRay.cs | 4 +-- 10 files changed, 52 insertions(+), 51 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index f4777b1b0f..336c494def 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -332,17 +332,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[0] += 1f; - if (npc.localAI[0] < maxSteamTime) + if (npc.localAI[0] < ThanatosHead.ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate; } } else diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 33d377f148..3c72d6c064 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -332,17 +332,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[0] += 1f; - if (npc.localAI[0] < maxSteamTime) + if (npc.localAI[0] < ThanatosHead.ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate; } } else diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 933b025751..1ba60c4c5a 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -52,6 +52,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Whether the head is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; + // Max time in vent phase + public const float ventDuration = 180f; + + // Spawn rate for vent clouds + public const int ventCloudSpawnRate = 5; + // Default life ratio for the other mechs private const float defaultLifeRatio = 5f; @@ -315,11 +321,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Phase gate values float velocityAdjustTime = 20f; - float speedUpTime = 480f; - float slowDownTime = 120f; + float speedUpTime = berserk ? 360f : 480f; + float slowDownTime = berserk ? 90f : 120f; float chargePhaseGateValue = speedUpTime + slowDownTime; - float laserBarrageDuration = 420f; + float laserBarrageDuration = berserk ? 330f : 420f; // Adjust opacity bool invisiblePhase = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune; @@ -361,8 +367,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float turnDegrees = baseVelocity * 0.11f; if (berserk) { - baseVelocity *= 1.2f; - turnDegrees *= 1.2f; + baseVelocity *= 1.25f; + turnDegrees *= 1.25f; } float turnSpeed = MathHelper.ToRadians(turnDegrees); float chargeVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar); @@ -380,7 +386,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float deathrayVelocityScalarIncrement = 1f / deathrayDuration; // Scalar to use during laser barrage, passive and immune phases - float laserBarrageVelocityScalarIncrement = 0.01f; + float laserBarrageVelocityScalarIncrement = berserk ? 0.02f : 0.01f; float laserBarrageVelocityScalarDecrement = 1f / velocityAdjustTime; // Distance from target @@ -547,7 +553,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= velocityAdjustTime) { - npc.localAI[0] = /*berserk ? 1f : 0f*/ 1f; + npc.localAI[0] = (berserk || otherExoMechsAlive == 0) ? 1f : 0f; AIState = (float)Phase.Charge; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; @@ -567,7 +573,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos vulnerable = true; // If close enough to the target, prepare to fire deathray - bool readyToFireDeathray = distanceFromTarget < 800f; + bool readyToFireDeathray = distanceFromTarget < 960f; if (readyToFireDeathray) npc.localAI[2] = 1f; @@ -599,8 +605,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Gradually turn and move slower if within 50 tiles of the target if (npc.localAI[2] == 1f) { - baseVelocity *= distanceFromTarget / 800f; - turnSpeed *= distanceFromTarget / 800f; + float velocityScale = distanceFromTarget / 960f; + baseVelocity *= velocityScale; + turnSpeed *= velocityScale; if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) { @@ -638,7 +645,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, 255, npc.whoAmI); + int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, npc.whoAmI); if (Main.projectile.IndexInRange(laser)) Main.projectile[laser].ai[0] = npc.whoAmI; } @@ -680,12 +687,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent"), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[1] += 1f; - if (npc.localAI[1] < maxSteamTime) + if (npc.localAI[1] < ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ventCloudSpawnRate; } } else diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 2f718d7be1..fefee3b33b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -331,17 +331,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[0] += 1f; - if (npc.localAI[0] < maxSteamTime) + if (npc.localAI[0] < ThanatosHead.ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate; } } else diff --git a/Projectiles/Boss/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index a57b17780b..908b1c6c34 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss if (num223 > 0f) { float num224 = 0f; - Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture.Width, 16); + Rectangle rectangle7 = new Rectangle(0, 0, texture.Width, texture.Height); while (num224 + 1f < num223) { if (num223 - num224 < rectangle7.Height) @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Boss spriteBatch.Draw(texture, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); num224 += rectangle7.Height * projectile.scale; value20 += projectile.velocity * rectangle7.Height * projectile.scale; - rectangle7.Y += 16; + rectangle7.Y += texture.Height; if (rectangle7.Y + rectangle7.Height > texture.Height) { rectangle7.Y = 0; diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 20fca4c374..642067453c 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Boss if (num223 > 0f) { float num224 = 0f; - Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); + Rectangle rectangle7 = new Rectangle(0, 0, texture2D20.Width, texture2D20.Height); while (num224 + 1f < num223) { if (num223 - num224 < rectangle7.Height) @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Boss spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); num224 += rectangle7.Height * projectile.scale; value20 += projectile.velocity * rectangle7.Height * projectile.scale; - rectangle7.Y += 16; + rectangle7.Y += texture2D20.Height; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { rectangle7.Y = 0; diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index 1c88e0cb97..7f8be06b35 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -24,14 +24,13 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { DisplayName.SetDefault("Thanatos Deathray"); - Main.projFrames[projectile.type] = 4; } public override void SetDefaults() { projectile.Calamity().canBreakPlayerDefense = true; - projectile.width = 32; - projectile.height = 32; + projectile.width = 30; + projectile.height = 30; projectile.hostile = true; projectile.alpha = 255; projectile.penetrate = -1; @@ -71,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); // Offset to move the beam forward so that it starts inside the NPC's mouth. - float beamStartForwardsOffset = -18f; + float beamStartForwardsOffset = -8f; // Set the starting location of the beam to the center of the NPC. projectile.Center = ThingToAttachTo.Center; @@ -80,11 +79,6 @@ namespace CalamityMod.Projectiles.Boss // Add the forwards offset, measured in pixels. projectile.position += hostNPCDirection * beamStartForwardsOffset; - projectile.rotation = ThingToAttachTo.velocity.ToRotation(); - - Time++; - - float scale = 1f; Time++; if (Time >= Lifetime) { @@ -92,13 +86,16 @@ namespace CalamityMod.Projectiles.Boss return; } - projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; + float scale = 1f; + projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; if (projectile.scale > scale) projectile.scale = scale; projectile.rotation = ThingToAttachTo.velocity.ToRotation(); projectile.velocity = projectile.rotation.ToRotationVector2(); + projectile.rotation = ThingToAttachTo.velocity.ToRotation() - MathHelper.PiOver2; + float arraySize = 3f; Vector2 samplingPoint = projectile.Center; float[] samples = new float[(int)arraySize]; @@ -121,6 +118,7 @@ namespace CalamityMod.Projectiles.Boss float divisor = expertMode ? 80f : 160f; if (ThingToAttachTo.Calamity().newAI[2] % divisor == 0f && projectile.owner == Main.myPlayer) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), ThingToAttachTo.Center); Vector2 velocity = projectile.velocity; velocity.Normalize(); float distanceBetweenProjectiles = malice ? 160f : death ? 256f : revenge ? 288f : 320f; @@ -134,7 +132,7 @@ namespace CalamityMod.Projectiles.Boss float radians = MathHelper.TwoPi / totalProjectiles; for (int j = 0; j < totalProjectiles; j++) { - Vector2 projVelocity = projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); + Vector2 projVelocity = projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; Projectile.NewProjectile(fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); } fireFrom += velocity * distanceBetweenProjectiles; @@ -197,11 +195,11 @@ namespace CalamityMod.Projectiles.Boss Texture2D beamEnd = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ExoDestroyerBeamEnd"); float drawLength = LengthOfLaser; - Color color = new Color(250, 0, 0, 0); + Color color = new Color(250, 100, 100, 0); // Draw start of beam Vector2 vector = projectile.Center - Main.screenPosition; - Rectangle? sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamStart.Width, 16); + Rectangle? sourceRectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamStart.Width, 30); spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, beamStart.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); // Draw middle of beam @@ -211,7 +209,7 @@ namespace CalamityMod.Projectiles.Boss if (drawLength > 0f) { float i = 0f; - Rectangle rectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamMiddle.Width, 16); + Rectangle rectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamMiddle.Width, 30); while (i + 1f < drawLength) { if (drawLength - i < rectangle.Height) @@ -222,7 +220,7 @@ namespace CalamityMod.Projectiles.Boss i += rectangle.Height * projectile.scale; center += projectile.velocity * rectangle.Height * projectile.scale; - rectangle.Y += 16; + rectangle.Y += 30; if (rectangle.Y + rectangle.Height > beamMiddle.Height) rectangle.Y = 0; } @@ -230,7 +228,7 @@ namespace CalamityMod.Projectiles.Boss // Draw end of beam Vector2 vector2 = center - Main.screenPosition; - sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamEnd.Width, 16); + sourceRectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamEnd.Width, 30); spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, beamEnd.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); return false; @@ -249,7 +247,7 @@ namespace CalamityMod.Projectiles.Boss return true; float collisionPoint = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 22f * projectile.scale, ref collisionPoint)) + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 30f * projectile.scale, ref collisionPoint)) return true; return false; diff --git a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs index cd9d0560cf..2d4932b5a6 100644 --- a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs +++ b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); // Offset to move the beam forward so that it starts inside the NPC's mouth. - float beamStartForwardsOffset = -18f; + float beamStartForwardsOffset = -8f; // Set the starting location of the beam to the center of the NPC. projectile.Center = ThingToAttachTo.Center; diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index f3456966c7..ea2ae5c374 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -237,7 +237,7 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return new Color(255, 255, 255, projectile.alpha); + return new Color(255, 100, 100, projectile.alpha); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index bd24c91aed..e83c2fa25c 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss if (num223 > 0f) { float num224 = 0f; - Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); + Rectangle rectangle7 = new Rectangle(0, 36 * (projectile.timeLeft / 3 % 4), texture2D20.Width, 36); while (num224 + 1f < num223) { if (num223 - num224 < rectangle7.Height) @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); num224 += rectangle7.Height * projectile.scale; value20 += projectile.velocity * rectangle7.Height * projectile.scale; - rectangle7.Y += 16; + rectangle7.Y += 36; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { rectangle7.Y = 0;