52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
using CalamityMod.Projectiles.Rogue;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class Valediction : RogueWeapon
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Valediction");
|
|
Tooltip.SetDefault("Throws a homing reaper scythe\n" +
|
|
"Stealth strikes spawn razorblade typhoons on enemy hits");
|
|
}
|
|
|
|
public override void SafeSetDefaults()
|
|
{
|
|
item.width = 80;
|
|
item.height = 64;
|
|
item.damage = 243;
|
|
item.noMelee = true;
|
|
item.noUseGraphic = true;
|
|
item.useAnimation = 17;
|
|
item.useTime = 17;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
item.knockBack = 7f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<ValedictionBoomerang>();
|
|
item.shootSpeed = 20f;
|
|
item.Calamity().rogue = true;
|
|
|
|
item.value = CalamityGlobalItem.Rarity13BuyPrice;
|
|
item.Calamity().customRarity = CalamityRarity.PureGreen;
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
|
{
|
|
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
|
if (stealth.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[stealth].Calamity().stealthStrike = true;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|