60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons
|
|
{
|
|
public class WindBlade : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Wind Blade");
|
|
Tooltip.SetDefault("Fires cyclones that suck enemies in");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 58;
|
|
item.damage = 27;
|
|
item.melee = true;
|
|
item.useAnimation = 20;
|
|
item.useStyle = 1;
|
|
item.useTime = 20;
|
|
item.useTurn = true;
|
|
item.knockBack = 5;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.height = 58;
|
|
item.value = Item.buyPrice(0, 4, 0, 0);
|
|
item.rare = 3;
|
|
item.shoot = mod.ProjectileType("Cyclone");
|
|
item.shootSpeed = 3f;
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(null, "AerialiteBar", 9);
|
|
recipe.AddIngredient(ItemID.SunplateBlock, 3);
|
|
recipe.AddTile(TileID.SkyMill);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
|
|
public override void MeleeEffects(Player player, Rectangle hitbox)
|
|
{
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59);
|
|
}
|
|
}
|
|
}
|
|
}
|