62 lines
2.0 KiB
C#
62 lines
2.0 KiB
C#
using CalamityMod.Projectiles.Melee;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class TrueExcaliburShortsword : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("True Excalibur Shortsword");
|
|
Tooltip.SetDefault("Don't underestimate the power of shortswords");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.useStyle = 3;
|
|
item.useTurn = false;
|
|
item.useAnimation = 12;
|
|
item.useTime = 12;
|
|
item.width = 42;
|
|
item.height = 42;
|
|
item.damage = 70;
|
|
item.melee = true;
|
|
item.knockBack = 5.75f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.useTurn = true;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<ShortBeam>();
|
|
item.shootSpeed = 12f;
|
|
item.value = Item.buyPrice(0, 80, 0, 0);
|
|
item.rare = 8;
|
|
}
|
|
|
|
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, item.shootSpeed * player.direction, 0f, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<ExcaliburShortsword>());
|
|
recipe.AddIngredient(ItemID.BrokenHeroSword);
|
|
recipe.AddTile(TileID.MythrilAnvil);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
|
|
public override void MeleeEffects(Player player, Rectangle hitbox)
|
|
{
|
|
if (Main.rand.NextBool(5))
|
|
{
|
|
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57);
|
|
}
|
|
}
|
|
}
|
|
}
|