62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Dusts;
|
|
using CalamityMod.Items.Placeables;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Items.Tools
|
|
{
|
|
public class AstralHamaxe : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Astral Hamaxe");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 80;
|
|
item.crit += 25;
|
|
item.melee = true;
|
|
item.width = 60;
|
|
item.height = 70;
|
|
item.useTime = 10;
|
|
item.useAnimation = 20;
|
|
item.useTurn = true;
|
|
item.axe = 30;
|
|
item.hammer = 150;
|
|
item.useStyle = 1;
|
|
item.knockBack = 5f;
|
|
item.value = Item.buyPrice(0, 95, 0, 0);
|
|
item.rare = 9;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.tileBoost += 3;
|
|
}
|
|
|
|
public override void MeleeEffects(Player player, Rectangle hitbox)
|
|
{
|
|
Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.NextBool(2) ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>(), 0.48f, 50, 78, -0.1f, 0.1f);
|
|
if (d != null)
|
|
{
|
|
d.customData = 0.02f;
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<AstralBar>(), 8);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|