56 lines
1.9 KiB
C#
56 lines
1.9 KiB
C#
using CalamityMod.Items.Materials;
|
|
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 ShadecrystalTome : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Magic";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 25;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 4;
|
|
Item.width = 28;
|
|
Item.height = 30;
|
|
Item.useTime = 6;
|
|
Item.useAnimation = 6;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 5.5f;
|
|
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
|
|
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, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
int num6 = Main.rand.Next(1, 3);
|
|
for (int index = 0; index < num6; ++index)
|
|
{
|
|
float SpeedX = velocity.X + Main.rand.Next(-40, 41) * 0.05f;
|
|
float SpeedY = velocity.Y + 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(ItemID.CrystalStorm).
|
|
AddIngredient<CryonicBar>(6).
|
|
AddTile(TileID.Bookcases).
|
|
Register();
|
|
}
|
|
}
|
|
}
|