47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Projectiles.Ranged;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class Barinautical : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 32;
|
|
Item.DamageType = DamageClass.Ranged;
|
|
Item.width = 30;
|
|
Item.height = 42;
|
|
Item.useTime = 4;
|
|
Item.useAnimation = 12;
|
|
Item.reuseDelay = 20;
|
|
Item.useLimitPerAnimation = 3;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 2f;
|
|
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
|
|
Item.rare = ItemRarityID.Pink;
|
|
Item.UseSound = SoundID.Item5;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<BoltArrow>();
|
|
Item.shootSpeed = 15f;
|
|
Item.useAmmo = AmmoID.Arrow;
|
|
Item.Calamity().canFirePointBlankShots = true;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (CalamityUtils.CheckWoodenAmmo(type, player))
|
|
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BoltArrow>(), damage, knockback, player.whoAmI);
|
|
else
|
|
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|