Пример #1
0
        public override void NPCLoot()
        {
            if (Main.expertMode)
            {
                if (!AAWorld.downedZero)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("ZeroAwakened1"), Color.PaleVioletRed);
                    }
                    Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("ZeroRune"));
                }
                AAWorld.downedZero = true;

                if (Main.rand.Next(10) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZeroTrophy"));
                }
                if (Main.rand.Next(7) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZeroMask"));
                }
                if (Main.rand.Next(50) == 0 && AAWorld.downedAllAncients)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EXSoul"));
                }
                npc.DropBossBags();
                return;
            }
        }
Пример #2
0
        public override void NPCLoot()
        {
            int Ashe = NPC.CountNPCS(mod.NPCType("Ashe"));

            if (Ashe == 0)
            {
                NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AHDeath>());
                if (Main.expertMode)
                {
                    npc.DropBossBags();
                }
            }
            if (!Main.expertMode)
            {
                string[] lootTableH = { "HarukaKunai", "Masamune", "MizuArashi", "HarukaBox" };
                int      lootH      = Main.rand.Next(lootTableH.Length);
                npc.DropLoot(mod.ItemType(lootTableH[lootH]));
            }
            if (Main.rand.Next(10) == 0)
            {
                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HarukaTrophy"));
            }
            NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <HarukaVanish>());
            if (Main.netMode != 1)
            {
                BaseUtility.Chat(Lang.BossChat("HarukaDowned"), new Color(72, 78, 117));
            }
            npc.value = 0f;
            npc.boss  = false;
        }
Пример #3
0
 public override void HitEffect(int hitDirection, double damage)
 {
     if (npc.life <= 0)
     {
         CombatText.NewText(npc.getRect(), new Color(45, 46, 70), Lang.BossChat("YamataHead"), true, true);
     }
 }
Пример #4
0
 public override void BossLoot(ref string name, ref int potionType)
 {
     if (Main.expertMode)
     {
         potionType = ItemID.SuperHealingPotion;
     }
     else
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA5"), new Color(146, 30, 68));
         }
     }
     if (!AAWorld.downedYamata)
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA2"), new Color(146, 30, 68));
         }
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA3"), Color.Indigo);
         }
     }
     else
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("YamataA4"), new Color(146, 30, 68));
         }
     }
 }
Пример #5
0
        public override void NPCLoot()
        {
            int Haruka = NPC.CountNPCS(mod.NPCType("Haruka"));

            if (Haruka == 0)
            {
                NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AHDeath>());
                if (Main.expertMode)
                {
                    npc.DropBossBags();
                }
            }
            if (!Main.expertMode)
            {
                string[] lootTableA = { "AshRain", "FuryFlame", "FireSpiritStaff", "AsheSatchel" };
                int      lootA      = Main.rand.Next(lootTableA.Length);
                npc.DropLoot(mod.ItemType(lootTableA[lootA]));
            }
            if (Main.rand.Next(10) == 0)
            {
                Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("AsheTrophy"));
            }
            int DeathAnim = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <AsheVanish>(), 0);

            Main.npc[DeathAnim].velocity = npc.velocity;
            if (Main.netMode != 1)
            {
                BaseUtility.Chat(Lang.BossChat("AsheDowned"), new Color(102, 20, 48));
            }
            npc.value = 0f;
            npc.boss  = false;
        }
Пример #6
0
        public override void NPCLoot()
        {
            Dead = true;
            if (!Tag)
            {
                npc.DropLoot(Items.Vanity.Mask.YamataMask.type, 1f / 7f);
                if (!Main.expertMode)
                {
                    AAWorld.downedYamata = true;
                    npc.DropLoot(mod.ItemType("DreadScale"), 20, 30);
                    string[] lootTable = { "Flairdra", "Crescent", "Hydraslayer", "AbyssArrow", "HydraStabber", "MidnightWrath", "YamataTerratool" };
                    int loot = Main.rand.Next(lootTable.Length);
                    npc.DropLoot(mod.ItemType(lootTable[loot]));
                    npc.DropLoot(Items.Boss.Yamata.YamataTrophy.type, 1f / 10);
                    if (Main.netMode != 1) BaseUtility.Chat(Lang.BossChat("Yamata1"), new Color(45, 46, 70));
                    npc.DropLoot(Items.Vanity.Mask.YamataMask.type, 1f / 7);
                    if (!AAWorld.downedYamata)
                    {
                        if (Main.netMode != 1) BaseUtility.Chat(Lang.BossChat("Yamata2"), Color.Indigo);
                    }
                }
                if (Main.expertMode)
                {
                    int npcID = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("YamataTransition"), 0, 0, 0, 0, 0, npc.target);
                    Main.npc[npcID].Center = npc.Center;
                    Main.npc[npcID].netUpdate2 = true; Main.npc[npcID].netUpdate = true;
                }
                npc.value = 0f;
                npc.boss = false;
            }

        }
Пример #7
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;
            }
        }
Пример #8
0
 public override void HitEffect(int hitDirection, double damage)
 {
     if (npc.life <= 0)
     {
         CombatText.NewText(npc.getRect(), new Color(146, 30, 68), Lang.BossChat("YamataAHead"), false, false);
         NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, ModContent.NPCType <YamataSoul>());
     }
 }
Пример #9
0
 public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
 {
     knockback = 0;
     damage    = 0;
     crit      = false;
     if (npc.ai[0] != 1)
     {
         npc.ai[0] = 1;
         CombatText.NewText(npc.Hitbox, new Color(72, 78, 117), Lang.BossChat("HarukaShadow"));
     }
     return(false);
 }
Пример #10
0
        public override void NPCLoot()
        {
            AAWorld.downedAthena = true;

            if (NPC.downedMoonlord)
            {
                if (!AAWorld.downedAthenaA)
                {
                    int a = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, ModContent.NPCType <AthenaDefeat>());
                    Main.npc[a].Center = npc.Center;
                }
                else
                {
                    int a = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, ModContent.NPCType <Olympian.AthenaA>());
                    Main.npc[a].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;
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("Athena10"), Color.Cyan);
                    }

                    Main.projectile[b].netUpdate = true;
                }
                return;
            }

            if (Main.expertMode)
            {
                npc.DropBossBags();
            }
            else
            {
                if (Main.rand.Next(7) == 0)
                {
                    npc.DropLoot(mod.ItemType("AthenaMask"));
                }
                npc.DropLoot(mod.ItemType("GoddessFeather"), Main.rand.Next(20, 25));
                string[] lootTable = { "DivineWindCharm", "GaleOfWings", "RazorwindLongbow", "SkycutterKopis", "OlympianWings" };
                int      loot      = Main.rand.Next(lootTable.Length);
                npc.DropLoot(mod.ItemType(lootTable[loot]));
            }


            if (Main.netMode != 1)
            {
                BaseUtility.Chat(Lang.BossChat("Athena11"), Color.CornflowerBlue);
            }
            int p = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, ModContent.NPCType <AthenaFlee>());

            Main.npc[p].Center = npc.Center;
        }
Пример #11
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;
        }
Пример #12
0
        public override void AI()
        {
            npc.TargetClosest();
            Player player = Main.player[npc.target];

            if (npc.velocity.Y == 0 || npc.velocity.Y < 0)
            {
                frameCounter--;
                if (frameCounter <= 0)
                {
                    frameCounter = npc.velocity.Y < 0 ? 3 : 10;
                    npc.frame.Y  = npc.frame.Y == 0 ? npc.frame.Height : 0;
                }
            }
            else
            {
                if (npc.velocity.Y > 0)
                {
                    npc.frame.Y = npc.frame.Height * 2;
                }
            }
            if (npc.velocity.X != 0)
            {
                if (npc.collideX)
                {
                    npc.velocity.X *= -2f;
                }
                if (npc.velocity.X > 0)
                {
                    npc.spriteDirection = 1;
                }
                else
                {
                    npc.spriteDirection = -1;
                }
            }
            float jumpWidth  = 3f;
            float jumpHeight = -1f;

            if (npc.whoAmI % 30 == 0)            //THE LEGENDARY SUPER FAT PIXIE
            {
                jumpWidth  = 8f;
                jumpHeight = -25f;
                if (npc.ai[0] >= 0)
                {
                    CombatText.NewText(npc.Hitbox, Color.LightGoldenrodYellow, Lang.BossChat("FatPixie"));
                }
            }
            BaseAI.AISlime(npc, ref npc.ai, false, 150, 4f, 2f, jumpWidth, jumpHeight);
            BaseDrawing.AddLight(npc.Center, new Color(212, 208, 107), 2f);
        }
Пример #13
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);
                    }
                }
            }
        }
Пример #14
0
 public override void NPCLoot()
 {
     if (Main.expertMode)
     {
         npc.DropLoot(mod.ItemType("ApocalyptitePlate"), 2, 4);
     }
     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.Vanity.Mask.ZeroMask>(), 1f / 7);
         npc.DropLoot(ModContent.ItemType <Items.Boss.Zero.ZeroTrophy>(), 1f / 10);
         if (Main.rand.Next(50) == 0 && AAWorld.downedAllAncients)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RealityStone"));
         }
     }
 }
Пример #15
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);
        }
Пример #16
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;
        }
Пример #17
0
 public void Laugh()
 {
     if (laughTimer > 0 && !Laughing)
     {
         CombatText.NewText(npc.getRect(), new Color(146, 30, 68), Lang.BossChat("YamataAHeadLaugh1"), true, true);
         Laughing = true;
     }
     else if (laughTimer <= 0)
     {
         Laughing = false;
     }
     if (Laughing)
     {
         laughTimer--;
         if (laughTimer % 20 == 0 && laughTimer != 120)
         {
             CombatText.NewText(npc.getRect(), new Color(146, 30, 68), Lang.BossChat("YamataAHeadLaugh2"), true, true);
         }
     }
 }
Пример #18
0
 public override void NPCLoot()
 {
     if (DontSayDeathLine)
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("WrathHaruka1"), new Color(72, 78, 117));
         }
     }
     else
     {
         if (Main.netMode != 1)
         {
             BaseUtility.Chat(Lang.BossChat("WrathHaruka2"), new Color(72, 78, 117));
         }
     }
     NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <WrathHarukaVanish>());
     npc.value = 0f;
     npc.boss  = false;
 }
Пример #19
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);
         }
     }
 }
Пример #20
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;
 }
Пример #21
0
        public override void NPCLoot()
        {
            if (DontSayDeathLine)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("FuryAshe1") + Main.LocalPlayer.name + "!", new Color(102, 20, 48));
                }
            }
            else
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("FuryAshe2"), new Color(102, 20, 48));
                }
            }
            int DeathAnim = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType <FuryAsheVanish>(), 0);

            Main.npc[DeathAnim].velocity = npc.velocity;
            npc.value = 0f;
            npc.boss  = false;
        }
Пример #22
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);
         }
     }
 }
Пример #23
0
        public override bool PreAI()
        {
            npc.TargetClosest();
            Player player = Main.player[npc.target];

            if (player.Center.X > npc.Center.X)
            {
                pos = 250;

                npc.direction = 1;
            }
            else
            {
                pos = -250;

                npc.direction = -1;
            }

            Vector2 wantedVelocity = player.Center - new Vector2(pos, 200);

            MoveToPoint(wantedVelocity);

            if (Main.netMode != 2)
            {
                npc.frameCounter++;
                if (npc.frameCounter >= 6)
                {
                    npc.frameCounter = 0;
                    npc.frame.Y     += Main.npcTexture[npc.type].Height / 4;
                }
                if (npc.frame.Y > Main.npcTexture[npc.type].Height / 4 * 3)
                {
                    npc.frame.Y = 0;
                }
            }
            if (Main.netMode != 1)
            {
                if (Vector2.Distance(player.Center, npc.Center) > 2200)
                {
                    npc.position = new Vector2(pos, 200);
                    for (int i = 0; i < 5; i++)
                    {
                        Dust d = Main.dust[Dust.NewDust(npc.position, npc.height, npc.width, ModContent.DustType <Feather>(), Main.rand.Next(-1, 2), 1, 0)];
                        d.position = npc.Center;
                    }
                }
                npc.ai[0]++;
                npc.alpha -= 15;

                if (npc.ai[0] == 1)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("SeraphHerald1"), Color.CadetBlue);
                    }
                    npc.netUpdate = true;
                }
                else
                if (npc.ai[0] == 120)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("SeraphHerald2"), Color.CadetBlue);
                    }
                }
                else
                if (npc.ai[0] == 240)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("SeraphHerald3"), Color.CadetBlue);
                    }
                }
                else
                if (npc.ai[0] == 360)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("SeraphHerald4"), Color.CadetBlue);
                    }
                }
                if (!AAWorld.downedGreed)
                {
                    if (npc.ai[0] >= 480)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("SeraphHerald5"), Color.CadetBlue);
                        }

                        for (int i = 0; i < 5; i++)
                        {
                            Dust.NewDust(npc.position, npc.height, npc.width, ModContent.DustType <Feather>(), Main.rand.Next(-1, 2), 1, 0);
                        }

                        npc.active    = false;
                        npc.netUpdate = true;
                    }
                }
                else
                {
                    if (npc.ai[0] == 480)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("SeraphHerald6"), Color.CadetBlue);
                        }
                    }

                    if (npc.ai[0] >= 600)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("SeraphHerald5"), Color.CadetBlue);
                        }

                        for (int i = 0; i < 5; i++)
                        {
                            Dust.NewDust(npc.position, npc.height, npc.width, ModContent.DustType <Feather>(), Main.rand.Next(-1, 2), 1, 0);
                        }

                        npc.active    = false;
                        npc.netUpdate = true;
                    }
                }
            }
            return(false);
        }
Пример #24
0
        public override void AI()
        {
            if (npc.velocity.Y == 0 && Main.netMode != 1)
            {
                npc.ai[0]++;
            }

            if (npc.ai[0] == 120)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat1"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 240)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat2"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 360)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat3"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 480)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat4"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] >= 600)
            {
                npc.ai[1]     = 1;
                music         = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/ThinkAboutIt");
                npc.netUpdate = true;
            }
            if (npc.ai[0] == 600)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat("...", 107, 137, 179, true);
                }
            }
            if (npc.ai[0] >= 840)
            {
                npc.ai[1]     = 2;
                npc.netUpdate = true;
            }
            if (npc.ai[0] == 840)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat5"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 960)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat6"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1080)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat7"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1200)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat8"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1380)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat9"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1540)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat10"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1660)
            {
                string Name;
                if (Main.netMode != 0)
                {
                    Name = "Terrarians";
                }
                else
                {
                    Name = Main.LocalPlayer.name;
                }
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat11") + Name + "?", 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1780)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat12"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 1900)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat13"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] == 2020)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat14"), 107, 137, 179, true);
                }
            }
            if (npc.ai[0] >= 2180)
            {
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat15"), 107, 137, 179, true);
                }
                AAWorld.downedRajahsRevenge = true;
                if (Main.netMode != 1)
                {
                    BaseUtility.Chat(Lang.BossChat("SupremeRajahDefeat16"), Color.Green, true);
                }
                int p = Projectile.NewProjectile(npc.position, npc.velocity, ModContent.ProjectileType <SupremeRajahLeave>(), 0, 0, Main.myPlayer);
                Main.projectile[p].position = npc.position;
                npc.active    = false;
                npc.netUpdate = true;
            }
        }
Пример #25
0
        public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
        {
            damage = 0;

            int dust1 = ModContent.DustType <Dusts.YamataADust>();
            int dust2 = ModContent.DustType <Dusts.YamataADust>();

            if (npc.life <= 0)
            {
                Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, dust1, 0f, 0f, 0);
                Main.dust[dust1].velocity *= 0.5f;
                Main.dust[dust1].scale    *= 1.3f;
                Main.dust[dust1].fadeIn    = 1f;
                Main.dust[dust1].noGravity = false;
                Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, dust2, 0f, 0f, 0);
                Main.dust[dust2].velocity *= 0.5f;
                Main.dust[dust2].scale    *= 1.3f;
                Main.dust[dust2].fadeIn    = 1f;
                Main.dust[dust2].noGravity = true;
            }
            if (!AAWorld.downedYamata)
            {
                if (npc.life <= (npc.lifeMax / 4 * 3) && threeQuarterHealth == false)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataA6"), new Color(146, 30, 68));
                    }
                    threeQuarterHealth = true;
                }
                if (npc.life <= npc.lifeMax / 2 && HalfHealth == false)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataA7"), new Color(146, 30, 68));
                    }
                    HalfHealth = true;
                }
                if (npc.life <= npc.lifeMax / 10 && tenthHealth == false)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataA8"), new Color(146, 30, 68));
                    }
                    tenthHealth = true;
                }
            }
            if (AAWorld.downedYamata)
            {
                if (npc.life <= (npc.lifeMax / 4 * 3) && threeQuarterHealth == false)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataA9"), new Color(146, 30, 68));
                    }
                    threeQuarterHealth = true;
                }
                if (npc.life <= npc.lifeMax / 2 && HalfHealth == false)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataA10"), new Color(146, 30, 68));
                    }
                    HalfHealth = true;
                }
                if (npc.life <= npc.lifeMax / 10 && tenthHealth == false)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataA11"), new Color(146, 30, 68));
                    }
                    tenthHealth = true;
                }
            }

            return(true);
        }
Пример #26
0
        public override void AI()
        {
            if (Main.expertMode)
            {
                damage = npc.damage / 4;
            }
            else
            {
                damage = npc.damage / 2;
            }
            npc.noGravity = true;
            npc.TargetClosest(true);
            Player   player    = Main.player[npc.target];
            AAPlayer modplayer = player.GetModPlayer <AAPlayer>();

            RingRoatation += .05f;
            npc.ai[1]++;
            if (internalAI[3] > 0)
            {
                internalAI[3]--;
            }

            if (Main.player[npc.target].dead && Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 5000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 5000f)
            {
                npc.TargetClosest(true);
                if (Main.player[npc.target].dead)
                {
                    if (internalAI[0] != 1f)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("SagittariusFree1"), Color.PaleVioletRed);
                        }
                        internalAI[0] = 1f;
                    }
                }
                if (Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 5000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 5000f)
                {
                    if (internalAI[0] != 1f)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("SagittariusFree2"), Color.PaleVioletRed);
                        }
                        internalAI[0] = 1f;
                    }
                }
            }
            if (internalAI[0] == 1f)
            {
                npc.TargetClosest(true);
                npc.velocity *= .7f;
                npc.alpha    += 5;
                if (npc.alpha >= 255)
                {
                    npc.active = false;
                }
                if (Main.player[npc.target].dead || Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 6000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 6000f)
                {
                    npc.TargetClosest(true);

                    internalAI[0] = 0f;
                }
            }
            else
            {
                npc.TargetClosest(true);
                if (npc.alpha > 0)
                {
                    npc.alpha -= 10;
                }
                if (npc.alpha <= 0)
                {
                    npc.alpha = 0;
                }
            }

            internalAI[1]++;

            if (internalAI[2] == 2)
            {
                npc.dontTakeDamage = true;
            }
            else
            {
                npc.dontTakeDamage = false;
            }

            if (internalAI[1] >= 300)
            {
                internalAI[1] = 0;
                internalAI[2] = internalAI[3] <= 0 ? Main.rand.Next(3) : Main.rand.Next(2);
                internalAI[4] = Main.rand.Next(2);
                if (internalAI[2] == 2)
                {
                    CombatText.NewText(npc.Hitbox, Color.PaleVioletRed, Lang.BossChat("SagittariusFree3"));
                }
                npc.ai        = new float[4];
                npc.netUpdate = true;
            }

            if (internalAI[2] == 1)
            {
                BaseAI.AIEater(npc, ref npc.ai, 0.05f, 4f, 0, false, true);
                npc.rotation = 0;
                BaseAI.ShootPeriodic(npc, player.position, player.width, player.height, mod.ProjType("SagProj"), ref shootAI[0], 15, damage, 10f, true, new Vector2(20f, 15f));
            }
            else if (internalAI[2] == 2) //Shield Mode
            {
                ShieldScale += .02f;
                if (ShieldScale >= 1f)
                {
                    ShieldScale = 1f;
                }
                internalAI[3] = 1200;
                npc.life     += 2;
                CombatText.NewText(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), CombatText.HealLife, string.Concat(2), false, false);
                BaseAI.AISpaceOctopus(npc, ref npc.ai, Main.player[npc.target].Center, 0.07f, 5f, 250f, 70f, ShootLaser);
            }
            else
            {
                BaseAI.AIEye(npc, ref npc.ai, false, true, .3f, .3f, 4, 4, 0, 0);
                npc.rotation = 0;
            }

            if (internalAI[2] != 2f)
            {
                ShieldScale -= .02f;
                if (ShieldScale <= 0f)
                {
                    ShieldScale = 0f;
                }
            }
            bool foundLocation = false;

            if (internalAI[4] == 1)
            {
                npc.alpha += 5;

                int Xint = Main.rand.Next(-500, 500);
                int Yint = Main.rand.Next(-500, 500);

                if (npc.alpha >= 255)
                {
                    npc.alpha = 255;
                    if ((Xint < -100 || Xint > 100) && (Yint < -90 || Yint > 90))
                    {
                        foundLocation = true;
                    }
                }
                if (foundLocation)
                {
                    Vector2 tele = new Vector2(player.Center.X + Xint, player.Center.Y + Yint);
                    npc.Center    = tele;
                    internalAI[4] = 0;
                }
            }
            else
            {
                npc.alpha -= 3;
                if (npc.alpha <= 0)
                {
                    npc.alpha = 0;
                }
            }

            npc.noTileCollide = true;
        }
Пример #27
0
        public override void AI()
        {
            Vector2 Origin    = new Vector2((int)(Main.maxTilesX * 0.65f), 100) * 16;
            Vector2 Acropolis = new Vector2(Origin.X + (80 * 16), Origin.Y + (79 * 16));

            npc.TargetClosest();
            if (Main.netMode != 1)
            {
                if (Vector2.Distance(npc.Center, Acropolis) < 5 && Main.netMode != 1)
                {
                    npc.velocity.X   *= 0;
                    npc.ai[1]         = 1;
                    npc.noTileCollide = false;
                    npc.noGravity     = false;
                    npc.netUpdate     = true;
                }
                if (npc.ai[1] == 0)
                {
                    MoveToPoint(Acropolis);
                }
                else
                {
                    npc.ai[0]++;
                    if (Main.netMode != 1)
                    {
                        if (npc.ai[2] == 0)
                        {
                            if (npc.ai[0] == 120)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat1"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 240)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat2"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 360)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat("...", Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 480)
                            {
                                music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/AthenaA");
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat3"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 600)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat4"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 720)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat5"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 840)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat6"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 960)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat7"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] == 1080)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat8"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else
                            if (npc.ai[0] >= 1200)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("AthenaDefeat9"), Color.CornflowerBlue);
                                }
                                AAModGlobalNPC.SpawnBoss(Main.player[npc.target], ModContent.NPCType <Olympian.AthenaA>(), false, npc.Center);

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

                                npc.active    = false;
                                npc.netUpdate = true;
                            }
                        }
                        else
                        {
                            if (npc.ai[0] == 120)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat("...", Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 240)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat1"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 360)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat2"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 480)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat("...", Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 600)
                            {
                                string s = "";
                                if (Main.ActivePlayersCount > 1)
                                {
                                    s = Lang.BossChat("Athena2Defeat4");
                                }
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat3") + s + "...", Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 720)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat5"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 840)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat6"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 960)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat7"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] == 1080)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat8"), Color.CornflowerBlue);
                                }
                                npc.netUpdate = true;
                            }
                            else if (npc.ai[0] >= 1200)
                            {
                                if (Main.netMode != 1)
                                {
                                    BaseUtility.Chat(Lang.BossChat("Athena2Defeat9"), Color.CornflowerBlue);
                                }
                                AAModGlobalNPC.SpawnBoss(Main.player[npc.target], ModContent.NPCType <AthenaFlee>(), false, npc.Center);
                                npc.active    = false;
                                npc.netUpdate = true;
                            }
                        }
                    }
                }
            }
        }
Пример #28
0
        public override void AI()
        {
            if (AAConfigClient.Instance.NoBossDialogue)
            {
                AAWorld.downedShen = true;
                npc.active         = false;
                npc.netUpdate      = true;
            }
            npc.TargetClosest();
            Player player = Main.player[npc.target];

            npc.Center = player.Center;

            npc.ai[1]++;
            if (npc.ai[0] == 0)
            {
                if (npc.ai[1] == 180)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath1"), new Color(180, 41, 32));
                }

                if (npc.ai[1] == 360)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath2"), new Color(45, 46, 70));
                }

                if (npc.ai[1] == 540)
                {
                    string Name = Main.netMode != 0 ? Lang.BossChat("ShenDeath3") : player.name;
                    BaseUtility.Chat(Name + Lang.BossChat("ShenDeath4"), new Color(180, 41, 32));
                }

                if (npc.ai[1] == 720)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath5"), new Color(45, 46, 70));
                }

                if (npc.ai[1] == 899)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath6"), new Color(45, 46, 70));
                    BaseUtility.Chat(Lang.BossChat("ShenDeath6"), new Color(180, 41, 32));
                }

                if (npc.ai[1] >= 900)
                {
                    AAWorld.downedShen = true;
                    npc.active         = false;
                    npc.netUpdate      = true;
                }
                return;
            }
            else
            {
                if (npc.ai[1] == 180)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath7"), new Color(45, 46, 70));
                }

                if (npc.ai[1] == 360)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath8"), new Color(180, 41, 32));
                }

                if (npc.ai[1] == 540)
                {
                    string Name = Main.netMode != 0 ? Lang.BossChat("ShenDeath9") : player.Male ? Lang.BossChat("boy") : Lang.BossChat("girl");
                    BaseUtility.Chat(Lang.BossChat("ShenDeath10") + Name + Lang.BossChat("ShenDeath11"), new Color(45, 46, 70));
                }

                if (npc.ai[1] == 720)
                {
                    BaseUtility.Chat(Lang.BossChat("ShenDeath12"), new Color(180, 41, 32));
                }

                if (npc.ai[1] == 899)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("ShenDeath13"), new Color(45, 46, 70));
                        BaseUtility.Chat(Lang.BossChat("ShenDeath13"), new Color(180, 41, 32));
                    }
                }
                if (npc.ai[1] >= 900)
                {
                    npc.active    = false;
                    npc.netUpdate = true;
                }
            }
        }
Пример #29
0
        public override void AI()
        {
            npc.TargetClosest();
            Player player = Main.player[npc.target];

            MoveToPoint(player.Center - new Vector2(0, 300f));

            if (Vector2.Distance(npc.Center, player.Center) > 2000)
            {
                npc.alpha  = 255;
                npc.Center = player.Center - new Vector2(0, 300f);
            }

            if (Main.netMode != 2)            //clientside stuff
            {
                npc.frameCounter++;
                if (npc.frameCounter >= 7)
                {
                    npc.frameCounter = 0;
                    npc.frame.Y     += Main.npcTexture[npc.type].Height / 4;
                }

                if (npc.frame.Y > Main.npcTexture[npc.type].Height / 4 * 3)
                {
                    npc.frame.Y = 0;
                }
                if (npc.ai[0] > 375)
                {
                    if (npc.alpha < 0)
                    {
                        npc.alpha = 0;
                    }
                    else
                    {
                        npc.alpha -= 5;
                    }
                    if (npc.scale < 1)
                    {
                        npc.scale += .02f;
                    }
                    else
                    {
                        npc.scale = 1;
                    }
                }
                if (npc.ai[0] >= 375)                 //after he says 'nyeh' on the server, change music on the client
                {
                    music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Yamata2");
                }
                if (npc.ai[0] >= 900)                 //after he says 'as if' on the server, transition color
                {
                    RVal += 5;
                    BVal -= 5;
                    if (RVal <= 90)
                    {
                        BVal = 90;
                    }
                    if (RVal >= 255)
                    {
                        RVal = 255;
                    }
                }
            }
            if (Main.netMode != 1)
            {
                npc.ai[0]++;

                if (npc.ai[0] == 375)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition1"), new Color(45, 46, 70));
                    }
                    npc.netUpdate = true;
                }
                else
                if (npc.ai[0] == 650)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition2"), new Color(45, 46, 70));
                    }
                }
                else
                if (npc.ai[0] == 900)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition3"), new Color(45, 46, 70));
                    }
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition7"), Color.PaleVioletRed);
                    }
                    npc.netUpdate = true;
                }
                else
                if (npc.ai[0] == 1100)
                {
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition4"), new Color(146, 30, 68));
                    }
                }
                else
                if (npc.ai[0] >= 1455 && !NPC.AnyNPCs(mod.NPCType("YamataA")))
                {
                    AAModGlobalNPC.SpawnBoss(player, mod.NPCType("YamataA"), false, npc.Center, "", false);
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition5"), Color.Magenta.R, Color.Magenta.G, Color.Magenta.B);
                    }
                    if (Main.netMode != 1)
                    {
                        BaseUtility.Chat(Lang.BossChat("YamataTransition6"), new Color(146, 30, 68));
                    }

                    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;

                    Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Sounds/YamataRoar"), npc.position);
                    Vector2 position = npc.Center + (Vector2.One * -20f);
                    int     num84    = 40;
                    int     height3  = num84;
                    for (int num85 = 0; num85 < 3; num85++)
                    {
                        int num86 = Dust.NewDust(position, num84, height3, 240, 0f, 0f, 100, default, 1.5f);
Пример #30
0
        public override void AI()
        {
            npc.noGravity = true;
            npc.TargetClosest(true);
            Player   player    = Main.player[npc.target];
            AAPlayer modPlayer = player.GetModPlayer <AAPlayer>();

            if (player.Center.X > npc.Center.X)
            {
                npc.direction = -1;
            }
            else
            {
                npc.direction = 1;
            }

            if (internalAI[0] == 0)
            {
                if (Main.netMode != 1)
                {
                    for (int m = 0; m < ProbeCount; m++)
                    {
                        int npcID = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("SagittariusOrbiter"), 0);
                        Main.npc[npcID].Center     = npc.Center;
                        Main.npc[npcID].velocity   = new Vector2(MathHelper.Lerp(-1f, 1f, (float)Main.rand.NextDouble()), MathHelper.Lerp(-1f, 1f, (float)Main.rand.NextDouble()));
                        Main.npc[npcID].velocity  *= 8f;
                        Main.npc[npcID].ai[0]      = m;
                        Main.npc[npcID].netUpdate2 = true; Main.npc[npcID].netUpdate = true;
                    }
                }
                internalAI[0] = 1;
            }

            if (MovementType[0] == 0)
            {
                internalAI[6]++;

                MovementType[1] -= 5;
                if (MovementType[1] <= 0)
                {
                    MovementType[1] = 0;
                }

                if (internalAI[6] > 200)
                {
                    internalAI[6]   = 0f;
                    MovementType[0] = Main.rand.Next(3);
                    npc.netUpdate   = true;
                }
            }
            if (MovementType[0] == 1)
            {
                internalAI[6]++;

                if (internalAI[6] > 240)
                {
                    internalAI[6]   = 0;
                    MovementType[0] = 5;
                    npc.netUpdate   = true;
                }
            }
            if (MovementType[0] == 2)
            {
                MovementType[1] += 5;
                if (MovementType[1] >= 255)
                {
                    MovementType[0] = 3;
                    npc.netUpdate   = true;
                }
            }
            if (MovementType[0] == 3)
            {
                MovementType[1] -= 5;
                if (MovementType[1] <= 0)
                {
                    MovementType[1] = 0;
                }

                internalAI[6]++;

                if (internalAI[6] > 360)
                {
                    internalAI[6]   = 0;
                    MovementType[0] = 5;
                    npc.netUpdate   = true;
                }
            }
            else if (MovementType[0] == 4 || MovementType[0] == 5)
            {
                MovementType[1] += 5;
                if (MovementType[1] >= 255)
                {
                    MovementType[0] = 0;
                    npc.netUpdate   = true;
                }
            }

            if (internalAI[4] < 60)
            {
                internalAI[4]++;
            }
            if (!NPC.AnyNPCs(ModContent.NPCType <SagittariusOrbiter>()) && internalAI[4] >= 60)
            {
                npc.Transform(ModContent.NPCType <SagittariusFree>());
            }

            if (internalAI[3] == 1f)
            {
                npc.TargetClosest(true);
                npc.velocity *= .7f;
                npc.alpha    += 5;
                if (npc.alpha >= 255)
                {
                    npc.active = false;
                }
                if (!Main.player[npc.target].dead || Math.Abs(npc.position.X - Main.player[npc.target].position.X) <= 6000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) >= 6000f)
                {
                    npc.TargetClosest(true);
                }
                return;
            }
            else
            {
                npc.TargetClosest(true);
                if (npc.alpha > 0)
                {
                    npc.alpha -= 10;
                }
                if (npc.alpha <= 0)
                {
                    npc.alpha = 0;
                }
            }

            if (Main.player[npc.target].dead)
            {
                npc.TargetClosest(true);
                if (Main.player[npc.target].dead)
                {
                    if (internalAI[3] != 1f)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("Sagittarius1"), Color.PaleVioletRed);
                        }
                        internalAI[3] = 1f;
                    }
                }
            }
            else if (Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 5000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 5000f || !modPlayer.ZoneVoid)
            {
                npc.TargetClosest(true);
                if (Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 5000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 5000f)
                {
                    if (internalAI[3] != 1f)
                    {
                        if (Main.netMode != 1)
                        {
                            BaseUtility.Chat(Lang.BossChat("Sagittarius2"), Color.PaleVioletRed);
                        }
                        internalAI[3] = 1f;
                    }
                }
            }


            npc.ai[1]++;

            if (npc.ai[1] >= 300)
            {
                internalAI[1] = 0;
                internalAI[2] = Main.rand.Next(3);
                npc.ai        = new float[4];
                npc.netUpdate = true;
            }



            if (internalAI[2] == 1) //Chaase down the target
            {
                BaseAI.AIElemental(npc, ref npc.ai, null, 120, false, false, 10, 10, 10, 2.5f);
            }
            else //Hover over target
            {
                BaseAI.AISpaceOctopus(npc, ref npc.ai, Main.player[npc.target].Center, 0.3f, 10f, 250f, 70f, null);
            }
            npc.rotation = 0;

            npc.noTileCollide = true;
        }