Re: look_in_direction & auto_exits

From: David Cole (tiznor@hotmail.com)
Date: 01/09/02


Thank you John, that did the trick.
Below is the look in direction that should be compadable with most circle
MUD's if anyone is interested. It works as follows: Look in a direction, and
you see what is in that direction unless its its dark, then it will be dark
etc.. it will also not make the chars light, light the looked to room, like
it was doing before by placing the char into the room and then putting them
back. You might want to fool with the It's pitch black thing to make it work
with the other room and not the room you are currently in if thats what you
want it to do... I intend to do so, but at the moment I don't have the time.
This is my first snippet released to the list, thank to all that helped. :)

If you don't have secret exits you will need to remove it from the snippet.

Replace look_in_direction in act.information.c with the following below.

void look_in_direction(struct char_data * ch, int dir)
{
  int door, slen = 0, next_room;
  *buf = '\0';

  if (IS_DARK(ch->in_room) && !CAN_SEE_IN_DARK(ch)) {
    send_to_char("&zIt is pitch black...&n\r\n", ch);
    return;
  } else if (AFF_FLAGGED(ch, AFF_BLIND)) {
    send_to_char("&WYou can't see a damn thing, your blind!&n\r\n", ch);
    return;
  }
    if (EXIT(ch, dir) && EXIT(ch, dir)->to_room != NOWHERE &&
  !IS_SET(EXIT(ch, dir)->exit_info, EX_SECRET)) {
    if (IS_SET(EXIT(ch, dir)->exit_info, EX_CLOSED) && EXIT(ch,
dir)->keyword) {
          sprintf(buf, "The %s is closed.\r\n", fname(EXIT(ch,
dir)->keyword));
          send_to_char(buf, ch);
    if (EXIT(ch, dir)->general_description)
          send_to_char(EXIT(ch, dir)->general_description, ch);
 } else {
      next_room = world[ch->in_room].dir_option[dir]->to_room;

      send_to_char(world[next_room].name, ch);
      send_to_char(CCNRM(ch, C_NRM), ch);
      send_to_char("\r\n", ch);
      send_to_char(world[next_room].description, ch);

      for (door = 0; door < NUM_OF_DIRS; door++)
        if (W_EXIT(next_room, door) && W_EXIT(next_room, door)->to_room !=
NOWHERE &&
   !IS_SET(W_EXIT(next_room, door)->exit_info, EX_SECRET)) {
        if (IS_SET(W_EXIT(next_room, door)->exit_info, EX_CLOSED))
          sprintf(buf, "%s-#&c%s&n ", buf, capdirs[door]);
     else
          sprintf(buf, "%s-&c%s&n ", buf, capdirs[door]);
  }
        sprintf(buf2, "Exits: %s\r\n", ((*buf) ? buf : "None."));
        send_to_char(buf2, ch);

      list_obj_to_char(world[next_room].contents, ch, 0, FALSE);
      list_char_to_char(world[next_room].people, ch);
 }
  } else
   send_to_char("You see nothing special..\r\n", ch);
}

Thanks,
Dave (Tiznor)

--
   +---------------------------------------------------------------+
   | 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