From fdd38fdb4198c8a8f336c3ca2a21965036e67d4d Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 6 Feb 2023 16:36:06 -0600 Subject: [PATCH] 1 - Permafrost sells Ice Cream while happy and in the Snow biome. 2 - Amidias sells Shrimp Po Boy while happy and in the Ocean biome. 3 - Cirrus sells Unicorn Horns while happy and in the Hallow biome. --- NPCs/TownNPCs/DILF.cs | 11 +++++++++++ NPCs/TownNPCs/FAP.cs | 10 +++++----- NPCs/TownNPCs/SEAHOE.cs | 11 +++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index ee16e219d3..2b01673fd8 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -201,6 +201,17 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; } + + bool happy = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.8999999761581421; + if (happy) + { + if (Main.LocalPlayer.ZoneSnow) + { + shop.item[nextSlot].SetDefaults(ItemID.IceCream); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0); + nextSlot++; + } + } } // Make this Town NPC teleport to the King statue when triggered. diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index c990ed5c85..8d9789b647 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -83,9 +83,7 @@ namespace CalamityMod.NPCs.TownNPCs public override void AI() { if (!CalamityWorld.spawnedCirrus) - { CalamityWorld.spawnedCirrus = true; - } } public override bool CanTownNPCSpawn(int numTownNPCs, int money) @@ -95,9 +93,7 @@ namespace CalamityMod.NPCs.TownNPCs Player player = Main.player[k]; bool hasVodka = player.InventoryHas(ModContent.ItemType())/* || player.PortableStorageHas(ModContent.ItemType())*/; if (player.active && hasVodka) - { return Main.hardMode || CalamityWorld.spawnedCirrus; - } } return CalamityWorld.spawnedCirrus; } @@ -454,11 +450,15 @@ namespace CalamityMod.NPCs.TownNPCs if (happyAsFuck) { shop.item[nextSlot].SetDefaults(ItemID.MilkCarton); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 50, 0); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 1, 0, 0); nextSlot++; if (Main.LocalPlayer.ZoneHallow) { + shop.item[nextSlot].SetDefaults(ItemID.UnicornHorn); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 50, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.Milkshake); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); nextSlot++; diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 89888f0d9d..f757432693 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -403,6 +403,17 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].shopCustomPrice = (int)(shop.item[nextSlot].shopCustomPrice * 0.8); nextSlot++; } + + bool happy = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.8999999761581421; + if (happy) + { + if (Main.LocalPlayer.ZoneBeach) + { + shop.item[nextSlot].SetDefaults(ItemID.ShrimpPoBoy); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 50, 0); + nextSlot++; + } + } } public override void HitEffect(int hitDirection, double damage)