/* * This is my code for a speedwalk command. * It allows players to perform multiple moves with one command; i.e., * SPEEDWALK NNWWSSEEUUDD * It also allows for spaces anywhere in the direction portion * * Rob Bagsbay * galen.bbs@aug3.augsburg.edu * * In interpreter.c add the following two lines: * ACMD(do_speedwalk); * * {"speedwalk", POS_STANDING, do_speedwalk, 0, 0 }, * * Then place the following somewhere in act.movement.c after perform_move */ ACMD(do_speedwalk) { int dir, r; for (r = 1; *argument && r; argument++) { while (*argument == ' ') ++argument; switch (*argument) { case 'N': case 'n': dir = NORTH; break; case 'E': case 'e': dir = EAST; break; case 'S': case 's': dir = SOUTH; break; case 'W': case 'w': dir = WEST; break; case 'U': case 'u': dir = UP; break; case 'D': case 'd': dir = DOWN; break; default: send_to_char("Alas, you can't go that way.\r\n", ch); return; break; } r = perform_move(ch, dir, 1); if (r && *(argument + 1)) send_to_char("\r\n", ch); } }