using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { public class WebBall : RogueWeapon { public override void SetStaticDefaults() { Item.ResearchUnlockCount = 99; } public override void SetDefaults() { Item.width = 20; Item.damage = 12; Item.noMelee = true; Item.noUseGraphic = true; Item.maxStack = 9999; Item.consumable = true; Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 20; Item.knockBack = 3f; Item.UseSound = SoundID.Item1; Item.height = 18; Item.value = Item.buyPrice(0, 0, 0, 30); Item.rare = ItemRarityID.White; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6.5f; Item.DamageType = RogueDamageClass.Instance; } 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 proj = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = true; return false; } return true; } public override void AddRecipes() { CreateRecipe(50). AddIngredient(ItemID.Cobweb, 10). Register(); } } }