51 lines
1.8 KiB
C#
51 lines
1.8 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Projectiles.Ranged;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class PestilentDefiler : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 135;
|
|
Item.DamageType = DamageClass.Ranged;
|
|
Item.width = 46;
|
|
Item.height = 20;
|
|
Item.useTime = 37;
|
|
Item.useAnimation = 37;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 9.5f;
|
|
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
|
|
Item.rare = ItemRarityID.Yellow;
|
|
Item.UseSound = SoundID.Item40;
|
|
Item.autoReuse = true;
|
|
Item.shootSpeed = 12f;
|
|
Item.shoot = ModContent.ProjectileType<SicknessRound>();
|
|
Item.useAmmo = AmmoID.Bullet;
|
|
Item.Calamity().canFirePointBlankShots = true;
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset()
|
|
{
|
|
return new Vector2(0, -5);
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (type == ProjectileID.Bullet)
|
|
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<SicknessRound>(), damage, knockback, player.whoAmI);
|
|
else
|
|
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
|
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|