Files
CalamityModPublic/Items/Weapons/Rogue/GodsParanoia.cs
T

63 lines
2.1 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class GodsParanoia : RogueWeapon
{
public override void SetDefaults()
{
Item.width = 20;
Item.height = 20;
Item.damage = 163;
Item.DamageType = RogueDamageClass.Instance;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useAnimation = Item.useTime = 29;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 5;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shootSpeed = 10f;
Item.shoot = ModContent.ProjectileType<GodsParanoiaProj>();
}
public override float StealthDamageMultiplier => 0.85f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
{
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
if (stealth.WithinBounds(Main.maxProjectiles))
{
Main.projectile[stealth].Calamity().stealthStrike = true;
Main.projectile[stealth].localNPCHitCooldown = 30;
}
return false;
}
return true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<CosmiliteBar>(12).
AddTile<CosmicAnvil>().
Register();
}
}
}