Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
63 lines
1.8 KiB
C#
63 lines
1.8 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class SirenSongFriendly : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Song");
|
|
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 26;
|
|
projectile.height = 26;
|
|
projectile.friendly = true;
|
|
projectile.minion = true;
|
|
projectile.minionSlots = 0f;
|
|
projectile.penetrate = 1;
|
|
projectile.timeLeft = 600;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
projectile.velocity.X *= 0.985f;
|
|
projectile.velocity.Y *= 0.985f;
|
|
if (projectile.localAI[0] == 0f)
|
|
{
|
|
projectile.scale += 0.02f;
|
|
if (projectile.scale >= 1.25f)
|
|
{
|
|
projectile.localAI[0] = 1f;
|
|
}
|
|
}
|
|
else if (projectile.localAI[0] == 1f)
|
|
{
|
|
projectile.scale -= 0.02f;
|
|
if (projectile.scale <= 0.75f)
|
|
{
|
|
projectile.localAI[0] = 0f;
|
|
}
|
|
}
|
|
if (projectile.ai[1] == 0f)
|
|
{
|
|
projectile.ai[1] = 1f;
|
|
float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f;
|
|
Main.harpNote = soundPitch;
|
|
Main.PlaySound(SoundID.Item26, projectile.position);
|
|
}
|
|
Lighting.AddLight(projectile.Center, 0f, 0f, 1.2f);
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
return new Color(255, 255, 255, 0);
|
|
}
|
|
}
|
|
}
|