58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Projectiles.Ranged;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Ranged
|
|
{
|
|
public class Leviatitan : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Leviatitan");
|
|
Tooltip.SetDefault("Fires green and normal water blasts");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 80;
|
|
item.ranged = true;
|
|
item.width = 82;
|
|
item.height = 28;
|
|
item.useTime = 9;
|
|
item.useAnimation = 9;
|
|
item.useStyle = 5;
|
|
item.noMelee = true;
|
|
item.knockBack = 5f;
|
|
item.value = Item.buyPrice(0, 60, 0, 0);
|
|
item.rare = 7;
|
|
item.UseSound = SoundID.Item92;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<AquaBlast>();
|
|
item.shootSpeed = 18f;
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset()
|
|
{
|
|
return new Vector2(-15, 0);
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
|
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<AquaBlastToxic>(), (int)((double)damage * 1.5), knockBack, player.whoAmI, 0f, 0f);
|
|
}
|
|
else
|
|
{
|
|
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<AquaBlast>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|