Files
CalamityModPublic/Items/Weapons/Summon/ScabRipper.cs
T

57 lines
2.0 KiB
C#

using Terraria.DataStructures;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class ScabRipper : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.damage = 15;
Item.mana = 10;
Item.width = 66;
Item.height = 70;
Item.useTime = Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 0.5f;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item83;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<BabyBloodCrawler>();
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)
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
velocity.X = 0;
velocity.Y = 0;
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.CrimtaneBar, 5).
AddIngredient(ItemID.TissueSample, 9).
AddIngredient(ItemID.Shadewood, 20).
AddTile(TileID.Anvils).
Register();
}
}
}