Added new axes.

This commit is contained in:
FyloZ 2020-07-19 19:05:58 -04:00
parent 391f089c93
commit 56de9e29e1
24 changed files with 398 additions and 13 deletions

View File

@ -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<ShadewoodAxe>(),
ModContent.ItemType<EbonwoodAxe>());
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)

View File

@ -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";
}
}

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

@ -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<BorealWoodAxe>())
.WithIngredient(ModContent.ItemType<PalmWoodAxe>())
.WithIngredient(ModContent.ItemType<RichMahoganyAxe>())
.WithIngredientGroup(DecimationRecipeGroupID.CorruptedWoodAxes)
.WithStation(TileID.WorkBenches)
.Build();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

View File

@ -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<CactusAxe>())
.WithIngredient(ModContent.ItemType<PumpkinAxe>())
.WithIngredient(ModContent.ItemType<GreatwoodAxe>())
.WithIngredient(ItemID.Vine, 2)
.WithStation(TileID.Loom)
.Build();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

@ -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();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

View File

@ -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;
}
}
}

View File

@ -6,6 +6,7 @@ namespace Decimation.Lib.Util.Builder
internal class RecipeBuilder
{
private readonly IDictionary<int, int> _ingredients = new Dictionary<int, int>();
private readonly IDictionary<string, int> _ingredientGroups = new Dictionary<string, int>();
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);
@ -52,6 +60,9 @@ namespace Decimation.Lib.Util.Builder
foreach (KeyValuePair<int, int> ingredient in _ingredients)
recipe.AddIngredient(ingredient.Key, ingredient.Value);
foreach (KeyValuePair<string, int> ingredientGroup in _ingredientGroups)
recipe.AddRecipeGroup(ingredientGroup.Key, ingredientGroup.Value);
foreach (int tile in _tiles) recipe.AddTile(tile);
recipe.SetResult(_result, _resultQuantity);