Re: [newbie] moving rooms

From: Christian Ejlertsen (chr.ejlertsen@has.dk)
Date: 10/18/02


> i have an idea for my mud, but i don't really know how to make it happen.. i
> want rooms that can shift in place.. like a labyrinth that never looks the
> same..
> ferry code has a room that moves if i'm not mistaken, could anyone help me
> with this?

In my mud code i have a feature that picks a random exit of the room.
This way you can make it appear like the room, although looking the same, is shifting places.
You can by setting more than one of an exit number guide the adventurer towards it's goal,
by increasing the chance of hitting a room that leads towards the exit.

--> SNIPPET <--

ACMD(do_move)
{
  int dir, i = 0;

 if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SPIN)) {
    for (i = 0;i<10;i++) {
      dir = number(0, NUM_OF_DIRS - 1);
      if (EXIT(ch, dir) && EXIT(ch, dir)->to_room != NOWHERE) {
        perform_move(ch, dir, 0);
        return;
      }
    }
  }
  perform_move(ch, subcmd - 1, 0);
}

--> SNIPPET <--

Christian

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT