using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { public class CosmicDischarge : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { Item.width = 50; Item.height = 52; Item.damage = 400; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; Item.autoReuse = true; Item.DamageType = DamageClass.MeleeNoSpeed; Item.useAnimation = 15; Item.useTime = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 0.5f; Item.UseSound = SoundID.Item122; Item.shootSpeed = 24f; Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.rare = ModContent.RarityType(); } 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.75f) * 0.7853982f; //0.5 Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, ai3); return false; } } }