65 lines
2.0 KiB
C#
65 lines
2.0 KiB
C#
using CalamityMod.Items.Materials;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class CorruptedCrusherBlade : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Corrupted Crusher Blade");
|
|
Tooltip.SetDefault("Inflicts cursed inferno and critical hits lower enemy defense");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 39;
|
|
item.melee = true;
|
|
item.width = 66;
|
|
item.height = 80;
|
|
item.useTime = 26;
|
|
item.useAnimation = 26;
|
|
item.useTurn = true;
|
|
item.useStyle = 1;
|
|
item.knockBack = 6.75f;
|
|
item.value = Item.buyPrice(0, 4, 0, 0);
|
|
item.rare = 3;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
}
|
|
|
|
public override void MeleeEffects(Player player, Rectangle hitbox)
|
|
{
|
|
if (Main.rand.NextBool(7))
|
|
{
|
|
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.CursedInferno, 180);
|
|
if (target.defense > 0 && crit)
|
|
{
|
|
target.defense -= 5;
|
|
}
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<EbonianGel>(), 15);
|
|
recipe.AddIngredient(ItemID.EbonstoneBlock, 50);
|
|
recipe.AddIngredient(ItemID.ShadowScale, 5);
|
|
recipe.AddIngredient(ItemID.IronBar, 4);
|
|
recipe.anyIronBar = true;
|
|
recipe.AddTile(TileID.DemonAltar);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|