Newbie: Climb skill.

From: Fionn Colvin (fcolvin@metz.une.edu.au)
Date: 10/20/96


Hiya all,
          A very newbie question here. I'm making a climb command where a 
player will type climb [direction] and then he/she will climb that way if 
the sector allows. What I'm having trouble with is the parsing of the 
direction argument in the command. Any help would be greatly appreciated.

PS. I know the if statements to parse the direction will not work, they 
are just like that so you can see what I want to do. :)


ACMD(do_climb)
{
  int dir = 0;

  argument = one_argument(argument, arg);

  if (!*arg) {
    send_to_char("Climb where?\r\n", ch);
    return;
  }

  if (arg == North)                <---------------
    dir = 0;                                      |
  else if (arg == East)                           |
    dir = 1;                                      |
  else if (arg == South)                          |
    dir = 2;                                      |   
  else if (arg == West)                           |  This stuff. :)
    dir = 3;                                      |
  else if (arg == Up)                             |   
    dir = 4;                                      |
  else if (arg == Down)                           |
    dir = 5;                       <---------------
  else {
    send_to_char("Usage: climb [n, e, s, w, u, d]\r\n", ch);
    return;
  }

  if ((SECT(ch->in_room) != SECT_CLIMB) && (SECT(EXIT(ch, dir)->to_room) != SECT_CLIMB)) {
    send_to_char("You can't climb there.\r\n", ch);
    return;
  }

  GET_POS(ch) = POS_CLIMBING;

  if (!perform_move(ch, dir, 0))
    GET_POS(ch) = POS_STANDING;
}
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST