From b5dc0df3760be67c7008a7151dcc1b97fd7e42a1 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Tue, 22 Oct 2024 06:31:23 -0700 Subject: [PATCH] Player effects and enemy infliction --- Buffs/DamageOverTime/HadopelagicPressure.cs | 32 +++++++-------------- CalPlayer/CalamityPlayerDrawEffects.cs | 9 ++++-- CalPlayer/CalamityPlayerLifeRegen.cs | 1 + NPCs/Abyss/BobbitWormHead.cs | 2 +- NPCs/Abyss/ColossalSquid.cs | 2 +- NPCs/Abyss/EidolonWyrmHead.cs | 2 +- NPCs/Abyss/OarfishHead.cs | 2 +- NPCs/Abyss/ReaperShark.cs | 2 +- NPCs/PrimordialWyrm/PrimordialWyrmHead.cs | 2 +- 9 files changed, 23 insertions(+), 31 deletions(-) diff --git a/Buffs/DamageOverTime/HadopelagicPressure.cs b/Buffs/DamageOverTime/HadopelagicPressure.cs index a861ccc55a..3893bbf245 100644 --- a/Buffs/DamageOverTime/HadopelagicPressure.cs +++ b/Buffs/DamageOverTime/HadopelagicPressure.cs @@ -33,26 +33,8 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(PlayerDrawSet drawInfo) { Player Player = drawInfo.drawPlayer; - // A bit of blood - if (Main.rand.NextBool(30)) - { - int bloodLifetime = Main.rand.Next(22, 36); - float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); - Color bloodColor = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat()); - bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); - - if (Main.rand.NextBool(15)) - bloodScale *= 1.3f; - - float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 1.5f); - Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier; - bloodVelocity.Y -= 5f; - BloodParticle blood = new BloodParticle(Player.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); - GeneralParticleHandler.SpawnParticle(blood); - } - // Blue n black dust - Dust water = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Water, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.4f); + Dust water = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 390, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.4f); water.noGravity = true; water.velocity *= 0.75f; water.velocity.X *= 0.75f; @@ -62,11 +44,17 @@ namespace CalamityMod.Buffs.DamageOverTime water.noGravity = false; water.scale *= 0.5f; } - if (Main.rand.NextBool(5)) + if (Main.rand.NextBool(4)) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool() ? Color.DarkBlue : Color.Blue, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-3f, -4f)), Main.rand.NextBool() ? Color.DeepSkyBlue : Color.MediumBlue, new Vector2(0.8f, 1), 0, 0.09f, 0f, 45); GeneralParticleHandler.SpawnParticle(pulse); } + if (Main.rand.NextBool(10)) + { + Color smokeColor = Color.MediumBlue; + Particle smoke = new HeavySmokeParticle(Player.Calamity().RandomDebuffVisualSpot, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } } internal static void DrawEffects(NPC npc, ref Color drawColor) @@ -75,7 +63,7 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(13)) { Color smokeColor = Color.MediumBlue; - Particle smoke = new HeavySmokeParticle(npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); + Particle smoke = new HeavySmokeParticle(npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f) + (0.00000013f * npc.width * npc.height), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true); GeneralParticleHandler.SpawnParticle(smoke); } Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 360, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f); diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 33b65d6b27..5dc228856e 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -255,6 +255,9 @@ namespace CalamityMod.CalPlayer if (drawInfo.shadow == 0f && (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire)) HolyFlames.DrawEffects(drawInfo); + if (calamityPlayer.hadopelagicpressure && drawInfo.shadow == 0f) + HadopelagicPressure.DrawEffects(drawInfo); + // Icarus' Folly has visual effects but they are mutually exclusive with all Holy Flames variations to prevent visual clutter else if (calamityPlayer.icarusFolly && drawInfo.shadow == 0f) IcarusFolly.DrawEffects(drawInfo); @@ -269,9 +272,6 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage); - if (calamityPlayer.voidfrost && drawInfo.shadow == 0f) - Voidfrost.DrawEffects(drawInfo); - if (calamityPlayer.pFlames && drawInfo.shadow == 0f) Plague.DrawEffects(drawInfo); @@ -300,6 +300,9 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.vermillionFlux && drawInfo.shadow == 0f) VermillionFlux.DrawEffects(drawInfo); + if (calamityPlayer.voidfrost && drawInfo.shadow == 0f) + Voidfrost.DrawEffects(drawInfo); + if (calamityPlayer.vHex && drawInfo.shadow == 0f) VulnerabilityHex.DrawEffects(drawInfo); #endregion diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 355f877134..12fd94b098 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -112,6 +112,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(vHex, 35); ApplyDoTDebuff(trueVHex, 50); ApplyDoTDebuff(cDepth, 18, purity); + ApplyDoTDebuff(hadopelagicpressure, 40, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity); ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity); ApplyDoTDebuff(cragsLava, 30); diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 7d28b94911..5a5095e12b 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -256,7 +256,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 300, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 569955cea9..6a5b4acd13 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -624,7 +624,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 300, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 658b2aad26..9bcd93843b 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -512,7 +512,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 300, true); } } } diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 20a9467a9b..a1876b577a 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 90); } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index 57d5e59a7b..e89c7c779c 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -709,7 +709,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 300, true); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 690eb437ff..aa29f2cc64 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -1505,7 +1505,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (NPC.Opacity == 1f && hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 1200, true); + target.AddBuff(ModContent.BuffType(), 1200, true); } } }