Beispiel #1
0
        public override void Kill(int timeLeft)
        {
            if (!AAWorld.downedZero && Main.expertMode)
            {
                if (Main.netMode != NetmodeID.MultiplayerClient)
                {
                    AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroDeath3"), Color.Red.R, Color.Red.G, Color.Red.B);
                }
            }
            int p = Projectile.NewProjectile(projectile.Center, new Vector2(0f, 0f), mod.ProjectileType("ZeroDeath2"), 0, 0);

            Main.projectile[p].Center = projectile.Center;
        }
Beispiel #2
0
        public override void HitEffect(int hitDirection, double damage)
        {
            if (npc.life <= (int)(npc.lifeMax * .66f) && !RespawnArms1 && Main.netMode != NetmodeID.MultiplayerClient)
            {
                WeaponCount += 1;
                npc.ai[1]    = 0;
                RespawnArms1 = true;

                RespawnArms();
                if (Main.netMode != NetmodeID.MultiplayerClient)
                {
                    AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroBoss10"), Color.Red, false);
                }
                npc.netUpdate = true;
            }
            if (npc.life <= (int)(npc.lifeMax * .33f) && !RespawnArms2 && Main.netMode != NetmodeID.MultiplayerClient)
            {
                WeaponCount += 1;
                npc.ai[1]    = 0;
                RespawnArms2 = true;
                RespawnArms();
                if (Main.netMode != NetmodeID.MultiplayerClient)
                {
                    AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroBoss10"), Color.Red, false);
                }
                npc.netUpdate = true;
            }

            if (npc.life <= 0 && npc.type == mod.NPCType("Zero"))
            {
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore1"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore1"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore1"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore1"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore3"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore3"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore3"), 1f);
                Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZeroGore3"), 1f);
                if (!Main.expertMode)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroBoss2"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
            }
        }
        public bool AliveCheck(Player player)
        {
            bool tooFar = Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 8000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 8000f;

            if (player.dead || tooFar || !player.active)
            {
                npc.TargetClosest(true);

                if (Main.player[npc.target].dead || !Main.player[npc.target].active || tooFar)
                {
                    if (!PlayerDead)
                    {
                        if (player.dead || !player.active)
                        {
                            if (Main.netMode != NetmodeID.MultiplayerClient)
                            {
                                AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened6"), Color.Red.R, Color.Red.G, Color.Red.B);
                            }
                        }
                        else if (tooFar)
                        {
                            if (Main.netMode != NetmodeID.MultiplayerClient)
                            {
                                AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened7"), Color.Red.R, Color.Red.G, Color.Red.B);
                            }
                        }
                        PlayerDead = true;
                    }
                    npc.velocity.Y = npc.velocity.Y - 0.04f;
                    if (npc.timeLeft > 10)
                    {
                        npc.timeLeft = 10;
                    }
                    npc.ai[1] = 0;
                    npc.ai[2] = 0;
                    npc.ai[3] = 0;
                    if (npc.position.Y + npc.height - npc.velocity.Y <= 0 && Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        BaseAI.KillNPC(npc); npc.netUpdate2 = true;
                    }
                    return(false);
                }
            }
            return(true);
        }
Beispiel #4
0
        public override void NPCLoot()
        {
            npc.value = 0f;
            npc.boss  = false;
            int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AsheVanish>(), 0, 0f, 0f, 0f, 0f, 255);

            Main.npc[num].velocity = npc.velocity;
            if (!NPC.AnyNPCs(ModContent.NPCType <AkumaA>()))
            {
                if (Main.netMode != NetmodeID.MultiplayerClient)
                {
                    AAModEXAI.Chat(AAMod.Lang.BossChat("AkumaAAshe1"), new Color(102, 20, 48), true);
                }
                return;
            }
            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                AAModEXAI.Chat(AAMod.Lang.BossChat("AkumaAAshe2"), new Color(102, 20, 48), true);
            }
        }
Beispiel #5
0
        public override void NPCLoot()
        {
            npc.value = 0f;
            npc.boss  = false;
            int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <HarukaVanish>(), 0, 0f, 0f, 0f, 0f, 255);

            Main.npc[num].velocity = npc.velocity;
            if (!NPC.AnyNPCs(ModContent.NPCType <YamataAHead>()))
            {
                if (Main.netMode != NetmodeID.MultiplayerClient)
                {
                    AAModEXAI.Chat(AAMod.Lang.BossChat("HarukaY1"), new Color(72, 78, 117), true);
                }
                return;
            }
            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                AAModEXAI.Chat(AAMod.Lang.BossChat("HarukaY2"), new Color(72, 78, 117), true);
            }
        }
Beispiel #6
0
 public override void AI()
 {
     AAWorld.downedZero = true;
     if (++projectile.frameCounter >= 10)
     {
         projectile.frameCounter = 0;
         if (++projectile.frame >= 30)
         {
             projectile.Kill();
         }
     }
     projectile.velocity.X *= 0.00f;
     projectile.velocity.Y += 0.00f;
     if (projectile.timeLeft == 913)
     {
         if (Main.netMode != NetmodeID.MultiplayerClient)
         {
             AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroDeath4"), Color.Red.R, Color.Red.G, Color.Red.B);
         }
     }
 }
Beispiel #7
0
 public override void AI()
 {
     if (Main.expertMode && !AAWorld.downedZero && !linesaid)
     {
         if (Main.netMode != NetmodeID.MultiplayerClient)
         {
             AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroDeath1"), Color.Red.R, Color.Red.G, Color.Red.B);
             linesaid = true;
         }
     }
     if (++projectile.frameCounter >= 6)
     {
         projectile.frameCounter = 0;
         if (++projectile.frame >= 7)
         {
             projectile.Kill();
         }
     }
     projectile.velocity.X *= 0.00f;
     projectile.velocity.Y += 0.00f;
 }
 public override void HitEffect(int hitDirection, double damage)
 {
     if (Counter[0] > 3000 && npc.ai[0] != 4 && npc.ai[0] != 2 && !isCharging)
     {
         if (Main.netMode != NetmodeID.MultiplayerClient)
         {
             Teleport(Main.rand.Next(2) == 0? 1:2);
             npc.ai[0]     = 4;
             npc.ai[1]     = 0;
             npc.ai[2]     = 0;
             npc.ai[3]     = 0;
             Counter[0]    = 0;
             Counterattack = true;
             npc.netUpdate = true;
         }
     }
     else if (npc.ai[0] != 4 && npc.ai[0] != 2 && !isCharging)
     {
         int TeleportChance = 1000 * (npc.life / npc.lifeMax);
         if (TeleportChance < 10)
         {
             TeleportChance = 10;
         }
         if (Main.rand.Next(TeleportChance) == 0)
         {
             Teleport(0);
         }
     }
     if (npc.life <= 0 && !Main.expertMode)
     {
         if (Main.netMode != NetmodeID.MultiplayerClient)
         {
             AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened4"), Color.Red.R, Color.Red.G, Color.Red.B);
         }
     }
 }
        public override void AI()
        {
            if ((NPC.CountNPCS(mod.NPCType("ZeroEcho")) > 0) || isCharging || npc.ai[0] == 2 || npc.ai[0] == 4)
            {
                npc.chaseable = false;
                npc.defense   = 9999;
            }
            else
            {
                npc.chaseable = true;
                npc.defense   = npc.defDefense;
            }

            int Repeats;

            if (npc.life < npc.life * (2 / 3))
            {
                Counter[0]++;
                Counter[1]++;
                Repeats = 4;
            }
            else if (npc.life < npc.life / 3)
            {
                Counter[0]++;
                Counter[1]++;
                Repeats = 5;
            }
            else
            {
                Counter[0] += 2;
                Counter[1] += 2;
                Repeats     = 3;
            }
            npc.TargetClosest(true);
            Player player = Main.player[npc.target];

            if (!AliveCheck(player))
            {
                return;
            }

            if (Counter[0] >= 4000)
            {
                Counter[0] = 4000;
            }

            if (Counter[1] >= 6000)
            {
                Counter[1] = 0;
                isCharging = true;
                npc.ai[0]  = 5;
                npc.ai[1]  = 0;
                npc.ai[2]  = 0;
                npc.ai[3]  = 0;
            }

            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                AAWorld.zeroUS = false;
            }

            for (int m = npc.oldPos.Length - 1; m > 0; m--)
            {
                npc.oldPos[m] = npc.oldPos[m - 1];
            }
            npc.oldPos[0] = npc.position;

            int Changerate = npc.life < npc.lifeMax / 2 ? 150 : 120;

            if (npc.ai[2]++ > Changerate && !Counterattack)
            {
                if (npc.ai[0] != 0)
                {
                    npc.velocity *= .0f;
                }
                switch (npc.ai[0])
                {
                case 0:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    float   spread = 45f * 0.0174f;
                    Vector2 dir    = Vector2.Normalize(player.Center - npc.Center);
                    dir *= 12f;
                    float  baseSpeed  = (float)Math.Sqrt((dir.X * dir.X) + (dir.Y * dir.Y));
                    double startAngle = Math.Atan2(dir.X, dir.Y) - .1d;
                    double deltaAngle = spread / 6f;
                    if (npc.ai[2] % 30 == 0)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            if (npc.ai[2] % Main.rand.Next(10) == 0 && Main.rand.Next(2) == 0)
                            {
                                double offsetAngle = startAngle + (deltaAngle * i);
                                Projectile.NewProjectile(npc.Center.X, npc.Center.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), mod.ProjectileType("StaticSphere"), npc.damage / 4, 5, Main.myPlayer);
                            }
                        }
                    }
                    if (npc.ai[2] > 271)
                    {
                        AIChange();
                    }
                    break;

                case 1:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    if (npc.ai[2] % 30 == 0 && npc.ai[2] < 121)
                    {
                        Teleport(3);
                    }

                    if (npc.ai[2] % 60 == 30)
                    {
                        Attack(Main.rand.Next(4));
                    }

                    if (npc.ai[3] < Repeats && npc.ai[2] > 280)
                    {
                        npc.ai[3]++;
                        npc.ai[2] = Changerate;
                    }
                    else
                    {
                        AIChange();
                    }

                    break;

                case 2:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    npc.velocity *= 0;
                    if (npc.ai[2] == 280)
                    {
                        Teleport(3);
                        if (npc.life > npc.lifeMax / 2)
                        {
                            if (Main.netMode != NetmodeID.MultiplayerClient)
                            {
                                if (Main.rand.Next(2) == 0)
                                {
                                    int dirY = player.velocity.Y > 0? 1:-1;

                                    int yPos = Math.Abs(player.velocity.Y) > 4f? -500 * dirY : -750 * dirY;

                                    for (int z = 0; z < 7; z++)
                                    {
                                        int a1 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 0f, 0f);
                                        int a2 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 1f, 0f);
                                        Main.projectile[a1].Center = player.Center + new Vector2(-500, yPos);
                                        Main.projectile[a2].Center = player.Center + new Vector2(500, yPos);
                                        yPos += 250 * dirY;
                                    }
                                }
                                else
                                {
                                    int dirX = player.velocity.X > 0? 1:-1;

                                    int xPos = Math.Abs(player.velocity.X) > 4f? -500 * dirX : -750 * dirX;

                                    for (int z = 0; z < 7; z++)
                                    {
                                        int h1 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 2f, 0f);
                                        int h2 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 3f, 0f);
                                        Main.projectile[h1].Center = player.Center + new Vector2(xPos, -500);
                                        Main.projectile[h2].Center = player.Center + new Vector2(xPos, 500);
                                        xPos += 250 * dirX;
                                    }
                                }
                            }
                        }
                        else
                        {
                            if (Main.netMode != NetmodeID.MultiplayerClient)
                            {
                                int dirX = player.velocity.X > 0? 1:-1;
                                int dirY = player.velocity.Y > 0? 1:-1;

                                int xPos = Math.Abs(player.velocity.X) > 4f? -500 * dirX : -750 * dirX;
                                int yPos = Math.Abs(player.velocity.Y) > 4f? -500 * dirY : -750 * dirY;

                                for (int z = 0; z < 13; z++)
                                {
                                    int a1 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 0f, 0f);
                                    int a2 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 1f, 0f);
                                    Main.projectile[a1].Center = player.Center + new Vector2(-500, yPos);
                                    Main.projectile[a2].Center = player.Center + new Vector2(500, yPos);
                                    yPos += 250 * dirY;
                                }
                                for (int z = 0; z < 13; z++)
                                {
                                    int h1 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 2f, 0f);
                                    int h2 = Projectile.NewProjectile(new Vector2(player.Center.X, player.Center.Y), Vector2.Zero, mod.ProjectileType("Blast"), damage, 3, Main.myPlayer, 3f, 0f);
                                    Main.projectile[h1].Center = player.Center + new Vector2(xPos, -500);
                                    Main.projectile[h2].Center = player.Center + new Vector2(xPos, 500);
                                    xPos += 250 * dirX;
                                }
                            }
                        }
                    }
                    if (npc.ai[2] > 520)
                    {
                        npc.ai[0]++;
                        npc.ai[1]     = 0;
                        npc.ai[2]     = 0;
                        npc.ai[3]     = 0;
                        npc.netUpdate = true;
                    }
                    break;

                case 3:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    if (npc.ai[2] == (npc.life < npc.lifeMax / 2 ? 200 : 300))
                    {
                        Teleport(3);
                        if (Main.netMode != NetmodeID.MultiplayerClient)
                        {
                            int a = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(0f, -12f), mod.ProjectileType("ProtoStar"), damage, 3);
                            Main.projectile[a].Center = npc.Center + new Vector2(-100, 0);
                            int b = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(0f, 12f), mod.ProjectileType("ProtoStar"), damage, 3);
                            Main.projectile[b].Center = npc.Center + new Vector2(100, 0);
                            int c = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(-12f, 0), mod.ProjectileType("ProtoStar"), damage, 3);
                            Main.projectile[c].Center = npc.Center + new Vector2(0, 100);
                            int d = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(12f, 0), mod.ProjectileType("ProtoStar"), damage, 3);
                            Main.projectile[d].Center = npc.Center + new Vector2(0, -100);
                            if (npc.life < npc.lifeMax / 2)
                            {
                                int a1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(0f, 12f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[a1].Center = npc.Center + new Vector2(-100, 0);
                                int b1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(0f, -12f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[b1].Center = npc.Center + new Vector2(100, 0);
                                int c1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(12f, 0), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[c1].Center = npc.Center + new Vector2(0, 100);
                                int d1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(-12f, 0), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[d1].Center = npc.Center + new Vector2(0, -100);
                                int e = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(8f, -8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[e].Center = npc.Center + new Vector2(-80, -80);
                                int e1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(-8f, 8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[e1].Center = npc.Center + new Vector2(-80, -80);
                                int f = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(-8f, 8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[f].Center = npc.Center + new Vector2(80, 80);
                                int f1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(8f, -8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[f1].Center = npc.Center + new Vector2(80, 80);
                                int g = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(-8f, -8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[g].Center = npc.Center + new Vector2(-80, 80);
                                int g1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(8f, 8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[g1].Center = npc.Center + new Vector2(-80, 80);
                                int h = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(8f, 8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[h].Center = npc.Center + new Vector2(80, -80);
                                int h1 = Projectile.NewProjectile(new Vector2(npc.Center.X, npc.Center.Y), new Vector2(-8f, -8f), mod.ProjectileType("ProtoStar"), damage, 3);
                                Main.projectile[h1].Center = npc.Center + new Vector2(80, -80);
                            }
                        }
                    }

                    if (npc.ai[2] > (npc.life < npc.lifeMax / 2 ? 260 : 360))
                    {
                        AIChange();
                    }

                    break;

                case 4:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    if (npc.ai[2] < (npc.life < npc.lifeMax / 2 ? 360 : 270))
                    {
                        if (npc.ai[3]++ > 60)
                        {
                            npc.ai[3] = 0;
                            Teleport(0);
                            NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ZeroEcho"));
                        }
                    }
                    if (npc.ai[2] == (npc.life < npc.lifeMax / 2 ? 400 : 310))
                    {
                        npc.ai[1] = 1f;
                    }
                    else
                    {
                        npc.ai[1] = 0f;
                    }
                    if (npc.ai[2] >= (npc.life < npc.lifeMax / 2 ? 480 : 390))
                    {
                        npc.ai[0] = 1;
                        npc.ai[1] = 0;
                        npc.ai[2] = 0;
                        npc.ai[3] = 0;
                    }
                    break;

                case 5:
                    if (!AliveCheck(player))
                    {
                        break;
                    }

                    Counterattack = false;

                    if (npc.ai[1]++ == 100)
                    {
                        if (Main.netMode != NetmodeID.MultiplayerClient)
                        {
                            AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened11"), Color.Red.R, Color.Red.G, Color.Red.B);
                        }
                        if (ShootDir == new Vector2(0, 0))
                        {
                            ShootDir = npc.DirectionTo(player.Center.RotatedBy(1.57f));
                        }
                        Projectile.NewProjectile(npc.Center + 60f * ShootDir, 10f * ShootDir, mod.ProjectileType("EchoRay"), npc.damage, 3f, Main.myPlayer, -6.2831855f / 450f, npc.whoAmI);
                        npc.ai[3] = 1f;
                    }
                    else if (npc.ai[1] > 100 && npc.ai[1] < 190)
                    {
                        npc.ai[3]     = 0f;
                        npc.rotation -= 6.2831855f / 450f;
                    }
                    else
                    {
                        npc.ai[3] = 0f;
                    }

                    if (npc.ai[1] < 85)
                    {
                        if (npc.ai[2] % (npc.life < npc.lifeMax / 2? 40:60) == 10)
                        {
                            Teleport(3);
                            NPC.NewNPC((int)player.Center.X + 50 * Main.rand.Next(4, 6) * (Main.rand.Next(2) == 0? -1:1), (int)player.Center.Y + 50 * Main.rand.Next(4, 6) * (Main.rand.Next(2) == 0? -1:1), mod.NPCType("ZeroMini"));
                        }
                        npc.rotation = npc.DirectionTo(player.Center.RotatedBy(1.57f)).ToRotation() + (float)Math.PI / 2;
                        if (npc.rotation > 2 * Math.PI)
                        {
                            npc.rotation -= 6.2831855f;
                        }
                        ShootDir = npc.DirectionTo(player.Center.RotatedBy(1.57f));
                    }

                    if (npc.ai[1] >= 190)
                    {
                        isCharging = false;
                        npc.ai[0]  = 1;
                        npc.ai[1]  = 0;
                        npc.ai[2]  = 0;
                        npc.ai[3]  = 0;
                    }
                    break;

                default:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    npc.ai[0] = 0;
                    goto case 0;
                }
            }
            else if (isCharging)
            {
                if (npc.ai[2] == 10)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened8"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened9"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
                if (npc.ai[2] == 40)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroAwakened10"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
                if (npc.ai[2] == 110)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(@"[Y]", Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
                npc.rotation = npc.DirectionTo(player.Center).ToRotation() + (float)Math.PI / 2;
                if (npc.ai[2] % (npc.life < npc.lifeMax / 2? 60:80) == 20)
                {
                    Teleport(3);
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        NPC.NewNPC((int)player.Center.X + 50 * Main.rand.Next(4, 6) * (Main.rand.Next(2) == 0? -1:1), (int)player.Center.Y + 50 * Main.rand.Next(4, 6) * (Main.rand.Next(2) == 0? -1:1), mod.NPCType("ZeroMini"));
                    }
                }
                Counterattack = false;
                npc.ai[1]     = 0f;
                npc.ai[3]     = 0f;
            }
            else if (Counterattack)
            {
                npc.ai[2]++;
                npc.position  = player.Center - new Vector2(0, 600);
                npc.velocity *= 0;

                if (npc.ai[2] == 240 && Main.netMode != NetmodeID.MultiplayerClient)
                {
                    NPC.NewNPC((int)player.Center.X, (int)player.Center.Y + 500, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 500, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X + 500, (int)player.Center.Y, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X - 500, (int)player.Center.Y, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X + 500, (int)player.Center.Y + 500, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X - 500, (int)player.Center.Y - 500, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X + 500, (int)player.Center.Y - 500, mod.NPCType("ZeroEcho"));
                    NPC.NewNPC((int)player.Center.X - 500, (int)player.Center.Y + 500, mod.NPCType("ZeroEcho"));
                }

                if (npc.ai[2] == 420)
                {
                    npc.ai[1] = 1f;
                }
                else
                {
                    npc.ai[1] = 0f;
                }

                if (npc.ai[2] > 520)
                {
                    Counterattack = false;
                    npc.ai[0]     = 2;
                    npc.ai[1]     = 0;
                    npc.ai[2]     = 0;
                    npc.ai[3]     = 0;
                }
            }
            else
            {
                BaseAI.AISkull(npc, ref Move, true, 14, 350, .04f, .05f);

                int Frequency = Main.rand.Next(30, 50);
                if (npc.life < npc.lifeMax / 2)
                {
                    Frequency = Main.rand.Next(20, 50);
                }
                if (npc.life < npc.lifeMax / 4)
                {
                    Frequency = Main.rand.Next(10, 40);
                }
                if (Main.rand.Next(2) == 0)
                {
                    BaseAI.ShootPeriodic(npc, player.position, player.width, player.height, mod.ProjectileType("GlitchBomb"), ref npc.ai[3], Frequency, npc.damage / 3, 10, true);
                }
                else
                {
                    BaseAI.ShootPeriodic(npc, player.position, player.width, player.height, mod.ProjectileType("GlitchRocket"), ref npc.ai[3], Frequency, npc.damage / 3, 10, true);
                }
            }

            if ((npc.Center - player.Center).Length() > 2000 && !isCharging && !Counterattack)
            {
                Teleport(0);
            }

            if (npc.ai[0] != 5)
            {
                npc.direction = npc.spriteDirection = 1;
                npc.rotation  = 0;
            }
        }
Beispiel #10
0
        public override void NPCLoot()
        {
            if (Main.expertMode)
            {
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType("ApocalyptitePlate"), 2, 4);

                if (Main.netMode != NetmodeID.MultiplayerClient)
                {
                    AAModEXAI.Chat(AAMod.Lang.BossChat("ZeroBoss1"), Color.Red.R, Color.Red.G, Color.Red.B);
                }
                if (AAWorld.downedZero)
                {
                    int z = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("ZeroProtocol"), 0, 0, 0, 0, 0, npc.target);
                    Main.npc[z].Center = npc.Center;

                    int b = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModLoader.GetMod("AAMod").ProjectileType("ShockwaveBoom"), 0, 1, Main.myPlayer, 0, 0);
                    Main.projectile[b].Center = npc.Center;

                    for (int proj = 0; proj < 1000; proj++)
                    {
                        if (Main.projectile[proj].active && Main.projectile[proj].friendly && !Main.projectile[proj].hostile)
                        {
                            Main.projectile[proj].hostile  = true;
                            Main.projectile[proj].friendly = false;
                            Vector2 vector = Main.projectile[proj].Center - npc.Center;
                            vector.Normalize();
                            Vector2 reflectvelocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101));
                            reflectvelocity.Normalize();
                            reflectvelocity *= vector.Length();
                            reflectvelocity += vector * 20f;
                            reflectvelocity.Normalize();
                            reflectvelocity *= vector.Length();
                            if (reflectvelocity.Length() < 20f)
                            {
                                reflectvelocity.Normalize();
                                reflectvelocity *= 20f;
                            }

                            Main.projectile[proj].penetrate = 1;

                            Main.projectile[proj].GetGlobalProjectile <AAModEXAIGlobalProjectile>().reflectvelocity = reflectvelocity;
                            Main.projectile[proj].GetGlobalProjectile <AAModEXAIGlobalProjectile>().isReflecting    = true;
                            Main.projectile[proj].GetGlobalProjectile <AAModEXAIGlobalProjectile>().ReflectConter   = 180;
                        }
                    }
                }
                else
                {
                    int z = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, ModLoader.GetMod("AAMod").NPCType("ZeroTransition"), 0, 0, 0, 0, 0, npc.target);
                    Main.npc[z].Center = npc.Center;
                }

                npc.netUpdate = true;
            }
            else
            {
                if (!AAWorld.downedZero)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        BaseUtility.Chat(AAMod.Lang.BossChat("ZeroBoss3"), Color.PaleVioletRed);
                    }
                }
                AAWorld.downedZero = true;
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType("ApocalyptitePlate"), 2, 4);
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType("UnstableSingularity"), 25, 35);
                string[] lootTable =
                {
                    "Battery",
                    "ZeroArrow",
                    "Vortex",
                    "EventHorizon",
                    "RealityCannon",
                    "RiftShredder",
                    "VoidStar",
                    "TeslaHand",
                    "ZeroStar",
                    "Neutralizer",
                    "ZeroTerratool",
                    "DoomPortal",
                    "Gigataser",
                    "OmegaVolley",
                    "GenocideCannon"
                };
                int loot = Main.rand.Next(lootTable.Length);
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType(lootTable[loot]));
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType("ZeroCore"), 1f / 10f);
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType("ZeroMask"), 1f / 7f);
                npc.DropLoot(ModLoader.GetMod("AAMod").ItemType("ZeroTrophy"), 1f / 10f);
                if (Main.rand.Next(50) == 0 && AAWorld.downedAllAncients)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModLoader.GetMod("AAMod").ItemType("RealityStone"));
                }
            }
        }
        public void Attacks(float AttackType)
        {
            Player player = Main.player[npc.target];

            bool sayQuote = Main.rand.Next(3) == 0;

            if (AttackType == 0f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    laughTimer = 120;
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat((!Quote1) ? AAMod.Lang.BossChat("YamataHead1") : AAMod.Lang.BossChat("YamataHead2"), new Color(45, 46, 70));
                    }
                    QuoteSaid = true;
                    Quote1    = true;
                }
                BaseAI.ShootPeriodic(npc, new Vector2(player.position.X, player.position.Y - 1), player.width, player.height, mod.ProjectileType("YamataVenom"), ref internalAI[3], 6, projDamage, 9f, true, new Vector2(20f, 15f));
            }
            if (AttackType == 1f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    laughTimer = 120;
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat((!Quote3) ? AAMod.Lang.BossChat("YamataHead3") : AAMod.Lang.BossChat("YamataHead4"), new Color(45, 46, 70));
                    }
                    QuoteSaid = true;
                    Quote3    = true;
                }
                BaseAI.ShootPeriodic(npc, new Vector2(player.position.X, -4f), player.width, player.height, mod.ProjectileType("YamataStorm"), ref internalAI[3], 40, projDamage, 10f, true, new Vector2(20f, 15f));
            }
            if (AttackType == 2f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    laughTimer = 120;
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat((!Quote3) ? AAMod.Lang.BossChat("YamataHead5") : AAMod.Lang.BossChat("YamataHead6"), new Color(45, 46, 70));
                    }
                    QuoteSaid = true;
                    Quote3    = true;
                }
                BaseAI.ShootPeriodic(npc, new Vector2(player.position.X, player.position.Y - 1), player.width, player.height, mod.ProjectileType("YamataBlast"), ref internalAI[3], 15, projDamage, 10f, true, new Vector2(20f, 15f));
            }
            if (AttackType == 3f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    laughTimer = 120;
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat((!Quote4) ? (AAMod.Lang.BossChat("YamataHead7") + (player.Male ? AAMod.Lang.BossChat("male2") : AAMod.Lang.BossChat("fimale2")) + AAMod.Lang.BossChat("YamataHead8")) : AAMod.Lang.BossChat("YamataHead9"), new Color(45, 46, 70));
                    }
                    QuoteSaid = true;
                    Quote4    = true;
                }
                EATTHELITTLEMAGGOT = true;
            }
        }
Beispiel #12
0
        public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
        {
            damage = 0;

            if (!AAWorld.downedYamata)
            {
                if (npc.life <= (npc.lifeMax / 4 * 3) && threeQuarterHealth == false)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("Yamata10"), new Color(45, 46, 70));
                    }
                    threeQuarterHealth = true;
                }
                if (npc.life <= npc.lifeMax / 2 && HalfHealth == false)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("Yamata11"), new Color(45, 46, 70));
                    }
                    HalfHealth = true;
                }
                if (npc.life <= npc.lifeMax / 4 && quarterHealth == false)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("Yamata12"), new Color(45, 46, 70));
                    }
                    quarterHealth = true;
                }
            }
            if (AAWorld.downedYamata)
            {
                if (npc.life <= (npc.lifeMax / 4 * 3) && threeQuarterHealth == false)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("Yamata13"), new Color(45, 46, 70));
                    }
                    threeQuarterHealth = true;
                }
                if (npc.life <= npc.lifeMax / 2 && HalfHealth == false)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("Yamata14"), new Color(45, 46, 70));
                    }
                    HalfHealth = true;
                }
                if (npc.life <= npc.lifeMax / 4 && quarterHealth == false)
                {
                    if (Main.netMode != NetmodeID.MultiplayerClient)
                    {
                        AAModEXAI.Chat(AAMod.Lang.BossChat("Yamata15"), new Color(45, 46, 70));
                    }
                    quarterHealth = true;
                }
            }

            return(true);
        }