Also fixed a few other bugs like with Web Balls, Jaws of Oblivion, Dune Hopper, Cobalt Kunai, Frostcrush Valari, Plaguenades, and Time Bolt
64 lines
2.3 KiB
C#
64 lines
2.3 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Rogue;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Rogue
|
|
{
|
|
public class TimeBolt : RogueWeapon
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Time Bolt");
|
|
Tooltip.SetDefault("There should be no boundary to human endeavor.\n" +
|
|
"Stealth strikes can hit more enemies and create a larger time field");
|
|
}
|
|
|
|
public override void SafeSetDefaults()
|
|
{
|
|
item.width = 24;
|
|
item.height = 46;
|
|
item.damage = 720;
|
|
item.noMelee = true;
|
|
item.noUseGraphic = true;
|
|
item.useAnimation = 20;
|
|
item.useStyle = ItemUseStyleID.SwingThrow;
|
|
item.useTime = 20;
|
|
item.knockBack = 4f;
|
|
item.UseSound = SoundID.Item1;
|
|
item.autoReuse = true;
|
|
item.value = Item.buyPrice(1, 40, 0, 0);
|
|
item.rare = 10;
|
|
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
|
item.shoot = ModContent.ProjectileType<TimeBoltKnife>();
|
|
item.shootSpeed = 16f;
|
|
item.Calamity().rogue = true;
|
|
}
|
|
|
|
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 proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
|
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
|
{
|
|
Main.projectile[proj].Calamity().stealthStrike = true;
|
|
Main.projectile[proj].penetrate = 11;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<CosmicKunai>());
|
|
recipe.AddIngredient(ItemID.FastClock);
|
|
recipe.AddIngredient(ModContent.ItemType<RuinousSoul>(), 5);
|
|
recipe.AddIngredient(ModContent.ItemType<Phantoplasm>(), 20);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|