From 8a9a8d000b2318432a6e189f060544070e3c9e39 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Sat, 29 Oct 2022 12:08:16 -0400 Subject: [PATCH 1/5] Fixed certain enemies not spawning during Blood Moons and ongoing invasions regardless if the player is near them or not --- NPCs/CalamityGlobalNPC.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bf5ffee473..a720944b9d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5778,18 +5778,20 @@ namespace CalamityMod.NPCs #endregion #region Any Events - public static bool AnyEvents(Player player) + public static bool AnyEvents(Player player, bool checkBloodMoon = false) { - if (Main.invasionType > InvasionID.None) + if (Main.invasionType > InvasionID.None && Main.invasionProgressNearInvasion) return true; if (player.PillarZone()) return true; - if (DD2Event.Ongoing) + if (DD2Event.Ongoing && player.ZoneOldOneArmy) return true; - if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.bloodMoon || Main.pumpkinMoon || Main.snowMoon)) + if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.pumpkinMoon || Main.snowMoon)) return true; if (AcidRainEvent.AcidRainEventIsOngoing && player.InSulphur()) return true; + if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && Main.bloodMoon && checkBloodMoon) + return true; return false; } #endregion From df50644bb7a10b4db9653439204d6230e78ef174 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Wed, 26 Oct 2022 22:27:39 -0400 Subject: [PATCH 2/5] added lifesteal cooldown visual --- CalPlayer/CalamityPlayer.cs | 12 ++++++++++++ Cooldowns/LifeSteal.cs | 15 +++++++++++++++ Cooldowns/LifeSteal.png | Bin 0 -> 223 bytes Cooldowns/LifeStealOutline.png | Bin 0 -> 196 bytes Cooldowns/LifeStealOverlay.png | Bin 0 -> 192 bytes 5 files changed, 27 insertions(+) create mode 100644 Cooldowns/LifeSteal.cs create mode 100644 Cooldowns/LifeSteal.png create mode 100644 Cooldowns/LifeStealOutline.png create mode 100644 Cooldowns/LifeStealOverlay.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1429a2ecaa..6cf0e996d9 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3414,6 +3414,18 @@ namespace CalamityMod.CalPlayer break; } } + + // Add a cooldown display for the vanilla lifesteal cooldown, which is active when negative + if (Player.lifeSteal < 0f) + { + float duration = Player.lifeSteal; + float baseCooldown = Main.expertMode ? 0.5f : 0.6f; + float lifeStealNerf = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; + duration /= baseCooldown - lifeStealNerf; + duration *= -1f; + if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < (int)duration)) + Player.AddCooldown(LifeSteal.ID, (int)duration); + } } ForceVariousEffects(); diff --git a/Cooldowns/LifeSteal.cs b/Cooldowns/LifeSteal.cs new file mode 100644 index 0000000000..9f3c48b1aa --- /dev/null +++ b/Cooldowns/LifeSteal.cs @@ -0,0 +1,15 @@ +using Microsoft.Xna.Framework; + +namespace CalamityMod.Cooldowns +{ + public class LifeSteal : CooldownHandler + { + public static new string ID => "LifeSteal"; + public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && instance.player.lifeSteal < 0f; + public override string DisplayName => "Life Steal Cooldown"; + public override string Texture => "CalamityMod/Cooldowns/LifeSteal"; + public override Color OutlineColor => new Color(255, 142, 165); + public override Color CooldownStartColor => Color.Lerp(new Color(255, 216, 216), new Color(255, 117, 117), instance.Completion); + public override Color CooldownEndColor => Color.Lerp(new Color(255, 216, 216), new Color(255, 117, 117), instance.Completion); + } +} diff --git a/Cooldowns/LifeSteal.png b/Cooldowns/LifeSteal.png new file mode 100644 index 0000000000000000000000000000000000000000..ff204d7181e94f4aa3d6424a77c038871581979b GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQajKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij?1AIbUqgh#h_xFEMQd+>td6|djM_?dOMybis3P`b+1o;L32LlEvZ)P{3 z5NCl$WHAE+-(e7DJf6QI1t{p?>Ealo5!`#;kc+{9gV|y2#sBs@Il`SFvm1s)r)C1pV(@hJb6Mw< G&;$SnD@2O` literal 0 HcmV?d00001 diff --git a/Cooldowns/LifeStealOutline.png b/Cooldowns/LifeStealOutline.png new file mode 100644 index 0000000000000000000000000000000000000000..86633b605abfec391f49143bafbfcea39a488857 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>VM%xNb!1@J z*w6hZkrl{i3-AeX{r~?zkQsXDavhLjDhcun{?G7qyMY&w$64SJSN`m}?|1&(@Zr}yvaTa()7BevL9R^{>yg{lB%mnJP@t$H Date: Thu, 27 Oct 2022 11:40:01 -0400 Subject: [PATCH 3/5] cooldown no longer is tied to the vanilla cooldown config since there's no vanilla buff --- CalPlayer/CalamityPlayer.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6cf0e996d9..ce19dd17d6 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3414,18 +3414,18 @@ namespace CalamityMod.CalPlayer break; } } + } - // Add a cooldown display for the vanilla lifesteal cooldown, which is active when negative - if (Player.lifeSteal < 0f) - { - float duration = Player.lifeSteal; - float baseCooldown = Main.expertMode ? 0.5f : 0.6f; - float lifeStealNerf = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; - duration /= baseCooldown - lifeStealNerf; - duration *= -1f; - if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < (int)duration)) - Player.AddCooldown(LifeSteal.ID, (int)duration); - } + // Add a cooldown display for the vanilla lifesteal cooldown, which is active when negative + if (Player.whoAmI == Main.myPlayer && Player.lifeSteal < 0f) + { + float duration = Player.lifeSteal; + float baseCooldown = Main.expertMode ? 0.5f : 0.6f; + float lifeStealNerf = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; + duration /= baseCooldown - lifeStealNerf; + duration *= -1f; + if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < (int)duration)) + Player.AddCooldown(LifeSteal.ID, (int)duration); } ForceVariousEffects(); From 2739f5275630893746707f3ca09da5aa82a1a225 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:41:24 -0400 Subject: [PATCH 4/5] forgot to remove this check --- Cooldowns/LifeSteal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cooldowns/LifeSteal.cs b/Cooldowns/LifeSteal.cs index 9f3c48b1aa..0cb11b571e 100644 --- a/Cooldowns/LifeSteal.cs +++ b/Cooldowns/LifeSteal.cs @@ -5,7 +5,7 @@ namespace CalamityMod.Cooldowns public class LifeSteal : CooldownHandler { public static new string ID => "LifeSteal"; - public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && instance.player.lifeSteal < 0f; + public override bool ShouldDisplay => instance.player.lifeSteal < 0f; public override string DisplayName => "Life Steal Cooldown"; public override string Texture => "CalamityMod/Cooldowns/LifeSteal"; public override Color OutlineColor => new Color(255, 142, 165); From b0e3c16c02bbe0d3c9b7d791453aa3f8be667e40 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 31 Oct 2022 08:51:35 -0500 Subject: [PATCH 5/5] 1 - Sepulcher no longer deletes projectiles. --- NPCs/SupremeCalamitas/SepulcherBody.cs | 15 --------------- NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs | 15 --------------- NPCs/SupremeCalamitas/SepulcherHead.cs | 15 --------------- NPCs/SupremeCalamitas/SepulcherTail.cs | 15 --------------- 4 files changed, 60 deletions(-) diff --git a/NPCs/SupremeCalamitas/SepulcherBody.cs b/NPCs/SupremeCalamitas/SepulcherBody.cs index a9c2f05aca..63e70e5222 100644 --- a/NPCs/SupremeCalamitas/SepulcherBody.cs +++ b/NPCs/SupremeCalamitas/SepulcherBody.cs @@ -113,21 +113,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x)) - { - if (projectile.penetrate == -1 && !projectile.minion) - { - projectile.penetrate = 1; - } - else if (projectile.penetrate >= 1) - { - projectile.penetrate = 1; - } - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs index 7ea9afb07a..cd9473268d 100644 --- a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs +++ b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs @@ -132,21 +132,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x)) - { - if (projectile.penetrate == -1 && !projectile.minion) - { - projectile.penetrate = 1; - } - else if (projectile.penetrate >= 1) - { - projectile.penetrate = 1; - } - } - } - public override void FindFrame(int frameHeight) { NPC.frameCounter++; diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 445bb73802..c272e37e4f 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -337,21 +337,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas return false; } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x)) - { - if (projectile.penetrate == -1 && !projectile.minion) - { - projectile.penetrate = 1; - } - else if (projectile.penetrate >= 1) - { - projectile.penetrate = 1; - } - } - } - public override bool CheckActive() { return false; diff --git a/NPCs/SupremeCalamitas/SepulcherTail.cs b/NPCs/SupremeCalamitas/SepulcherTail.cs index f293098ba7..7893de23af 100644 --- a/NPCs/SupremeCalamitas/SepulcherTail.cs +++ b/NPCs/SupremeCalamitas/SepulcherTail.cs @@ -163,21 +163,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas return false; } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => projectile.type != x)) - { - if (projectile.penetrate == -1 && !projectile.minion) - { - projectile.penetrate = 1; - } - else if (projectile.penetrate >= 1) - { - projectile.penetrate = 1; - } - } - } - public override void HitEffect(int hitDirection, double damage) { if (NPC.life <= 0)