55 lines
2.0 KiB
C#
55 lines
2.0 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 AshenStalactite : RogueWeapon
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 36;
|
|
Item.height = 34;
|
|
Item.damage = 37;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.useAnimation = Item.useTime = 20;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.knockBack = 1f;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
Item.maxStack = 1;
|
|
Item.value = CalamityGlobalItem.Rarity1BuyPrice;
|
|
Item.rare = ItemRarityID.Orange;
|
|
Item.shoot = ModContent.ProjectileType<AshenStalactiteProj>();
|
|
Item.shootSpeed = 15f;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable())
|
|
type = ModContent.ProjectileType<AshenStalagmiteProj>();
|
|
}
|
|
|
|
public override float StealthDamageMultiplier => 1.15f;
|
|
public override float StealthVelocityMultiplier => 0.6f;
|
|
public override float StealthKnockbackMultiplier => 2.5f;
|
|
|
|
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, type, damage, knockback, player.whoAmI, 0f, 1f);
|
|
if (p.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[p].Calamity().stealthStrike = true;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|