Files
CalamityModPublic/Items/Weapons/Melee/Nebulash.cs
T
2022-12-27 04:28:21 +07:00

48 lines
1.6 KiB
C#

using Terraria.DataStructures;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class Nebulash : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nebulash");
Tooltip.SetDefault("Fires a whip sword that emits particle explosions on hit");
SacrificeTotal = 1;
}
public override void SetDefaults()
{
Item.width = 16;
Item.height = 16;
Item.damage = 60;
Item.rare = ItemRarityID.Lime;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.channel = true;
Item.autoReuse = true;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.useAnimation = 18;
Item.useTime = 18;
Item.useStyle = ItemUseStyleID.Shoot;
Item.knockBack = 2f;
Item.UseSound = SoundID.Item117;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
Item.shootSpeed = 24f;
Item.shoot = ModContent.ProjectileType<NebulashFlail>();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float ai3 = (Main.rand.NextFloat() - 0.5f) * 0.7853982f; //0.5
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, ai3);
return false;
}
}
}