Hog drawing fixes + New Piggy sounds
* Added a bunch of a new Piggy Idle sounds and two new unique Death sounds * Added Horrible Hog Banner * Fixed Horrible Hog drawing errors in the Bestiary * Made some small modifications to Horrible Hog's death animation
This commit is contained in:
1 parent
d8bf3bca62
commit
b696ff55c4
21 files changed
+68
-14
No files matched your search
@@ -0,0 +1,7 @@
|
||||
namespace CalamityMod.Items.Placeables.Banners
|
||||
{
|
||||
public class HorribleHogBanner : BaseBanner
|
||||
{
|
||||
public override int BannerTileID => 152;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 397 B |
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<HorribleHogBanner>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
+27
-10
@@ -38,7 +38,10 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
private static Asset<Texture2D> BloomFlare;
|
||||
private static Asset<Texture2D> 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<PiggyItem>();
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<PiggyBanner>();
|
||||
@@ -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<ModGore>("Piggy2").Type, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
NPC.direction = hit.HitDirection;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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<StormlionScout>(); // NOT YET IMPLEMENTED. Banner sprite is already on the mastersheet and associated with this case/position.
|
||||
break; */
|
||||
case 152:
|
||||
npc = NPCType<HorribleHog>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 75 KiB |
Reference in new issue
Block a user