diff --git a/Items/SummonItems/TownPets/PiggyLicense.cs b/Items/SummonItems/TownPets/TheHousingContract.cs similarity index 93% rename from Items/SummonItems/TownPets/PiggyLicense.cs rename to Items/SummonItems/TownPets/TheHousingContract.cs index 424e1ba178..c646795033 100644 --- a/Items/SummonItems/TownPets/PiggyLicense.cs +++ b/Items/SummonItems/TownPets/TheHousingContract.cs @@ -11,10 +11,9 @@ using Terraria.ModLoader; namespace CalamityMod.Items.SummonItems.TownPets { - public class PiggyLicense : ModItem, ILocalizedModType + public class TheHousingContract : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.SummonItems"; - public override string Texture => "Terraria/Images/Item_" + ItemID.LicenseBunny; public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; diff --git a/Items/SummonItems/TownPets/TheHousingContract.png b/Items/SummonItems/TownPets/TheHousingContract.png new file mode 100644 index 0000000000..e2b10b4af8 Binary files /dev/null and b/Items/SummonItems/TownPets/TheHousingContract.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index db28331712..d025bca61a 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -154,6 +154,7 @@ Archmage: One of the world's foremost experts on magical theory, he is renowned Bandit: The bandit may have a bad habit of looting battlefields and taking what isn't theirs, but their actions are mostly motivated by their hatred of the obscenely rich who haven't truly earned the wealth they possess. Their methods are somewhat shady, but can always be relied upon to get a job done. BrimstoneWitch: Recruited to Yharim's forces late into the war, her magic overflows with such power that she is largely incapable of casting normal spells. Yet despite her great power, Calamitas prefers not to use it, as it takes a heavy toll on her psyche. SeaKing: The seventeenth ruler of the constitutional monarchy of Ilmeris since the tribes of the Ilmeran Sea unified, under the Electric Goddess, Otonilou, and the elusive God of the Seas. Alas, one cannot be a ruler without subjects, and while he remains respected by those who opposed Godseeker Yharim, his kingdom is no more. +TownPiggy: Oink //Boss Minions Brimling: Extensions of the Brimstone Elemental herself, and part of her very being. Both she and her Brimlings are of a single mind, so she naturally cares for them just as she cares for herself. When heavily wounded, they withdraw into a cocoon to protect themselves from further harm. SoulSeeker: The Clone's attempt at wielding the souls of the damned as weapons, these retain slightly more autonomy than their Azafurian brethren. And yet given the striking resemblance the bear to the Clone's shell, it's arguable that they might be further from Calamitas' current soul seekers than those found in Azafure's ruins. diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 741ab4c05c..5354320aec 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -212,11 +212,6 @@ OverloadedSludge: { ''' } -PiggyLicense: { - DisplayName: Piggy License - Tooltip: Use to adopt a piggy for your town -} - Portabulb: { DisplayName: Portabulb Tooltip: @@ -294,6 +289,11 @@ Terminus: { Tooltip: Hold to start or end the Boss Rush } +TheHousingContract: { + DisplayName: The Housing Contract + Tooltip: Use to adopt a piggy for your town +} + YharonEgg: { DisplayName: Blessed Phoenix Egg Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 7be074b811..e7a73eee94 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -562,8 +562,8 @@ SeaKing: { } TownPiggy: { - DisplayName: Piggy - Census.SpawnCondition: Use a Piggy License + DisplayName: Town Piggy + Census.SpawnCondition: Use The Housing Contract Name: { Oolong: Oolong @@ -584,7 +584,7 @@ TownPiggy: { Curly: Curly Techno: Techno JohnPork: John Pork - Piglet: Piglet + Piglet: Piglet } Chat: { diff --git a/NPCs/TownNPCs/TownPiggy.cs b/NPCs/TownNPCs/TownPiggy.cs index 2d46b1852f..3c15194e38 100644 --- a/NPCs/TownNPCs/TownPiggy.cs +++ b/NPCs/TownNPCs/TownPiggy.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.TownNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[Type] = 8; + Main.npcFrameCount[Type] = 13; NPCID.Sets.ExtraFramesCount[Type] = 0; NPCID.Sets.AttackFrameCount[Type] = 0; NPCID.Sets.DangerDetectRange[Type] = 250; @@ -51,6 +51,7 @@ namespace CalamityMod.NPCs.TownNPCs NPC.width = 20; NPC.height = 20; NPC.aiStyle = NPCAIStyleID.Passive; + AIType = NPCID.TownBunny; NPC.damage = 0; NPC.defense = 0; NPC.lifeMax = 50; @@ -59,7 +60,6 @@ namespace CalamityMod.NPCs.TownNPCs NPC.knockBackResist = 0.5f; NPC.housingCategory = 1; DrawOffsetY = -4; - //AnimationType = NPCID.TownBunny; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { @@ -113,8 +113,34 @@ namespace CalamityMod.NPCs.TownNPCs public override void FindFrame(int frameHeight) { - if (NPC.velocity.X == 0) + // Sleep animation + if (NPC.ai[0] >= 20f && NPC.ai[0] <= 22f) + { + if (NPC.velocity.Y == 0) + { + if (NPC.ai[1] > 30f && (NPC.frame.Y < frameHeight * 8)) + { + NPC.frame.Y = frameHeight * 8; + } + if (NPC.frame.Y > 0) + { + NPC.frameCounter++; + } + if (NPC.frameCounter > 6) + { + NPC.frameCounter = 0; + NPC.frame.Y += frameHeight; + } + if (NPC.frame.Y > 12 * frameHeight) + { + NPC.frame.Y = frameHeight * 8; + } + } + } + else if (NPC.velocity.X == 0) + { NPC.frame.Y = 0; + } else { if (NPC.velocity.Y == 0) @@ -122,14 +148,12 @@ namespace CalamityMod.NPCs.TownNPCs if (NPC.frameCounter++ % 6 == 0) { NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) - { - NPC.frame.Y = frameHeight; - } } } if (NPC.frame.Y < frameHeight) NPC.frame.Y = frameHeight; + if (NPC.frame.Y > frameHeight * 7) + NPC.frame.Y = frameHeight; } } diff --git a/NPCs/TownNPCs/TownPiggy.png b/NPCs/TownNPCs/TownPiggy.png index 7255ad1ca4..ae68308cdf 100644 Binary files a/NPCs/TownNPCs/TownPiggy.png and b/NPCs/TownNPCs/TownPiggy.png differ diff --git a/NPCs/TownNPCs/TownPiggy_Head.png b/NPCs/TownNPCs/TownPiggy_Head.png index 4eee0bb14f..a31c29b619 100644 Binary files a/NPCs/TownNPCs/TownPiggy_Head.png and b/NPCs/TownNPCs/TownPiggy_Head.png differ diff --git a/Packets/Entities/SyncTownPigLicensePacket.cs b/Packets/Entities/SyncTownPigLicensePacket.cs index 0b9cff6f95..4b5c3f865b 100644 --- a/Packets/Entities/SyncTownPigLicensePacket.cs +++ b/Packets/Entities/SyncTownPigLicensePacket.cs @@ -15,6 +15,6 @@ namespace CalamityMod.Packets packet.Send(toClient, ignoreClient); } - public override void HandlePacket(BinaryReader packet, int sender) => PiggyLicense.SpawnPiggy(); + public override void HandlePacket(BinaryReader packet, int sender) => TheHousingContract.SpawnPiggy(); } }