Exemplo n.º 1
0
 public string Use(IItem item)
 {
     if (LockedExits.ContainsKey(item))
     {
         Exits.Add(LockedExits[item].Key, LockedExits[item].Value);
         LockedExits.Remove(item);
         if (item.Name.ToLower() == "machete")
         {
             return("You use the machete and slash anything in your way! You can now see the path to the east.");
         }
         if (item.Name.ToLower() == "torch and matches")
         {
             return("You can now see around the cave! There's a wooden paddle over there in the corner! You also see an exit to the north.");
         }
         if (item.Name.ToLower() == "row boat")
         {
             return("You are now in the row boat. This rowboat is pretty worn...Will it make it to the ship?");
         }
         if (item.Name.ToLower() == "wooden paddle")
         {
             return("You are now able to row south towards the ship!");
         }
     }
     return("No use for that here");
 }
Exemplo n.º 2
0
        public string Use(IItem item)
        {
            if (LockedExits.ContainsKey(item))
            {
                Exits.Add(LockedExits[item].Key, LockedExits[item].Value);
                LockedExits.Remove(item);

                return("You have unlocked a room");
            }
            return("No use for that here");
        }
Exemplo n.º 3
0
 public string Use(IItem item)
 {
     if (LockedExits.ContainsKey(item))
     {
         Exits.Add(LockedExits[item].Key, LockedExits[item].Value);
         LockedExits.Remove(item);
         return(item.UsedString);
     }
     else if (Actions.ContainsKey(item))
     {
         IEvent e = Actions[item];
         e.Active = true;
         e.Rooms.ForEach(r => r.Exits.Add(r.Events[e].Key, r.Events[e].Value));
         return(item.UsedString);
     }
     return("No use for that here");
 }
Exemplo n.º 4
0
        public void AddLockedRoom(IItem key, string direction, IRoom room)
        {
            var lockedRoom = new KeyValuePair <string, IRoom>(direction, room);

            LockedExits.Add(key, lockedRoom);
        }