/// <summary>
 /// Should we spawn a special zombie?
 /// </summary>
 public static void CheckSpawnSpecial()
 {
     //If the player started the game
     if (GamePad.GetState(PlayerIndex.Two).Buttons.Y == ButtonState.Pressed)
     {
         //Call the spawn special zombie method, passing the variable for Juggernaught
         WorldDirector.ZombieSpawner("j");
     }
     //If the player started the game
     if (GamePad.GetState(PlayerIndex.Two).Buttons.X == ButtonState.Pressed)
     {
         //Call the spawn special zombie method, passing the variable for Juggernaught
         WorldDirector.ZombieSpawner("s");
     }
     //If the player started the game
     if (GamePad.GetState(PlayerIndex.Two).Buttons.A == ButtonState.Pressed)
     {
         //Call the spawn special zombie method, passing the variable for Juggernaught
         WorldDirector.ZombieSpawner("e");
     }
     //If the player started the game
     if (GamePad.GetState(PlayerIndex.Two).Buttons.B == ButtonState.Pressed)
     {
         //Call the spawn special zombie method, passing the variable for Juggernaught
         WorldDirector.ZombieSpawner("cm");
     }
 }
 /// <summary>
 /// Override Logic method
 /// </summary>
 public override void Logic()
 {
     //Set the target to the first entry in the survivor list
     Target = World.AliveSurvivorList.ElementAt(0);
     //Go through every survivor
     foreach (Survivor surv in World.AliveSurvivorList)
     {
         //If the target has more kills than the next survivor
         if (Target.Kills >= surv.Kills && surv.IsAlive)
         {
             //Set that survivor as the target
             Target = surv;
         }
     }
     //One in three chance of this happening
     if (ExtensionMethods.RandomNumber(1, 3) == 2)
     {
         //If the Director has enough resources
         if (World.Director.Resources > SpeedEffect.Instance.Cost)
         {
             //Go through all the zombies
             foreach (Zombie zom in World.ZombieList)
             {
                 if (CollisionEngine.IsNear(Target, zom))
                 {
                     //Use either the slow or speed up
                     if (ExtensionMethods.RandomNumber(1, 2) == 2)
                     {
                         //Slow the players
                         SpeedEffect.Instance.Activate();
                     }
                     else
                     {
                         //Make the zombies go faster
                         SlowEffect.Instance.Activate();
                     }
                 }
             }
         }
     }
     //One in three chance of spawning a juggernaught
     if (ExtensionMethods.RandomNumber(1, 3) == 2)
     {
         //Try and spawn a juggernaught
         WorldDirector.ZombieSpawner("j");
     }
     //One in two chance of spawning an exploder
     if (ExtensionMethods.RandomNumber(1, 5) == 3)
     {
         //Try and spawn a juggernaught
         WorldDirector.ZombieSpawner("e");
     }
     //One in three chance of spawning a speeder
     //One in three chance of spawning a juggernaught
     if (ExtensionMethods.RandomNumber(1, 1000) == 2)
     {
         //Try and spawn a juggernaught
         WorldDirector.ZombieSpawner("s");
     }
 }
 /// <summary>
 /// Override Logic method
 /// </summary>
 public override void Logic()
 {
     if (Target.IsAlive == false)
     {
         Target = World.AliveSurvivorList.ElementAt(ExtensionMethods.RandomNumber(0, World.AliveSurvivorList.Count));
     }
     //If the Director has enough resources
     if (World.Director.Resources > SpeedEffect.Instance.Cost)
     {
         //Use either the slow or speed up
         if (ExtensionMethods.RandomNumber(1, 10) == 5)
         {
             //Slow the players
             SpeedEffect.Instance.Activate();
         }
         else if (ExtensionMethods.RandomNumber(1, 10) == 2)
         {
             //Make the zombies go faster
             SlowEffect.Instance.Activate();
         }
     }
     //Spawn a new common zomibie, one in five chance
     if (ExtensionMethods.RandomNumber(1, 20) == 2)
     {
         //Try and spawn a common zombie
         WorldDirector.ZombieSpawner("cm");
     }
     //If the director can spawn a weapon, do it
     if (World.Director.CanSpawnWeapon)
     {
         SpawnWeaponEffect.Instance.Activate();
     }
 }
Example #4
0
        /// <summary>
        /// Override Logic method
        /// </summary>
        public override void Logic()
        {
            //Go through every survivor
            foreach (Survivor surv in World.AliveSurvivorList)
            {
                //If the survivor has more kills than the target
                if (Target.Kills < surv.Kills && surv.IsAlive)
                {
                    //Set that survivor to be the target
                    Target = surv;
                }
            }
            //If the Director has enough resources
            if (World.Director.Resources >= 10000)
            {
                while (World.Director.Resources > 500)
                {
                    //Use either the slow or speed up
                    if (ExtensionMethods.RandomNumber(1, 10) == 5)
                    {
                        //Slow the players
                        SpeedEffect.Instance.Activate();
                    }
                    if (ExtensionMethods.RandomNumber(1, 10) == 2)
                    {
                        //Make the zombies go faster
                        SlowEffect.Instance.Activate();
                    }
                    //Spawn a new common zomibie, one in ten chance
                    if (ExtensionMethods.RandomNumber(1, 10) == 2)
                    {
                        //Try and spawn a common zombie
                        WorldDirector.ZombieSpawner("cm");
                    }
                    //Spawn a juggernaught, one in ten
                    if (ExtensionMethods.RandomNumber(1, 10) == 7)
                    {
                        //Try and spawn a common zombie
                        WorldDirector.ZombieSpawner("j");
                    }
                    //Spawn an exploder, one in ten
                    if (ExtensionMethods.RandomNumber(1, 10) == 4)
                    {
                        //Try and spawn a common zombie
                        WorldDirector.ZombieSpawner("e");
                    }
                    //Spawn a speeder, one in ten
                    if (ExtensionMethods.RandomNumber(1, 10) == 3)
                    {
                        //Try and spawn a common zombie
                        WorldDirector.ZombieSpawner("s");
                    }
                }
            }

            //If the director can spawn a weapon, do it
            if (World.Director.CanSpawnWeapon)
            {
                SpawnWeaponEffect.Instance.Activate();
            }
        }