49 lines
1.8 KiB
C#
49 lines
1.8 KiB
C#
using CalamityMod.Projectiles.Magic;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Items.Weapons.Magic
|
|
{
|
|
public class PurgeGuzzler : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Purge Guzzler");
|
|
Tooltip.SetDefault("Fires three beams of holy energy");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 80;
|
|
item.magic = true;
|
|
item.mana = 12;
|
|
item.width = 58;
|
|
item.height = 44;
|
|
item.useTime = 12;
|
|
item.useAnimation = 12;
|
|
item.useStyle = 5;
|
|
item.noMelee = true;
|
|
item.knockBack = 4.5f;
|
|
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon");
|
|
item.value = Item.buyPrice(1, 20, 0, 0);
|
|
item.rare = 10;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<HolyLaser>();
|
|
item.shootSpeed = 6f;
|
|
item.Calamity().postMoonLordRarity = 12;
|
|
}
|
|
|
|
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 numProj = 2;
|
|
float rotation = MathHelper.ToRadians(4);
|
|
for (int i = 0; i < numProj + 1; i++)
|
|
{
|
|
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
|
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|