diff --git a/Content/Decimation.cs b/Content/Decimation.cs index 941ec04..37c86ed 100644 --- a/Content/Decimation.cs +++ b/Content/Decimation.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using Decimation.Content.Items.Tools.Axes; using Decimation.Content.NPCs.Arachnus; using Decimation.Content.NPCs.DuneWyrm; using Decimation.Content.NPCs.DuneWyrm.AncientTombCrawler; @@ -9,6 +10,7 @@ using Decimation.Lib.Util; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using Terraria.UI; @@ -105,14 +107,32 @@ namespace Decimation.Content public override void AddRecipeGroups() { - RecipeGroup gems = new RecipeGroup(() => Lang.misc[37] + " Gem", ItemID.Amethyst, ItemID.Topaz, - ItemID.Emerald, ItemID.Sapphire, ItemID.Ruby, ItemID.Diamond); + RecipeGroup gems = new RecipeGroup(() => Language.GetTextValue("LegacyMisc.37") + " Gem", + ItemID.Amethyst, + ItemID.Topaz, + ItemID.Emerald, + ItemID.Sapphire, + ItemID.Ruby, + ItemID.Diamond); + RecipeGroup.RegisterGroup(DecimationRecipeGroupID.AnyGem, gems); - RecipeGroup threads = new RecipeGroup(() => Lang.misc[37] + " Thread", ItemID.BlackThread, - ItemID.GreenThread, ItemID.PinkThread); + RecipeGroup threads = new RecipeGroup(() => Language.GetTextValue("LegacyMisc.37") + " Thread", + ItemID.BlackThread, + ItemID.GreenThread, + ItemID.PinkThread); + RecipeGroup.RegisterGroup(DecimationRecipeGroupID.AnyThread, threads); - RecipeGroup.RegisterGroup("AnyGem", gems); - RecipeGroup.RegisterGroup("AnyThread", threads); + RecipeGroup corruptedWoodAxes = new RecipeGroup( + () => Language.GetTextValue("LegacyMisc.37") + " Corrupted Wood Axe", + ModContent.ItemType(), + ModContent.ItemType()); + RecipeGroup.RegisterGroup(DecimationRecipeGroupID.CorruptedWoodAxes, corruptedWoodAxes); + + RecipeGroup corruptedWoodHammers = new RecipeGroup( + () => Language.GetTextValue("LegacyMisc.37") + " Corrupted Wood Hammer", + ItemID.ShadewoodHammer, + ItemID.EbonwoodHammer); + RecipeGroup.RegisterGroup(DecimationRecipeGroupID.CorruptedWoodHammers, corruptedWoodHammers); } public override void HandlePacket(BinaryReader reader, int whoAmI) diff --git a/Content/DecimationRecipeGroupID.cs b/Content/DecimationRecipeGroupID.cs new file mode 100644 index 0000000..ec58c84 --- /dev/null +++ b/Content/DecimationRecipeGroupID.cs @@ -0,0 +1,11 @@ +namespace Decimation.Content +{ + public class DecimationRecipeGroupID + { + public const string AnyGem = "AnyGem"; + public const string AnyThread = "AnyThread"; + public const string CorruptedWoodAxes = "CorruptedAxes"; + public const string CorruptedWoodHammers = "CorruptedHammers"; + public const string CorruptedWoodPickaxes = "CorruptedPickaxes"; + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/BorealWoodAxe.cs b/Content/Items/Tools/Axes/BorealWoodAxe.cs new file mode 100644 index 0000000..c0d7275 --- /dev/null +++ b/Content/Items/Tools/Axes/BorealWoodAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class BorealWoodAxe : DecimationTool + { + protected override string ItemName => "Boreal Wood Axe"; + protected override int AxePower => 35; + protected override int MeleeDamages => 3; + + protected override void InitTool() + { + item.width = 32; + item.height = 28; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 10); + item.useTime = 19; + item.useAnimation = 28; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.BorealWood, 7) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/BorealWoodAxe.png b/Content/Items/Tools/Axes/BorealWoodAxe.png new file mode 100644 index 0000000..dc82e84 Binary files /dev/null and b/Content/Items/Tools/Axes/BorealWoodAxe.png differ diff --git a/Content/Items/Tools/Axes/CactusAxe.cs b/Content/Items/Tools/Axes/CactusAxe.cs new file mode 100644 index 0000000..991afcf --- /dev/null +++ b/Content/Items/Tools/Axes/CactusAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class CactusAxe : DecimationTool + { + protected override string ItemName => "Cactus Axe"; + protected override int AxePower => 35; + protected override int MeleeDamages => 3; + + protected override void InitTool() + { + item.width = 44; + item.height = 34; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 30); + item.useTime = 23; + item.useAnimation = 32; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.Cactus, 15) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/CactusAxe.png b/Content/Items/Tools/Axes/CactusAxe.png new file mode 100644 index 0000000..5b8ec2f Binary files /dev/null and b/Content/Items/Tools/Axes/CactusAxe.png differ diff --git a/Content/Items/Tools/Axes/EbonwoodAxe.cs b/Content/Items/Tools/Axes/EbonwoodAxe.cs new file mode 100644 index 0000000..5b65ed7 --- /dev/null +++ b/Content/Items/Tools/Axes/EbonwoodAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class EbonwoodAxe : DecimationTool + { + protected override string ItemName => "Ebonwood Axe"; + protected override int AxePower => 40; + protected override int MeleeDamages => 6; + + protected override void InitTool() + { + item.width = 32; + item.height = 28; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 10); + item.useTime = 16; + item.useAnimation = 25; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.Ebonwood, 7) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/EbonwoodAxe.png b/Content/Items/Tools/Axes/EbonwoodAxe.png new file mode 100644 index 0000000..99d3418 Binary files /dev/null and b/Content/Items/Tools/Axes/EbonwoodAxe.png differ diff --git a/Content/Items/Tools/Axes/GreatwoodAxe.cs b/Content/Items/Tools/Axes/GreatwoodAxe.cs new file mode 100644 index 0000000..d7c216b --- /dev/null +++ b/Content/Items/Tools/Axes/GreatwoodAxe.cs @@ -0,0 +1,37 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class GreatwoodAxe : DecimationTool + { + protected override string ItemName => "Greatwood Axe"; + protected override int AxePower => 50; + protected override int MeleeDamages => 6; + + protected override void InitTool() + { + item.width = 48; + item.height = 36; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 40); + item.useTime = 20; + item.useAnimation = 28; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ModContent.ItemType()) + .WithIngredient(ModContent.ItemType()) + .WithIngredient(ModContent.ItemType()) + .WithIngredientGroup(DecimationRecipeGroupID.CorruptedWoodAxes) + .WithStation(TileID.WorkBenches) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/GreatwoodAxe.png b/Content/Items/Tools/Axes/GreatwoodAxe.png new file mode 100644 index 0000000..10a0bd5 Binary files /dev/null and b/Content/Items/Tools/Axes/GreatwoodAxe.png differ diff --git a/Content/Items/Tools/Axes/MultigrainAxe.cs b/Content/Items/Tools/Axes/MultigrainAxe.cs new file mode 100644 index 0000000..8207435 --- /dev/null +++ b/Content/Items/Tools/Axes/MultigrainAxe.cs @@ -0,0 +1,39 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class MultigrainAxe : DecimationTool + { + protected override string ItemName => "Multigrain Axe"; + protected override int AxePower => 60; + protected override int MeleeDamages => 10; + + protected override void InitTool() + { + item.width = 54; + item.height = 42; + item.knockBack = 5f; + item.value = Item.sellPrice(silver: 8, copper: 70); + item.rare = Rarity.Blue.GetRarityValue(); + item.useTime = 16; + item.useAnimation = 24; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ModContent.ItemType()) + .WithIngredient(ModContent.ItemType()) + .WithIngredient(ModContent.ItemType()) + .WithIngredient(ItemID.Vine, 2) + .WithStation(TileID.Loom) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/MultigrainAxe.png b/Content/Items/Tools/Axes/MultigrainAxe.png new file mode 100644 index 0000000..cb35074 Binary files /dev/null and b/Content/Items/Tools/Axes/MultigrainAxe.png differ diff --git a/Content/Items/Tools/Axes/PalmWoodAxe.cs b/Content/Items/Tools/Axes/PalmWoodAxe.cs new file mode 100644 index 0000000..9e30560 --- /dev/null +++ b/Content/Items/Tools/Axes/PalmWoodAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class PalmWoodAxe : DecimationTool + { + protected override string ItemName => "Palm Wood Axe"; + protected override int AxePower => 35; + protected override int MeleeDamages => 3; + + protected override void InitTool() + { + item.width = 32; + item.height = 28; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 10); + item.useTime = 19; + item.useAnimation = 28; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.PalmWood, 7) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/PalmWoodAxe.png b/Content/Items/Tools/Axes/PalmWoodAxe.png new file mode 100644 index 0000000..7f0bafe Binary files /dev/null and b/Content/Items/Tools/Axes/PalmWoodAxe.png differ diff --git a/Content/Items/Tools/Axes/PearlwoodAxe.cs b/Content/Items/Tools/Axes/PearlwoodAxe.cs new file mode 100644 index 0000000..81f4db2 --- /dev/null +++ b/Content/Items/Tools/Axes/PearlwoodAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class PearlwoodAxe : DecimationTool + { + protected override string ItemName => "Pearlwood Axe"; + protected override int AxePower => 45; + protected override int MeleeDamages => 8; + + protected override void InitTool() + { + item.width = 32; + item.height = 28; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 10); + item.useTime = 16; + item.useAnimation = 25; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.Pearlwood, 7) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/PearlwoodAxe.png b/Content/Items/Tools/Axes/PearlwoodAxe.png new file mode 100644 index 0000000..7bfa6ad Binary files /dev/null and b/Content/Items/Tools/Axes/PearlwoodAxe.png differ diff --git a/Content/Items/Tools/Axes/PumpkinAxe.cs b/Content/Items/Tools/Axes/PumpkinAxe.cs new file mode 100644 index 0000000..e1b44af --- /dev/null +++ b/Content/Items/Tools/Axes/PumpkinAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class PumpkinAxe : DecimationTool + { + protected override string ItemName => "Pumpkin Axe"; + protected override int AxePower => 35; + protected override int MeleeDamages => 5; + + protected override void InitTool() + { + item.width = 40; + item.height = 32; + item.knockBack = 4.5f; + item.value = Item.sellPrice(silver: 4); + item.useTime = 23; + item.useAnimation = 32; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.Pumpkin, 15) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/PumpkinAxe.png b/Content/Items/Tools/Axes/PumpkinAxe.png new file mode 100644 index 0000000..1a8dc9a Binary files /dev/null and b/Content/Items/Tools/Axes/PumpkinAxe.png differ diff --git a/Content/Items/Tools/Axes/RichMahoganyAxe.cs b/Content/Items/Tools/Axes/RichMahoganyAxe.cs new file mode 100644 index 0000000..3e21fdd --- /dev/null +++ b/Content/Items/Tools/Axes/RichMahoganyAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class RichMahoganyAxe : DecimationTool + { + protected override string ItemName => "Rich Mahogany Axe"; + protected override int AxePower => 35; + protected override int MeleeDamages => 3; + + protected override void InitTool() + { + item.width = 32; + item.height = 28; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 20); + item.useTime = 19; + item.useAnimation = 28; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.RichMahogany, 7) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/RichMahoganyAxe.png b/Content/Items/Tools/Axes/RichMahoganyAxe.png new file mode 100644 index 0000000..5de833a Binary files /dev/null and b/Content/Items/Tools/Axes/RichMahoganyAxe.png differ diff --git a/Content/Items/Tools/Axes/ShadewoodAxe.cs b/Content/Items/Tools/Axes/ShadewoodAxe.cs new file mode 100644 index 0000000..648bfea --- /dev/null +++ b/Content/Items/Tools/Axes/ShadewoodAxe.cs @@ -0,0 +1,33 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Tools.Axes +{ + public class ShadewoodAxe : DecimationTool + { + protected override string ItemName => "Shadewood Axe"; + protected override int AxePower => 40; + protected override int MeleeDamages => 6; + + protected override void InitTool() + { + item.width = 32; + item.height = 28; + item.knockBack = 4.5f; + item.value = Item.sellPrice(copper: 10); + item.useTime = 16; + item.useAnimation = 25; + item.crit = 4; + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.Shadewood, 7) + .Build(); + } + } +} \ No newline at end of file diff --git a/Content/Items/Tools/Axes/ShadewoodAxe.png b/Content/Items/Tools/Axes/ShadewoodAxe.png new file mode 100644 index 0000000..38aa7f1 Binary files /dev/null and b/Content/Items/Tools/Axes/ShadewoodAxe.png differ diff --git a/Lib/Items/DecimationTool.cs b/Lib/Items/DecimationTool.cs index 2fbe11d..1ecd54d 100644 --- a/Lib/Items/DecimationTool.cs +++ b/Lib/Items/DecimationTool.cs @@ -12,17 +12,20 @@ protected override void Init() { item.autoReuse = true; - this.item.useTurn = true; - this.item.maxStack = 1; + item.useStyle = 1; + item.useTurn = true; + item.maxStack = 1; + item.melee = true; InitTool(); - this.item.damage = this.MeleeDamages; - this.item.pick = this.PickaxePower; - this.item.axe = this.AxePower; - this.item.hammer = this.HammerPower; + item.damage = MeleeDamages; + item.pick = PickaxePower; + item.axe = AxePower / 5; // Axe power is multiplied by 5 for some reason + item.hammer = HammerPower; - if (this.MeleeDamages > 0) this.item.melee = true; + item.damage = 1000; + if (MeleeDamages > 0) item.noMelee = false; } } } \ No newline at end of file diff --git a/Lib/Util/Builder/RecipeBuilder.cs b/Lib/Util/Builder/RecipeBuilder.cs index 810e937..2d30e81 100644 --- a/Lib/Util/Builder/RecipeBuilder.cs +++ b/Lib/Util/Builder/RecipeBuilder.cs @@ -6,6 +6,7 @@ namespace Decimation.Lib.Util.Builder internal class RecipeBuilder { private readonly IDictionary _ingredients = new Dictionary(); + private readonly IDictionary _ingredientGroups = new Dictionary(); private readonly Mod _mod; private readonly int _result; private readonly int _resultQuantity; @@ -31,6 +32,13 @@ namespace Decimation.Lib.Util.Builder return this; } + public RecipeBuilder WithIngredientGroup(string group, int quantity = 1) + { + _ingredientGroups.Add(group, quantity); + + return this; + } + public RecipeBuilder WithStation(int tile) { _tiles.Add(tile); @@ -51,6 +59,9 @@ namespace Decimation.Lib.Util.Builder foreach (KeyValuePair ingredient in _ingredients) recipe.AddIngredient(ingredient.Key, ingredient.Value); + + foreach (KeyValuePair ingredientGroup in _ingredientGroups) + recipe.AddRecipeGroup(ingredientGroup.Key, ingredientGroup.Value); foreach (int tile in _tiles) recipe.AddTile(tile);