Exemplo n.º 1
0
int perform_move(struct char_data *ch, int dir, int need_specials_check)
{
  room_rnum was_in;
  struct follow_type *k, *next;

  if (ch == NULL || dir < 0 || dir >= NUM_OF_DIRS || FIGHTING(ch))
    return (0);
  else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
    send_to_char(ch, "Alas, you cannot go that way...\r\n");
  else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED)) {
    if (EXIT(ch, dir)->keyword)
      send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
    else
      send_to_char(ch, "It seems to be closed.\r\n");
  } else {
    if (!ch->followers)
      return (do_simple_move(ch, dir, need_specials_check));

    was_in = IN_ROOM(ch);
    if (!do_simple_move(ch, dir, need_specials_check))
      return (0);

    for (k = ch->followers; k; k = next) {
      next = k->next;
      if ((IN_ROOM(k->follower) == was_in) &&
	  (GET_POS(k->follower) >= POS_STANDING)) {
	act("You follow $N.\r\n", FALSE, k->follower, 0, ch, TO_CHAR);
	perform_move(k->follower, dir, 1);
      }
    }
    return (1);
  }
  return (0);
}
Exemplo n.º 2
0
void no_map(int map[21][21], room_rnum room) {
  int exit;
  int x,y;
  for(exit = 0;exit<10;exit++) {
    if(dirvals[exit].x == 2)
      continue;
    x = 10 + dirvals[exit].x;
    y = 10 + dirvals[exit].y;
    if(EXITN(room, exit) && !EXIT_FLAGGED(EXITN(room,exit), EX_CLOSED))
      map[x][y] = 75;    
  }
}
Exemplo n.º 3
0
void map_search(int map[21][21], int x, int y, room_rnum room) {
  int exit;
  for(exit=0;exit < 12;exit++) {
    if(dirvals[exit].x == 2)
      continue;
    int tx = x + dirvals[exit].x;
    int ty = y + dirvals[exit].y;
    if(tx > 20 || tx < 0 || ty > 20 || ty < 0)
      continue;
    if(EXITN(room, exit)) {
      struct room_direction_data *nexit = EXITN(room,exit);      
      room_rnum nroom = nexit->to_room;
      if(map[tx][ty] == 100 && !EXIT_FLAGGED(nexit, EX_CLOSED)) {
	if(ROOM_FLAGGED(nroom, ROOM_NO_MAP)) {
	  map[tx][ty] = 75;
	} else {
          map[tx][ty] = SECT(nroom);
          map_search(map,tx,ty,nroom);
        }
      }
    }
  }
}