Files
CalamityModPublic/Items/Weapons/Melee/EssenceFlayer.cs
T
2023-08-01 06:22:24 +07:00

68 lines
2.3 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class EssenceFlayer : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetDefaults()
{
Item.width = 100;
Item.damage = 200;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 19;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 19;
Item.useTurn = true;
Item.knockBack = 8f;
Item.UseSound = SoundID.Item71;
Item.autoReuse = true;
Item.height = 78;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.shoot = ModContent.ProjectileType<EssenceScythe>();
Item.shootSpeed = 21f;
Item.rare = ModContent.RarityType<DarkBlue>();
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow").Value);
}
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, 173);
}
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300);
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300);
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<CosmiliteBar>(12).
AddTile<CosmicAnvil>().
Register();
}
}
}