52 lines
1.9 KiB
C#
52 lines
1.9 KiB
C#
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 Cinquedea : RogueWeapon
|
|
{
|
|
public static int BaseDamage = 36;
|
|
public static float Knockback = 5f;
|
|
public static float Speed = 8f;
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.damage = BaseDamage;
|
|
Item.rare = ItemRarityID.Orange;
|
|
Item.knockBack = Knockback;
|
|
Item.autoReuse = true;
|
|
Item.useTime = 15;
|
|
Item.useAnimation = 15;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.width = 32;
|
|
Item.height = 32;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.shoot = ModContent.ProjectileType<CinquedeaProj>();
|
|
Item.shootSpeed = Speed;
|
|
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
// Terraria seems to really dislike high crit values in SetDefaults
|
|
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8;
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable())
|
|
{
|
|
int p = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<CinquedeaProj>(), damage, knockback, player.whoAmI, 0f, 1f);
|
|
if (p.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[p].Calamity().stealthStrike = true;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|