Also fixed a few other bugs like with Web Balls, Jaws of Oblivion, Dune Hopper, Cobalt Kunai, Frostcrush Valari, Plaguenades, and Time Bolt
74 lines
2.7 KiB
C#
74 lines
2.7 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class ExecutionersBlade : RogueWeapon
|
|
{
|
|
private int counter = 0;
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Executioner's Blade");
|
|
Tooltip.SetDefault("Throws a stream of homing blades\n" +
|
|
"Stealth strikes summon a guillotine of blades on hit");
|
|
}
|
|
|
|
public override void SafeSetDefaults()
|
|
{
|
|
item.width = 64;
|
|
item.damage = 467;
|
|
item.noMelee = true;
|
|
item.noUseGraphic = true;
|
|
item.useTime = 3;
|
|
item.useAnimation = 9;
|
|
item.reuseDelay = 1;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
item.knockBack = 6.75f;
|
|
item.UseSound = SoundID.Item73;
|
|
item.autoReuse = true;
|
|
item.height = 64;
|
|
item.value = Item.buyPrice(1, 80, 0, 0);
|
|
item.rare = 10;
|
|
item.shoot = ModContent.ProjectileType<ExecutionersBladeProj>();
|
|
item.shootSpeed = 26f;
|
|
item.Calamity().rogue = true;
|
|
item.Calamity().customRarity = CalamityRarity.DarkBlue;
|
|
}
|
|
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow"));
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 11);
|
|
recipe.AddRecipeGroup("NForEE", 5);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
|
if (player.Calamity().StealthStrikeAvailable() && counter == 0 && stealth.WithinBounds(Main.maxProjectiles))
|
|
{
|
|
Main.projectile[stealth].Calamity().stealthStrike = true;
|
|
}
|
|
|
|
counter++;
|
|
if (counter >= item.useAnimation / item.useTime)
|
|
counter = 0;
|
|
return false;
|
|
}
|
|
}
|
|
}
|