From 5a80f8858401f0ba4898d9164ea8285996689284 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 29 Jun 2020 21:42:14 -0500 Subject: [PATCH] 1 - Fixed an oversight/bug with contact and projectile damage reduction. 2 - Tried to fix Provi crystal in multiplayer again omegalul. 3 - Ravager stomp fix. 4 - Ceaseless Void tile enrage adjusted. 5 - Boss Rush EoW HP increased a lot. 6 - Tried to fix Provi cocoon flames/stars in multiplayer. --- CalPlayer/CalamityPlayer.cs | 7 ++- CalamityMod.cs | 4 +- NPCs/CalamityAI.cs | 8 ++-- NPCs/CalamityGlobalNPC.cs | 6 +-- NPCs/Providence/Providence.cs | 10 ++++- NPCs/Ravager/RavagerBody.cs | 4 +- Projectiles/Boss/DoGBeamPortal.cs | 65 +++++++++++++-------------- Projectiles/Boss/HolyBurnOrb.cs | 12 +++-- Projectiles/Boss/HolyLight.cs | 13 +++--- Projectiles/Boss/ProvidenceCrystal.cs | 3 -- 10 files changed, 64 insertions(+), 68 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c046eb754a..1d9d009eda 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5815,7 +5815,7 @@ namespace CalamityMod.CalPlayer } else { - float amount = npc.velocity.Length() / (npc.Calamity().maxVelocity * 0.4f); + float amount = npc.velocity.Length() / (npc.Calamity().maxVelocity * 0.5f); if (amount > 1f) amount = 1f; @@ -5908,7 +5908,7 @@ namespace CalamityMod.CalPlayer if (DRStat > 0) contactDamageReduction *= 1f - (DRStat * 0.01f); - contactDamageReduction = 1D - (1D / (1D + contactDamageReduction)); + contactDamageReduction = 1D / (1D + contactDamageReduction); damage = (int)(damage * contactDamageReduction); } @@ -6137,7 +6137,7 @@ namespace CalamityMod.CalPlayer if (DRStat > 0) projectileDamageReduction *= 1f - (DRStat * 0.01f); - projectileDamageReduction = 1D - (1D / (1D + projectileDamageReduction)); + projectileDamageReduction = 1D / (1D + projectileDamageReduction); damage = (int)(damage * projectileDamageReduction); } @@ -9289,7 +9289,6 @@ namespace CalamityMod.CalPlayer #endregion #region Drawing - public static readonly PlayerLayer MiscEffectsBack = new PlayerLayer("CalamityMod", "MiscEffectsBack", PlayerLayer.MiscEffectsBack, delegate (PlayerDrawInfo drawInfo) { if (drawInfo.shadow != 0f) diff --git a/CalamityMod.cs b/CalamityMod.cs index 82d5a2af85..0a6ea28421 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -132,8 +132,8 @@ namespace CalamityMod // Boss velocity scaling data structure public static SortedDictionary bossVelocityDamageScaleValues; - public const float velocityScaleMin = 0.6f; - public const float bitingEnemeyVelocityScale = 0.9f; + public const float velocityScaleMin = 0.5f; + public const float bitingEnemeyVelocityScale = 0.8f; // Lists public static IList donatorList; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index c4e2fbc8cc..b5c4289c96 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3516,7 +3516,7 @@ namespace CalamityMod.NPCs tileEnrageMult += (800 - nearbyActiveTiles) * 0.001f; // Ranges from 1f to 1.8f // Increase projectile fire rate based on number of nearby active tiles - float projectileFireRateMultiplier = MathHelper.Lerp(1f, 2f, 1f - ((tileEnrageMult - 1f) / 0.8f)); + float projectileFireRateMultiplier = MathHelper.Lerp(1f, 4f, 1f - ((tileEnrageMult - 1f) / 0.8f)); // Increase damage of projectiles and contact damage based on number of nearby active tiles int damageIncrease = 0; @@ -3534,7 +3534,7 @@ namespace CalamityMod.NPCs num474 *= 1.25f; npc.ai[0] += 1f; - if (npc.ai[0] >= 60f * projectileFireRateMultiplier) + if (npc.ai[0] >= 45f * projectileFireRateMultiplier) { npc.ai[0] = 0f; @@ -3586,7 +3586,7 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) calamityGlobalNPC.newAI[1] += 2f; - if (calamityGlobalNPC.newAI[1] >= 900f * projectileFireRateMultiplier) + if (calamityGlobalNPC.newAI[1] >= 600f * projectileFireRateMultiplier) { calamityGlobalNPC.newAI[1] = 0f; int damage = (expertMode ? CalamityUtils.GetMasterModeProjectileDamage(50, 1.5) : 60) + damageIncrease; @@ -3603,7 +3603,7 @@ namespace CalamityMod.NPCs int num946 = ModContent.ProjectileType(); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, damage, 0f, Main.myPlayer, 0f, 0f); + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, damage, 0f, Main.myPlayer, tileEnrageMult, 0f); Main.projectile[num947].timeLeft = 300; npc.netUpdate = true; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 973505ffc3..8e32715a40 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -218,9 +218,9 @@ namespace CalamityMod.NPCs { NPCID.GolemFistLeft, 250000 }, { NPCID.GolemFistRight, 250000 }, - { NPCID.EaterofWorldsHead, 2500000 }, // 30 seconds - { NPCID.EaterofWorldsBody, 2500000 }, - { NPCID.EaterofWorldsTail, 2500000 }, + { NPCID.EaterofWorldsHead, 15000000 }, // 30 seconds + { NPCID.EaterofWorldsBody, 15000000 }, + { NPCID.EaterofWorldsTail, 15000000 }, // Tier 2 { NPCID.TheDestroyer, 2500000 }, // 30 seconds + immunity timer at start diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 50fc136e59..1a55d6dbd7 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -214,6 +214,7 @@ namespace CalamityMod.NPCs.Providence // Phase times float phaseTime = nightTime ? 240f : 300f; float crystalPhaseTime = nightTime ? 60f : 120f; + int nightCrystalTime = 210; float attackDelayAfterCocoon = 90f; // Phases @@ -1190,9 +1191,14 @@ namespace CalamityMod.NPCs.Providence if (npc.ai[1] >= crystalPhaseTime) { if (npc.ai[1] == crystalPhaseTime && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, 0f, 0f); + { + int proj = Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, 0f, 0f); - if (npc.ai[1] >= crystalPhaseTime + 210f || !nightTime) + if (nightTime) + Main.projectile[proj].timeLeft = nightCrystalTime; + } + + if (npc.ai[1] >= crystalPhaseTime + nightCrystalTime || !nightTime) npc.ai[0] = -1f; } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index ba6efe3381..a03b512b93 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -561,10 +561,10 @@ namespace CalamityMod.NPCs.Ravager float amount = death ? 1f : 1f - lifeRatio; Vector2 targetVector = player.position; + float aimY = targetVector.Y - 320f; if (npc.ai[0] == 2f && npc.ai[1] == 0f) { - float aimY = targetVector.Y - 320f; if (npc.Top.Y > aimY) { if (npc.velocity.Y > 0f) @@ -584,7 +584,7 @@ namespace CalamityMod.NPCs.Ravager if (Math.Abs(player.velocity.X) < 0.5f) npc.Calamity().newAI[2] = 0f; - if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset) || npc.ai[1] > 0f) + if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (npc.Top.Y <= aimY || npc.ai[0] != 2f)) || npc.ai[1] > 0f) { if (npc.ai[0] == 2f) { diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index 844466f5c0..89e6fa7364 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -56,43 +56,40 @@ namespace CalamityMod.Projectiles.Boss if (beamTimer <= 0) { Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); - float spread = 30f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - if (projectile.owner == Main.myPlayer) - { - for (i = 0; i < 4; i++) - { - float speed = 4f; - int seeProjFileforDmg = 0; - if (CalamityWorld.death) - { - speed = 7f; - } - else if (CalamityWorld.revenge) - { - speed = 6f; - } - else if (Main.expertMode) - { - speed = 5f; - } - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * speed), (float)(Math.Cos(offsetAngle) * speed), ModContent.ProjectileType(), seeProjFileforDmg, projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * speed), (float)(-Math.Cos(offsetAngle) * speed), ModContent.ProjectileType(), seeProjFileforDmg, projectile.knockBack, projectile.owner, 0f, 0f); - } - } + if (projectile.owner == Main.myPlayer) + { + float speed = 3f; + int seeProjFileforDmg = 0; + if (CalamityWorld.death) + { + speed = 5f; + } + else if (CalamityWorld.revenge) + { + speed = 4.5f; + } + else if (Main.expertMode) + { + speed = 4f; + } + speed *= projectile.ai[0]; + int totalProjectiles = 8; + float radians = MathHelper.TwoPi / totalProjectiles; + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 vector255 = new Vector2(0f, -speed).RotatedBy(radians * i); + Projectile.NewProjectile(projectile.Center, vector255, ModContent.ProjectileType(), seeProjFileforDmg, 0f, projectile.owner, 0f, 0f); + } + } beamTimer = 180; } - int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); + int num103 = Player.FindClosest(projectile.Center, 1, 1); float scaleFactor2 = projectile.velocity.Length(); Vector2 vector11 = Main.player[num103].Center - projectile.Center; if (Vector2.Distance(Main.player[num103].Center, projectile.Center) > 2000f) { - projectile.position.X = (float)(Main.player[num103].Center.X / 16) * 16f - (float)(projectile.width / 2); - projectile.position.Y = (float)(Main.player[num103].Center.Y / 16) * 16f - (float)(projectile.height / 2) - 250f; + projectile.position.X = Main.player[num103].Center.X / 16 * 16f - (projectile.width / 2); + projectile.position.Y = Main.player[num103].Center.Y / 16 * 16f - (projectile.height / 2) - 250f; projectile.ai[1] = 0f; beamTimer = 90; } @@ -112,7 +109,7 @@ namespace CalamityMod.Projectiles.Boss if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 60; num623++) @@ -142,8 +139,8 @@ namespace CalamityMod.Projectiles.Boss if (projectile.timeLeft < 85) { byte b2 = (byte)(projectile.timeLeft * 3); - byte a2 = (byte)(100f * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); + byte a2 = (byte)(100f * (b2 / 255f)); + return new Color(b2, b2, b2, a2); } return new Color(255, 255, 255, 100); } diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index f91036b4bb..eb6db64052 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -45,13 +45,11 @@ namespace CalamityMod.Projectiles.Boss if (projectile.velocity.Length() < 16f) projectile.velocity *= 1.01f; - int num487 = Player.FindClosest(projectile.position, projectile.width, projectile.height); - Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490); + projectile.ai[1] = Player.FindClosest(projectile.position, projectile.width, projectile.height); + int num487 = (int)projectile.ai[1]; + float num491 = Vector2.Distance(Main.player[num487].Center, projectile.Center); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) + if (num491 < 50f && !Main.player[num487].dead && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) { int num492 = expertMode ? -150 : -100; if (CalamityWorld.death || CalamityWorld.bossRushActive) @@ -69,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss { Main.player[num487].KillMe(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " burst into sinless ash."), 1000.0, 0, false); } - NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, num492); projectile.Kill(); } } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 60847743e8..a90f4bd63f 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -41,12 +41,11 @@ namespace CalamityMod.Projectiles.Boss if (projectile.velocity.Length() < 16f) projectile.velocity *= 1.01f; - int num487 = Player.FindClosest(projectile.position, projectile.width, projectile.height); - Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) + projectile.ai[1] = Player.FindClosest(projectile.position, projectile.width, projectile.height); + int num487 = (int)projectile.ai[1]; + float num491 = Vector2.Distance(Main.player[num487].Center, projectile.Center); + + if (num491 < 50f && !Main.player[num487].dead && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) { int num492 = expertMode ? 50 : 35; Main.player[num487].HealEffect(num492, false); @@ -55,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss { Main.player[num487].statLife = Main.player[num487].statLifeMax2; } - NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, num492); projectile.Kill(); } } diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index a1751ddb0b..5680c48c3d 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -48,9 +48,6 @@ namespace CalamityMod.Projectiles.Boss return; } - if (!Main.dayTime) - projectile.timeLeft -= CalamityWorld.death ? 9 : 16; - projectile.position.X = Main.player[projectile.owner].Center.X - (projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].Center.Y - (projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 360f; if (Main.player[projectile.owner].gravDir == -1f)