Files
CalamityModPublic/Items/Weapons/Magic/TearsofHeaven.cs
T
2021-12-31 00:47:22 -05:00

64 lines
2.3 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class TearsofHeaven : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Tears of Heaven");
Tooltip.SetDefault("Casts slow-moving homing balls of heavenly light");
}
public override void SetDefaults()
{
item.damage = 64;
item.magic = true;
item.mana = 18;
item.width = 28;
item.height = 30;
item.useTime = 15;
item.useAnimation = 15;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.knockBack = 5.5f;
item.value = Item.buyPrice(0, 80, 0, 0);
item.rare = ItemRarityID.Yellow;
item.UseSound = SoundID.Item8;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<TearsofHeavenProjectile>();
item.shootSpeed = 5.5f;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(2, 3);
for (int index = 0; index < num6; ++index)
{
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(double)damage, knockBack, player.whoAmI, 0.0f, 0.0f);
}
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<FrigidflashBolt>());
recipe.AddIngredient(ItemID.WaterBolt);
recipe.AddIngredient(ModContent.ItemType<SeaPrism>(), 15);
recipe.AddIngredient(ModContent.ItemType<CoreofCinder>(), 5);
recipe.AddTile(TileID.Bookcases);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}