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

69 lines
2.5 KiB
C#

using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.DraedonsArsenal;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class PulsePistol : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
public override void SetDefaults()
{
CalamityGlobalItem modItem = Item.Calamity();
Item.width = 62;
Item.height = 22;
Item.DamageType = DamageClass.Magic;
Item.damage = 26;
Item.knockBack = 0f;
Item.useTime = Item.useAnimation = 20;
Item.autoReuse = true;
Item.mana = 6;
Item.useStyle = ItemUseStyleID.Shoot;
Item.UseSound = PulseRifle.FireSound;
Item.noMelee = true;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.shoot = ModContent.ProjectileType<PulseRifleShot>();
Item.shootSpeed = 5.2f; // This may seem low but the shot has 10 extra updates.
modItem.UsesCharge = true;
modItem.MaxCharge = 50f;
modItem.ChargePerUse = 0.05f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<PulsePistolShot>(), damage, knockback, player.whoAmI, 0f, 0f);
return false;
}
public override Vector2? HoldoutOffset() => new Vector2(10f, 0f);
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1);
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MysteriousCircuitry>(5).
AddIngredient<DubiousPlating>(7).
AddIngredient<AerialiteBar>(4).
AddIngredient<SeaPrism>(7).
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Func<bool> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}