using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TizonaMod.Items
{
public class VulcanRepeater : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("");
}
public override void SetDefaults()
{
Item.damage = 56; // Sets the item's damage. Note that projectiles shot by this weapon will use its and the used ammunition's damage added together.
Item.DamageType = DamageClass.Ranged;
Item.width = 40; // hitbox width of the item
Item.height = 20; // hitbox height of the item
Item.useTime = 17; // The item's use time in ticks (60 ticks == 1 second.)
Item.useAnimation = 20; // The length of the item's use animation in ticks (60 ticks == 1 second.)
Item.useStyle = ItemUseStyleID.Shoot; // how you use the item (swinging, holding out, etc)
Item.noMelee = true; //so the item's animation doesn't do damage
Item.knockBack = 2.5f; // Sets the item's knockback. Note that projectiles shot by this weapon will use its and the used ammunition's knockback added together.
Item.value = 10000; // how much the item sells for (measured in copper)
Item.rare = ItemRarityID.Green; // the color that the item's name will be in-game
Item.UseSound = SoundID.Item5; // The sound that this item plays when used.
Item.autoReuse = true; // if you can hold click to automatically use it again
Item.shoot = 10; //idk why but all the guns in the vanilla source have this
Item.shootSpeed = 16; // the speed of the projectile (measured in pixels per frame)
Item.useAmmo = AmmoID.Arrow; // The "ammo Id" of the ammo item that this weapon uses. Note that this is not an item Id, but just a magic value.
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ItemID.SoulofSight, 5);
recipe.AddIngredient(ItemID.SoulofFright, 5);
recipe.AddIngredient(ItemID.SoulofMight, 5);
recipe.AddIngredient(ItemID.TitaniumBar, 15);
recipe.AddIngredient(ItemID.HallowedRepeater, 1);
recipe.AddTile(TileID.MythrilAnvil);
recipe.Register();
Recipe recipe2 = CreateRecipe();
recipe2.AddIngredient(ItemID.SoulofSight, 5);
recipe2.AddIngredient(ItemID.SoulofFright, 5);
recipe2.AddIngredient(ItemID.SoulofMight, 5);
recipe2.AddIngredient(ItemID.AdamantiteBar, 15);
recipe2.AddIngredient(ItemID.HallowedRepeater, 1);
recipe2.AddTile(TileID.MythrilAnvil);
recipe2.Register();
}
/*
* Feel free to uncomment any of the examples below to see what they do
*/
// What if I wanted this gun to have a 38% chance not to consume ammo?
/*public override bool ConsumeAmmo(Player player)
{
return Main.rand.NextFloat() >= .38f;
}*/
// What if I wanted it to work like Uzi, replacing regular bullets with High Velocity Bullets?
// Uzi/Molten Fury style: Replace normal Bullets with High Velocity
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (type == ProjectileID.WoodenArrowFriendly) // or ProjectileID.WoodenArrowFriendly
{
type = ProjectileID.HellfireArrow; // or ProjectileID.FireArrow;
}
return true; // return true to allow tmodloader to call Projectile.NewProjectile as normal
}
}
}