71 lines
2.5 KiB
C#
71 lines
2.5 KiB
C#
using CalamityMod.Items.Placeables;
|
|
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 AquamarineStaff : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Magic";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.staff[Item.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 17;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 3;
|
|
Item.width = 38;
|
|
Item.height = 38;
|
|
Item.useTime = 22;
|
|
Item.useAnimation = 22;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 2.5f;
|
|
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.UseSound = SoundID.Item43;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<AquamarineBolt>();
|
|
Item.shootSpeed = 14f;
|
|
}
|
|
|
|
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(-30, 31) * 0.05f;
|
|
float SpeedY = velocity.Y + (float)Main.rand.Next(-30, 31) * 0.05f;
|
|
int projectile = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0.0f, 0.0f);
|
|
Main.projectile[projectile].timeLeft = 180;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.AmethystStaff).
|
|
AddIngredient<PearlShard>(3).
|
|
AddIngredient<SeaPrism>(5).
|
|
AddIngredient<Navystone>(25).
|
|
AddTile(TileID.Anvils).
|
|
Register();
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.TopazStaff).
|
|
AddIngredient<PearlShard>(3).
|
|
AddIngredient<SeaPrism>(5).
|
|
AddIngredient<Navystone>(25).
|
|
AddTile(TileID.Anvils).
|
|
Register();
|
|
}
|
|
}
|
|
}
|