53 lines
2.1 KiB
C#
53 lines
2.1 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class AquamarineBolt : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Magic";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2;
|
|
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 16;
|
|
Projectile.height = 16;
|
|
Projectile.friendly = true;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.penetrate = 1;
|
|
Projectile.DamageType = DamageClass.Magic;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.25f / 255f, (255 - Projectile.alpha) * 0.25f / 255f);
|
|
int num154 = 14;
|
|
int num155 = Dust.NewDust(Projectile.Center, Projectile.width - num154 * 2, Projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1.5f);
|
|
Main.dust[num155].noGravity = true;
|
|
Main.dust[num155].velocity *= 0.1f;
|
|
Main.dust[num155].velocity += Projectile.velocity * 0.5f;
|
|
if (Main.rand.NextBool(16))
|
|
{
|
|
int num156 = 16;
|
|
int num157 = Dust.NewDust(Projectile.Center, Projectile.width - num156 * 2, Projectile.height - num156 * 2, 68, 0f, 0f, 100, default, 1f);
|
|
Main.dust[num157].velocity *= 0.25f;
|
|
Main.dust[num157].velocity += Projectile.velocity * 0.5f;
|
|
}
|
|
Projectile.rotation += 0.3f * (float)Projectile.direction;
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200);
|
|
|
|
public override bool PreDraw(ref Color lightColor)
|
|
{
|
|
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
|
return false;
|
|
}
|
|
}
|
|
}
|