- static command_t command;
- bool words_processed = false;
-
- /* Can't leave cave once it's closing (except by main office). */
- if (OUTSID(game.newloc) && game.newloc != 0 && game.closng) {
- rspeak(EXIT_CLOSED);
- game.newloc = game.loc;
- if (!game.panic)
- game.clock2 = PANICTIME;
- game.panic = true;
- }
-
- /* See if a dwarf has seen him and has come from where he
- * wants to go. If so, the dwarf's blocking his way. If
- * coming from place forbidden to pirate (dwarves rooted in
- * place) let him get out (and attacked). */
- if (game.newloc != game.loc && !FORCED(game.loc) && !CNDBIT(game.loc, COND_NOARRR)) {
- for (size_t i = 1; i <= NDWARVES - 1; i++) {
- if (game.odloc[i] == game.newloc && game.dseen[i]) {
- game.newloc = game.loc;
- rspeak(DWARF_BLOCK);
- break;
- }
- }
- }
- game.loc = game.newloc;
-
- if (!dwarfmove())
- croak();
-
- /* Describe the current location and (maybe) get next command. */
-
- for (;;) {
- if (game.loc == 0)
- croak();
- const char* msg = locations[game.loc].description.small;
- if (MOD(game.abbrev[game.loc], game.abbnum) == 0 ||
- msg == 0)
- msg = locations[game.loc].description.big;
- if (!FORCED(game.loc) && DARK(game.loc)) {
- /* The easiest way to get killed is to fall into a pit in
- * pitch darkness. */
- if (game.wzdark && PCT(35)) {
- rspeak(PIT_FALL);
- game.oldlc2 = game.loc;
- croak();
- continue; /* back to top of main interpreter loop */
- }
- msg = arbitrary_messages[PITCH_DARK];
- }
- if (TOTING(BEAR))
- rspeak(TAME_BEAR);
- speak(msg);
- if (FORCED(game.loc)) {
- playermove(HERE);
- return true;
- }
- if (game.loc == LOC_Y2 && PCT(25) && !game.closng)
- rspeak(SAYS_PLUGH);