From bbdb59f85e65f1e6acaa97b2caf9e5a8fbcd0796 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:38:18 -0400 Subject: [PATCH] Skeletron Merchant sells Punch Card if named "Sans Undertale" --- NPCs/CalamityGlobalTownNPC.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 81b36b3502..fc16876bc9 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1332,6 +1332,29 @@ namespace CalamityMod.NPCs shop.Add(ItemType()); } } + + public override void ModifyActiveShop(NPC npc, string shopName, Item[] items) + { + // TODO: Uses a hardcoded string since dedicated names are currently hardcoded strings + // Will need to be changed if dedicated names are localized in the future + if (npc.type == NPCID.SkeletonMerchant && npc.GivenName == "Sans Undertale") + { + int index = 0; + for (int i = 0; i < Chest.maxItems; i++) + { + if (items[i] == null) + { + index = i; + break; + } + } + var punch = new Item(ItemType()) + { + shopCustomPrice = Item.buyPrice(gold: 10) + }; + items[index] = punch; + } + } #endregion } }