62 lines
1.9 KiB
C#
62 lines
1.9 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 GeliticBlade : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Gelitic Blade");
|
|
Tooltip.SetDefault("Fires a gel wave that slows down on enemy hits");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 62;
|
|
item.damage = 36;
|
|
item.melee = true;
|
|
item.useAnimation = 30;
|
|
item.useTime = 30;
|
|
item.useTurn = true;
|
|
item.useStyle = 1;
|
|
item.knockBack = 5.25f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.height = 62;
|
|
item.value = Item.buyPrice(0, 12, 0, 0);
|
|
item.rare = 4;
|
|
item.shoot = ModContent.ProjectileType<GelWave>();
|
|
item.shootSpeed = 9f;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<PurifiedGel>(), 30);
|
|
recipe.AddIngredient(ItemID.Gel, 35);
|
|
recipe.AddIngredient(ItemID.HellstoneBar, 10);
|
|
recipe.AddTile(TileID.Anvils);
|
|
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, 20);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Slimed, 300);
|
|
}
|
|
}
|
|
}
|