diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 045e6e8c9d..569571129f 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -170,13 +170,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -189,8 +189,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index f99563191e..3a458b9bc0 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -220,13 +220,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -238,8 +238,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 120, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120, true); } } } diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index c6d822fba8..ec9612a6eb 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -170,13 +170,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -187,8 +187,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 90, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 90, true); } } } diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 2ee30a1eb6..406217e360 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -109,13 +109,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(ModContent.NPCType()) < 1) { diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 4c1d0a5224..7559259950 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -603,13 +603,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -644,8 +644,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 300, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 300, true); } } } diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index e56551c93e..24f1e4cc7f 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -449,13 +449,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -511,8 +511,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 240, true); } } } diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 96f39acaa8..a9732fa936 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -545,13 +545,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -585,8 +585,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 82e8de97e9..2397731dab 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -578,15 +578,15 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(NPC.HitInfo hit) { - for (int k = 0; k < damage / NPC.lifeMax * 100.0; k++) + for (int k = 0; k < hit.Damage / NPC.lifeMax * 100.0; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 5cb10e0f68..b05c130dd4 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -165,13 +165,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -188,8 +188,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 90, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 90, true); } } } diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 834929e9ea..a852a00745 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -164,13 +164,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -209,8 +209,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 60, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 60, true); } } } diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 7b1723aadd..2ed306db01 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -165,13 +165,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -187,8 +187,8 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 60, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 60, true); } } } diff --git a/NPCs/PlagueEnemies/Melter.cs b/NPCs/PlagueEnemies/Melter.cs index ca0653c161..a3f6aa3d14 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -66,22 +66,22 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/PlagueEnemies/PestilentSlime.cs b/NPCs/PlagueEnemies/PestilentSlime.cs index b77ba4ab14..fb0e987633 100644 --- a/NPCs/PlagueEnemies/PestilentSlime.cs +++ b/NPCs/PlagueEnemies/PestilentSlime.cs @@ -129,14 +129,14 @@ namespace CalamityMod.NPCs.PlagueEnemies { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } } } @@ -149,8 +149,8 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index 7241d36646..dd20a6df2f 100644 --- a/NPCs/PlagueEnemies/PlagueCharger.cs +++ b/NPCs/PlagueEnemies/PlagueCharger.cs @@ -130,22 +130,22 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 120, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index f7d0398ab0..4fe11c9490 100644 --- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs +++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs @@ -130,22 +130,22 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 94fc31e0f3..44b455d8d1 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -617,7 +617,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -665,8 +665,8 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 240, true); } } } diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index d07ef3e9fc..ac5c2237de 100644 --- a/NPCs/PlagueEnemies/Plagueshell.cs +++ b/NPCs/PlagueEnemies/Plagueshell.cs @@ -57,14 +57,14 @@ namespace CalamityMod.NPCs.PlagueEnemies { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { @@ -86,8 +86,8 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 3, 4); diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index f42e61c5f8..9ec25f7aca 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -182,22 +182,22 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 08add555a3..6b39d99c44 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -246,15 +246,15 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) + if (hurtInfo.Damage > 0) { if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { - player.AddBuff(ModContent.BuffType(), 240, true); - player.AddBuff(BuffID.Poisoned, 240, true); - player.AddBuff(BuffID.Venom, 240, true); + target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(BuffID.Poisoned, 240, true); + target.AddBuff(BuffID.Venom, 240, true); } - player.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 240, true); } } @@ -262,13 +262,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 64f9ebc095..53a3a368df 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -131,15 +131,15 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) + if (hurtInfo.Damage > 0) { if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { - player.AddBuff(ModContent.BuffType(), 300, true); - player.AddBuff(BuffID.Poisoned, 300, true); - player.AddBuff(BuffID.Venom, 300, true); + target.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(BuffID.Poisoned, 300, true); + target.AddBuff(BuffID.Venom, 300, true); } - player.AddBuff(ModContent.BuffType(), 300, true); + target.AddBuff(ModContent.BuffType(), 300, true); } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index d7e053bf64..3c11eeb40b 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1117,7 +1117,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 2; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -1320,15 +1320,15 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) + if (hurtInfo.Damage > 0) { if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { - player.AddBuff(ModContent.BuffType(), 480, true); - player.AddBuff(BuffID.Poisoned, 480, true); - player.AddBuff(BuffID.Venom, 480, true); + target.AddBuff(ModContent.BuffType(), 480, true); + target.AddBuff(BuffID.Poisoned, 480, true); + target.AddBuff(BuffID.Venom, 480, true); } - player.AddBuff(ModContent.BuffType(), 480, true); + target.AddBuff(ModContent.BuffType(), 480, true); } } } diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 656774e4fa..cd9aac3b70 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.Polterghast public override void HitEffect(NPC.HitInfo hit) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { NPC.position.X = NPC.position.X + (NPC.width / 2); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 7a656a41f5..cade633e01 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -518,8 +518,8 @@ namespace CalamityMod.NPCs.Polterghast public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.MoonLeech, 360, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.MoonLeech, 360, true); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -536,7 +536,7 @@ namespace CalamityMod.NPCs.Polterghast public override void HitEffect(NPC.HitInfo hit) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { NPC.position.X = NPC.position.X + (NPC.width / 2); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 4ac2dc3624..3efb6bbfc5 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1333,8 +1333,8 @@ namespace CalamityMod.NPCs.Polterghast public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.MoonLeech, 900, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.MoonLeech, 900, true); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -1351,7 +1351,7 @@ namespace CalamityMod.NPCs.Polterghast public override void HitEffect(NPC.HitInfo hit) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Ectoplasm, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Ectoplasm, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { NPC.position.X = NPC.position.X + (NPC.width / 2); diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 35672ae0fe..00a6d188fa 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -476,13 +476,13 @@ namespace CalamityMod.NPCs.Polterghast { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 180, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index ed8d4c4acf..4c368a861f 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -1195,8 +1195,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 300, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 300, true); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)/* tModPorter Note: bossLifeScale -> balance (bossAdjustment is different, see the docs for details) */ @@ -1208,7 +1208,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -1221,7 +1221,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } for (int k = 0; k < 50; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 9b17dd50ff..69aebb9d81 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -897,8 +897,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 240, true); } public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) @@ -921,7 +921,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -934,7 +934,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } for (int k = 0; k < 50; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index e228cd20dd..932250ee81 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -580,14 +580,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -600,7 +600,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } for (int k = 0; k < 50; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index d72076e8eb..482e921240 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -330,8 +330,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 120, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120, true); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -359,7 +359,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } for (int k = 0; k < 30; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 144ce46f1a..8748ad20d7 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.Providence public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.Providence } for (int k = 0; k < 30; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 352aead50f..5195a086c3 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Providence public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.Providence } for (int k = 0; k < 50; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 3589b24fb2..3ed0046489 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -177,7 +177,7 @@ namespace CalamityMod.NPCs.Providence public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.Providence } for (int k = 0; k < 30; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index e8226dde46..0c0533de05 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -2451,7 +2451,7 @@ namespace CalamityMod.NPCs.Providence int dustType = ProvUtils.GetDustID(currentMode); for (int k = 0; k < 15; k++) { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, hitDirection, -1f, 0, default, 1f); + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, hit.HitDirection, -1f, 0, default, 1f); Main.dust[dust].noGravity = true; } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 9a04730f24..765b50cf83 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -870,8 +870,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 2f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 2f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -885,8 +885,8 @@ namespace CalamityMod.NPCs.Ravager } for (int k = 0; k < 50; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 5, hitDirection, -1f, 0, default, 2f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 5, hit.HitDirection, -1f, 0, default, 2f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } } } @@ -960,8 +960,8 @@ namespace CalamityMod.NPCs.Ravager public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 480, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 480, true); } public override void BossLoot(ref string name, ref int potionType) diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 0d3ffd317d..82f6310760 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -294,8 +294,8 @@ namespace CalamityMod.NPCs.Ravager public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 240, true); } public override void HitEffect(NPC.HitInfo hit) @@ -303,9 +303,9 @@ namespace CalamityMod.NPCs.Ravager if (NPC.life > 0) { int num285 = 0; - while (num285 < damage / NPC.lifeMax * 100.0) + while (num285 < hit.Damage / NPC.lifeMax * 100.0) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 79cee16b97..d3043be270 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -295,8 +295,8 @@ namespace CalamityMod.NPCs.Ravager public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 240, true); } public override void HitEffect(NPC.HitInfo hit) @@ -304,9 +304,9 @@ namespace CalamityMod.NPCs.Ravager if (NPC.life > 0) { int num285 = 0; - while (num285 < damage / NPC.lifeMax * 100.0) + while (num285 < hit.Damage / NPC.lifeMax * 100.0) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 337736581e..796efdd3e7 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -113,9 +113,9 @@ namespace CalamityMod.NPCs.Ravager if (NPC.life > 0) { int num285 = 0; - while ((double)num285 < damage / (double)NPC.lifeMax * 100.0) + while ((double)num285 < hit.Damage / (double)NPC.lifeMax * 100.0) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, (float)hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, (float)hit.HitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index e62b0f6ead..a0125f693f 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -193,8 +193,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -206,8 +206,8 @@ namespace CalamityMod.NPCs.Ravager } for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 3bfb34b4af..26364cc5f2 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -77,8 +77,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -89,8 +89,8 @@ namespace CalamityMod.NPCs.Ravager } for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index d1acbff368..e0fe96a5bb 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -79,8 +79,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -91,8 +91,8 @@ namespace CalamityMod.NPCs.Ravager } for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index e09287bc2a..5048579167 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -128,9 +128,10 @@ namespace CalamityMod.NPCs.Ravager public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage <= 0) + if (hurtInfo.Damage <= 0) return; - player.AddBuff(ModContent.BuffType(), 240, true); + + target.AddBuff(ModContent.BuffType(), 240, true); SoundEngine.PlaySound(SoundID.Item14, NPC.Center); NPC.ai[0] = 0f; NPC.life = 0; diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 73b366b38a..da2f2b6fe6 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.Signus { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 204, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 204, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 7371b02d00..aec8f60824 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -951,7 +951,7 @@ namespace CalamityMod.NPCs.Signus { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -1014,8 +1014,8 @@ namespace CalamityMod.NPCs.Signus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 420, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 420, true); } } } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index f974b13d6a..a40c7807fc 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } } public override void OnKill() @@ -86,8 +86,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Weak, 90, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Weak, 90, true); } } } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index c44f4a3d17..50e6baf533 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -48,13 +48,13 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } } } @@ -92,8 +92,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Weak, 90, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Weak, 90, true); } } } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index ddc548fc06..4bd2ff5ec1 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -63,13 +63,13 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } } } @@ -107,8 +107,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Darkness, 90, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Darkness, 90, true); } } } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 506648da1b..7847b254f4 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -155,13 +155,13 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } } } @@ -177,8 +177,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Darkness, 90, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Darkness, 90, true); } } } diff --git a/NPCs/SlimeGod/CrimulanSlimeGod.cs b/NPCs/SlimeGod/CrimulanSlimeGod.cs index f9a332dea1..0c050b9d58 100644 --- a/NPCs/SlimeGod/CrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/CrimulanSlimeGod.cs @@ -688,7 +688,7 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } } @@ -699,8 +699,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Darkness, 300, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Darkness, 300, true); } } } diff --git a/NPCs/SlimeGod/EbonianSlimeGod.cs b/NPCs/SlimeGod/EbonianSlimeGod.cs index 51dca013d8..4aadf930da 100644 --- a/NPCs/SlimeGod/EbonianSlimeGod.cs +++ b/NPCs/SlimeGod/EbonianSlimeGod.cs @@ -701,7 +701,7 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } } @@ -712,8 +712,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Weak, 300, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Weak, 300, true); } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index b1fefc3ff0..d7073c1e8e 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -649,18 +649,18 @@ namespace CalamityMod.NPCs.SlimeGod { Color color = Main.rand.NextBool() ? Color.Lavender : Color.Crimson; color.A = 150; - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, color, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, color, 1f); } } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) + if (hurtInfo.Damage > 0) { int debufftype = CalamityWorld.getFixedBoi ? BuffID.VortexDebuff : BuffID.Slow; - player.AddBuff(debufftype, 180, true); - player.AddBuff(BuffID.Weak, 180, true); - player.AddBuff(BuffID.Darkness, 180, true); + target.AddBuff(debufftype, 180, true); + target.AddBuff(BuffID.Weak, 180, true); + target.AddBuff(BuffID.Darkness, 180, true); } } } diff --git a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs index a7b941bdc2..6c2750f446 100644 --- a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs @@ -688,7 +688,7 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } if (NPC.life <= 0) { @@ -726,8 +726,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Darkness, 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Darkness, 240, true); } } } diff --git a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs index 5c1c05500b..9fe8bb529a 100644 --- a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs +++ b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs @@ -701,7 +701,7 @@ namespace CalamityMod.NPCs.SlimeGod dustColor.A = 150; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, dustColor, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hit.HitDirection, -1f, NPC.alpha, dustColor, 1f); } if (NPC.life <= 0) { @@ -739,8 +739,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Weak, 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Weak, 240, true); } } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 056659271e..24299e14c6 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -320,8 +320,8 @@ namespace CalamityMod.NPCs.StormWeaver chargePhaseGateValue *= 0.5f; int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; - if (damage > 0) - player.AddBuff(BuffID.Electrified, buffDuration, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Electrified, buffDuration, true); } public override bool CheckActive() @@ -332,7 +332,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 479ecf70dd..0913900d77 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -890,8 +890,8 @@ namespace CalamityMod.NPCs.StormWeaver chargePhaseGateValue *= 0.5f; int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 480 : 240; - if (damage > 0) - player.AddBuff(BuffID.Electrified, buffDuration, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Electrified, buffDuration, true); } public override bool CheckActive() @@ -902,7 +902,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 7442c121ce..e1df007efd 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -320,14 +320,14 @@ namespace CalamityMod.NPCs.StormWeaver chargePhaseGateValue *= 0.5f; int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; - if (damage > 0) - player.AddBuff(BuffID.Electrified, buffDuration, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Electrified, buffDuration, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index 2c2340742a..e5c24b98a2 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -218,8 +218,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 15; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulfurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index 31cffdb75a..a28c29e31b 100644 --- a/NPCs/SulphurousSea/AquaticUrchin.cs +++ b/NPCs/SulphurousSea/AquaticUrchin.cs @@ -131,8 +131,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 120, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120, true); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -158,13 +158,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 0161cdb120..f2be18405a 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -90,8 +90,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180); } public override void HitEffect(NPC.HitInfo hit) @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulfurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index e15d8bbc94..149ee81929 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -109,8 +109,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 120); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -132,13 +132,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index 4bf7b08fe3..fb29adb746 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -102,8 +102,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 120); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 120); } public override void FindFrame(int frameHeight) @@ -154,13 +154,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 30a6f6de43..9847c44669 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -93,8 +93,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -116,13 +116,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index 234fb87c2b..63861df430 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -324,8 +324,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 180); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 180); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -361,13 +361,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index 7992f825df..a78eeedba7 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -157,13 +157,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 2; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSea/BlindedAngler.cs b/NPCs/SunkenSea/BlindedAngler.cs index 4c9fc12a34..94087acfc4 100644 --- a/NPCs/SunkenSea/BlindedAngler.cs +++ b/NPCs/SunkenSea/BlindedAngler.cs @@ -124,13 +124,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index d8701aab8b..d6307e9b41 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -225,13 +225,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index 2fac37e172..11de5671f2 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -217,13 +217,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index cd57af6988..a0673c8688 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -152,21 +152,21 @@ namespace CalamityMod.NPCs.SunkenSea public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(BuffID.Electrified, 120, true); + if (hurtInfo.Damage > 0) + target.AddBuff(BuffID.Electrified, 120, true); } public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 99804f3c01..2901d5fcca 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -478,13 +478,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index 89cb971cee..721196eea2 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.SunkenSea } for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index 8712d87cfd..b71e18ecba 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index e8c0b38801..f4e261bcaf 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -215,7 +215,7 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hit.HitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSea/SeaSerpent1.cs b/NPCs/SunkenSea/SeaSerpent1.cs index 433ee1b076..4b1d00a776 100644 --- a/NPCs/SunkenSea/SeaSerpent1.cs +++ b/NPCs/SunkenSea/SeaSerpent1.cs @@ -312,13 +312,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/SeaSerpent2.cs b/NPCs/SunkenSea/SeaSerpent2.cs index 3266fa0c64..dd6c20d5b9 100644 --- a/NPCs/SunkenSea/SeaSerpent2.cs +++ b/NPCs/SunkenSea/SeaSerpent2.cs @@ -133,13 +133,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/SeaSerpent3.cs b/NPCs/SunkenSea/SeaSerpent3.cs index b052936bad..0c359367e8 100644 --- a/NPCs/SunkenSea/SeaSerpent3.cs +++ b/NPCs/SunkenSea/SeaSerpent3.cs @@ -130,13 +130,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/SeaSerpent4.cs b/NPCs/SunkenSea/SeaSerpent4.cs index b4499d2c87..0f481442c0 100644 --- a/NPCs/SunkenSea/SeaSerpent4.cs +++ b/NPCs/SunkenSea/SeaSerpent4.cs @@ -130,13 +130,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SunkenSea/SeaSerpent5.cs b/NPCs/SunkenSea/SeaSerpent5.cs index f9c6391f78..7bf8cbf361 100644 --- a/NPCs/SunkenSea/SeaSerpent5.cs +++ b/NPCs/SunkenSea/SeaSerpent5.cs @@ -130,13 +130,13 @@ namespace CalamityMod.NPCs.SunkenSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, 37, hit.HitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.Server) { diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 882a0eb824..43e6f9202d 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2892,7 +2892,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { @@ -2931,8 +2931,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 600, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 600, true); } } } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 4839412f85..3203d25c75 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2936,8 +2936,8 @@ namespace CalamityMod.NPCs.Yharon #region On Hit Player public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - if (damage > 0) - player.AddBuff(ModContent.BuffType(), 240, true); + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), 240, true); } #endregion @@ -3110,7 +3110,7 @@ namespace CalamityMod.NPCs.Yharon for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) {