From 720a6437ca2d5a4faa0184782ec974733e59ab71 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sun, 24 Mar 2024 22:49:12 -0700 Subject: [PATCH] forge required for more dialogue --- CalPlayer/CalamityPlayer.cs | 3 +++ .../Furniture/CraftingStations/DraedonsForge.cs | 14 ++++++++++++++ Localization/en-US/Mods.CalamityMod.UI.hjson | 4 ++-- UI/DraedonSummoning/CodebreakerUI.Communication.cs | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 70e9ea4116..4e98779649 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1179,6 +1179,7 @@ namespace CalamityMod.CalPlayer #region Draedon Summoning public bool AbleToSelectExoMech = false; public bool HasTalkedAtCodebreaker = false; + public bool HasCraftedDraedonsForge = false; public List SeenDraedonDialogs = new(); #endregion Draedon Summoning @@ -1313,6 +1314,7 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("newCalamitasInventory", newCalamitasInventory); boost.AddWithCondition("GivenBrimstoneLocus", GivenBrimstoneLocus); boost.AddWithCondition("HasTalkedAtCodebreaker", HasTalkedAtCodebreaker); + boost.AddWithCondition("HasCraftedDraedonsForge", HasCraftedDraedonsForge); // Calculate the new total time of all sessions at the instant of this player save. TimeSpan newSessionTotal = previousSessionTotal.Add(CalamityMod.SpeedrunTimer.Elapsed); @@ -1403,6 +1405,7 @@ namespace CalamityMod.CalPlayer newCalamitasInventory = boost.Contains("newCalamitasInventory"); GivenBrimstoneLocus = boost.Contains("GivenBrimstoneLocus"); HasTalkedAtCodebreaker = boost.Contains("HasTalkedAtCodebreaker"); + HasCraftedDraedonsForge = boost.Contains("HasCraftedDraedonsForge"); // Load rage if it's there, which it will be for any players saved with 1.5. // Older players have "stress" instead, which will be ignored. This is intentional. diff --git a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs index 229205fecf..60d8f1eb10 100644 --- a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs +++ b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs @@ -9,6 +9,20 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public class DraedonsForge : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Terraria.On_Recipe.ConsumeForCraft += DraeforgeUnlockDetour; + } + + private static bool DraeforgeUnlockDetour(On_Recipe.orig_ConsumeForCraft orig, Recipe self, Item item, Item requiredItem, ref int stackRequired) + { + if (self.HasTile(ModContent.TileType())) + { + Main.LocalPlayer.Calamity().HasCraftedDraedonsForge = true; + } + return orig(self, item, requiredItem, ref stackRequired); + } + public override void SetDefaults() { Item.width = 58; diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 44d2a3bba7..7c4de20acc 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -110,7 +110,7 @@ Cooldowns: { SandsmokeBombActive: Sandsmoke Bomb Duration SandsmokeBombCooldown: Sandsmoke Bomb Cooldown SilvaRevive: Silva Revive Cooldown - SpeedBlasterBoost: Speed Blaster Boost + SpeedBlasterBoost: Speed Blaster Boost SpongeDurability: Sponge Barrier Durability SpongeRecharge: Sponge Barrier Recharge TarragonCloak: Tarragon Cloak Cooldown @@ -154,7 +154,7 @@ Communication: { } WhoAreYouPart2: { - Inquiry: Introduction 2 + Inquiry: Task Complete Response: ''' Excellent. I can tell that you have successfully taken advantage of the Exo Prisms. Before you waste your breath asking me how I know, Exo Prisms, along with many other parts of my machines, have tracking devices embedded within to both monitor my creations and prevent theft.\n\n diff --git a/UI/DraedonSummoning/CodebreakerUI.Communication.cs b/UI/DraedonSummoning/CodebreakerUI.Communication.cs index 988a374cce..c301e33376 100644 --- a/UI/DraedonSummoning/CodebreakerUI.Communication.cs +++ b/UI/DraedonSummoning/CodebreakerUI.Communication.cs @@ -394,7 +394,7 @@ namespace CalamityMod.UI.DraedonSummoning { // Skip/isolate the introduction text as needed. string inquiry = dialog.Inquiry; - if (!Main.LocalPlayer.Calamity().HasTalkedAtCodebreaker && !DialogOptions[0].HasBeenSeen) + if (!Main.LocalPlayer.Calamity().HasCraftedDraedonsForge) { if (inquiry != DialogOptions[0].Inquiry) continue;