AbandonedChickenNugger
Terrarian
I want my gun to use any iron bar instead of just an iron bar but
recipe.AddIngredient(ItemID.AnyIronBar, 25); Wouldn't work so what would I do?
recipe.AddIngredient(ItemID.AnyIronBar, 25); Wouldn't work so what would I do?
Code:
using Terraria.ID;
using Terraria.ModLoader;
namespace TheWoodenExcalibur.Items.Weapons
{
public class MiniGun : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("Arnold.");
}
public override void SetDefaults() {
item.damage = 40;
item.ranged = true;
item.width = 30;
item.height = 10;
item.useTime = 6;
item.useAnimation = 6;
item.useStyle = 5;
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 5;
item.value = 250000;
item.rare = 2;
item.UseSound = SoundID.Item11;
item.autoReuse = true;
item.shoot = 10; //idk why but all the guns in the vanilla source have this
item.shootSpeed = 32f;
item.useAmmo = AmmoID.Bullet;
}
public override void AddRecipes() {
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.IronBar, 25);
recipe.AddIngredient(ItemID.Obsidian, 25);
recipe.AddIngredient(ItemID.Minishark, 1);
recipe.AddIngredient(ItemID.IllegalGunParts, 1);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}