Example #1
0
        public void MoveTo(Location loc)
        {
            //check to make sure player has any requied items
            if (loc.ItemRequiredToEnter != null)
            {
                //check for item
                bool playerHasRequiredItem = false;
                foreach (InventoryItem ii in this.Inventory)
                {
                    if (ii.Details.ID == loc.ItemRequiredToEnter.ID)
                    {
                        playerHasRequiredItem = true;
                        break;
                    }
                }

                if (!playerHasRequiredItem)
                {
                    Console.WriteLine(" You must have a {0} to enter this location", loc.ItemRequiredToEnter.Name);
                    return;
                }
            }
            CurrentHitPoints = MaximumHitPoints;
            CurrentLocation  = loc;
            GameEngine.QuestProcessor(this, loc);
            GameEngine.MonsterProcesser(this, loc);
        }