67 lines
2.0 KiB
C#
67 lines
2.0 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class CausticEdge : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Caustic Edge");
|
|
Tooltip.SetDefault("Inflicts poison and venom on enemy hits");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 46;
|
|
item.damage = 70;
|
|
item.scale = 1.4f;
|
|
item.melee = true;
|
|
item.useTurn = true;
|
|
item.useAnimation = 27;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
item.useTime = 27;
|
|
item.knockBack = 5f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.height = 48;
|
|
item.value = Item.buyPrice(0, 2, 0, 0);
|
|
item.rare = ItemRarityID.Green;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.BladeofGrass);
|
|
recipe.AddIngredient(ItemID.LavaBucket);
|
|
recipe.AddRecipeGroup("Boss2Material", 3);
|
|
recipe.AddIngredient(ItemID.Deathweed, 5);
|
|
recipe.AddTile(TileID.DemonAltar);
|
|
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, 74);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Poisoned, 240);
|
|
target.AddBuff(BuffID.Venom, 120);
|
|
}
|
|
|
|
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Poisoned, 240);
|
|
target.AddBuff(BuffID.Venom, 120);
|
|
}
|
|
}
|
|
}
|