Exemplo n.º 1
0
        public override bool UseItem(Player player)
        {
            CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>(mod);

            Main.NewText("Undead creatures are rising from ground!", 175, 75, 255);
            Main.NewText("The Night of Undead has begun...", 135, 17, 17);
            ZWorld.ZInvasion = true;
            return(true);
        }
Exemplo n.º 2
0
        public override bool CanUseItem(Player player)
        {
            CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer <CyberWrathInvasion>(mod);

            if (ZWorld.ZInvasion)
            {
                return(false);
            }

            if (Main.dayTime)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
        public override void PostUpdate()
        {
            bool      First   = true;
            const int XOffset = 1200;
            const int YOffset = 1200;

            CyberWrathInvasion modPlayer = player.GetModPlayer <CyberWrathInvasion>(mod);

            if (!ZWorld.ZInvasion)
            {
                ZWorld.ZPoints = 0;
            }

            if (ZWorld.ZPoints >= 100)
            {
                ZWorld.ZInvasion = false;
            }

            if (ZWorld.ZPoints > 100)
            {
                ZWorld.ZPoints = 100;
            }

            if (!ZWorld.ZInvasion)
            {
                ZWorld.ZPoints = 0;
            }

            if (ZWorld.ZInvasion)
            {
                //Always
                if (Main.rand.Next(3000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Arsonist"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Deadling1"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Deadling2"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Deadling3"));
                }
                if (Main.rand.Next(2250) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("FatSack"));
                }

                if (Main.rand.Next(3000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Arsonist"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Deadling1"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Deadling2"));
                }
                if (Main.rand.Next(700) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Deadling3"));
                }
                if (Main.rand.Next(2250) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("FatSack"));
                }
                //EoC defeated
                if (NPC.downedBoss1 && Main.rand.Next(4000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("FarmerZombie"));
                }

                if (NPC.downedBoss1 && Main.rand.Next(4000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("FarmerZombie"));
                }
                //EoW/BoC defeated
                if (NPC.downedBoss2 && Main.rand.Next(3000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Zombat"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(8000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("DiceZombie"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(5000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Zombeast"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(1000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("PetrifiedZombie1"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(1000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("PetrifiedZombie2"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(1000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("PetrifiedZombie3"));
                }

                if (NPC.downedBoss2 && Main.rand.Next(3000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Zombat"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(8000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("DiceZombie"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(5000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Zombeast"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(1000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("PetrifiedZombie1"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(1000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("PetrifiedZombie2"));
                }
                if (NPC.downedBoss2 && Main.rand.Next(1000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("PetrifiedZombie3"));
                }
                //Skeletron defeated
                if (NPC.downedBoss3 && Main.rand.Next(10000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Painmaker"));
                }
                if (NPC.downedBoss3 && Main.rand.Next(6000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("SpearZombie"));
                }
                if (NPC.downedBoss3 && Main.rand.Next(6000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Zombomber"));
                }

                if (NPC.downedBoss3 && Main.rand.Next(10000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Painmaker"));
                }
                if (NPC.downedBoss3 && Main.rand.Next(6000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("SpearZombie"));
                }
                if (NPC.downedBoss3 && Main.rand.Next(6000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Zombomber"));
                }
                //Hardmode
                if (NPC.downedMechBossAny && Main.rand.Next(20000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Almagron"));
                }
                if (Main.hardMode && Main.rand.Next(15000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Cryptomage"));
                }
                if (Main.hardMode && Main.rand.Next(12500) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Dapperblook"));
                }
                if (Main.hardMode && Main.rand.Next(10000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Scourge"));
                }
                if (Main.hardMode && Main.rand.Next(8550) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Bonecing"));
                }
                if (Main.hardMode && Main.rand.Next(6000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("TheHaunt"));
                }
                if (Main.hardMode && Main.rand.Next(4375) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("GhoulOfficer"));
                }
                if (Main.hardMode && Main.rand.Next(1055) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Corpse1"));
                }
                if (Main.hardMode && Main.rand.Next(1055) == 1)
                {
                    NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("Corpse2"));
                }

                if (NPC.downedMechBossAny && Main.rand.Next(20000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Almagron"));
                }
                if (Main.hardMode && Main.rand.Next(15000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Cryptomage"));
                }
                if (Main.hardMode && Main.rand.Next(12500) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Dapperblook"));
                }
                if (Main.hardMode && Main.rand.Next(10000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Scourge"));
                }
                if (Main.hardMode && Main.rand.Next(8550) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Bonecing"));
                }
                if (Main.hardMode && Main.rand.Next(6000) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("TheHaunt"));
                }
                if (Main.hardMode && Main.rand.Next(4375) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("GhoulOfficer"));
                }
                if (Main.hardMode && Main.rand.Next(1055) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Corpse1"));
                }
                if (Main.hardMode && Main.rand.Next(1055) == 1)
                {
                    NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("Corpse2"));
                }
            }

            if (Main.dayTime && ZWorld.ZInvasion)
            {
                Main.NewText("Undead creatures has been defeated!", 175, 75, 255);
                Main.NewText("The Night of Undead has ended!", 135, 17, 17);
                ZWorld.ZPoints   = 0;
                ZWorld.ZInvasion = false;
            }
        }