Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using CalamityMod.Projectiles.Magic;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Magic
|
|
{
|
|
public class Purge : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Nano Purge");
|
|
Tooltip.SetDefault("Fires a barrage of nano lasers");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 50;
|
|
item.magic = true;
|
|
item.mana = 6;
|
|
item.width = 20;
|
|
item.height = 12;
|
|
item.useTime = 20;
|
|
item.useAnimation = 20;
|
|
item.useStyle = ItemUseStyleID.HoldingOut;
|
|
item.noMelee = true;
|
|
item.noUseGraphic = true;
|
|
item.channel = true;
|
|
item.knockBack = 3f;
|
|
item.value = Item.buyPrice(0, 95, 0, 0);
|
|
item.rare = 9;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<PurgeProj>();
|
|
item.shootSpeed = 24f;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.FragmentVortex, 20);
|
|
recipe.AddIngredient(ItemID.LaserMachinegun);
|
|
recipe.AddIngredient(ItemID.Nanites, 100);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<PurgeProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
|
return false;
|
|
}
|
|
}
|
|
}
|