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

57 lines
1.9 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 Seabow : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Seabow");
Tooltip.SetDefault("Fires slow-moving water blasts");
}
public override void SetDefaults()
{
item.damage = 12;
item.ranged = true;
item.width = 22;
item.height = 46;
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.knockBack = 2.5f;
item.value = Item.buyPrice(0, 2, 0, 0);
item.rare = ItemRarityID.Green;
item.UseSound = SoundID.Item5;
item.autoReuse = true;
item.shoot = ProjectileID.PurificationPowder;
item.shootSpeed = 16f;
item.useAmmo = AmmoID.Arrow;
item.Calamity().canFirePointBlankShots = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
Projectile.NewProjectile(position.X, position.Y, SpeedX * 0.5f, SpeedY * 0.5f, ModContent.ProjectileType<SandWater>(), (int)(damage * 0.4), 0f, player.whoAmI);
return true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<VictideBar>(), 2);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}