Beispiel #1
0
 public void Equip(string weaponName)
 {
     foreach (Weapon weapon in inventory)
     {
         if (weapon.Name == weaponName)
             equipedWeapon = weapon;
     }
 }
Beispiel #2
0
 public void NewLevel(Random random)
 {
     level++;
     switch (level)
     {
         case 1:
             Enemies = new List<Enemy>(){ new Bat(this, GetRandomLocation(random)), };
             WeaponInRoom = new Sword(this, GetRandomLocation(random));
             break;
     }
 }
Beispiel #3
0
        public void NewLevel(Random random)
        {
            level++;
            switch (level)
            {
                case 1:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Bat(this, GetRandomLocation(random)));
                    WeaponInRoom = new Sword(this, GetRandomLocation(random));
                    break;

                case 2:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Ghost(this, GetRandomLocation(random)));
                    WeaponInRoom = new BluePotion(this, GetRandomLocation(random));
                    break;

                case 3:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Ghoul(this, GetRandomLocation(random)));
                    WeaponInRoom = new Bow(this, GetRandomLocation(random));
                    break;

                case 4:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Ghost(this, GetRandomLocation(random)));
                    Enemies.Add(new Bat(this, GetRandomLocation(random)));

                    if (player.Weapons.Contains(Bow) == true)
                    {
                        if (player.Weapons.Contains(BluePotion) == true)
                        {
                            WeaponInRoom = null;
                        }
                        else
                        {
                            WeaponInRoom = new BluePotion(this, GetRandomLocation(random));
                        }
                    }

                    else
                    {
                        WeaponInRoom = new Bow(this, GetRandomLocation(random));
                    }

                    break;

                case 5:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Ghoul(this, GetRandomLocation(random)));
                    Enemies.Add(new Bat(this, GetRandomLocation(random)));
                    WeaponInRoom = new RedPotion(this, GetRandomLocation(random));
                    break;

                case 6:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Ghoul(this, GetRandomLocation(random)));
                    Enemies.Add(new Ghost(this, GetRandomLocation(random)));
                    WeaponInRoom = new Mace(this, GetRandomLocation(random));
                    break;

                case 7:
                    Enemies = new List<Enemy>();
                    Enemies.Add(new Ghoul(this, GetRandomLocation(random)));
                    Enemies.Add(new Ghost(this, GetRandomLocation(random)));
                    Enemies.Add(new Bat(this, GetRandomLocation(random)));

                    if (player.Weapons.Contains(Mace) == true)
                    {
                        if (player.Weapons.Contains(RedPotion) == true)
                        {
                            WeaponInRoom = null;
                        }
                        else
                        {
                            WeaponInRoom = new RedPotion(this, GetRandomLocation(random));
                        }
                    }

                    else
                    {
                        WeaponInRoom = new Mace(this, GetRandomLocation(random));
                    }
                    break;

                case 8:

            }
        }
Beispiel #4
0
 public void AcquireWeapon(Weapon weapon)
 {
     player.AcquireWeapon(weapon);
     //WeaponsInRoom.Find((e) => (weapon.Name == e.Name)).PickUpWeapon();
     WeaponsInRoom.Remove(weapon);
 }