Skip to content

Commit

Permalink
Fix Baby Cannonball Jellyfish bestiary bug (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
HwakYuk authored Apr 27, 2024
1 parent 6b60acd commit 1da1a25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions NPCs/Abyss/BabyCannonballJellyfish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ namespace CalamityMod.NPCs.Abyss
public class BabyCannonballJellyfish : ModNPC
{
public bool hasBeenHit = false;
public int explosionDamage;

public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 7;
//Main.npcCatchable[NPC.type] = true;
Main.npcCatchable[NPC.type] = true;
NPCID.Sets.CountsAsCritter[NPC.type] = true;
}

Expand All @@ -34,7 +35,8 @@ public override void SetDefaults()
NPC.chaseable = false;
NPC.aiStyle = -1;
AIType = -1;
NPC.damage = 30;
NPC.damage = 0;
explosionDamage = 30;
NPC.width = 28;
NPC.height = 36;
NPC.defense = 0;
Expand Down Expand Up @@ -157,7 +159,7 @@ private void Explode()
NPC.position -= NPC.Size * 0.5f; //hitbox expansion + adjustments
SoundEngine.PlaySound(SoundID.Item14, NPC.Center); //bomb sound
foreach (Player player in Main.player.Where(player => player.active && !player.dead && NPC.Hitbox.Intersects(player.Hitbox)))
player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, NPC.direction);
player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), explosionDamage, NPC.direction);
for (int k = 0; k < 8; k++)
{
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, 0f, -1f, 0, default, 1f);
Expand All @@ -169,8 +171,6 @@ private void Explode()
NPC.netUpdate = true;
}

public override bool CanHitPlayer(Player target, ref int cooldownSlot) => NPC.life <= 0;

public override void HitEffect(NPC.HitInfo hit)
{
for (int k = 0; k < 2; k++)
Expand Down

0 comments on commit 1da1a25

Please sign in to comment.