54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using CalamityMod.Projectiles.Ranged;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class Archerfish : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Archerfish");
|
|
Tooltip.SetDefault("Converts musket balls into streams of water");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 23;
|
|
item.ranged = true;
|
|
item.width = 78;
|
|
item.height = 36;
|
|
item.useTime = 10;
|
|
item.useAnimation = 10;
|
|
item.useStyle = ItemUseStyleID.HoldingOut;
|
|
item.noMelee = true;
|
|
item.knockBack = 2f;
|
|
item.value = Item.buyPrice(0, 4, 0, 0);
|
|
item.rare = ItemRarityID.Orange;
|
|
item.UseSound = SoundID.Item11;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<ArcherfishShot>();
|
|
item.shootSpeed = 11f;
|
|
item.useAmmo = AmmoID.Bullet;
|
|
item.Calamity().canFirePointBlankShots = true;
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset()
|
|
{
|
|
return new Vector2(-10, -5);
|
|
}
|
|
|
|
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.Bullet)
|
|
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ArcherfishShot>(), damage, knockBack, player.whoAmI);
|
|
else
|
|
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|