65 lines
2.2 KiB
C#
65 lines
2.2 KiB
C#
using Terraria.DataStructures;
|
|
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 FantasyTalisman : RogueWeapon
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.ResearchUnlockCount = 99;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 30;
|
|
Item.damage = 82;
|
|
Item.noMelee = true;
|
|
Item.consumable = true;
|
|
Item.noUseGraphic = true;
|
|
Item.useAnimation = 16;
|
|
Item.useTime = 16;
|
|
Item.useStyle = ItemUseStyleID.Swing;
|
|
Item.knockBack = 6f;
|
|
Item.UseSound = SoundID.Item1;
|
|
Item.autoReuse = true;
|
|
Item.height = 30;
|
|
Item.maxStack = 9999;
|
|
Item.value = Item.buyPrice(0, 0, 60, 0);
|
|
Item.rare = ItemRarityID.Lime;
|
|
Item.shoot = ModContent.ProjectileType<FantasyTalismanProj>();
|
|
Item.shootSpeed = 16.5f;
|
|
Item.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
public override float StealthDamageMultiplier => 0.8f;
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
|
{
|
|
int stealth = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<FantasyTalismanStealth>(), damage, knockback, player.whoAmI);
|
|
if (stealth.WithinBounds(Main.maxProjectiles))
|
|
Main.projectile[stealth].Calamity().stealthStrike = true;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe(150).
|
|
AddIngredient<SolarVeil>(3).
|
|
AddIngredient(ItemID.Silk).
|
|
AddIngredient(ItemID.Ectoplasm).
|
|
AddTile(TileID.MythrilAnvil).
|
|
Register();
|
|
}
|
|
}
|
|
}
|