46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using System;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class SandDollar : RogueWeapon
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 30;
|
|
Item.height = 28;
|
|
Item.damage = 20;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.useTime = Item.useAnimation = 28;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.knockBack = 3.5f;
|
|
Item.autoReuse = true;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.shoot = ModContent.ProjectileType<SandDollarProj>();
|
|
Item.shootSpeed = 8f;
|
|
}
|
|
|
|
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;
|
|
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|