Restructure quips for invalid movements.
This commit is contained in:
parent
386ca2b8d2
commit
d739c111d7
2 changed files with 36 additions and 21 deletions
|
@ -204,9 +204,9 @@ motions: !!omap
|
|||
words: ['east', 'e']
|
||||
- WEST:
|
||||
words: ['west', 'w']
|
||||
- MOT_45:
|
||||
- NORTH:
|
||||
words: ['north', 'n']
|
||||
- MOT_46:
|
||||
- SOUTH:
|
||||
words: ['south', 's']
|
||||
- NE:
|
||||
words: ['ne']
|
||||
|
|
53
main.c
53
main.c
|
@ -604,25 +604,40 @@ static void playermove( int motion)
|
|||
if (travel[travel_entry].stop) {
|
||||
/* Couldn't find an entry matching the motion word passed
|
||||
* in. Various messages depending on word given. */
|
||||
int spk = CANT_APPLY;
|
||||
if (motion >= EAST && motion <= NW)
|
||||
spk = BAD_DIRECTION;
|
||||
if (motion == UP ||
|
||||
motion == DOWN)
|
||||
spk = BAD_DIRECTION;
|
||||
if (motion == FORWARD ||
|
||||
motion == LEFT ||
|
||||
motion == RIGHT)
|
||||
spk = UNSURE_FACING;
|
||||
if (motion == OUTSIDE ||
|
||||
motion == INSIDE)
|
||||
spk = NO_INOUT_HERE;
|
||||
if (motion == XYZZY ||
|
||||
motion == PLUGH)
|
||||
spk = NOTHING_HAPPENS;
|
||||
if (motion == CRAWL)
|
||||
spk = WHICH_WAY;
|
||||
rspeak(spk);
|
||||
switch (motion) {
|
||||
case EAST:
|
||||
case WEST:
|
||||
case SOUTH:
|
||||
case NORTH:
|
||||
case NE:
|
||||
case NW:
|
||||
case SW:
|
||||
case SE:
|
||||
rspeak(BAD_DIRECTION);
|
||||
break;
|
||||
case UP:
|
||||
case DOWN:
|
||||
rspeak(BAD_DIRECTION);
|
||||
break;
|
||||
case FORWARD:
|
||||
case LEFT:
|
||||
case RIGHT:
|
||||
rspeak(UNSURE_FACING);
|
||||
break;
|
||||
case OUTSIDE:
|
||||
case INSIDE:
|
||||
rspeak(NO_INOUT_HERE);
|
||||
break;
|
||||
case XYZZY:
|
||||
case PLUGH:
|
||||
rspeak(NOTHING_HAPPENS);
|
||||
break;
|
||||
case CRAWL:
|
||||
rspeak(WHICH_WAY);
|
||||
break;
|
||||
default:
|
||||
rspeak(CANT_APPLY);
|
||||
}
|
||||
return;
|
||||
}
|
||||
++travel_entry;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue