Files
CalamityModPublic/Projectiles/Magic/LightBead.cs
T
Andrew Marheine cb6b42f43f 1 - Highest tier accessory reforges now reforge into other highest tier accessory reforges.
2 - Nerfed Amalgam extra projectile damage values.
3 - Arma bags now only drop on first boss kills.
4 - Nerfed Conference Call extra bullet damage by 30%.
5 - Cal Clone dashes are no longer predictive.
6 - Old Duke looks in the direction he's about to dash instead of directly at the player, if he's going to dash.
7 - Updated pillar spawn code a bit more.
8 - Pulse Rifle now works like it should and doesn't hit 4 times on a single target.
9 - Adjusted HomeInOnNPC calls to use projectile.tileCollide to decide homing through tiles or not.
2021-04-13 00:19:56 -05:00

73 lines
2.5 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class LightBead : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Light Bead");
}
public override void SetDefaults()
{
projectile.width = 8;
projectile.height = 8;
projectile.friendly = true;
projectile.alpha = 50;
projectile.scale = 1.2f;
projectile.penetrate = 1;
projectile.timeLeft = 600;
projectile.magic = true;
}
public override void AI()
{
Lighting.AddLight(projectile.Center, 0.5f, 0.5f, 0.5f);
projectile.rotation += projectile.velocity.X * 0.2f;
projectile.ai[1] += 1f;
if (Main.rand.NextBool(3))
{
int num300 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 0, default, 1f);
Main.dust[num300].noGravity = true;
Main.dust[num300].velocity *= 0.5f;
Main.dust[num300].scale *= 0.9f;
}
if (projectile.ai[1] > 300f)
{
projectile.scale -= 0.05f;
if (projectile.scale <= 0.2f)
{
projectile.scale = 0.2f;
projectile.Kill();
return;
}
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 200f, 18f, 10f);
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(255, 255, 200, projectile.alpha);
}
public override void Kill(int timeLeft)
{
for (int k = 0; k < 6; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
int beadAmt = Main.rand.Next(2, 3);
if (projectile.owner == Main.myPlayer)
{
for (int b = 0; b < beadAmt; b++)
{
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType<LightBeadSplit>(), (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f);
}
}
}
}
}