diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index d5a8b5302d..98be736e1f 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -134,7 +134,6 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics Terraria.IL_NPC.NPCLoot += FixSplittingWormBannerDrops; - Terraria.On_Item.Prefix += LetRogueItemsBeReforgeable; // Should not be necessary in 1.4 // IL.Terraria.Main.DoUpdate += FixProjectileUpdatePriorityProblems; diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index d87272f3c1..1eef86e629 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -135,19 +135,6 @@ namespace CalamityMod.ILEditing } #endregion Fixing Splitting Worm Banner Spam in Deathmode - #region Let Rogue Items Be Reforgeable - private static bool LetRogueItemsBeReforgeable(Terraria.On_Item.orig_Prefix orig, Item self, int pre) - { - if (self.CountsAsClass() && self.maxStack == 1 && pre == -3) - { - PrefixLoader.Roll(self, ref pre, 40, WorldGen.gen ? WorldGen.genRand : Main.rand, PrefixCategory.AnyWeapon); - return true; - } - - return orig(self, pre); - } - #endregion Let Rogue Items Be Reforgeable - #region Fix Projectile Update Priority Problems // This IL edit is commented out because it seems to be causing issues, sometimes creating errors preventing Terraria from updating diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index 27c5ecc24a..71359c25b2 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -7,6 +7,9 @@ namespace CalamityMod.Items.Weapons.Rogue { public abstract class RogueWeapon : ModItem { + // Apparently custom damage classes for weapons still don't allow for generic weapon prefixes + public override bool WeaponPrefix() => true; + public override bool RangedPrefix() => false; public override void ModifyResearchSorting(ref ItemGroup itemGroup) => itemGroup = (ItemGroup)CalamityResearchSorting.RogueWeapon; diff --git a/Prefixes/RogueWeaponPrefix.cs b/Prefixes/RogueWeaponPrefix.cs index 1dd9681e47..0803460f55 100644 --- a/Prefixes/RogueWeaponPrefix.cs +++ b/Prefixes/RogueWeaponPrefix.cs @@ -127,7 +127,8 @@ namespace CalamityMod.Prefixes internal float shootSpeedMult = 1f; internal float stealthDmgMult = 1f; - public override PrefixCategory Category => PrefixCategory.Custom; + // The part where it can only be rolled by rogue weapons is done by CanRoll below + public override PrefixCategory Category => PrefixCategory.AnyWeapon; public RogueWeaponPrefix() { } @@ -152,7 +153,7 @@ namespace CalamityMod.Prefixes valueMult *= extraValue; } - public override bool CanRoll(Item item) => item.CountsAsClass() && (item.maxStack == 1 || item.AllowReforgeForStackableItem) && GetType() != typeof(RogueWeaponPrefix); + public override bool CanRoll(Item item) => item.CountsAsClass() && (item.maxStack == 1 || item.AllowReforgeForStackableItem) && GetType() != typeof(RogueWeaponPrefix); public override void SetStats(ref float damageMult, ref float knockbackMult, ref float useTimeMult, ref float scaleMult, ref float shootSpeedMult, ref float manaMult, ref int critBonus) {