2 - Bows and guns now only convert their most basic ammo types to their special projectiles. 3 - Sped up Gamma Heart bullets again. 4 - Reduced the amount of projectiles created by Clockwork Bow, Alluvion, Deathwind, Dragon's Breath, Phangasm and Conference Call.
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using CalamityMod.Projectiles.Ranged;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class Needler : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Needler");
|
|
Tooltip.SetDefault("Converts musket balls into needles that stick to enemies and explode");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 45;
|
|
item.ranged = true;
|
|
item.width = 44;
|
|
item.height = 26;
|
|
item.useTime = 18;
|
|
item.useAnimation = 18;
|
|
item.useStyle = ItemUseStyleID.HoldingOut;
|
|
item.noMelee = true;
|
|
item.knockBack = 5.5f;
|
|
item.value = Item.buyPrice(0, 36, 0, 0);
|
|
item.rare = ItemRarityID.Pink;
|
|
item.UseSound = SoundID.Item108;
|
|
item.autoReuse = true;
|
|
item.shootSpeed = 9f;
|
|
item.shoot = ModContent.ProjectileType<NeedlerProj>();
|
|
item.useAmmo = AmmoID.Bullet;
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset()
|
|
{
|
|
return new Vector2(-5, 0);
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
if (type == ProjectileID.Bullet)
|
|
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<NeedlerProj>(), damage, knockBack, player.whoAmI);
|
|
else
|
|
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|