Files
CalamityModPublic/Items/Weapons/Rogue/SludgeSplotch.cs
T
2023-05-28 06:14:26 +07:00

66 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;
using Terraria.Audio;
namespace CalamityMod.Items.Weapons.Rogue
{
public class SludgeSplotch : RogueWeapon
{
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 99;
}
public override void SetDefaults()
{
Item.width = 32;
Item.damage = 48;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.consumable = true;
Item.useAnimation = 18;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 18;
Item.knockBack = 1f;
Item.autoReuse = true;
Item.height = 30;
Item.maxStack = 9999;
Item.value = Item.sellPrice(0, 0, 0, 40);
Item.rare = ItemRarityID.Green;
Item.shoot = ModContent.ProjectileType<SludgeSplotchProj1>();
Item.shootSpeed = 10f;
Item.DamageType = RogueDamageClass.Instance;
}
public override float StealthVelocityMultiplier => 1.2f;
public override float StealthKnockbackMultiplier => 3f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
SoundEngine.PlaySound(SoundID.NPCDeath9 with { Volume = SoundID.NPCDeath9.Volume * 2f }, player.Center);
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;
}
public override void AddRecipes()
{
CreateRecipe(100).
AddIngredient<BlightedGel>(15).
AddRecipeGroup("Boss2Material").
Register();
}
}
}