Clam only deals contact dmg when actually attacking

This commit is contained in:
Nathanael Overton committed 2025-07-28 09:16:04 -04:00
1 parent ed4191d68e
commit 661bb4add4
1 file changed
+11 -1
+11 -1
View File
@@ -47,6 +47,8 @@ namespace CalamityMod.NPCs.SunkenSea
public ref float ShellRotation => ref NPC.localAI[0];
public int originalDamage;
#region Textures
public static Asset<Texture2D> bottomJawTex;
@@ -84,7 +86,7 @@ namespace CalamityMod.NPCs.SunkenSea
public override void SetDefaults()
{
NPC.damage = Main.hardMode ? 60 : 30;
originalDamage = NPC.damage = Main.hardMode ? 60 : 30;
NPC.width = 50;
NPC.height = 30;
NPC.defense = 9999;
@@ -159,6 +161,7 @@ namespace CalamityMod.NPCs.SunkenSea
{
case (int)PhaseType.Idle:
{
NPC.damage = 0;
NPC.chaseable = false;
NPC.velocity.X *= 0.9f;
if (ShellRotation > 0)
@@ -206,6 +209,7 @@ namespace CalamityMod.NPCs.SunkenSea
break;
case (int)PhaseType.Attacking:
{
NPC.damage = 0;
NPC.knockBackResist = 0.05f;
NPC.defense = Main.hardMode ? 15 : 6;
NPC.chaseable = true;
@@ -224,6 +228,8 @@ namespace CalamityMod.NPCs.SunkenSea
}
else
{
NPC.damage = originalDamage;
if (NPC.velocity.Y < 0)
{
ShellRotation += 0.065f;
@@ -251,6 +257,7 @@ namespace CalamityMod.NPCs.SunkenSea
break;
case (int)PhaseType.Squirt:
{
NPC.damage = 0;
NPC.chaseable = true;
// Slow down. Once the clam is rested, start incrementing Timer
if (NPC.velocity.Y == 0)
@@ -293,6 +300,7 @@ namespace CalamityMod.NPCs.SunkenSea
// Fire the projectile
if (Timer == (endClose - 5))
{
NPC.damage = originalDamage;
Vector2 velocity = NPC.SafeDirectionTo(Target.Center, Vector2.UnitY) * 5;
// If the player is on the other side of the clam, flip the jet so that it doesn't fire backwards
@@ -323,6 +331,8 @@ namespace CalamityMod.NPCs.SunkenSea
break;
case (int)PhaseType.Pod:
{
NPC.damage = 0;
NPC.chaseable = true;
NPC pod = Main.npc[(int)NPC.localAI[2] - 1];
// If the Pearlpod is invalid, go back to idling