diff --git a/Items/Placeables/Banners/HorribleHogBanner.cs b/Items/Placeables/Banners/HorribleHogBanner.cs new file mode 100644 index 0000000000..7b588fd920 --- /dev/null +++ b/Items/Placeables/Banners/HorribleHogBanner.cs @@ -0,0 +1,7 @@ +namespace CalamityMod.Items.Placeables.Banners +{ + public class HorribleHogBanner : BaseBanner + { + public override int BannerTileID => 152; + } +} diff --git a/Items/Placeables/Banners/HorribleHogBanner.png b/Items/Placeables/Banners/HorribleHogBanner.png new file mode 100644 index 0000000000..a0d8790fc3 Binary files /dev/null and b/Items/Placeables/Banners/HorribleHogBanner.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 4f4d3f9c8d..442f903af0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -4723,3 +4723,5 @@ GreedPot: { DisplayName: Urn of Avarice Tooltip: Offer your treasures to the Urn, and your avarice may at last be satiated } + +HorribleHogBanner.DisplayName: Horrible Hog Banner diff --git a/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs b/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs index daf6c7087d..5d8522b4fe 100644 --- a/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs +++ b/NPCs/NormalNPCs/HorribleHog/HorribleHog.AI.Transitionals.cs @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog MiscAttackCounter++; NPC.velocity.X = NPC.oldVelocity.X * 0.6f; - NPC.velocity.Y = -8f; + NPC.velocity.Y = -10f; NPC.netUpdate = true; } @@ -298,9 +298,9 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog CalamityUtils.AddScreenshakeAt(NPC.Center, 4f); } - FrameY = BalledUpFrame; - + UseBalledSprite = true; NPC.damage = 0; + NPC.GravityMultiplier *= 1.28f; NPC.dontTakeDamage = true; } diff --git a/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs b/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs index 2093ade2bd..032ce920f8 100644 --- a/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs +++ b/NPCs/NormalNPCs/HorribleHog/HorribleHog.cs @@ -8,6 +8,7 @@ using CalamityMod.DataStructures; using CalamityMod.Effects; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Tools; using CalamityMod.Particles; using CalamityMod.Projectiles.Enemy; @@ -220,6 +221,11 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog NPCID.Sets.TrailCacheLength[Type] = 5; NPCID.Sets.TrailingMode[Type] = 0; NPCID.Sets.CantTakeLunchMoney[Type] = true; + + NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new(); + drawModifiers.Position.X += 12f; + drawModifiers.PortraitPositionXOverride = 14f; + NPCID.Sets.NPCBestiaryDrawOffset[Type] = drawModifiers; } public override void SetDefaults() @@ -239,6 +245,9 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog NPC.noTileCollide = false; NPC.dontTakeDamage = false; + Banner = NPC.type; + BannerItem = ModContent.ItemType(); + SquashVector = Vector2.One; SquashVectorTarget = Vector2.One; ResetAttackWeights(); @@ -348,7 +357,7 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog NPC.spriteDirection = NPC.direction; // Despawn immediately if it's morning. - if (Main.dayTime && AIState != (int)BehaviorState.DespawnAnimation) + if (Main.dayTime && AIState != (int)BehaviorState.DespawnAnimation && AIState != (int)BehaviorState.DeathAnimation) SwitchBehavior(specificAttack: BehaviorState.DespawnAnimation); // If the current target dies, laugh at them. @@ -826,6 +835,21 @@ namespace CalamityMod.NPCs.NormalNPCs.HorribleHog public override void FindFrame(int frameHeight) { + if (NPC.IsABestiaryIconDummy) + { + if (FrameY < IdleFrame) + FrameY = IdleFrame; + + NPC.frameCounter++; + if (NPC.frameCounter >= 5) + { + FrameY++; + if (FrameY > MaxFrame_Walking) + FrameY = MinFrame_Walking; + NPC.frameCounter = 0; + } + } + NPC.frame.Y = FrameY * frameHeight; } diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 3cbdb3cfd9..b714ed0655 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -38,7 +38,10 @@ namespace CalamityMod.NPCs.NormalNPCs private static Asset BloomFlare; private static Asset ShineFlare; - private static SoundStyle IdleSound = new("CalamityMod/Sounds/Custom/Piggy/PiggyIdle", 3); + private static SoundStyle IdleSound_Grunt = new("CalamityMod/Sounds/Custom/Piggy/PiggyIdle_Grunt", 3); + private static SoundStyle IdleSound_SnortYip = new("CalamityMod/Sounds/Custom/Piggy/PiggyIdle_SnortYip", 3); + private static SoundStyle IdleSound_Yip = new("CalamityMod/Sounds/Custom/Piggy/PiggyIdle_Yip", 2); + private static SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PiggyDeath", 2); private static SoundStyle DivineSwine_CoinFailSound = new("CalamityMod/Sounds/Custom/DivineSwine/DivineSwineCoinFail", 3); private static SoundStyle DivineSwine_SwineSpeakLoopingSound = new("CalamityMod/Sounds/Custom/DivineSwine/DivineSwineNearbyLoop") @@ -105,7 +108,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.aiStyle = -1; NPC.knockBackResist = 1.15f; NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath1; + NPC.DeathSound = DeathSound; NPC.catchItem = (short)ModContent.ItemType(); Banner = NPC.type; BannerItem = ModContent.ItemType(); @@ -235,9 +238,6 @@ namespace CalamityMod.NPCs.NormalNPCs public void MainBehavior_HorribleHogTransformation() { - // 16MAY2026: fryzahh - // Needs to be changed once Horrible Hog's spritesheet is finished. If it is not before this PR is merged please notify me immediately. - NPC.velocity.X *= 0.9f; NPC.rotation = 0f; if (!SoundEngine.TryGetActiveSound(NearbySoundSlot, out _)) @@ -332,12 +332,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.netUpdate = true; } - SoundEngine.PlaySound(IdleSound, NPC.Center); + var chosenSoundStyle = Utils.SelectRandom(Main.rand, IdleSound_Grunt, IdleSound_SnortYip, IdleSound_Yip); + SoundEngine.PlaySound(chosenSoundStyle, NPC.Center); NPC.soundDelay = Main.rand.Next(60, 120); } NPC.spriteDirection = NPC.direction; - float targetAngle = (NPC.velocity.Y != 0f) ? NPC.velocity.X * 0.175f * (NPC.velocity.Y < 0).ToDirectionInt() : 0f; + float targetAngle = (NPC.velocity.Y != 0f) ? NPC.velocity.X * 0.085f * (NPC.velocity.Y < 0).ToDirectionInt() : 0f; NPC.rotation = NPC.rotation.AngleLerp(targetAngle, 0.075f); } @@ -366,6 +367,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.collideX) { SoundEngine.PlaySound(SoundID.Dig with { Volume = 0.7f }, NPC.Center); + SoundEngine.PlaySound(IdleSound_Grunt with { Volume = 1.2f }, NPC.Center); SquashVector = new Vector2(0.6f, 1f); NPC.velocity.X = NPC.oldVelocity.X * -0.86f; @@ -382,12 +384,28 @@ namespace CalamityMod.NPCs.NormalNPCs Timer = 0f; NPC.netUpdate = true; } + + float idealRotation = (NPC.velocity.Y != 0f) ? NPC.velocity.ToRotation() + (NPC.direction > 0 ? 0f : -MathHelper.Pi) : 0f; + NPC.rotation = idealRotation; } if (LocalAIState == 1f) { if (NPC.velocity.Y == 0f) + { NPC.velocity.X *= 0.9f; + if (MathF.Abs(NPC.velocity.X) >= 0.08f && MathF.Abs(NPC.velocity.X) < 0.09f) + { + NPC.velocity.Y = -4f; + var soundStyle = Utils.SelectRandom(Main.rand, IdleSound_SnortYip, IdleSound_Yip); + SoundEngine.PlaySound(soundStyle.WithPitchOffset(0.35f), NPC.Center); + } + } + + if (MathF.Abs(NPC.velocity.X) > 0.09f) + NPC.rotation += NPC.velocity.X * 0.075f; + else + NPC.rotation = NPC.rotation.AngleLerp(0f, 0.125f); if (Timer >= 120f) { @@ -397,9 +415,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.netUpdate = true; } } - - float idealRotation = (NPC.velocity.Y != 0f) ? NPC.velocity.ToRotation() + (NPC.direction > 0 ? 0f : -MathHelper.Pi) : 0f; - NPC.rotation = idealRotation; } public void TransformIntoVariant(int type) @@ -487,6 +502,8 @@ namespace CalamityMod.NPCs.NormalNPCs Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Piggy2").Type, 1f); } } + + NPC.direction = hit.HitDirection; } public override void FindFrame(int frameHeight) diff --git a/Sounds/Custom/Piggy/PiggyIdle1.wav b/Sounds/Custom/Piggy/PiggyIdle1.wav deleted file mode 100644 index 11a3e053f4..0000000000 Binary files a/Sounds/Custom/Piggy/PiggyIdle1.wav and /dev/null differ diff --git a/Sounds/Custom/Piggy/PiggyIdle2.wav b/Sounds/Custom/Piggy/PiggyIdle2.wav deleted file mode 100644 index 8d15b131c9..0000000000 Binary files a/Sounds/Custom/Piggy/PiggyIdle2.wav and /dev/null differ diff --git a/Sounds/Custom/Piggy/PiggyIdle3.wav b/Sounds/Custom/Piggy/PiggyIdle3.wav deleted file mode 100644 index 49b7ecf9a3..0000000000 Binary files a/Sounds/Custom/Piggy/PiggyIdle3.wav and /dev/null differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_Grunt1.ogg b/Sounds/Custom/Piggy/PiggyIdle_Grunt1.ogg new file mode 100644 index 0000000000..079759cdad Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_Grunt1.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_Grunt2.ogg b/Sounds/Custom/Piggy/PiggyIdle_Grunt2.ogg new file mode 100644 index 0000000000..b1c5986a90 Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_Grunt2.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_Grunt3.ogg b/Sounds/Custom/Piggy/PiggyIdle_Grunt3.ogg new file mode 100644 index 0000000000..9948305206 Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_Grunt3.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_SnortYip1.ogg b/Sounds/Custom/Piggy/PiggyIdle_SnortYip1.ogg new file mode 100644 index 0000000000..65bf10904e Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_SnortYip1.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_SnortYip2.ogg b/Sounds/Custom/Piggy/PiggyIdle_SnortYip2.ogg new file mode 100644 index 0000000000..ef78b4e388 Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_SnortYip2.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_SnortYip3.ogg b/Sounds/Custom/Piggy/PiggyIdle_SnortYip3.ogg new file mode 100644 index 0000000000..9019c3c009 Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_SnortYip3.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_Yip1.ogg b/Sounds/Custom/Piggy/PiggyIdle_Yip1.ogg new file mode 100644 index 0000000000..4f6cbb0608 Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_Yip1.ogg differ diff --git a/Sounds/Custom/Piggy/PiggyIdle_Yip2.ogg b/Sounds/Custom/Piggy/PiggyIdle_Yip2.ogg new file mode 100644 index 0000000000..35354c6527 Binary files /dev/null and b/Sounds/Custom/Piggy/PiggyIdle_Yip2.ogg differ diff --git a/Sounds/NPCKilled/PiggyDeath1.ogg b/Sounds/NPCKilled/PiggyDeath1.ogg new file mode 100644 index 0000000000..bf433830bf Binary files /dev/null and b/Sounds/NPCKilled/PiggyDeath1.ogg differ diff --git a/Sounds/NPCKilled/PiggyDeath2.ogg b/Sounds/NPCKilled/PiggyDeath2.ogg new file mode 100644 index 0000000000..e3431f86b8 Binary files /dev/null and b/Sounds/NPCKilled/PiggyDeath2.ogg differ diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index 12cd3e56cb..6cfeddec43 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -5,6 +5,7 @@ using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.Deconstructors; using CalamityMod.NPCs.DraedonLabThings; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.NormalNPCs.HorribleHog; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; @@ -528,6 +529,9 @@ namespace CalamityMod.Tiles /* case 151: npc = NPCType(); // NOT YET IMPLEMENTED. Banner sprite is already on the mastersheet and associated with this case/position. break; */ + case 152: + npc = NPCType(); + break; default: break; } diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png index cec364ea19..ae7a3a513e 100644 Binary files a/Tiles/MonsterBanner.png and b/Tiles/MonsterBanner.png differ