Skeletron Merchant sells Punch Card if named "Sans Undertale"

This commit is contained in:
CongratsIsTrash authored and GitHub committed 2025-06-27 15:38:18 -04:00
1 parent 8733622e94
commit bbdb59f85e
1 file changed
+23
+23
View File
@@ -1332,6 +1332,29 @@ namespace CalamityMod.NPCs
shop.Add(ItemType<OddMushroom>());
}
}
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<PunchCard>())
{
shopCustomPrice = Item.buyPrice(gold: 10)
};
items[index] = punch;
}
}
#endregion
}
}