62 lines
2.0 KiB
C#
62 lines
2.0 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Melee;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
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 = 41;
|
|
item.melee = true;
|
|
item.useAnimation = 20;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
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 = ItemRarityID.Orange;
|
|
item.shoot = ModContent.ProjectileType<Cyclone>();
|
|
item.shootSpeed = 3f;
|
|
}
|
|
|
|
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.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(ModContent.ItemType<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);
|
|
}
|
|
}
|
|
}
|
|
}
|