diff --git a/Gores/Piggy.png b/Gores/Piggy.png new file mode 100644 index 0000000000..576706349c Binary files /dev/null and b/Gores/Piggy.png differ diff --git a/Gores/Piggy2.png b/Gores/Piggy2.png new file mode 100644 index 0000000000..add55f0216 Binary files /dev/null and b/Gores/Piggy2.png differ diff --git a/Items/Placeables/Banners/PiggyBanner.png b/Items/Placeables/Banners/PiggyBanner.png index e6cd993b29..8d755b0036 100644 Binary files a/Items/Placeables/Banners/PiggyBanner.png and b/Items/Placeables/Banners/PiggyBanner.png differ diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 1a4926e687..0ca326718f 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[Type] = 1; + Main.npcFrameCount[Type] = 8; Main.npcCatchable[Type] = true; NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() @@ -259,49 +259,59 @@ namespace CalamityMod.NPCs.NormalNPCs public override void HitEffect(NPC.HitInfo hit) { + int dustType = Type == ModContent.NPCType() ? DustID.GoldCritter : DustID.Blood; for (int k = 0; k < 5; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, 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, hit.HitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, hit.HitDirection, -1f, 0, default, 1f); + } + + if (!Main.dedServ && Type != ModContent.NPCType()) + { + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Piggy").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Piggy2").Type, 1f); } } } public override void FindFrame(int frameHeight) { - //if (NPC.velocity.Y == 0f) - //{ - // if (!NPC.IsABestiaryIconDummy) - // { - // if (NPC.velocity.X == 0f) - // { - // NPC.frame.Y = 0; - // NPC.frameCounter = 0.0; - // return; - // } - // } - // NPC.frameCounter += NPC.IsABestiaryIconDummy ? 0.6f : Math.Abs(NPC.velocity.X) * 0.25f; - // NPC.frameCounter += 1.0; - // if (NPC.frameCounter > 12.0) - // { - // NPC.frame.Y = NPC.frame.Y + frameHeight; - // NPC.frameCounter = 0.0; - // } - // if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - 1) - // { - // NPC.frame.Y = frameHeight; - // } - //} - //else - //{ - // NPC.frameCounter = 0.0; - // NPC.frame.Y = frameHeight * 2; - //} + if (NPC.velocity.Y == 0f) + { + if (!NPC.IsABestiaryIconDummy) + { + if (NPC.velocity.X == 0f) + { + NPC.frame.Y = 0; + NPC.frameCounter = 0.0; + return; + } + } + + NPC.frameCounter += NPC.IsABestiaryIconDummy ? 0.6f : Math.Abs(NPC.velocity.X) * 0.25f; + NPC.frameCounter += 1.0; + if (NPC.frameCounter > 7.0) + { + NPC.frame.Y = NPC.frame.Y + frameHeight; + NPC.frameCounter = 0.0; + } + + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - 1) + { + NPC.frame.Y = frameHeight; + } + } + else + { + NPC.frameCounter = 0.0; + NPC.frame.Y = frameHeight * 2; + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/NormalNPCs/Piggy.png b/NPCs/NormalNPCs/Piggy.png index 47f2d4067f..7255ad1ca4 100644 Binary files a/NPCs/NormalNPCs/Piggy.png and b/NPCs/NormalNPCs/Piggy.png differ diff --git a/NPCs/NormalNPCs/PiggyGold.png b/NPCs/NormalNPCs/PiggyGold.png index 8e322b613a..351dae2e17 100644 Binary files a/NPCs/NormalNPCs/PiggyGold.png and b/NPCs/NormalNPCs/PiggyGold.png differ diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png index 4142434796..cec364ea19 100644 Binary files a/Tiles/MonsterBanner.png and b/Tiles/MonsterBanner.png differ