78 lines
2.7 KiB
C#
78 lines
2.7 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Projectiles.Melee;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
public class CatastropheClaymore : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Melee";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 60;
|
|
Item.damage = 85;
|
|
Item.DamageType = DamageClass.Melee;
|
|
Item.useAnimation = Item.useTime = 23;
|
|
Item.useTurn = true;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.knockBack = 6.25f;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
Item.height = 60;
|
|
Item.value = CalamityGlobalItem.Rarity6BuyPrice;
|
|
Item.rare = ItemRarityID.LightPurple;
|
|
Item.shoot = ModContent.ProjectileType<CatastropheClaymoreSparkle>();
|
|
Item.shootSpeed = 11f;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, Main.myPlayer, Main.rand.Next(3));
|
|
return false;
|
|
}
|
|
|
|
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, 73);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
|
|
{
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
target.AddBuff(BuffID.Ichor, 60);
|
|
target.AddBuff(BuffID.OnFire3, 180);
|
|
target.AddBuff(BuffID.Frostburn2, 120);
|
|
}
|
|
}
|
|
|
|
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
|
|
{
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
target.AddBuff(BuffID.Ichor, 60);
|
|
target.AddBuff(BuffID.OnFire3, 180);
|
|
target.AddBuff(BuffID.Frostburn2, 120);
|
|
}
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.HallowedBar, 10).
|
|
AddRecipeGroup("CursedFlameIchor", 5).
|
|
AddIngredient(ItemID.SoulofFright, 3).
|
|
AddIngredient(ItemID.SoulofMight, 3).
|
|
AddIngredient(ItemID.SoulofSight, 3).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
}
|
|
}
|
|
}
|