using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { public class ShadeNimbus : ModProjectile { public override void SetStaticDefaults() { DisplayName.SetDefault("Nimbus"); Main.projFrames[projectile.type] = 6; } public override void SetDefaults() { projectile.width = 54; projectile.height = 28; projectile.tileCollide = false; projectile.ignoreWater = true; projectile.penetrate = -1; } public override void AI() { projectile.frameCounter++; if (projectile.frameCounter > 8) { projectile.frameCounter = 0; projectile.frame++; if (projectile.frame > 5) { projectile.frame = 0; } } projectile.ai[1] += 1f; if (projectile.ai[1] >= 7200f) { projectile.alpha += 5; if (projectile.alpha > 255) { projectile.alpha = 255; projectile.Kill(); } } else { projectile.ai[0] += 1f; if (projectile.ai[0] > 8f) { projectile.ai[0] = 0f; if (projectile.owner == Main.myPlayer) { int num414 = (int)(projectile.position.X + 14f + (float)Main.rand.Next(projectile.width - 28)); int num415 = (int)(projectile.position.Y + (float)projectile.height + 4f); Projectile.NewProjectile((float)num414, (float)num415, 0f, 5f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); } } } projectile.localAI[0] += 1f; if (projectile.localAI[0] >= 10f) { projectile.localAI[0] = 0f; int num416 = 0; int num417 = 0; float num418 = 0f; int num419 = projectile.type; for (int num420 = 0; num420 < 1000; num420++) { if (Main.projectile[num420].active && Main.projectile[num420].owner == projectile.owner && Main.projectile[num420].type == num419 && Main.projectile[num420].ai[1] < 3600f) { num416++; if (Main.projectile[num420].ai[1] > num418) { num417 = num420; num418 = Main.projectile[num420].ai[1]; } } } if (num416 > 2) { Main.projectile[num417].netUpdate = true; Main.projectile[num417].ai[1] = 36000f; return; } } } } }