53 lines
2.0 KiB
C#
53 lines
2.0 KiB
C#
using Terraria.DataStructures;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.GameContent.Creative;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class ProfanedTrident : RogueWeapon
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Wrathwing");
|
|
Tooltip.SetDefault("Throws an agile, homing winged spear that constantly spits fire\n" +
|
|
"Stealth strikes create an eruption of cinders on hit");
|
|
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
|
}
|
|
|
|
public override void SafeSetDefaults()
|
|
{
|
|
Item.width = 152;
|
|
Item.height = 148;
|
|
Item.damage = 592;
|
|
Item.knockBack = 5f;
|
|
Item.noMelee = true;
|
|
Item.noUseGraphic = true;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.useTime = Item.useAnimation = 13;
|
|
Item.autoReuse = true;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
|
Item.rare = ItemRarityID.Purple;
|
|
Item.Calamity().customRarity = CalamityRarity.Violet;
|
|
Item.shoot = ModContent.ProjectileType<WrathwingSpear>();
|
|
Item.shootSpeed = 28f;
|
|
Item.Calamity().rogue = true;
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable())
|
|
damage = (int)(damage * 0.85f);
|
|
|
|
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 = player.Calamity().StealthStrikeAvailable();
|
|
return false;
|
|
}
|
|
}
|
|
}
|