52 lines
1.9 KiB
C#
52 lines
1.9 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Summon;
|
|
using CalamityMod.Rarities;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Summon
|
|
{
|
|
public class DragonbloodDisgorger : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Summon";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = 215;
|
|
Item.mana = 10;
|
|
Item.width = 64;
|
|
Item.height = 62;
|
|
Item.useTime = Item.useAnimation = 15;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 4f;
|
|
Item.value = CalamityGlobalItem.Rarity12BuyPrice;
|
|
Item.rare = ModContent.RarityType<Turquoise>();
|
|
Item.UseSound = SoundID.DD2_SkeletonDeath;
|
|
Item.shoot = ModContent.ProjectileType<SkeletalDragonMother>();
|
|
Item.shootSpeed = 10f;
|
|
Item.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
|
if (Main.projectile.IndexInRange(p))
|
|
Main.projectile[p].originalDamage = Item.damage;
|
|
return false;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.maxMinions >= 5;
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<BloodstoneCore>(12).
|
|
AddTile(TileID.LunarCraftingStation).
|
|
Register();
|
|
}
|
|
}
|
|
}
|