public override bool CheckDead() { if (Phase == (int)AIStates.Dying && GlobalTimer >= 659) { foreach (NPC npc in Main.npc.Where(n => n.modNPC is VitricBackdropLeft || n.modNPC is VitricBossPlatformUp)) { npc.active = false; //reset arena } StarlightWorld.Flag(WorldFlags.GlassBossDowned); return(true); } ChangePhase(AIStates.Dying, true); npc.dontTakeDamage = true; npc.friendly = true; npc.life = 1; foreach (Player player in Main.player.Where(n => n.Hitbox.Intersects(arena))) { player.GetModPlayer <StarlightPlayer>().ScreenMoveTarget = homePos; player.GetModPlayer <StarlightPlayer>().ScreenMoveTime = 720; player.immuneTime = 720; player.immune = true; } if (Phase == (int)AIStates.Dying && GlobalTimer >= 659) { return(true); } else { return(false); } }
public override bool CheckDead() { NPC.NewNPC((StarlightWorld.VitricBiome.X - 10) * 16, (StarlightWorld.VitricBiome.Center.Y + 12) * 16, NPCType <GlassweaverTown>()); StarlightWorld.Flag(WorldFlags.DesertOpen); Main.NewText("The temple doors slide open...", new Color(200, 170, 80)); return(true); }
public override void NPCLoot() { for (int k = 0; k < Main.maxPlayers; k++) { Player player = Main.player[k]; if (player.active && StarlightWorld.SquidBossArena.Contains((player.Center / 16).ToPoint())) { player.GetModPlayer <MedalPlayer>().ProbeMedal("Auroracle"); } } StarlightWorld.Flag(WorldFlags.SquidBossDowned); }
public override void AI() { foreach (Player player in Main.player) { if (AbilityHelper.CheckSmash(player, projectile.Hitbox)) { if (!StarlightWorld.HasFlag(WorldFlags.SealOpen)) { StarlightWorld.Flag(WorldFlags.SealOpen); player.GetHandler().ActiveAbility?.Deactivate(); player.GetModPlayer <StarlightPlayer>().Shake = 80; Main.PlaySound(SoundID.NPCDeath59); Main.PlaySound(SoundID.Item123); for (float k = 0; k <= 3.14f; k += 0.02f) { Dust.NewDustPerfect(projectile.Center, DustID.Stone, new Vector2(-1, 0).RotatedBy(k) * Main.rand.Next(0, 150) * 0.1f, 0, default, 2.5f);
public override bool NewRightClick(int i, int j) { if (Keys.Key.Use <Keys.OvergrowKey>()) { for (int x = i - 2; x < i + 2; x++) { for (int y = j - 7; y < j + 7; y++) { if (Main.tile[x, y].type == Type) { Main.tile[x, y].frameX += 36; } } } CombatText.NewText(new Rectangle(i * 16, j * 16, 1, 1), new Color(255, 255, 200), Main.tile[i, j].frameX / 36 + "/3"); if (Main.tile[i, j].frameX > 100) { StarlightWorld.Flag(WorldFlags.OvergrowBossOpen); } } return(true); }
public override void GoodEffects() => StarlightWorld.Flag(WorldFlags.SquidBossOpen);
public override void AI() { Lighting.AddLight(npc.Center, new Vector3(1, 1, 0.8f)); GlobalTimer++; //tick our timer up constantly AttackTimer++; //tick up our attack timer if (npc.ai[0] == (int)OvergrowBossPhase.Struggle) //when the boss is trapped before spawning the first time { if (spawnPoint == Vector2.Zero) { spawnPoint = npc.Center; //sets the boss' home } npc.velocity.Y = (float)Math.Sin((GlobalTimer % 120) / 120f * 6.28f) * 0.6f; if (!Main.npc.Any(n => n.active && n.type == NPCType <OvergrowBossAnchor>())) //once the chains are broken { npc.velocity *= 0; npc.Center = spawnPoint; GlobalTimer = 0; StarlightPlayer mp = Main.LocalPlayer.GetModPlayer <StarlightPlayer>(); mp.ScreenMoveTime = 860; mp.ScreenMoveTarget = npc.Center; mp.ScreenMovePan = npc.Center + new Vector2(0, -100); Phase = (int)OvergrowBossPhase.spawnAnimation; } } if (Phase == (int)OvergrowBossPhase.spawnAnimation) //the boss' spawn animation. { if (GlobalTimer == 1) { music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/OvergrowBoss"); } if (GlobalTimer <= 120) { npc.position.Y--; } if (GlobalTimer == 120) { StarlightWorld.Flag(WorldFlags.OvergrowBossFree); } if (GlobalTimer == 500) { string message = "Faerie Guardian"; if (Main.rand.Next(10000) == 0) { message = "Titty Elongator"; // Yep } UILoader.GetUIState <TextCard>().Display("Eggshells", message, null, 220); } if (GlobalTimer >= 860) { Phase = (int)OvergrowBossPhase.Setup; } } if (Phase == (int)OvergrowBossPhase.Setup) { npc.boss = true; int index = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCType <OvergrowBossFlail>()); //spawn the flail after intro (Main.npc[index].modNPC as OvergrowBossFlail).parent = this; //set the flail's parent flail = Main.npc[index].modNPC as OvergrowBossFlail; //tells the boss what flail it owns Phase = (int)OvergrowBossPhase.FirstAttack; //move on to the first attack phase GlobalTimer = 0; //reset our timer npc.ai[3] = 0; //reset our attack timer } if (flail == null) { return; //at this point, our boss should have her flail. if for some reason she dosent, this is a safety check } if (Phase == (int)OvergrowBossPhase.FirstAttack) //the first attacking phase { //attack pattern advancement logic if (AttackTimer == 1) { RandomizeTarget(); if (AttackPhase == 1) { AttackPhase++; //tick up an additional time so that we dont use 2 alternate attacks in a row. TODO: Should make a cleaner way to do this. } AttackPhase++; if (AttackPhase == 1 && Main.rand.Next(2) == 0) { AttackPhase++; } if (AttackPhase > 6) { AttackPhase = 0; } if (flail.npc.life <= 1) //move to next phase once the flail is depleated { Phase = (int)OvergrowBossPhase.FirstToss; AttackPhase = 0; ResetAttack(); //foreach (Projectile proj in Main.projectile.Where(p => p.type == ProjectileType<Projectiles.Dummies.OvergrowBossPitDummy>())) proj.ai[1] = 1; //opens the pits } } switch (AttackPhase) //attack pattern { case 0: Phase1Spin(); break; case 1: Phase1Bolts(); break; //______randonly picks between these two case 2: Phase1Trap(); break; //___| case 3: Phase1Toss(); break; case 4: Phase1Toss(); break; case 5: Phase1Bolts(); break; case 6: Phase1Toss(); break; } } if (Phase == (int)OvergrowBossPhase.FirstToss) { RapidToss(); //toss rapidly till thrown into a pit } if (Phase == (int)OvergrowBossPhase.Stun) { if (GlobalTimer == 1) { npc.alpha = 255; for (int k = 0; k < 100; k++) { Dust d = Dust.NewDustPerfect(npc.Center, 1 /*DustType<>()*/, Vector2.One.RotatedByRandom(Math.PI) * Main.rand.NextFloat(5)); d.customData = npc.Center; } npc.Center = spawnPoint + new Vector2(0, 320); flail.npc.ai[0] = 1; } if (GlobalTimer >= 120) { npc.alpha = 0; if (npc.Hitbox.Intersects(flail.npc.Hitbox)) { flail.npc.ai[0] = 0; flail.npc.ai[3] = 1; flail.npc.velocity *= 0; flail.npc.life = flail.npc.lifeMax; flail.npc.dontTakeDamage = false; flail.npc.friendly = false; npc.life -= 20000; Phase = (int)OvergrowBossPhase.SecondAttack; ResetAttack(); CombatText.NewText(npc.Hitbox, Color.Red, 20000, true); Main.PlaySound(SoundID.DD2_BetsyScream, npc.Center); Main.LocalPlayer.GetModPlayer <StarlightPlayer>().Shake += 30; for (int k = 0; k < 100; k++) { Dust d = Dust.NewDustPerfect(flail.npc.Center, DustType <Dusts.Stone>(), Vector2.One.RotatedByRandom(Math.PI) * Main.rand.NextFloat(5)); } } } } }
public override void NPCLoot() { StarlightWorld.Flag(WorldFlags.SquidBossDowned); }