Files
CalamityModPublic/Items/Weapons/DraedonsArsenal/Taser.cs
T

61 lines
2.0 KiB
C#

using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Sounds;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class Taser : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.width = 50;
Item.height = 26;
Item.DamageType = DamageClass.Ranged;
Item.damage = 15;
Item.knockBack = 0f;
Item.useTime = Item.useAnimation = 28;
Item.autoReuse = true;
Item.useStyle = ItemUseStyleID.Shoot;
Item.UseSound = CommonCalamitySounds.PlasmaBoltSound;
Item.noMelee = true;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.shoot = ModContent.ProjectileType<TaserHook>();
Item.shootSpeed = 15f;
modItem.UsesCharge = true;
modItem.MaxCharge = 50f;
modItem.ChargePerUse = 0.05f;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1);
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MysteriousCircuitry>(7).
AddIngredient<DubiousPlating>(5).
AddIngredient<AerialiteBar>(4).
AddIngredient<SeaPrism>(7).
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Func<bool> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}