Fixed Craw Carapace line flat thorns damage hitting invincible enemies

This commit is contained in:
CongratsIsTrash committed 2024-06-04 14:33:47 -04:00
1 parent 4cd6653390
commit 942e1694a7
1 file changed
+15 -6
+15 -6
View File
@@ -1198,8 +1198,11 @@ namespace CalamityMod.CalPlayer
if (crawCarapace)
{
npc.AddBuff(ModContent.BuffType<Crumbling>(), 900);
int onHitDamage = Player.CalcIntDamage<GenericDamageClass>(40);
Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false);
if (!npc.dontTakeDamage)
{
int onHitDamage = Player.CalcIntDamage<GenericDamageClass>(40);
Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false);
}
SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center);
}
@@ -1207,8 +1210,11 @@ namespace CalamityMod.CalPlayer
{
npc.AddBuff(ModContent.BuffType<ArmorCrunch>(), 900);
npc.AddBuff(ModContent.BuffType<CrushDepth>(), 900);
int onHitDamage = Player.CalcIntDamage<GenericDamageClass>(250);
Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false);
if (!npc.dontTakeDamage)
{
int onHitDamage = Player.CalcIntDamage<GenericDamageClass>(250);
Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false);
}
SoundEngine.PlaySound(BaroclawHit, Player.Center);
Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f;
Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY);
@@ -1228,8 +1234,11 @@ namespace CalamityMod.CalPlayer
if (absorber)
{
npc.AddBuff(ModContent.BuffType<AbsorberAffliction>(), 900);
int onHitDamage = Player.CalcIntDamage<GenericDamageClass>(350);
Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false);
if (!npc.dontTakeDamage)
{
int onHitDamage = Player.CalcIntDamage<GenericDamageClass>(350);
Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false);
}
SoundEngine.PlaySound(AbsorberHit, Player.Center);
Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f;
Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY);