From 3cb03f994a65933e7f62e3d8a6e009504ad5eee0 Mon Sep 17 00:00:00 2001 From: Big Duckie Date: Tue, 5 Jul 2022 16:17:11 -0600 Subject: [PATCH] Clean up accessory code. --- Items/Accessories/HallowedBand.cs | 14 ++++---- Items/Accessories/HarmonyScarf.cs | 35 +++++++++---------- Items/Accessories/HarmonyScarfUpgraded.cs | 36 +++++++++---------- Items/Accessories/HellfireBand.cs | 13 ++++--- Items/Accessories/IronBand.cs | 11 +++--- Items/Accessories/LunaticBand.cs | 42 +++++++++++------------ Items/Accessories/NebulaBand.cs | 17 +++++---- Items/Accessories/SolarBand.cs | 17 +++++---- Items/Accessories/StardustBand.cs | 17 +++++---- Items/Accessories/ValkyrieWings.cs | 10 +++--- Items/Accessories/VortexBand.cs | 17 +++++---- 11 files changed, 111 insertions(+), 118 deletions(-) diff --git a/Items/Accessories/HallowedBand.cs b/Items/Accessories/HallowedBand.cs index 9eeb775..d62863e 100644 --- a/Items/Accessories/HallowedBand.cs +++ b/Items/Accessories/HallowedBand.cs @@ -25,16 +25,16 @@ public class HallowedBand : ModItem public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage(DamageClass.Generic) += 0.08f; - player.buffImmune[24] = true; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() { - Recipe recipe = CreateRecipe(); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.HallowedBar, 3); - recipe.AddIngredient(ItemID.Ruby, 2); - recipe.AddTile(TileID.Anvils); - recipe.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.HallowedBar, 3) + .AddIngredient(ItemID.Ruby, 2) + .AddTile(TileID.Anvils) + .Register(); } } diff --git a/Items/Accessories/HarmonyScarf.cs b/Items/Accessories/HarmonyScarf.cs index 59e9476..4550be3 100644 --- a/Items/Accessories/HarmonyScarf.cs +++ b/Items/Accessories/HarmonyScarf.cs @@ -9,7 +9,6 @@ public class HarmonyScarf : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Harmony Scarf"); Tooltip.SetDefault("Increases Max HP and Mana by 60\n20% increased all damage \nGrants immunity to the [c/FF4E00:On Fire!], [c/A84DFD:Distorted], and [c/9362B3:Obstructed] debuffs \n'This would be a nice gift for a partner!'"); } @@ -28,26 +27,26 @@ public class HarmonyScarf : ModItem player.statManaMax2 += 60; player.statLifeMax2 += 60; player.GetDamage(DamageClass.Generic) += 0.2f; - player.buffImmune[24] = true; - player.buffImmune[164] = true; - player.buffImmune[163] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe recipe = CreateRecipe(); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.LeafWand, 1); - recipe.AddIngredient(ItemID.Emerald, 8); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.AddIngredient(ItemID.SoulofSight, 15); - recipe.AddIngredient(ItemID.SoulofFright, 15); - recipe.AddIngredient(ItemID.SoulofMight, 15); - recipe.AddIngredient(ItemID.LunarBar, 8); - recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddTile(ModContent.TileType()); - recipe.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.LeafWand) + .AddIngredient(ItemID.Emerald, 8) + .AddIngredient(ItemID.SoulofLight, 15) + .AddIngredient(ItemID.SoulofNight, 15) + .AddIngredient(ItemID.SoulofSight, 15) + .AddIngredient(ItemID.SoulofFright, 15) + .AddIngredient(ItemID.SoulofMight, 15) + .AddIngredient(ItemID.LunarBar, 8) + .AddIngredient(ModContent.ItemType(), 8) + .AddTile(ModContent.TileType()) + .Register(); } } diff --git a/Items/Accessories/HarmonyScarfUpgraded.cs b/Items/Accessories/HarmonyScarfUpgraded.cs index b075d9e..9ef7e5a 100644 --- a/Items/Accessories/HarmonyScarfUpgraded.cs +++ b/Items/Accessories/HarmonyScarfUpgraded.cs @@ -28,27 +28,27 @@ public class HarmonyScarfUpgraded : ModItem player.statManaMax2 += 120; player.statLifeMax2 += 120; player.GetDamage(DamageClass.Generic) += 0.3f; - player.buffImmune[24] = true; - player.buffImmune[164] = true; - player.buffImmune[163] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.Sapphire, 15); - val.AddIngredient(ItemID.Ruby, 15); - val.AddIngredient(ItemID.Amethyst, 15); - val.AddIngredient(ItemID.SoulofLight, 30); - val.AddIngredient(ItemID.SoulofNight, 30); - val.AddIngredient(ItemID.SoulofSight, 30); - val.AddIngredient(ItemID.SoulofFright, 30); - val.AddIngredient(ItemID.SoulofMight, 30); - val.AddIngredient(ItemID.LunarBar, 20); - val.AddIngredient(ModContent.ItemType(), 20); - val.AddTile(ModContent.TileType()); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.Sapphire, 15) + .AddIngredient(ItemID.Ruby, 15) + .AddIngredient(ItemID.Amethyst, 15) + .AddIngredient(ItemID.SoulofLight, 30) + .AddIngredient(ItemID.SoulofNight, 30) + .AddIngredient(ItemID.SoulofSight, 30) + .AddIngredient(ItemID.SoulofFright, 30) + .AddIngredient(ItemID.SoulofMight, 30) + .AddIngredient(ItemID.LunarBar, 20) + .AddIngredient(ModContent.ItemType(), 20) + .AddTile(ModContent.TileType()) + .Register(); } } diff --git a/Items/Accessories/HellfireBand.cs b/Items/Accessories/HellfireBand.cs index b299995..2b05c75 100644 --- a/Items/Accessories/HellfireBand.cs +++ b/Items/Accessories/HellfireBand.cs @@ -9,7 +9,6 @@ public class HellfireBand : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Hellfire Band"); Tooltip.SetDefault("4% increased all damage \nGrants immunity to the [c/FF4E00:On Fire!] debuff"); } @@ -26,15 +25,15 @@ public class HellfireBand : ModItem public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage(DamageClass.Generic) += 0.04f; - player.buffImmune[24] = true; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.HellstoneBar, 3); - val.AddTile(TileID.Anvils); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.HellstoneBar, 3) + .AddTile(TileID.Anvils) + .Register(); } } diff --git a/Items/Accessories/IronBand.cs b/Items/Accessories/IronBand.cs index 3c90f68..eb3a0bc 100644 --- a/Items/Accessories/IronBand.cs +++ b/Items/Accessories/IronBand.cs @@ -9,7 +9,6 @@ public class IronBand : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Iron Band"); } public override void SetDefaults() @@ -24,10 +23,10 @@ public class IronBand : ModItem public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddRecipeGroup("IronBar", 3); - val.AddTile(TileID.Anvils); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddRecipeGroup("IronBar", 3) + .AddTile(TileID.Anvils) + .Register(); } } diff --git a/Items/Accessories/LunaticBand.cs b/Items/Accessories/LunaticBand.cs index b22e644..cdbec43 100644 --- a/Items/Accessories/LunaticBand.cs +++ b/Items/Accessories/LunaticBand.cs @@ -27,34 +27,34 @@ public class LunaticBand : ModItem { player.GetDamage(DamageClass.Generic) += 0.14f; player.buffImmune[BuffID.OnFire] = true; - player.buffImmune[BuffID.VortexDebuff] = true; player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.LunarBar, 8); - val.AddTile(TileID.LunarCraftingStation); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.LunarBar, 8) + .AddTile(TileID.LunarCraftingStation) + .Register(); - Recipe val2 = CreateRecipe(); - val2.AddIngredient(ModContent.ItemType()); - val2.AddIngredient(ItemID.LunarBar, 8); - val2.AddTile(TileID.LunarCraftingStation); - val2.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.LunarBar, 8) + .AddTile(TileID.LunarCraftingStation) + .Register(); - Recipe val3 = CreateRecipe(); - val3.AddIngredient(ModContent.ItemType()); - val3.AddIngredient(ItemID.LunarBar, 8); - val3.AddTile(TileID.LunarCraftingStation); - val3.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.LunarBar, 8) + .AddTile(TileID.LunarCraftingStation) + .Register(); - Recipe val4 = CreateRecipe(); - val4.AddIngredient(ModContent.ItemType()); - val4.AddIngredient(ItemID.LunarBar, 8); - val4.AddTile(TileID.LunarCraftingStation); - val4.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.LunarBar, 8) + .AddTile(TileID.LunarCraftingStation) + .Register(); } } diff --git a/Items/Accessories/NebulaBand.cs b/Items/Accessories/NebulaBand.cs index f2a3e66..8b0114c 100644 --- a/Items/Accessories/NebulaBand.cs +++ b/Items/Accessories/NebulaBand.cs @@ -9,7 +9,6 @@ public class NebulaBand : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Nebula Band"); Tooltip.SetDefault("12% increased magic damage \nGrants immunity to the [c/FF4E00:On Fire!], [c/A84DFD:Distorted], and [c/9362B3:Obstructed] debuffs"); } @@ -26,17 +25,17 @@ public class NebulaBand : ModItem public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage(DamageClass.Magic) += 0.12f; - player.buffImmune[24] = true; - player.buffImmune[164] = true; - player.buffImmune[163] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.FragmentNebula, 6); - val.AddTile(TileID.LunarCraftingStation); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.FragmentNebula, 6) + .AddTile(TileID.LunarCraftingStation) + .Register(); } } diff --git a/Items/Accessories/SolarBand.cs b/Items/Accessories/SolarBand.cs index 1f112ff..58f5ab8 100644 --- a/Items/Accessories/SolarBand.cs +++ b/Items/Accessories/SolarBand.cs @@ -9,7 +9,6 @@ public class SolarBand : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Solar Band"); Tooltip.SetDefault("12% increased melee and throwing damage \nGrants immunity to the [c/FF4E00:On Fire!], [c/A84DFD:Distorted], and [c/9362B3:Obstructed] debuffs"); } @@ -27,17 +26,17 @@ public class SolarBand : ModItem { player.GetDamage(DamageClass.Melee) += 0.12f; player.GetDamage(DamageClass.Throwing) += 0.12f; - player.buffImmune[24] = true; - player.buffImmune[164] = true; - player.buffImmune[163] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.FragmentSolar, 6); - val.AddTile(TileID.LunarCraftingStation); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.FragmentSolar, 6) + .AddTile(TileID.LunarCraftingStation) + .Register(); } } diff --git a/Items/Accessories/StardustBand.cs b/Items/Accessories/StardustBand.cs index 785a5f9..bd82efa 100644 --- a/Items/Accessories/StardustBand.cs +++ b/Items/Accessories/StardustBand.cs @@ -9,7 +9,6 @@ public class StardustBand : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Stardust Band"); Tooltip.SetDefault("12% increased minion damage \nGrants immunity to the [c/FF4E00:On Fire!], [c/A84DFD:Distorted], and [c/9362B3:Obstructed] debuffs"); } @@ -26,17 +25,17 @@ public class StardustBand : ModItem public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage(DamageClass.Summon) += 0.12f; - player.buffImmune[24] = true; - player.buffImmune[164] = true; - player.buffImmune[163] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.FragmentStardust, 6); - val.AddTile(TileID.LunarCraftingStation); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.FragmentStardust, 6) + .AddTile(TileID.LunarCraftingStation) + .Register(); } } diff --git a/Items/Accessories/ValkyrieWings.cs b/Items/Accessories/ValkyrieWings.cs index e0d9389..303d21c 100644 --- a/Items/Accessories/ValkyrieWings.cs +++ b/Items/Accessories/ValkyrieWings.cs @@ -43,10 +43,10 @@ public class ValkyrieWings : ModItem public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ItemID.HallowedBar, 10); - val.AddIngredient(ItemID.SoulofFlight, 20); - val.AddTile(TileID.MythrilAnvil); - val.Register(); + CreateRecipe() + .AddIngredient(ItemID.HallowedBar, 10) + .AddIngredient(ItemID.SoulofFlight, 20) + .AddTile(TileID.MythrilAnvil) + .Register(); } } diff --git a/Items/Accessories/VortexBand.cs b/Items/Accessories/VortexBand.cs index 6fcdf3d..eb1efa8 100644 --- a/Items/Accessories/VortexBand.cs +++ b/Items/Accessories/VortexBand.cs @@ -9,7 +9,6 @@ public class VortexBand : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Vortex Band"); Tooltip.SetDefault("12% increased ranged damage \nGrants immunity to the [c/FF4E00:On Fire!], [c/A84DFD:Distorted], and [c/9362B3:Obstructed] debuffs"); } @@ -26,17 +25,17 @@ public class VortexBand : ModItem public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage(DamageClass.Ranged) += 0.12f; - player.buffImmune[24] = true; - player.buffImmune[164] = true; - player.buffImmune[163] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Obstructed] = true; + player.buffImmune[BuffID.VortexDebuff] = true; } public override void AddRecipes() { - Recipe val = CreateRecipe(); - val.AddIngredient(ModContent.ItemType()); - val.AddIngredient(ItemID.FragmentVortex, 6); - val.AddTile(TileID.LunarCraftingStation); - val.Register(); + CreateRecipe() + .AddIngredient(ModContent.ItemType()) + .AddIngredient(ItemID.FragmentVortex, 6) + .AddTile(TileID.LunarCraftingStation) + .Register(); } }