Files
CalamityModPublic/Projectiles/Magic/BloodBlast.cs
T

59 lines
2.3 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class BloodBlast : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 12;
Projectile.height = 12;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.alpha = 255;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
Projectile.extraUpdates = 2;
Projectile.DamageType = DamageClass.Magic;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0.5f, 0f, 0f);
for (int num92 = 0; num92 < 2; num92++)
{
float num93 = Projectile.velocity.X / 3f * (float)num92;
float num94 = Projectile.velocity.Y / 3f * (float)num92;
int num95 = 4;
int num96 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num95, Projectile.position.Y + (float)num95), Projectile.width - num95 * 2, Projectile.height - num95 * 2, 5, 0f, 0f, 100, default, 1.2f);
Dust dust = Main.dust[num96];
dust.noGravity = true;
dust.velocity *= 0.1f;
dust.velocity += Projectile.velocity * 0.1f;
dust.position.X -= num93;
dust.position.Y -= num94;
}
if (Main.rand.NextBool(5))
{
int num97 = 4;
int num98 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num97, Projectile.position.Y + (float)num97), Projectile.width - num97 * 2, Projectile.height - num97 * 2, 5, 0f, 0f, 100, default, 0.6f);
Main.dust[num98].velocity *= 0.25f;
Main.dust[num98].velocity += Projectile.velocity * 0.5f;
}
if (Projectile.ai[1] >= 20f)
{
Projectile.velocity.Y = Projectile.velocity.Y + 0.2f;
}
else
{
Projectile.rotation += 0.3f * (float)Projectile.direction;
}
}
}
}