From 9cd0c1dba014ca93f7f8350deca98a016ca33c8d Mon Sep 17 00:00:00 2001 From: Nathanael Overton Date: Tue, 19 May 2026 15:50:25 -0400 Subject: [PATCH] Add dialogue --- .../en-US/Mods.CalamityMod.NPCs.hjson | 39 +++++++++++--- NPCs/TownNPCs/ShadySalesman.cs | 52 ++++++++++++++++++- 2 files changed, 82 insertions(+), 9 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 40b4ff4541..9b6f27093b 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -313,6 +313,13 @@ SupremeCataclysm.DisplayName: Cataclysm SupremeCatastrophe.DisplayName: Catastrophe Yharon.DisplayName: Yharon, Dragon of Rebirth YharonPhase2: Yharon, Resplendent Phoenix +DraconicSwarmer.DisplayName: Draconic Swarmer +Dragonfolly.DisplayName: Dragonfolly +Shoreskipper.DisplayName: Shoreskipper +BrainIllusion.DisplayName: Brain Illusion +FalseBrain.DisplayName: False Brain +BloodBomb.DisplayName: Blood Bomb + // Town NPCs, Pets, etc AndroombaFriendly.DisplayName: Androomba Pal @@ -573,6 +580,30 @@ SeaKing: { } } +ShadySalesman: { + DisplayName: Shady Salesman + Census.SpawnCondition: Defeat a Horrible Hog + + Chat: { + Normal1: Have you ever wondered why coins are shiny? Simple! It’s to match my partner’s dazzling products! + Normal2: Have you ever had a dream? If you have the cash, I can sell you several! + Normal3: Whatever you are thinking, I have the perfect thing for you, at a genuinely excessive discount! + Normal4: Is your life rapidly shrinking? Want to know this world’s marvels before your time comes? Are the local merchants only showing you worthless hogwash?! Worry not, Hoggart and I have just the solution! Hogwash sold separately. + Normal5: There’s a saying that goes “the grass is greener on the other side.” It’s absolute balderdash!! For 5 platinum coins, you can buy our Greener Paint and make your life the greenest! + Normal6: They say keeping an Angel Statue nearby is more dangerous than a loaded gun. That’s why I own multiple guns - in case some hooligan tries to sell me an Angel Statue! + Rain: People always say “rain, rain, go away! Come back another day!”, but everyone knows it would be better if it came back never! To solve this, I intend to invest in Hoggart’s Dome Program, we just need 500 platinum coins to get it off the ground! + WindyDay: Aren’t you tired of your house being blown away by any shoddy gust of wind? Well, I have the solution to your problem! With my state-of-the-art industrial super glue (for only 5 gold coins a pack), you too may survive the attack of invaders with outstanding lung capacity! + Desert: Exhausted from this oven-like heat? Yearning for something to help you cool down? Check out our revolutionary new product: water! It comes in all flavors of flavorless! Any bottle shape is available, from round to triangular! Feel the chill of molten ice as it enters your guts! It even has healing properties! Sip our free sample for the low price of 50 gold! + Tundra: Did you ever hear the tragedy of Kevin Bacon the Wise? I thought not, It’s not a story the Elumphants would tell you. Kevin Bacon was a Ham Lord of the Hogs, so powerful and so wise he could use his Hogtusk to influence metal to create gold… Unfortunately, he taught his apprentice everything he knew, then his apprentice out-cashed and deposed him. Ironic. He could save others from debt, but not himself. + Graveyard: Does that zombie look like a happy customer? No!! It’s full of maggots!! It has no life savings!! While you still do, hurry up and spend yours on a funky edition, happiness-smelling Maggot Repellent! + BloodMoon1: These shambling deadheads are the worst! How am I supposed to rip people off when they’re all either dead, broke or fighting for their lives?! + BloodMoon2: Like my partner always says, price makes the prize! Hire our Moon Doom Cannon, and enjoy a whole year without the meatsack invasion! Fund the construction of the Eclipse variant and get a deluxe model with a neat robotic decal! All for 5000 platinum coins! + BloodMoon3: Violence is at every corner tonight, huh? Remember these words, son: make deals, not war! + Hardmode: Those pesky merchants still want to sell you full-price, low quality copper tools?! Bird droppings!! Barter with me, and you’ll receive Palladium at HOG-WILD prizes! + MoonLordDefeated: I’ve been told this land is ruled by three gnomes in a suit of armor. That’s impossible! Gnomes are the most deplorable customers I’ve dealt with. They can’t handle a spoon without snapping it in half!! It’s always the halflings... + } +} + TownPiggy: { DisplayName: Town Piggy Census.SpawnCondition: Use The Housing Contract @@ -605,11 +636,3 @@ TownPiggy: { 2: Snort! } } - -DraconicSwarmer.DisplayName: Draconic Swarmer -Dragonfolly.DisplayName: Dragonfolly -Shoreskipper.DisplayName: Shoreskipper -BrainIllusion.DisplayName: Brain Illusion -FalseBrain.DisplayName: False Brain -BloodBomb.DisplayName: Blood Bomb -ShadySalesman.DisplayName: Shady Salesman diff --git a/NPCs/TownNPCs/ShadySalesman.cs b/NPCs/TownNPCs/ShadySalesman.cs index 24f65ea78b..3933ae5f44 100644 --- a/NPCs/TownNPCs/ShadySalesman.cs +++ b/NPCs/TownNPCs/ShadySalesman.cs @@ -196,8 +196,58 @@ namespace CalamityMod.NPCs.TownNPCs public override string GetChat() { + WeightedRandom dialogue = new WeightedRandom(); - return "dialogue"; + dialogue.Add(this.GetLocalizedValue("Chat.Normal1")); + dialogue.Add(this.GetLocalizedValue("Chat.Normal2")); + dialogue.Add(this.GetLocalizedValue("Chat.Normal3")); + dialogue.Add(this.GetLocalizedValue("Chat.Normal4")); + dialogue.Add(this.GetLocalizedValue("Chat.Normal5")); + dialogue.Add(this.GetLocalizedValue("Chat.Normal6")); + + if (Main.raining) + { + dialogue.Add(this.GetLocalizedValue("Chat.Rain")); + } + + if (Main._shouldUseWindyDayMusic) + { + dialogue.Add(this.GetLocalizedValue("Chat.WindyDay")); + } + + if (Main.LocalPlayer.ZoneDesert) + { + dialogue.Add(this.GetLocalizedValue("Chat.Desert")); + } + + if (Main.LocalPlayer.ZoneSnow) + { + dialogue.Add(this.GetLocalizedValue("Chat.Tundra")); + } + + if (Main.LocalPlayer.ZoneGraveyard) + { + dialogue.Add(this.GetLocalizedValue("Chat.Graveyard")); + } + + if (Main.bloodMoon) + { + dialogue.Add(this.GetLocalizedValue("Chat.BloodMoon1")); + dialogue.Add(this.GetLocalizedValue("Chat.BloodMoon2")); + dialogue.Add(this.GetLocalizedValue("Chat.BloodMoon3")); + } + + if (Main.hardMode) + { + dialogue.Add(this.GetLocalizedValue("Chat.Hardmode")); + } + + if (NPC.downedMoonlord) + { + dialogue.Add(this.GetLocalizedValue("Chat.MoonLordDefeated")); + } + + return dialogue; } public override void SetChatButtons(ref string button, ref string button2)