51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Projectiles.Melee;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Melee
|
|
{
|
|
[LegacyName("VirulentKatana")]
|
|
public class Virulence : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Melee";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 100;
|
|
Item.knockBack = 5.5f;
|
|
Item.useAnimation = Item.useTime = 15;
|
|
Item.DamageType = DamageClass.Melee;
|
|
Item.useTurn = true;
|
|
Item.autoReuse = true;
|
|
Item.shootSpeed = 9f;
|
|
Item.shoot = ModContent.ProjectileType<VirulentWave>();
|
|
|
|
Item.width = 48;
|
|
Item.height = 62;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
|
|
Item.rare = ItemRarityID.Yellow;
|
|
}
|
|
|
|
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, (int)(damage * 0.85), knockback, player.whoAmI, 0f, 0f);
|
|
return false;
|
|
}
|
|
|
|
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<Plague>(), 300);
|
|
}
|
|
|
|
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<Plague>(), 300);
|
|
}
|
|
}
|
|
}
|