Files
CalamityModPublic/Items/Weapons/DraedonsArsenal/Taser.cs
T
Altixal e0bf810be7 Added token knockback to all weapons
Change carried over from 1.4.4

Also did a little regexing oops
2024-08-11 11:07:20 +07:00

60 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Sounds;
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.damage = 16;
Item.DamageType = DamageClass.Ranged;
Item.useAnimation = Item.useTime = 28;
Item.knockBack = 0.25f;
Item.shoot = ModContent.ProjectileType<TaserHook>();
Item.shootSpeed = 25f;
Item.UseSound = CommonCalamitySounds.PlasmaBoltSound;
Item.useStyle = ItemUseStyleID.Shoot;
Item.autoReuse = true;
Item.noMelee = true;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
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();
}
}
}