Exemplo n.º 1
0
        public void Attacks(float AttackType)
        {
            Player player = Main.player[npc.target];

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

            if (AttackType == 0f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat((!Quote1) ? Lang.BossChat("YamataHead1") : 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, ModContent.ProjectileType <YamataVenom>(), ref internalAI[3], 6, projDamage, 9f, true, new Vector2(20f, 15f));
            }
            if (AttackType == 1f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat((!Quote3) ? Lang.BossChat("YamataHead3") : 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, ModContent.ProjectileType <YamataStorm>(), ref internalAI[3], 40, projDamage, 10f, true, new Vector2(20f, 15f));
            }
            if (AttackType == 2f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat((!Quote3) ? Lang.BossChat("YamataHead5") : 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, ModContent.ProjectileType <YamataBlast>(), ref internalAI[3], 15, projDamage, 10f, true, new Vector2(20f, 15f));
            }
            if (AttackType == 3f)
            {
                if (!QuoteSaid && sayQuote)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat((!Quote4) ? (Lang.BossChat("YamataHead7") + (player.Male ? Lang.BossChat("male2") : Lang.BossChat("fimale2")) + Lang.BossChat("YamataHead8")) : Lang.BossChat("YamataHead9"), new Color(45, 46, 70));
                    }
                    QuoteSaid = true;
                    Quote4    = true;
                }
                EATTHELITTLEMAGGOT = true;
            }
        }
Exemplo n.º 2
0
        public override void Kill(int timeLeft)
        {
            if (!AAWorld.downedZero && Main.expertMode)
            {
                if (Main.netMode != 1)
                {
                    AAMod.Chat(Lang.BossChat("ZeroDeath3"), Color.Red.R, Color.Red.G, Color.Red.B);
                }
            }
            int p = Projectile.NewProjectile(new Vector2(projectile.Center.X, projectile.Center.Y), new Vector2(0f, 0f), mod.ProjectileType("ZeroDeath2"), 0, 0);

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

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

            if (npc.life <= 0 && npc.type == ModContent.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 != 1)
                    {
                        AAMod.Chat(Lang.BossChat("ZeroBoss2"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
            }
        }
Exemplo n.º 4
0
        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 != 1)
                            {
                                AAMod.Chat(Lang.BossChat("ZeroAwakened6"), Color.Red.R, Color.Red.G, Color.Red.B);
                            }
                        }
                        else if (tooFar)
                        {
                            if (Main.netMode != 1)
                            {
                                AAMod.Chat(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 != 1)
                    {
                        BaseAI.KillNPC(npc); npc.netUpdate2 = true;
                    }
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 5
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 != 1) AAMod.Chat(Lang.BossChat("Yamata10"), new Color(45, 46, 70));
                    threeQuarterHealth = true;
                }
                if (npc.life <= npc.lifeMax / 2 && HalfHealth == false)
                {
                    if (Main.netMode != 1) AAMod.Chat(Lang.BossChat("Yamata11"), new Color(45, 46, 70));
                    HalfHealth = true;
                }
                if (npc.life <= npc.lifeMax / 4 && quarterHealth == false)
                {
                    if (Main.netMode != 1) AAMod.Chat(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 != 1) AAMod.Chat(Lang.BossChat("Yamata13"), new Color(45, 46, 70));
                    threeQuarterHealth = true;
                }
                if (npc.life <= npc.lifeMax / 2 && HalfHealth == false)
                {
                    if (Main.netMode != 1) AAMod.Chat(Lang.BossChat("Yamata14"), new Color(45, 46, 70));
                    HalfHealth = true;
                }
                if (npc.life <= npc.lifeMax / 4 && quarterHealth == false)
                {
                    if (Main.netMode != 1) AAMod.Chat(Lang.BossChat("Yamata15"), new Color(45, 46, 70));
                    quarterHealth = true;
                }
            }
            
            return true;
        }
Exemplo n.º 6
0
 public override void AI()
 {
     if (Main.expertMode && !AAWorld.downedZero && !linesaid)
     {
         if (Main.netMode != 1)
         {
             AAMod.Chat(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;
 }
Exemplo n.º 7
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 != 1)
         {
             AAMod.Chat(Lang.BossChat("ZeroDeath4"), Color.Red.R, Color.Red.G, Color.Red.B);
         }
     }
 }
Exemplo n.º 8
0
 public override void HitEffect(int hitDirection, double damage)
 {
     if (Counter[0] > 3000 && npc.ai[0] != 4 && npc.ai[0] != 2 && !isCharging)
     {
         if (Main.netMode != 1)
         {
             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 != 1)
         {
             AAMod.Chat(Lang.BossChat("ZeroAwakened4"), Color.Red.R, Color.Red.G, Color.Red.B);
         }
     }
 }
Exemplo n.º 9
0
        public override void AI()
        {
            if ((npc.ai[0] == 4 && NPC.CountNPCS(mod.NPCType("ZeroEcho")) > 0 && !Counterattack) || isCharging)
            {
                npc.dontTakeDamage = true;
            }
            else
            {
                npc.dontTakeDamage = false;
            }

            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 != 1)
            {
                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), ModContent.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] == 160)
                    {
                        if (npc.life > npc.lifeMax / 2)
                        {
                            if (Main.rand.Next(2) == 0)
                            {
                                int dirY = player.velocity.Y > 0? 1:-1;

                                int yPos = Math.Abs(player.velocity.Y) > 4f? -300 * dirY : -900 * 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(-300, yPos);
                                    Main.projectile[a2].Center = player.Center + new Vector2(300, yPos);
                                    yPos += 150 * dirY;
                                }
                            }
                            else
                            {
                                int dirX = player.velocity.X > 0? 1:-1;

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

                                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, -300);
                                    Main.projectile[h2].Center = player.Center + new Vector2(xPos, 300);
                                    xPos += 150 * dirX;
                                }
                            }
                        }
                        else
                        {
                            int dirX = player.velocity.X > 0? 1:-1;
                            int dirY = player.velocity.Y > 0? 1:-1;

                            int xPos = Math.Abs(player.velocity.X) > 4f? -300 * dirX : -900 * dirX;
                            int yPos = Math.Abs(player.velocity.Y) > 4f? -300 * dirY : -900 * 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(-300, yPos);
                                Main.projectile[a2].Center = player.Center + new Vector2(300, yPos);
                                yPos += 150 * 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, -300);
                                Main.projectile[h2].Center = player.Center + new Vector2(xPos, 300);
                                xPos += 150 * dirX;
                            }
                        }
                    }
                    if (npc.ai[2] > 400)
                    {
                        npc.ai[0]++;
                        npc.ai[1] = 0;
                        npc.ai[2] = 0;
                        npc.ai[3] = 0;
                    }
                    break;

                case 3:
                    if (!AliveCheck(player))
                    {
                        break;
                    }
                    if (npc.ai[2] == (npc.life < npc.lifeMax / 2 ? 200 : 300))
                    {
                        Teleport(3);
                        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]++ > 30)
                        {
                            npc.ai[3] = 0;
                            Teleport(0);
                            NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.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 != 1)
                        {
                            AAMod.Chat(Lang.BossChat("ZeroAwakened11"), Color.Red.R, Color.Red.G, Color.Red.B);
                        }
                        if (ShootDir == new Vector2(0, 0))
                        {
                            ShootDir = npc.DirectionTo(player.Center);
                        }
                        Projectile.NewProjectile(npc.position, 10f * ShootDir, ModContent.ProjectileType <EchoRay>(), 100, 3f, Main.myPlayer, 0, npc.whoAmI);
                        npc.ai[3] = 1f;
                    }
                    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), ModContent.NPCType <ZeroMini>());
                        }
                        npc.rotation = npc.DirectionTo(player.Center).ToRotation() + (float)Math.PI / 2;
                        ShootDir     = npc.DirectionTo(player.Center);
                    }

                    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 != 1)
                    {
                        AAMod.Chat(Lang.BossChat("ZeroAwakened8"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat(Lang.BossChat("ZeroAwakened9"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
                if (npc.ai[2] == 40)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat(Lang.BossChat("ZeroAwakened10"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
                if (npc.ai[2] == 110)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.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? 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), ModContent.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] == 120)
                {
                    NPC.NewNPC((int)player.Center.X, (int)player.Center.Y + 300, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 300, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X + 300, (int)player.Center.Y, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X + 300, (int)player.Center.Y + 300, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y - 300, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X + 300, (int)player.Center.Y - 300, ModContent.NPCType <ZeroEcho>());
                    NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y + 300, ModContent.NPCType <ZeroEcho>());
                }

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

                if (npc.ai[2] > 400)
                {
                    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, ModContent.ProjectileType <GlitchBomb>(), ref npc.ai[3], Frequency, npc.damage / 3, 10, true);
                }
                else
                {
                    BaseAI.ShootPeriodic(npc, player.position, player.width, player.height, ModContent.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;
            }
        }
Exemplo n.º 10
0
        public override void HitEffect(int hitDirection, double damage)
        {
            if (npc.life <= (int)(npc.lifeMax * .66f) && !RespawnArms1 && Main.netMode != 1)
            {
                WeaponCount += 1;
                npc.ai[1]    = 0;
                RespawnArms1 = true;

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

            if (npc.life <= 0 && npc.type == ModContent.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 && Main.netMode != 1)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat(Lang.BossChat("ZeroBoss1"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                    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, mod.ProjectileType("ShockwaveBoom"), 0, 1, Main.myPlayer, 0, 0);
                    Main.projectile[b].Center = npc.Center;

                    npc.netUpdate = true;
                }
                if (!Main.expertMode)
                {
                    if (Main.netMode != 1)
                    {
                        AAMod.Chat(Lang.BossChat("ZeroBoss2"), Color.Red.R, Color.Red.G, Color.Red.B);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public override void NPCLoot()
        {
            if (Main.expertMode)
            {
                npc.DropLoot(mod.ItemType("ApocalyptitePlate"), 2, 4);

                if (Main.netMode != 1)
                {
                    AAMod.Chat(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, mod.ProjectileType("ShockwaveBoom"), 0, 1, Main.myPlayer, 0, 0);
                    Main.projectile[b].Center = npc.Center;
                }
                else
                {
                    int z = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.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 != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("ZeroBoss3"), Color.PaleVioletRed);
                    }
                }
                AAWorld.downedZero = true;
                npc.DropLoot(mod.ItemType("ApocalyptitePlate"), 2, 4);
                npc.DropLoot(mod.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(mod.ItemType(lootTable[loot]));
                npc.DropLoot(ModContent.ItemType <Items.Pets.ZeroCore>(), 1f / 10f);
                npc.DropLoot(ModContent.ItemType <Items.Vanity.Mask.ZeroMask>(), 1f / 7f);
                npc.DropLoot(ModContent.ItemType <Items.Boss.Zero.ZeroTrophy>(), 1f / 10f);
            }
        }