diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index f2beb36ff8..ef2a89146b 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -90,6 +90,7 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics On.Terraria.Main.InitLifeBytes += BossRushLifeBytes; IL.Terraria.NPC.NPCLoot += FixSplittingWormBannerDrops; + IL.Terraria.Main.DoUpdate += FixProjectileUpdatePriorityProblems; } /// @@ -163,6 +164,7 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes; IL.Terraria.NPC.NPCLoot -= FixSplittingWormBannerDrops; + IL.Terraria.Main.DoUpdate -= FixProjectileUpdatePriorityProblems; } } } diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 8c065b6390..06a926e3a3 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -4,13 +4,22 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using System; using System.Collections.Generic; +using System.Linq; +using System.Reflection; using Terraria; +using Terraria.GameInput; using Terraria.ID; namespace CalamityMod.ILEditing { public partial class ILChanges { + public struct OrderedProjectileEntry + { + public int OriginalIndex; + public Projectile Proj; + } + // This list should contain all vanilla NPCs present in Boss Rush which ARE NOT bosses and whose health is boosted over 32,767. private static readonly List NeedsFourLifeBytes = new List() { @@ -70,6 +79,8 @@ namespace CalamityMod.ILEditing NPCID.AncientCultistSquidhead, }; + public static readonly List OrderedProjectiles = new List(); + #region Fixing NPC HP Sync Byte Counts in Boss Rush // CONTEXT FOR FIX: When NPCs sync they have a pre-determined amount of bytes that are used to store HP/Max NPC information in packets for efficiency. // However, this may not always coincide with the true HP of the NPC when it's created if it has more HP than the allocated bytes can sufficiently store, which can @@ -127,6 +138,68 @@ namespace CalamityMod.ILEditing } #endregion Fixing Splitting Worm Banner Spam in Deathmode + #region Fix Projectile Update Priority Problems + + // CONTEXT FOR FIX: The way projectile updating works is via looping, starting from 0 and ending at 999. For most cases this works sufficiently. + // However, in contexts where two projectile's update logic are dependent on each-other in some way (such as mechworm segment movement) it is possible + // that one projectile will update unexpectedly before the other, creating gaps. By making the update logic ordered based on a priority system, this can be + // alleviated. + private static void FixProjectileUpdatePriorityProblems(ILContext il) + { + var cursor = new ILCursor(il); + + // Locate the location where the projectile loop starts. + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCallOrCallvirt("SetUP"))) + { + LogFailure("Projectile Update Priority fix", "Could not locate the LockOnHelper.SetUP method."); + return; + } + + // Before doing anything else, prepare the list of ordered projectiles. + cursor.EmitDelegate>>(() => + { + List cache = new List(); + for (int i = 0; i < Main.maxProjectiles; i++) + { + cache.Add(new OrderedProjectileEntry() + { + Proj = Main.projectile[i], + OriginalIndex = i + }); + } + return cache.OrderByDescending(p => p.Proj.active ? p.Proj.Calamity().UpdatePriority : 0f).ToList(); + }); + cursor.Emit(OpCodes.Stsfld, typeof(ILChanges).GetField("OrderedProjectiles", BindingFlags.Static | BindingFlags.Public)); + + // Go before the declaration of the projectile loop index and declare the ordered projectile. + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStsfld
("ProjectileUpdateLoopIndex"))) + { + LogFailure("Projectile Update Priority fix", "Could not locate the ProjectileUpdateLoopIndex field."); + return; + } + + // Replace the projectile reference on the Projectile.Update call. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdelemRef())) + { + LogFailure("Projectile Update Priority fix", $"Could not locate the Main.projectile index load reference."); + return; + } + + // Pop the Main.projectile[i] reference and replace it with OrderedProjectiles[i].Proj. + cursor.Emit(OpCodes.Pop); + cursor.Emit(OpCodes.Ldsfld, typeof(ILChanges).GetField("OrderedProjectiles", BindingFlags.Static | BindingFlags.Public)); + cursor.Emit(OpCodes.Ldloc, 29); + cursor.Emit(OpCodes.Callvirt, typeof(List).GetMethod("get_Item")); + cursor.Emit(OpCodes.Ldfld, typeof(OrderedProjectileEntry).GetField("Proj")); + + // Remove the direct i reference in the Update call and replace it with the original index in the cache, to prevent update ID + // mismatches. + cursor.Remove(); + cursor.Emit(OpCodes.Ldloc, 29); + cursor.EmitDelegate>(i => OrderedProjectiles[i].OriginalIndex); + } + #endregion Fix Projectile Update Priority Problems + #region Make Mouse Hover Items Work with Animated Items private static void MakeMouseHoverItemsSupportAnimations(ILContext il) { diff --git a/Items/Accessories/DaedalusEmblem.cs b/Items/Accessories/DaedalusEmblem.cs index 9745a487e5..7a1d1aa768 100644 --- a/Items/Accessories/DaedalusEmblem.cs +++ b/Items/Accessories/DaedalusEmblem.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Items.Accessories { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CelestialStone); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.RangerEmblem); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/NecklaceofVexation.cs b/Items/Accessories/NecklaceofVexation.cs index f52df007a7..ea438c686f 100644 --- a/Items/Accessories/NecklaceofVexation.cs +++ b/Items/Accessories/NecklaceofVexation.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ItemID.AvengerEmblem); + recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index 78071c595f..da6cedf164 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -38,10 +38,10 @@ namespace CalamityMod.Items.Accessories { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CelestialEmblem); + recipe.AddRecipeGroup("AnyEvilWater", 10); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddRecipeGroup("AnyEvilWater", 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/StatisBlessing.cs b/Items/Accessories/StatisBlessing.cs index a2476b5cd2..4505b01bb1 100644 --- a/Items/Accessories/StatisBlessing.cs +++ b/Items/Accessories/StatisBlessing.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(ItemID.PapyrusScarab); recipe.AddIngredient(ItemID.PygmyNecklace); recipe.AddIngredient(ItemID.SummonerEmblem); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HolyWater, 30); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index cb76aae66c..9bab5dab80 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -40,9 +40,9 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FragmentStardust, 10); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.FragmentStardust, 10); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/StatisNinjaBelt.cs b/Items/Accessories/StatisNinjaBelt.cs index 65c319996a..c8edefe659 100644 --- a/Items/Accessories/StatisNinjaBelt.cs +++ b/Items/Accessories/StatisNinjaBelt.cs @@ -39,10 +39,10 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MasterNinjaGear); recipe.AddIngredient(ItemID.FrogLeg); recipe.AddIngredient(ModContent.ItemType(), 50); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.MasterNinjaGear); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index 33bd8c6d64..0f3398dc86 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -101,8 +101,8 @@ namespace CalamityMod.Items.Accessories.Wings public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddRecipeGroup("WingsGroup"); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddRecipeGroup("WingsGroup"); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.LunarBar, 5); diff --git a/Items/Ammo/ElysianArrow.cs b/Items/Ammo/ElysianArrow.cs index cf2930ecdb..2fc32dc1c5 100644 --- a/Items/Ammo/ElysianArrow.cs +++ b/Items/Ammo/ElysianArrow.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.HolyArrow, 150); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 150); recipe.AddRecipe(); diff --git a/Items/Ammo/FlashBullet.cs b/Items/Ammo/FlashBullet.cs index 74bd7ce6db..4a44c9d14e 100644 --- a/Items/Ammo/FlashBullet.cs +++ b/Items/Ammo/FlashBullet.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Glass, 3); recipe.AddIngredient(ItemID.Grenade); + recipe.AddIngredient(ItemID.Glass, 3); recipe.AddTile(TileID.Anvils); recipe.SetResult(this, 10); recipe.AddRecipe(); diff --git a/Items/Ammo/GodSlayerSlug.cs b/Items/Ammo/GodSlayerSlug.cs index 13e30ffe2b..c1a375a1dc 100644 --- a/Items/Ammo/GodSlayerSlug.cs +++ b/Items/Ammo/GodSlayerSlug.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.EmptyBullet, 999); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this, 999); recipe.AddRecipe(); diff --git a/Items/Ammo/NapalmArrow.cs b/Items/Ammo/NapalmArrow.cs index e9645d97c0..88bccc085f 100644 --- a/Items/Ammo/NapalmArrow.cs +++ b/Items/Ammo/NapalmArrow.cs @@ -31,9 +31,9 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.WoodenArrow, 250); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.Torch); - recipe.AddIngredient(ItemID.WoodenArrow, 250); recipe.AddTile(TileID.Anvils); recipe.SetResult(this, 250); recipe.AddRecipe(); diff --git a/Items/Ammo/TerraArrow.cs b/Items/Ammo/TerraArrow.cs index 12da4f9279..21acf93f00 100644 --- a/Items/Ammo/TerraArrow.cs +++ b/Items/Ammo/TerraArrow.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Ammo public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.WoodenArrow, 250); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this, 250); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaBodyArmor.cs b/Items/Armor/AuricTeslaBodyArmor.cs index 2d815053f4..1544139a86 100644 --- a/Items/Armor/AuricTeslaBodyArmor.cs +++ b/Items/Armor/AuricTeslaBodyArmor.cs @@ -61,8 +61,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); @@ -71,8 +71,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaCuisses.cs b/Items/Armor/AuricTeslaCuisses.cs index 72bae3bee9..f9bfe2eab6 100644 --- a/Items/Armor/AuricTeslaCuisses.cs +++ b/Items/Armor/AuricTeslaCuisses.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ItemID.FlyingCarpet); + recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); @@ -50,8 +50,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ItemID.FlyingCarpet); + recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaHelm.cs b/Items/Armor/AuricTeslaHelm.cs index a905a20cd4..908df2efb5 100644 --- a/Items/Armor/AuricTeslaHelm.cs +++ b/Items/Armor/AuricTeslaHelm.cs @@ -78,8 +78,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaHoodedFacemask.cs b/Items/Armor/AuricTeslaHoodedFacemask.cs index ddf27452c1..a050a7ef89 100644 --- a/Items/Armor/AuricTeslaHoodedFacemask.cs +++ b/Items/Armor/AuricTeslaHoodedFacemask.cs @@ -76,8 +76,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaPlumedHelm.cs b/Items/Armor/AuricTeslaPlumedHelm.cs index 43ce5c8dd7..6ae5b201fd 100644 --- a/Items/Armor/AuricTeslaPlumedHelm.cs +++ b/Items/Armor/AuricTeslaPlumedHelm.cs @@ -83,8 +83,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index af764c0346..ef861917f8 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -92,8 +92,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/AuricTeslaWireHemmedVisage.cs b/Items/Armor/AuricTeslaWireHemmedVisage.cs index 92f44f24dc..fa340c955d 100644 --- a/Items/Armor/AuricTeslaWireHemmedVisage.cs +++ b/Items/Armor/AuricTeslaWireHemmedVisage.cs @@ -76,8 +76,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/PlagueReaperMask.cs b/Items/Armor/PlagueReaperMask.cs index b14af54182..34f66bb4b2 100644 --- a/Items/Armor/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaperMask.cs @@ -96,15 +96,15 @@ namespace CalamityMod.Items.Armor public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.NecroHelmet); recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ItemID.NecroHelmet); recipe.AddIngredient(ItemID.Nanites, 11); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AncientNecroHelmet); recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ItemID.AncientNecroHelmet); recipe.AddIngredient(ItemID.Nanites, 11); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/PlagueReaperStriders.cs b/Items/Armor/PlagueReaperStriders.cs index 3b7d61ce40..9a885999f9 100644 --- a/Items/Armor/PlagueReaperStriders.cs +++ b/Items/Armor/PlagueReaperStriders.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Armor public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.NecroGreaves); recipe.AddIngredient(ModContent.ItemType(), 21); - recipe.AddIngredient(ItemID.NecroGreaves); recipe.AddIngredient(ItemID.Nanites, 17); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Armor/PlagueReaperVest.cs b/Items/Armor/PlagueReaperVest.cs index fff0b8bbac..06849d1378 100644 --- a/Items/Armor/PlagueReaperVest.cs +++ b/Items/Armor/PlagueReaperVest.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Armor public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.NecroBreastplate); //I will instead change the position of the necro armor get trolled recipe.AddIngredient(ModContent.ItemType(), 29); //I like prime numbers =) - recipe.AddIngredient(ItemID.NecroBreastplate); recipe.AddIngredient(ItemID.Nanites, 19); //Change this to 30 and 20 and I will hunt you down recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Potions/SulphurskinPotion.cs b/Items/Potions/SulphurskinPotion.cs index 84bb6b5f51..13cd181d47 100644 --- a/Items/Potions/SulphurskinPotion.cs +++ b/Items/Potions/SulphurskinPotion.cs @@ -36,15 +36,15 @@ namespace CalamityMod.Items.Potions public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 15); //possibly add herbs if added to sulph sea recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ItemID.BottledWater); recipe.AddTile(TileID.Bottles); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Potions/YharimsStimulants.cs b/Items/Potions/YharimsStimulants.cs index c41be912b7..8daafb66d9 100644 --- a/Items/Potions/YharimsStimulants.cs +++ b/Items/Potions/YharimsStimulants.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Items.Potions recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 50); recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ModContent.ItemType(), 50); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Potions/ZenPotion.cs b/Items/Potions/ZenPotion.cs index df91b32972..9ccddede02 100644 --- a/Items/Potions/ZenPotion.cs +++ b/Items/Potions/ZenPotion.cs @@ -35,20 +35,20 @@ namespace CalamityMod.Items.Potions { ModRecipe recipe = new ModRecipe(mod); recipe.alchemy = true; + recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ItemID.PinkGel); recipe.AddIngredient(ItemID.Daybloom); - recipe.AddIngredient(ItemID.BottledWater); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); // Alternative recipe is not "alchemy" because none of the blood orb recipes are recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ItemID.BottledWater); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Potions/ZergPotion.cs b/Items/Potions/ZergPotion.cs index 8fd63b9f3b..7b051e0f80 100644 --- a/Items/Potions/ZergPotion.cs +++ b/Items/Potions/ZergPotion.cs @@ -35,20 +35,20 @@ namespace CalamityMod.Items.Potions { ModRecipe recipe = new ModRecipe(mod); recipe.alchemy = true; + recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.BottledWater); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); // Alternative recipe is not "alchemy" because none of the blood orb recipes are recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ItemID.BottledWater); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Tools/FellerofEvergreens.cs b/Items/Tools/FellerofEvergreens.cs index 9e6d1366b0..c1ee741d67 100644 --- a/Items/Tools/FellerofEvergreens.cs +++ b/Items/Tools/FellerofEvergreens.cs @@ -34,18 +34,18 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TungstenAxe); + recipe.AddIngredient(ItemID.TungstenBar, 10); recipe.AddIngredient(ItemID.Wood, 15); recipe.anyWood = true; - recipe.AddIngredient(ItemID.TungstenBar, 10); - recipe.AddIngredient(ItemID.TungstenAxe); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SilverAxe); + recipe.AddIngredient(ItemID.SilverBar, 10); recipe.AddIngredient(ItemID.Wood, 15); recipe.anyWood = true; - recipe.AddIngredient(ItemID.SilverBar, 10); - recipe.AddIngredient(ItemID.SilverAxe); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/CarnageRay.cs b/Items/Weapons/Magic/CarnageRay.cs index 5799ff4e61..bf47cd7782 100644 --- a/Items/Weapons/Magic/CarnageRay.cs +++ b/Items/Weapons/Magic/CarnageRay.cs @@ -45,10 +45,10 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.WandofSparking); recipe.AddIngredient(ItemID.CrimsonRod); - recipe.AddIngredient(ItemID.AmberStaff); recipe.AddIngredient(ItemID.MagicMissile); + recipe.AddIngredient(ItemID.WandofSparking); + recipe.AddIngredient(ItemID.AmberStaff); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.DemonAltar); diff --git a/Items/Weapons/Magic/ClamorNoctus.cs b/Items/Weapons/Magic/ClamorNoctus.cs index 53540a92a3..f8f8821756 100644 --- a/Items/Weapons/Magic/ClamorNoctus.cs +++ b/Items/Weapons/Magic/ClamorNoctus.cs @@ -108,10 +108,10 @@ Fires night wyverns and stars from the sky that stick to enemies and tiles and e public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/CrystalFlareStaff.cs b/Items/Weapons/Magic/CrystalFlareStaff.cs index 62648425cd..11ce2deb0b 100644 --- a/Items/Weapons/Magic/CrystalFlareStaff.cs +++ b/Items/Weapons/Magic/CrystalFlareStaff.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FrostCore); recipe.AddIngredient(ItemID.FrostStaff); + recipe.AddIngredient(ItemID.FrostCore); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Magic/DivineRetribution.cs b/Items/Weapons/Magic/DivineRetribution.cs index c896620324..4ed7b66c71 100644 --- a/Items/Weapons/Magic/DivineRetribution.cs +++ b/Items/Weapons/Magic/DivineRetribution.cs @@ -92,8 +92,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.LunarCraftingStation); diff --git a/Items/Weapons/Magic/ElementalRay.cs b/Items/Weapons/Magic/ElementalRay.cs index 2da8c36bfe..bcf4e87f8c 100644 --- a/Items/Weapons/Magic/ElementalRay.cs +++ b/Items/Weapons/Magic/ElementalRay.cs @@ -82,9 +82,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/GammaFusillade.cs b/Items/Weapons/Magic/GammaFusillade.cs index 95cb7b463f..fa5c28a46e 100644 --- a/Items/Weapons/Magic/GammaFusillade.cs +++ b/Items/Weapons/Magic/GammaFusillade.cs @@ -38,8 +38,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ItemID.SpellTome); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/MagnaCannon.cs b/Items/Weapons/Magic/MagnaCannon.cs index 5ee9b3e0a2..181429d4b7 100644 --- a/Items/Weapons/Magic/MagnaCannon.cs +++ b/Items/Weapons/Magic/MagnaCannon.cs @@ -51,10 +51,10 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpaceGun); recipe.AddIngredient(ItemID.Granite, 25); recipe.AddIngredient(ItemID.Obsidian, 15); recipe.AddIngredient(ItemID.Amber, 5); - recipe.AddIngredient(ItemID.SpaceGun); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/MagneticMeltdown.cs b/Items/Weapons/Magic/MagneticMeltdown.cs index 1cbfbd2074..08d72198d7 100644 --- a/Items/Weapons/Magic/MagneticMeltdown.cs +++ b/Items/Weapons/Magic/MagneticMeltdown.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.SpectreStaff); recipe.AddIngredient(ItemID.MagnetSphere); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index d30410c68c..2f35fa20f7 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -45,10 +45,10 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.WandofSparking); recipe.AddIngredient(ItemID.Vilethorn); - recipe.AddIngredient(ItemID.AmberStaff); recipe.AddIngredient(ItemID.MagicMissile); + recipe.AddIngredient(ItemID.WandofSparking); + recipe.AddIngredient(ItemID.AmberStaff); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.DemonAltar); diff --git a/Items/Weapons/Magic/PlasmaRifle.cs b/Items/Weapons/Magic/PlasmaRifle.cs index cd51c0e575..4835bc027c 100644 --- a/Items/Weapons/Magic/PlasmaRifle.cs +++ b/Items/Weapons/Magic/PlasmaRifle.cs @@ -81,16 +81,16 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddIngredient(ItemID.Musket); recipe.AddIngredient(ItemID.ToxicFlask); + recipe.AddIngredient(ItemID.Musket); + recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddIngredient(ItemID.TheUndertaker); recipe.AddIngredient(ItemID.ToxicFlask); + recipe.AddIngredient(ItemID.TheUndertaker); + recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/RelicofRuin.cs b/Items/Weapons/Magic/RelicofRuin.cs index 5c31ac073c..687e7a0b6a 100644 --- a/Items/Weapons/Magic/RelicofRuin.cs +++ b/Items/Weapons/Magic/RelicofRuin.cs @@ -50,9 +50,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddRecipeGroup("AnyAdamantiteBar", 5); // This is here to keep the Forbidden Fragment stuff on the same tier. - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); recipe.AddIngredient(ItemID.SpellTome); + recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); + recipe.AddRecipeGroup("AnyAdamantiteBar", 5); // This is here to keep the Forbidden Fragment stuff on the same tier. recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index 1734433b95..2105a5e618 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ShadowbeamStaff); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ItemID.ShadowbeamStaff); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/StratusSphere.cs b/Items/Weapons/Magic/StratusSphere.cs index db5ed2dcbc..e57510c61a 100644 --- a/Items/Weapons/Magic/StratusSphere.cs +++ b/Items/Weapons/Magic/StratusSphere.cs @@ -45,10 +45,10 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.NebulaArcanum); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ItemID.NebulaArcanum); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/TheSwarmer.cs b/Items/Weapons/Magic/TheSwarmer.cs index 408a0de0ee..92460c68ee 100644 --- a/Items/Weapons/Magic/TheSwarmer.cs +++ b/Items/Weapons/Magic/TheSwarmer.cs @@ -40,9 +40,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FragmentVortex, 20); recipe.AddIngredient(ItemID.BeeGun); recipe.AddIngredient(ItemID.WaspGun); + recipe.AddIngredient(ItemID.FragmentVortex, 20); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/TomeofFates.cs b/Items/Weapons/Magic/TomeofFates.cs index 595cebf9ff..a24f6ad852 100644 --- a/Items/Weapons/Magic/TomeofFates.cs +++ b/Items/Weapons/Magic/TomeofFates.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 9); recipe.AddIngredient(ItemID.SpellTome); + recipe.AddIngredient(ModContent.ItemType(), 9); recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 8b330ea2f2..4661786fcb 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -118,9 +118,9 @@ Fires wyverns and colored feathers from the sky that stick to enemies and tiles public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.SoulofFlight, 15); recipe.AddRecipeGroup("AnyMythrilBar", 5); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index a11e598ff8..e4ae226485 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BrokenHeroSword); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ItemID.BrokenHeroSword); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/ArkoftheAncients.cs b/Items/Weapons/Melee/ArkoftheAncients.cs index 8e31999a03..4facc0e5ac 100644 --- a/Items/Weapons/Melee/ArkoftheAncients.cs +++ b/Items/Weapons/Melee/ArkoftheAncients.cs @@ -98,20 +98,20 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.Starfury); recipe.AddIngredient(ItemID.EnchantedSword); recipe.AddIngredient(ItemID.Excalibur); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.Starfury); recipe.AddIngredient(ItemID.Arkhalis); recipe.AddIngredient(ItemID.Excalibur); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/BloodyEdge.cs b/Items/Weapons/Melee/BloodyEdge.cs index a2fcccb570..746cd6113c 100644 --- a/Items/Weapons/Melee/BloodyEdge.cs +++ b/Items/Weapons/Melee/BloodyEdge.cs @@ -37,16 +37,16 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.LightsBane); - recipe.AddIngredient(ItemID.BladeofGrass); recipe.AddIngredient(ItemID.Muramasa); + recipe.AddIngredient(ItemID.BladeofGrass); recipe.AddIngredient(ItemID.FieryGreatsword); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BloodButcherer); - recipe.AddIngredient(ItemID.BladeofGrass); recipe.AddIngredient(ItemID.Muramasa); + recipe.AddIngredient(ItemID.BladeofGrass); recipe.AddIngredient(ItemID.FieryGreatsword); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index a5fd808e17..cef0d9bb13 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ItemID.FieryGreatsword); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/Mourningstar.cs b/Items/Weapons/Melee/Mourningstar.cs index 763d596057..4bd2ad4ab5 100644 --- a/Items/Weapons/Melee/Mourningstar.cs +++ b/Items/Weapons/Melee/Mourningstar.cs @@ -40,10 +40,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SolarEruption); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 6);//Quantities may or may not be intentional hue - recipe.AddIngredient(ItemID.SolarEruption); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/NightsStabber.cs b/Items/Weapons/Melee/NightsStabber.cs index 185974f036..ef7bb40c70 100644 --- a/Items/Weapons/Melee/NightsStabber.cs +++ b/Items/Weapons/Melee/NightsStabber.cs @@ -36,18 +36,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index 28da591b41..d764bf0ef4 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DeathSickle); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.CursedFlame, 20); - recipe.AddIngredient(ItemID.DeathSickle); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/StormRuler.cs b/Items/Weapons/Melee/StormRuler.cs index 0df8b2e7a1..d503d9abc2 100644 --- a/Items/Weapons/Melee/StormRuler.cs +++ b/Items/Weapons/Melee/StormRuler.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.FragmentSolar, 10); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 5d2e3c2c8c..da95fb46ad 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -109,8 +109,8 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.BrokenHeroSword); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/Aeries.cs b/Items/Weapons/Ranged/Aeries.cs index 8f7b53b5d6..320286b261 100644 --- a/Items/Weapons/Ranged/Aeries.cs +++ b/Items/Weapons/Ranged/Aeries.cs @@ -53,8 +53,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpectreBar, 5); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.SpectreBar, 5); recipe.AddIngredient(ItemID.ShroomiteBar, 5); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index ca38b36f73..90dce58d66 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -72,10 +72,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SniperRifle); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 50); - recipe.AddIngredient(ItemID.SniperRifle); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/ElementalEruption.cs b/Items/Weapons/Ranged/ElementalEruption.cs index 5f80285d74..42032e469b 100644 --- a/Items/Weapons/Ranged/ElementalEruption.cs +++ b/Items/Weapons/Ranged/ElementalEruption.cs @@ -55,11 +55,11 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index b09ef658ef..bfefc41eef 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -50,10 +50,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SniperScope); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ItemID.SniperScope); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index ee6008bfc4..180360e186 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -104,11 +104,11 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType()); - recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType()); recipe.AddTile(TileType()); diff --git a/Items/Weapons/Ranged/Impaler.cs b/Items/Weapons/Ranged/Impaler.cs index 4dd46de45c..0e61f4b93b 100644 --- a/Items/Weapons/Ranged/Impaler.cs +++ b/Items/Weapons/Ranged/Impaler.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.StakeLauncher); recipe.AddIngredient(ItemID.ExplosivePowder, 100); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.LivingFireBlock, 75); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index d891084347..d49eb8d6c8 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -69,16 +69,16 @@ namespace CalamityMod.Items.Weapons.Ranged { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.DemonBow); - recipe.AddIngredient(ItemID.MoltenFury); recipe.AddIngredient(ItemID.BeesKnees); + recipe.AddIngredient(ItemID.MoltenFury); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.TendonBow); - recipe.AddIngredient(ItemID.MoltenFury); recipe.AddIngredient(ItemID.BeesKnees); + recipe.AddIngredient(ItemID.MoltenFury); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 95672567ba..cda1a9d3b3 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -88,9 +88,9 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ItemID.Tsunami); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ItemID.SharkFin, 2); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs index cac500b1b0..2b90178150 100644 --- a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs +++ b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs @@ -106,10 +106,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.DaedalusStormbow); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs index 49d5d0873b..abbdea2d0c 100644 --- a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs @@ -71,14 +71,14 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.Uzi); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddIngredient(ItemID.FragmentVortex, 10); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 25); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.Uzi); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index a3e65695b0..2576ddcb16 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -74,12 +74,12 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.Shotgun); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index d09e22f919..61c3ad846f 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -52,8 +52,8 @@ namespace CalamityMod.Items.Weapons.Rogue { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.HolyWater, 20); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.SandstorminaBottle); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 4525001cc9..7107e71c3a 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -55,8 +55,6 @@ namespace CalamityMod.Items.Weapons.Rogue { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 200); - recipe.AddIngredient(ItemID.FrozenKey); - recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); @@ -65,8 +63,10 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ItemID.FrostCore, 2); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.FrozenKey); + recipe.AddIngredient(ItemID.FrostCore, 2); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.IceMachine); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index ba3a074909..229b54a115 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -61,10 +61,10 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DayBreak); recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ItemID.DayBreak); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index 5381430c3c..f2d76609db 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -56,9 +56,9 @@ Stealth strikes continuously leave spectral clones in their wake"); { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 500); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 20); - recipe.AddIngredient(ModContent.ItemType(), 500); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index 52453b8aef..abb6601cfb 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -53,10 +53,10 @@ Stealth strikes leak tar as they fly"); { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.MolotovCocktail, 50); - recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 2dd69e4094..81246ae97c 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -53,9 +53,9 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(ModContent.TileType()); diff --git a/Items/Weapons/Summon/ElementalAxe.cs b/Items/Weapons/Summon/ElementalAxe.cs index ad1c4edb2f..8556f3c823 100644 --- a/Items/Weapons/Summon/ElementalAxe.cs +++ b/Items/Weapons/Summon/ElementalAxe.cs @@ -49,11 +49,11 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/EyeOfNight.cs b/Items/Weapons/Summon/EyeOfNight.cs index d1947859b5..e4ac4993e0 100644 --- a/Items/Weapons/Summon/EyeOfNight.cs +++ b/Items/Weapons/Summon/EyeOfNight.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Summon recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.ImpStaff); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 67912a6ccd..176b89e20e 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Summon recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.ImpStaff); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index 3fe5903194..6cf9ce5349 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -42,19 +42,19 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.OpticStaff); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.OpticStaff); - recipe.AddTile(TileID.MythrilAnvil); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Summon/PrototypeAndromechaRing.cs b/Items/Weapons/Summon/PrototypeAndromechaRing.cs index fd418e71dd..78f2cbb50e 100644 --- a/Items/Weapons/Summon/PrototypeAndromechaRing.cs +++ b/Items/Weapons/Summon/PrototypeAndromechaRing.cs @@ -53,10 +53,10 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 40); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.WingsVortex); + recipe.AddIngredient(ModContent.ItemType(), 40); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index a515e42b6a..f56085f4f7 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -70,10 +70,10 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index e988e1a6d8..bc94b86cdd 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -122,8 +122,11 @@ namespace CalamityMod.Projectiles public int ExplosiveEnchantCountdown = 0; public const int ExplosiveEnchantTime = 2400; - #region SetDefaults - public override void SetDefaults(Projectile projectile) + // Update priority variable. + public float UpdatePriority = 0f; + + #region SetDefaults + public override void SetDefaults(Projectile projectile) { switch (projectile.type) { @@ -419,7 +422,7 @@ namespace CalamityMod.Projectiles // Disable Lunatic Cultist's homing resistance globally ProjectileID.Sets.Homing[projectile.type] = false; - } + } #endregion #region PreAI diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 008eacd3dd..426351fddc 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic // Decide where to position the laserbeam. Vector2 circlePointDirection = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); - projectile.Center = MagicCircle.Center + projectile.velocity * projectile.scale * -12f + Owner.velocity; + projectile.Center = MagicCircle.Center; // Update the laser length. float[] laserLengthSamplePoints = new float[24]; @@ -171,11 +171,11 @@ namespace CalamityMod.Projectiles.Magic GameShaders.Misc["CalamityMod:Flame"].UseImage("Images/Misc/Perlin"); - Vector2[] basePoints = new Vector2[12]; + Vector2[] basePoints = new Vector2[24]; for (int i = 0; i < basePoints.Length; i++) basePoints[i] = projectile.Center + projectile.velocity * i / (basePoints.Length - 1f) * LaserLength; - Vector2 overallOffset = projectile.Size * 0.5f - Main.screenPosition; + Vector2 overallOffset = -Main.screenPosition; RayDrawer.Draw(basePoints, overallOffset, 92); return false; } diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 284c344de7..a2161574c6 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -34,6 +34,9 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { + // Always update before the laserbeam, so that it doesn't recieve strange offsets. + projectile.Calamity().UpdatePriority = 1f; + // If the owner is no longer able to cast the circle, kill it. if (!Owner.channel || Owner.noItems || Owner.CCed) { @@ -55,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic // Decide where to position the magic circle. Vector2 circlePointDirection = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); - projectile.Center = Owner.Center + Vector2.UnitX * Owner.direction * 30f + circlePointDirection * projectile.scale * 56f; + projectile.Center = Owner.Center + circlePointDirection * projectile.scale * 56f; // Adjust the owner's direction. Owner.ChangeDir(projectile.direction); diff --git a/Projectiles/Ranged/ClockworkBowHoldout.cs b/Projectiles/Ranged/ClockworkBowHoldout.cs index a1ba679f13..bf6fa82443 100644 --- a/Projectiles/Ranged/ClockworkBowHoldout.cs +++ b/Projectiles/Ranged/ClockworkBowHoldout.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Ranged private ref float CurrentChargingFrames => ref projectile.ai[0]; private ref float LoadedBolts => ref projectile.ai[1]; private ref float FramesToLoadBolt => ref projectile.localAI[0]; + private ref float LastDirection => ref projectile.localAI[1]; //private ref float Overfilled => ref projectile.localAI[1]; Until i implement the bow animation there is no need for that private float angularSpread = MathHelper.ToRadians(16); @@ -161,20 +162,29 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.myPlayer == projectile.owner) { - float interpolant = Utils.InverseLerp(5f, 25f, projectile.Distance(Main.MouseWorld), true); + float interpolant = Utils.InverseLerp(5f, 25f, Owner.Distance(Main.MouseWorld), true); Vector2 oldVelocity = projectile.velocity; - projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(Main.MouseWorld), interpolant); + projectile.velocity = Vector2.Lerp(projectile.velocity, Owner.SafeDirectionTo(Main.MouseWorld), interpolant); if (projectile.velocity != oldVelocity) { projectile.netSpam = 0; projectile.netUpdate = true; } } + projectile.position = armPosition - projectile.Size * 0.5f + projectile.velocity.SafeNormalize(Vector2.Zero) * 35f; projectile.rotation = projectile.velocity.ToRotation(); - if (projectile.spriteDirection == -1) + int oldDirection = projectile.spriteDirection; + if (oldDirection == -1) projectile.rotation += MathHelper.Pi; - projectile.spriteDirection = projectile.direction; + + projectile.direction = projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); + // If the direction differs from what it originaly was, undo the previous 180 degree turn. + // If this is not done, the bow will have 1 frame of rotational "jitter" when the direction changes based on the + // original angle. This effect looks very strange in-game. + if (projectile.spriteDirection != oldDirection) + projectile.rotation -= MathHelper.Pi; + projectile.timeLeft = 3; } @@ -191,7 +201,6 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - float loops = LoadedBolts + 1; if (LoadedBolts == ClockworkBow.MaxBolts) //If the bow is fully loaded, shave off the part where you draw the arrow that's charging currently loops = LoadedBolts; @@ -231,7 +240,7 @@ namespace CalamityMod.Projectiles.Ranged var BoltTexture = ModContent.GetTexture("CalamityMod/Projectiles/Ranged/PrecisionBolt"); Vector2 PointingTo = new Vector2((float)Math.Cos(projectile.rotation + BoltAngle), (float)Math.Sin(projectile.rotation + BoltAngle)); //It's called trigonometry we do a little trigonometry Vector2 ShiftDown = PointingTo.RotatedBy(-MathHelper.PiOver2); - float FlipFactor = projectile.direction == -1 ? MathHelper.Pi : 0f; + float FlipFactor = Owner.direction < 0 ? MathHelper.Pi : 0f; Vector2 drawPosition = Owner.Center + PointingTo.RotatedBy(FlipFactor) * (20f + (Shift * 40)) - ShiftDown.RotatedBy(FlipFactor) * (BoltTexture.Width / 2) - Main.screenPosition; spriteBatch.Draw(BoltTexture, drawPosition, null, Transparency, projectile.rotation + BoltAngle + MathHelper.PiOver2 + FlipFactor, BoltTexture.Size(), 1f, 0, 0); diff --git a/Projectiles/Ranged/PumplerHoldout.cs b/Projectiles/Ranged/PumplerHoldout.cs index 36a0b69b02..182df02321 100644 --- a/Projectiles/Ranged/PumplerHoldout.cs +++ b/Projectiles/Ranged/PumplerHoldout.cs @@ -177,25 +177,36 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.myPlayer == projectile.owner) { - float interpolant = Utils.InverseLerp(5f, 25f, projectile.Distance(Main.MouseWorld), true); + float interpolant = Utils.InverseLerp(5f, 25f, Owner.Distance(Main.MouseWorld), true); Vector2 oldVelocity = projectile.velocity; - projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(Main.MouseWorld), interpolant); + projectile.velocity = Vector2.Lerp(projectile.velocity, Owner.SafeDirectionTo(Main.MouseWorld), interpolant); if (projectile.velocity != oldVelocity) { projectile.netSpam = 0; projectile.netUpdate = true; } } - - - //Please someone kill me i dont want to deal with offset moments, //Dom oomfie! projectile.position = armPosition - projectile.Size * 0.5f + projectile.velocity.SafeNormalize(Vector2.Zero) * 30f; projectile.rotation = projectile.velocity.ToRotation(); - if (projectile.spriteDirection == -1) + + projectile.position = armPosition - projectile.Size * 0.5f + projectile.velocity.SafeNormalize(Vector2.Zero) * 35f; + projectile.rotation = projectile.velocity.ToRotation(); + + int oldDirection = projectile.spriteDirection; + if (oldDirection == -1) projectile.rotation += MathHelper.Pi; - projectile.spriteDirection = projectile.direction; + + projectile.direction = projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); + // If the direction differs from what it originaly was, undo the previous 180 degree turn. + // If this is not done, the gun will have 1 frame of rotational "jitter" when the direction changes based on the + // original angle. This effect looks very strange in-game. + if (projectile.spriteDirection != oldDirection) + projectile.rotation -= MathHelper.Pi; + + + projectile.timeLeft = 2; } diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index a8bdeb821b..ab1711307e 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 shotPosition = player.RotatedRelativePoint(player.MountedCenter, true); shotPosition += projectile.velocity.ToRotation().ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(40f)).RotatedBy(-0.25f * projectile.spriteDirection) * 42f; - projectile.velocity = projectile.SafeDirectionTo(Main.MouseWorld); + projectile.velocity = player.SafeDirectionTo(Main.MouseWorld); Vector2 shotVelocity = projectile.velocity * shotSpeed; // The velocity should always be a unit vector. diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index 14f97109f5..bfe3e12b62 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -110,6 +110,7 @@ namespace CalamityMod.Projectiles.Summon // Accumulate the total segments of the worm. segmentAhead.localAI[0] = projectile.localAI[0] + 1f; + segmentAhead.Calamity().UpdatePriority = segmentAhead.localAI[0]; // Locate the head segment by looping through the projectile array. // Doing identity checks across every segment would be much more expensive than doing just this one loop.