46 lines
1.4 KiB
C#
46 lines
1.4 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 StormSaber : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Storm Saber");
|
|
Tooltip.SetDefault("Fires a storm beam");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 58;
|
|
item.damage = 42;
|
|
item.melee = true;
|
|
item.useAnimation = 23;
|
|
item.useTime = 23;
|
|
item.useTurn = true;
|
|
item.useStyle = 1;
|
|
item.knockBack = 6f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.height = 68;
|
|
item.value = Item.buyPrice(0, 36, 0, 0);
|
|
item.rare = 5;
|
|
item.shoot = ModContent.ProjectileType<StormBeam>();
|
|
item.shootSpeed = 12f;
|
|
}
|
|
|
|
public override void MeleeEffects(Player player, Rectangle hitbox)
|
|
{
|
|
if (Main.rand.NextBool(5))
|
|
{
|
|
int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 187, (float)(player.direction * 2), 0f, 150, default, 1.3f);
|
|
Main.dust[num250].velocity *= 0.2f;
|
|
}
|
|
}
|
|
}
|
|
}
|