Files
CalamityModPublic/Items/Weapons/Ranged/Butcher.cs
T

62 lines
1.8 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class Butcher : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Butcher");
Tooltip.SetDefault("Fires faster and more accurately the longer you hold the trigger");
}
public override void SetDefaults()
{
item.damage = 18;
item.width = 20;
item.height = 12;
item.useTime = 40;
item.useAnimation = 40;
item.useStyle = ItemUseStyleID.HoldingOut;
item.rare = ItemRarityID.Pink;
item.knockBack = 1f;
item.value = Item.buyPrice(0, 36, 0, 0);
item.UseSound = SoundID.Item38;
item.noMelee = true;
item.noUseGraphic = true;
item.ranged = true;
item.channel = true;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<ButcherGun>();
item.shootSpeed = 12f;
item.useAmmo = AmmoID.Bullet;
item.Calamity().canFirePointBlankShots = true;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<ButcherGun>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Shotgun);
recipe.AddRecipeGroup("AnyCobaltBar", 5);
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 4);
recipe.AddIngredient(ItemID.IllegalGunParts);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}