using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { public class TearsofHeaven : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { Item.damage = 54; Item.DamageType = DamageClass.Magic; Item.mana = 18; Item.width = 38; Item.height = 48; Item.useTime = 20; Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; Item.value = CalamityGlobalItem.Rarity8BuyPrice; Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item8; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5.5f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int index = 0; index < 2; ++index) { float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); } return false; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). AddIngredient(ItemID.WaterBolt). AddIngredient(15). AddIngredient(5). AddTile(TileID.Bookcases). Register(); } } }