diff --git a/CalamityLists.cs b/CalamityLists.cs index 3daa47a5bb..d787cb5500 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Ammo.FiniteUse; using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; @@ -155,6 +156,8 @@ namespace CalamityMod public static List ZeroMinionSlotExceptionList; public static List DontCopyOriginalMinionAIList; + public static Dictionary EncryptedSchematicIDRelationship; + public static void LoadLists() { donatorList = new List() @@ -2506,6 +2509,14 @@ namespace CalamityMod { ProjectileType() }; + + EncryptedSchematicIDRelationship = new Dictionary() + { + [1] = ItemType(), + [2] = ItemType(), + [3] = ItemType(), + [4] = ItemType(), + }; } public static void UnloadLists() @@ -2594,6 +2605,8 @@ namespace CalamityMod MinionsToNotResurrectList = null; ZeroMinionSlotExceptionList = null; DontCopyOriginalMinionAIList = null; + + EncryptedSchematicIDRelationship = null; } } } diff --git a/CustomRecipes/ArsenalTierGatedRecipe.cs b/CustomRecipes/ArsenalTierGatedRecipe.cs new file mode 100644 index 0000000000..9830216ac3 --- /dev/null +++ b/CustomRecipes/ArsenalTierGatedRecipe.cs @@ -0,0 +1,28 @@ +using Terraria.ModLoader; + +namespace CalamityMod.CustomRecipes +{ + public class ArsenalTierGatedRecipe : ModRecipe + { + public int Tier; + public ArsenalTierGatedRecipe(Mod mod, int tier) : base(mod) => Tier = tier; + + public override bool RecipeAvailable() + { + switch (Tier) + { + case 1: + return RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes; + case 2: + return RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes; + case 3: + return RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes; + case 4: + return RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes; + case 5: + return RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes; + } + return false; + } + } +} \ No newline at end of file diff --git a/CustomRecipes/RecipeUnlockHandler.cs b/CustomRecipes/RecipeUnlockHandler.cs new file mode 100644 index 0000000000..b768573f22 --- /dev/null +++ b/CustomRecipes/RecipeUnlockHandler.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using System.IO; +using Terraria; + +namespace CalamityMod.CustomRecipes +{ + public static class RecipeUnlockHandler + { + public static bool HasUnlockedT1ArsenalRecipes = false; + public static bool HasUnlockedT2ArsenalRecipes = false; + public static bool HasUnlockedT3ArsenalRecipes = false; + public static bool HasUnlockedT4ArsenalRecipes = false; + public static bool HasUnlockedT5ArsenalRecipes = false; + + public static void Save(List boolTagContainer) + { + boolTagContainer.AddWithCondition("HasUnlockedT1ArsenalRecipes", HasUnlockedT1ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT2ArsenalRecipes", HasUnlockedT2ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT3ArsenalRecipes", HasUnlockedT3ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT4ArsenalRecipes", HasUnlockedT4ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT5ArsenalRecipes", HasUnlockedT5ArsenalRecipes); + } + + public static void Load(IList boolTagContainer) + { + HasUnlockedT1ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT1ArsenalRecipes"); + HasUnlockedT2ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT2ArsenalRecipes"); + HasUnlockedT3ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT3ArsenalRecipes"); + HasUnlockedT4ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT4ArsenalRecipes"); + HasUnlockedT5ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT5ArsenalRecipes"); + } + + public static void SendData(BinaryWriter writer) + { + BitsByte flags = new BitsByte(); + flags[0] = HasUnlockedT1ArsenalRecipes; + flags[1] = HasUnlockedT2ArsenalRecipes; + flags[2] = HasUnlockedT3ArsenalRecipes; + flags[3] = HasUnlockedT4ArsenalRecipes; + flags[4] = HasUnlockedT5ArsenalRecipes; + + writer.Write(flags); + } + + public static void ReceiveData(BinaryReader reader) + { + BitsByte flags = reader.ReadByte(); + HasUnlockedT1ArsenalRecipes = flags[0]; + HasUnlockedT2ArsenalRecipes = flags[1]; + HasUnlockedT3ArsenalRecipes = flags[2]; + HasUnlockedT4ArsenalRecipes = flags[3]; + HasUnlockedT5ArsenalRecipes = flags[4]; + } + } +} \ No newline at end of file diff --git a/Items/DraedonMisc/EncryptedSchematicHell.cs b/Items/DraedonMisc/EncryptedSchematicHell.cs new file mode 100644 index 0000000000..0113e3f8f5 --- /dev/null +++ b/Items/DraedonMisc/EncryptedSchematicHell.cs @@ -0,0 +1,23 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.DraedonMisc +{ + public class EncryptedSchematicHell : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Encrypted Schematic"); + Tooltip.SetDefault("Requires a Codebreaker with a sophisticated display to decrypt"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.maxStack = 1; + } + } +} diff --git a/Items/DraedonMisc/EncryptedSchematic.png b/Items/DraedonMisc/EncryptedSchematicHell.png similarity index 100% rename from Items/DraedonMisc/EncryptedSchematic.png rename to Items/DraedonMisc/EncryptedSchematicHell.png diff --git a/Items/DraedonMisc/EncryptedSchematicIce.cs b/Items/DraedonMisc/EncryptedSchematicIce.cs new file mode 100644 index 0000000000..c1797e3e2d --- /dev/null +++ b/Items/DraedonMisc/EncryptedSchematicIce.cs @@ -0,0 +1,23 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.DraedonMisc +{ + public class EncryptedSchematicIce : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Encrypted Schematic"); + Tooltip.SetDefault("Requires a Codebreaker with a complex voltage regulation system to decrypt"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.maxStack = 1; + } + } +} diff --git a/Items/DraedonMisc/EncryptedSchematicIce.png b/Items/DraedonMisc/EncryptedSchematicIce.png new file mode 100644 index 0000000000..6cd561cb05 Binary files /dev/null and b/Items/DraedonMisc/EncryptedSchematicIce.png differ diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.cs b/Items/DraedonMisc/EncryptedSchematicJungle.cs new file mode 100644 index 0000000000..0cfadc7dc9 --- /dev/null +++ b/Items/DraedonMisc/EncryptedSchematicJungle.cs @@ -0,0 +1,23 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.DraedonMisc +{ + public class EncryptedSchematicJungle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Encrypted Schematic"); + Tooltip.SetDefault("Requires a Codebreaker with a fine tuned, long range sensor to decrypt"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.maxStack = 1; + } + } +} diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.png b/Items/DraedonMisc/EncryptedSchematicJungle.png new file mode 100644 index 0000000000..6cd561cb05 Binary files /dev/null and b/Items/DraedonMisc/EncryptedSchematicJungle.png differ diff --git a/Items/DraedonMisc/EncryptedSchematic.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs similarity index 72% rename from Items/DraedonMisc/EncryptedSchematic.cs rename to Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index 723e05f62f..f675c39f21 100644 --- a/Items/DraedonMisc/EncryptedSchematic.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -3,12 +3,12 @@ using Terraria.ModLoader; namespace CalamityMod.Items.DraedonMisc { - public class EncryptedSchematic : ModItem + public class EncryptedSchematicPlanetoid : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Encrypted Schematic"); - Tooltip.SetDefault("May be deciphered at the Codebreaker if it is upgraded enough"); + Tooltip.SetDefault("Requires a Codebreaker with a computer to decrypt"); } public override void SetDefaults() @@ -17,7 +17,7 @@ namespace CalamityMod.Items.DraedonMisc item.height = 42; item.rare = ItemRarityID.Red; item.Calamity().customRarity = CalamityRarity.DraedonRust; - item.maxStack = 999; + item.maxStack = 1; } } } diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.png b/Items/DraedonMisc/EncryptedSchematicPlanetoid.png new file mode 100644 index 0000000000..6cd561cb05 Binary files /dev/null and b/Items/DraedonMisc/EncryptedSchematicPlanetoid.png differ diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs new file mode 100644 index 0000000000..0d4e2de9a1 --- /dev/null +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -0,0 +1,24 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.DraedonMisc +{ + public class EncryptedSchematicSunkenSea : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Schematic"); + Tooltip.SetDefault("You can barely make out its text. It states:\n" + + "Something idk"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.maxStack = 1; + } + } +} diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.png b/Items/DraedonMisc/EncryptedSchematicSunkenSea.png new file mode 100644 index 0000000000..6cd561cb05 Binary files /dev/null and b/Items/DraedonMisc/EncryptedSchematicSunkenSea.png differ diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index ef1d2a0bc4..9e3aa6746f 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -13,7 +13,7 @@ namespace CalamityMod.TileEntities public class TECodebreaker : ModTileEntity { public int InputtedCellCount; - public bool HasSchematic; + public int HeldSchematicID; public int DecryptionCountdown; public int DecryptionTotalTime => 1800; @@ -24,6 +24,51 @@ namespace CalamityMod.TileEntities public bool ContainsAdvancedDisplay; public bool ContainsVoltageRegulationSystem; public bool ContainsCoolingCell; + + public bool CanDecryptHeldSchematic + { + get + { + // You can't decrypt nothing. + if (HeldSchematicID == 0) + return false; + + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer && ContainsSensorArray; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer && ContainsSensorArray && ContainsAdvancedDisplay; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer && ContainsSensorArray && ContainsAdvancedDisplay && ContainsVoltageRegulationSystem; + + return false; + } + } + + public string UnderlyingSchematicText + { + get + { + // You can't decrypt nothing. + if (HeldSchematicID == 0) + return string.Empty; + + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; + if (schematicType == ModContent.ItemType()) + return "test1"; + if (schematicType == ModContent.ItemType()) + return "test2"; + if (schematicType == ModContent.ItemType()) + return "test3"; + if (schematicType == ModContent.ItemType()) + return "test4"; + + return string.Empty; + } + } + public Vector2 Center => Position.ToWorldCoordinates(8f * CodebreakerTile.Width, 8f * CodebreakerTile.Height); // This guarantees that this tile entity will not persist if not placed directly on the top left corner of a Charging Station tile. @@ -56,7 +101,7 @@ namespace CalamityMod.TileEntities public override void Update() => UpdateTime(); - public void DropConstituents(int x, int y) + public void DropConstituents(int x, int y) { if (ContainsDecryptionComputer) Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); @@ -68,7 +113,10 @@ namespace CalamityMod.TileEntities Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); if (ContainsCoolingCell) Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); - } + + if (HeldSchematicID != 0) + Item.NewItem(x * 16, y * 16, 32, 32, CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]); + } public void SyncConstituents() { @@ -125,7 +173,7 @@ namespace CalamityMod.TileEntities packet.Write((byte)CalamityModMessageType.UpdateCodebreakerContainedStuff); packet.Write(ID); packet.Write(InputtedCellCount); - packet.Write(HasSchematic); + packet.Write(HeldSchematicID); } public static void ReadContainmentSync(Mod mod, BinaryReader reader) @@ -136,7 +184,7 @@ namespace CalamityMod.TileEntities // Continue reading to the end even if a tile entity with the given ID does not exist. // Not doing this will cause errors/bugs. int cellCount = reader.ReadInt32(); - bool hasSchematic = reader.ReadBoolean(); + int schematicID = reader.ReadInt32(); // After doing reading, check again to see if the tile entity is actually there. // If it isn't don't bother doing anything else. @@ -148,7 +196,7 @@ namespace CalamityMod.TileEntities return; codebreakerTileEntity.InputtedCellCount = cellCount; - codebreakerTileEntity.HasSchematic = hasSchematic; + codebreakerTileEntity.HeldSchematicID = schematicID; } public void UpdateTime() @@ -165,7 +213,8 @@ namespace CalamityMod.TileEntities ["ContainsSensorArray"] = ContainsSensorArray, ["ContainsAdvancedDisplay"] = ContainsAdvancedDisplay, ["ContainsVoltageRegulationSystem"] = ContainsVoltageRegulationSystem, - ["ContainsCoolingCell"] = ContainsCoolingCell + ["ContainsCoolingCell"] = ContainsCoolingCell, + ["HeldSchematicID"] = HeldSchematicID }; } @@ -176,6 +225,7 @@ namespace CalamityMod.TileEntities ContainsAdvancedDisplay = tag.GetBool("ContainsAdvancedDisplay"); ContainsVoltageRegulationSystem = tag.GetBool("ContainsVoltageRegulationSystem"); ContainsCoolingCell = tag.GetBool("ContainsCoolingCell"); + HeldSchematicID = tag.GetInt("HeldSchematicID"); } public override void NetSend(BinaryWriter writer, bool lightSend) @@ -185,6 +235,7 @@ namespace CalamityMod.TileEntities writer.Write(ContainsAdvancedDisplay); writer.Write(ContainsVoltageRegulationSystem); writer.Write(ContainsCoolingCell); + writer.Write(HeldSchematicID); } public override void NetReceive(BinaryReader reader, bool lightReceive) @@ -194,6 +245,7 @@ namespace CalamityMod.TileEntities ContainsAdvancedDisplay = reader.ReadBoolean(); ContainsVoltageRegulationSystem = reader.ReadBoolean(); ContainsCoolingCell = reader.ReadBoolean(); + HeldSchematicID = reader.ReadInt32(); } } } diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index c908be04ad..428a9d6139 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -3,6 +3,7 @@ using CalamityMod.TileEntities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Linq; using System.Text; using Terraria; using Terraria.DataStructures; @@ -69,12 +70,19 @@ namespace CalamityMod.UI Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); Texture2D occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Full"); - Texture2D schematicTexture = codebreakerTileEntity.HasSchematic ? occupiedSchematicIconTexture : emptySchematicIconTexture; + Texture2D schematicTexture = codebreakerTileEntity.HeldSchematicID != 0 ? occupiedSchematicIconTexture : emptySchematicIconTexture; spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); + // Display some error text if the codebreaker isn't strong enough to decrypt the text. + if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) + { + Vector2 errorDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; + DisplayNotStrongEnoughErrorText(errorDisplayLocation); + } + // Handle decryption costs. - if (codebreakerTileEntity.HasSchematic && codebreakerTileEntity.DecryptionCountdown == 0) + else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0) { int cost = 30; Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; @@ -91,17 +99,20 @@ namespace CalamityMod.UI Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); - // Generate gibberish and use slowly insert the real text at the beginning. + // Generate gibberish and use slowly insert the real text. // When decryption is done the gibberish will go away and only the underlying text will remain. int textPadding = 6; - string trueMessage = "The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal."; + string trueMessage = codebreakerTileEntity.UnderlyingSchematicText; StringBuilder text = new StringBuilder(codebreakerTileEntity.DecryptionCountdown == 0 ? trueMessage : CalamityUtils.GenerateRandomAlphanumericString(500)); + // Don't mess with whitespace characters. Doing so can cause the word-wrap to "jump" around. for (int i = 0; i < trueMessage.Length; i++) { if (char.IsWhiteSpace(trueMessage[i])) text[i] = trueMessage[i]; } + + // Insert the necessary amount of true text. for (int i = 0; i < (int)(trueMessage.Length * codebreakerTileEntity.DecryptionCompletion); i++) text[i] = trueMessage[i]; @@ -204,21 +215,23 @@ namespace CalamityMod.UI if (Main.mouseLeft && Main.mouseLeftRelease) { - if (playerHandItem.IsAir && codebreakerTileEntity.HasSchematic) + if (playerHandItem.IsAir && codebreakerTileEntity.HeldSchematicID != 0) { - playerHandItem.SetDefaults(ModContent.ItemType()); - codebreakerTileEntity.HasSchematic = false; + playerHandItem.SetDefaults(CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]); + codebreakerTileEntity.HeldSchematicID = 0; codebreakerTileEntity.DecryptionCountdown = 0; codebreakerTileEntity.SyncContainedStuff(); Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; } - else if (playerHandItem.type == ModContent.ItemType()) + else if (CalamityLists.EncryptedSchematicIDRelationship.ContainsValue(playerHandItem.type)) { + codebreakerTileEntity.HeldSchematicID = CalamityLists.EncryptedSchematicIDRelationship.First(i => i.Value == Main.mouseItem.type).Key; playerHandItem.TurnToAir(); - codebreakerTileEntity.HasSchematic = true; codebreakerTileEntity.SyncContainedStuff(); Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; } } @@ -257,5 +270,12 @@ namespace CalamityMod.UI Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); } + + public static void DisplayNotStrongEnoughErrorText(Vector2 drawPosition) + { + string text = "Encryption unsolveable: Upgrades required."; + drawPosition.X -= 30f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.IndianRed * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + } } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 445f06248d..377a9dbcc3 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Events; using CalamityMod.NPCs; @@ -456,6 +457,8 @@ namespace CalamityMod.World if (HasGeneratedLuminitePlanetoids) downed.Add("HasGeneratedLuminitePlanetoids"); + RecipeUnlockHandler.Save(downed); + return new TagCompound { { @@ -560,6 +563,8 @@ namespace CalamityMod.World encounteredOldDuke = downed.Contains("encounteredOldDuke"); HasGeneratedLuminitePlanetoids = downed.Contains("HasGeneratedLuminitePlanetoids"); + RecipeUnlockHandler.Load(downed); + abyssChasmBottom = tag.GetInt("abyssChasmBottom"); acidRainPoints = tag.GetInt("acidRainPoints"); Reforges = tag.GetInt("Reforges"); @@ -803,6 +808,9 @@ namespace CalamityMod.World writer.Write(flags8); writer.Write(flags9); writer.Write(flags10); + + RecipeUnlockHandler.SendData(writer); + writer.Write(abyssChasmBottom); writer.Write(acidRainPoints); writer.Write(Reforges); @@ -914,6 +922,8 @@ namespace CalamityMod.World _ = flags10[6]; _ = flags10[7]; + RecipeUnlockHandler.ReceiveData(reader); + abyssChasmBottom = reader.ReadInt32(); acidRainPoints = reader.ReadInt32(); Reforges = reader.ReadInt32(); diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index f10e8a59d7..00ecb4d969 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -227,7 +227,7 @@ namespace CalamityMod.World { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(2, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(2, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { @@ -298,7 +298,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { @@ -365,7 +365,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } // If it's a frozen chest. if (type == TileID.Containers) @@ -448,7 +448,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { @@ -541,7 +541,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) {