59 lines
2.1 KiB
C#
59 lines
2.1 KiB
C#
using Microsoft.Xna.Framework;
|
|
using System;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class MadAlchemistsCocktailPurple : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Mad Alchemist's Cocktail Purple");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 24;
|
|
projectile.height = 24;
|
|
projectile.friendly = true;
|
|
projectile.magic = true;
|
|
projectile.ignoreWater = true;
|
|
projectile.penetrate = 1;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
projectile.rotation += Math.Abs(projectile.velocity.X) * 0.04f * (float)projectile.direction;
|
|
projectile.ai[0] += 1f;
|
|
if (projectile.ai[0] >= 90f)
|
|
{
|
|
projectile.velocity.Y = projectile.velocity.Y + 0.4f;
|
|
projectile.velocity.X = projectile.velocity.X * 0.97f;
|
|
}
|
|
if (projectile.velocity.Y > 16f)
|
|
{
|
|
projectile.velocity.Y = 16f;
|
|
}
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
Main.PlaySound(SoundID.Item107, projectile.position);
|
|
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
|
|
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
|
|
if (projectile.owner == Main.myPlayer)
|
|
{
|
|
for (int num221 = 0; num221 < 4; num221++)
|
|
{
|
|
Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
|
value17.Normalize();
|
|
value17 *= (float)Main.rand.Next(10, 201) * 0.01f;
|
|
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType<MadAlchemistsCocktailShrapnel>(), projectile.damage / 3, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|