74 lines
2.7 KiB
C#
74 lines
2.7 KiB
C#
using CalamityMod.CustomRecipes;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Items.Weapons.Rogue;
|
|
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 FrequencyManipulator : RogueWeapon, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
|
|
public override void SetDefaults()
|
|
{
|
|
CalamityGlobalItem modItem = Item.Calamity();
|
|
|
|
Item.damage = 80;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.width = 26;
|
|
Item.height = 44;
|
|
Item.useTime = 56;
|
|
Item.useAnimation = 56;
|
|
Item.autoReuse = true;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.knockBack = 5f;
|
|
|
|
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
|
|
Item.rare = ItemRarityID.Pink;
|
|
Item.UseSound = SoundID.Item1;
|
|
|
|
Item.shootSpeed = 16f;
|
|
Item.shoot = ModContent.ProjectileType<FrequencyManipulatorProjectile>();
|
|
|
|
modItem.UsesCharge = true;
|
|
modItem.MaxCharge = 85f;
|
|
modItem.ChargePerUse = 0.04f;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
|
|
|
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2);
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable())
|
|
damage = (int)(damage * 0.9f);
|
|
|
|
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
|
if (proj.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient<MysteriousCircuitry>(8).
|
|
AddIngredient<DubiousPlating>(12).
|
|
AddRecipeGroup("AnyMythrilBar", 10).
|
|
AddIngredient(ItemID.SoulofSight, 20).
|
|
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func<bool> condition), condition).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
}
|
|
}
|
|
}
|