61 lines
2.1 KiB
C#
61 lines
2.1 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Magic;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Magic
|
|
{
|
|
public class ShadecrystalTome : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Shadecrystal Barrage");
|
|
Tooltip.SetDefault("Summons rapid fire shadecrystals, can shoot two crystals at once");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 23;
|
|
item.magic = true;
|
|
item.mana = 4;
|
|
item.width = 28;
|
|
item.height = 30;
|
|
item.useTime = 6;
|
|
item.useAnimation = 6;
|
|
item.useStyle = ItemUseStyleID.HoldingOut;
|
|
item.noMelee = true;
|
|
item.knockBack = 5.5f;
|
|
item.value = Item.buyPrice(0, 36, 0, 0);
|
|
item.rare = ItemRarityID.Pink;
|
|
item.UseSound = SoundID.Item9;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<ShadecrystalProjectile>();
|
|
item.shootSpeed = 16f;
|
|
}
|
|
|
|
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(1, 3);
|
|
for (int index = 0; index < num6; ++index)
|
|
{
|
|
float SpeedX = speedX + Main.rand.Next(-40, 41) * 0.05f;
|
|
float SpeedY = speedY + Main.rand.Next(-40, 41) * 0.05f;
|
|
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.CrystalStorm);
|
|
recipe.AddIngredient(ModContent.ItemType<VerstaltiteBar>(), 6);
|
|
recipe.AddTile(TileID.Bookcases);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|