From 0ff3b941b4701589e685a46b0f03387484eb78bb Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 2 Sep 2022 13:23:37 -0400 Subject: [PATCH] reforge cleanup + comments --- Utilities/ItemUtils.cs | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index a9fc2f350c..2e0750b745 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -171,10 +171,10 @@ namespace CalamityMod { int[][] accessoryReforgeTiers = new int[][] { - /* 0 */ new int[] { PrefixID.Hard, PrefixID.Jagged, PrefixID.Brisk, PrefixID.Wild, PrefixID.Arcane, GetCalPrefix("Quiet") }, + /* 0 */ new int[] { PrefixID.Hard, PrefixID.Jagged, PrefixID.Brisk, PrefixID.Wild, GetCalPrefix("Quiet") }, /* 1 */ new int[] { PrefixID.Guarding, PrefixID.Spiked, PrefixID.Precise, PrefixID.Fleeting, PrefixID.Rash, GetCalPrefix("Cloaked") }, /* 2 */ new int[] { PrefixID.Armored, PrefixID.Angry, PrefixID.Hasty2, PrefixID.Intrepid, PrefixID.Arcane, GetCalPrefix("Camouflaged") }, - /* 3 */ new int[] { PrefixID.Warding, PrefixID.Menacing, PrefixID.Quick2, PrefixID.Violent, PrefixID.Lucky, GetCalPrefix("Silent") }, + /* 3 */ new int[] { PrefixID.Warding, PrefixID.Menacing, PrefixID.Lucky, PrefixID.Quick2, PrefixID.Violent, GetCalPrefix("Silent") }, }; prefix = IteratePrefix(rand, accessoryReforgeTiers, currentPrefix); } @@ -182,17 +182,30 @@ namespace CalamityMod // MELEE (includes tools and whips) else if (item.CountsAsClass() || item.CountsAsClass()) { + // Terrarian (has its own special "Legendary" for marketing reasons) + if (item.type == ItemID.Terrarian) + { + int[][] terrarianReforgeTiers = new int[][] + { + /* 0 */ new int[] { PrefixID.Keen, PrefixID.Forceful, PrefixID.Strong }, + /* 1 */ new int[] { PrefixID.Hurtful, PrefixID.Ruthless, PrefixID.Zealous }, + /* 2 */ new int[] { PrefixID.Superior, PrefixID.Demonic, PrefixID.Godly }, + /* 3 */ new int[] { PrefixID.Legendary2 }, + }; + prefix = IteratePrefix(rand, terrarianReforgeTiers, currentPrefix); + } + // Yoyos, Flails, Spears, etc. - if ((item.channel || item.noMelee) && item.type != ItemID.Zenith && item.useStyle != ItemUseStyleID.Rapier) + // Spears actually work fine with Legendary, but vanilla doesn't give it to them, so we won't either. + // Zenith and rapiers are specifically excluded from this, so they get broadsword reforges despite not scaling with melee speed. + else if ((item.channel || item.noMelee) && item.type != ItemID.Zenith && item.useStyle != ItemUseStyleID.Rapier) { - // The Terrarian can get a special "Legendary" reforge - bool terrarian = item.type == ItemID.Terrarian; int[][] meleeNoSpeedReforgeTiers = new int[][] { /* 0 */ new int[] { PrefixID.Keen, PrefixID.Forceful, PrefixID.Strong }, /* 1 */ new int[] { PrefixID.Hurtful, PrefixID.Ruthless, PrefixID.Zealous }, - /* 2 */ terrarian ? new int[] { PrefixID.Superior, PrefixID.Demonic, PrefixID.Godly } : new int[] { PrefixID.Superior, PrefixID.Demonic }, - /* 3 */ terrarian ? new int[] { PrefixID.Legendary2 } : new int[] { PrefixID.Godly } + /* 2 */ new int[] { PrefixID.Superior, PrefixID.Demonic }, + /* 3 */ new int[] { PrefixID.Godly } }; prefix = IteratePrefix(rand, meleeNoSpeedReforgeTiers, currentPrefix); }