Files
CalamityModPublic/Items/Weapons/Magic/PlagueStaff.cs
T
Altixal 6544581ffa balancing 4: the big one
- made injection slightly cheaper in compensation for nerf
2023-02-19 19:26:46 -05:00

52 lines
1.8 KiB
C#

using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class PlagueStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Plague Staff");
Tooltip.SetDefault("Fires a tight spread of 4 plague fangs");
Item.staff[Item.type] = true;
SacrificeTotal = 1;
}
public override void SetDefaults()
{
Item.damage = 78;
Item.DamageType = DamageClass.Magic;
Item.mana = 22;
Item.width = 46;
Item.height = 46;
Item.useTime = 21;
Item.useAnimation = 21;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 8f;
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.UseSound = SoundID.Item43;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<PlagueFang>();
Item.shootSpeed = 16f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
for (int i = 0; i < 3; i++)
{
Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(5f)) * Main.rand.NextFloat(0.8f, 1.2f);
Projectile.NewProjectile(source, position, spreadVelocity, type, damage, knockback, Main.myPlayer);
}
return true; // Fires one directly with no randomness, totaling 4 projectiles
}
}
}