Files
CalamityModPublic/Items/Weapons/Ranged/NullificationRifle.cs
T
2022-12-27 04:47:44 +07:00

52 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 NullificationRifle : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nullification Pistol");
Tooltip.SetDefault("Is it nullable or not? Let's find out!\n" +
"Fires a fast null bullet that distorts NPC stats");
SacrificeTotal = 1;
}
public override void SetDefaults()
{
Item.damage = 135;
Item.DamageType = DamageClass.Ranged;
Item.width = 52;
Item.height = 28;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 7f;
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.UseSound = SoundID.Item33;
Item.autoReuse = true;
Item.shootSpeed = 25f;
Item.shoot = ModContent.ProjectileType<NullShot>();
Item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-5, 0);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<NullShot>(), damage, knockback, player.whoAmI);
return false;
}
}
}