76 lines
2.6 KiB
C#
76 lines
2.6 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 TrueCausticEdge : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("True Caustic Edge");
|
|
Tooltip.SetDefault("Fires a bouncing caustic beam\n" +
|
|
"Inflicts poison and venom");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 64;
|
|
item.damage = 150;
|
|
item.melee = true;
|
|
item.useAnimation = 28;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
item.useTime = 28;
|
|
item.useTurn = true;
|
|
item.knockBack = 5.75f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.height = 74;
|
|
item.value = Item.buyPrice(0, 36, 0, 0);
|
|
item.rare = ItemRarityID.Pink;
|
|
item.shoot = ModContent.ProjectileType<TrueCausticEdgeProjectile>();
|
|
item.shootSpeed = 16f;
|
|
}
|
|
|
|
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, speedX, speedY, type, (int)(damage * 0.75), knockBack, player.whoAmI, 0f, 0f);
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<CausticEdge>());
|
|
recipe.AddRecipeGroup("AnyEvilFlask", 5);
|
|
recipe.AddIngredient(ItemID.FlaskofPoison, 5);
|
|
recipe.AddIngredient(ItemID.Deathweed, 3);
|
|
recipe.AddTile(TileID.DemonAltar);
|
|
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, 74);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Poisoned, 300);
|
|
target.AddBuff(BuffID.Venom, 150);
|
|
}
|
|
|
|
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Poisoned, 300);
|
|
target.AddBuff(BuffID.Venom, 150);
|
|
}
|
|
}
|
|
}
|