- switch(k) /* get the token from the input and switch on it */
- {
- case 'h': moveplayer(4); return; /* west */
- case 'H': run(4); return; /* west */
- case 'l': moveplayer(2); return; /* east */
- case 'L': run(2); return; /* east */
- case 'j': moveplayer(1); return; /* south */
- case 'J': run(1); return; /* south */
- case 'k': moveplayer(3); return; /* north */
- case 'K': run(3); return; /* north */
- case 'u': moveplayer(5); return; /* northeast */
- case 'U': run(5); return; /* northeast */
- case 'y': moveplayer(6); return; /* northwest */
- case 'Y': run(6); return; /* northwest */
- case 'n': moveplayer(7); return; /* southeast */
- case 'N': run(7); return; /* southeast */
- case 'b': moveplayer(8); return; /* southwest */
- case 'B': run(8); return; /* southwest */
-
- case '.': if (yrepcount) viewflag=1; return; /* stay here */
-
- case 'w': yrepcount=0; wield(); return; /* wield a weapon */
-
- case 'W': yrepcount=0; wear(); return; /* wear armor */
-
- case 'r': yrepcount=0;
- if (c[BLINDCOUNT]) { cursors(); lprcat("\nYou can't read anything when you're blind!"); } else
- if (c[TIMESTOP]==0) readscr(); return; /* to read a scroll */
-
- case 'q': yrepcount=0; if (c[TIMESTOP]==0) quaff(); return; /* quaff a potion */
-
- case 'd': yrepcount=0; if (c[TIMESTOP]==0) dropobj(); return; /* to drop an object */
-
- case 'c': yrepcount=0; cast(); return; /* cast a spell */
-
- case 'i': yrepcount=0; nomove=1; showstr(); return; /* status */
-
- case 'e': yrepcount=0;
- if (c[TIMESTOP]==0) eatcookie(); return; /* to eat a fortune cookie */
-
- case 'D': yrepcount=0; seemagic(0); nomove=1; return; /* list spells and scrolls */
-
- case '?': yrepcount=0; help(); nomove=1; return; /* give the help screen*/
-
- case 'S': clear(); lprcat("Saving . . ."); lflush();
- savegame(savefilename); wizard=1; died(-257); /* save the game - doesn't return */
-
- case 'Z': yrepcount=0; if (c[LEVEL]>9) { oteleport(1); return; }
- cursors(); lprcat("\nAs yet, you don't have enough experience to use teleportation");
- return; /* teleport yourself */
-
- case '^': /* identify traps */ flag=yrepcount=0; cursors();
- lprc('\n'); for (j=playery-1; j<playery+2; j++)
- {
- if (j < 0) j=0; if (j >= MAXY) break;
- for (i=playerx-1; i<playerx+2; i++)
- {
- if (i < 0) i=0; if (i >= MAXX) break;
- switch(item[i][j])
- {
- case OTRAPDOOR: case ODARTRAP:
- case OTRAPARROW: case OTELEPORTER:
- lprcat("\nIts "); lprcat(objectname[item[i][j]]); flag++;
- };
- }
- }
- if (flag==0) lprcat("\nNo traps are visible");
- return;
+ switch (k) { /* get the token from the input and switch on
+ * it */
+ case 'h':
+ moveplayer(4);
+ return; /* west */
+ case 'H':
+ run(4);
+ return; /* west */
+ case 'l':
+ moveplayer(2);
+ return; /* east */
+ case 'L':
+ run(2);
+ return; /* east */
+ case 'j':
+ moveplayer(1);
+ return; /* south */
+ case 'J':
+ run(1);
+ return; /* south */
+ case 'k':
+ moveplayer(3);
+ return; /* north */
+ case 'K':
+ run(3);
+ return; /* north */
+ case 'u':
+ moveplayer(5);
+ return; /* northeast */
+ case 'U':
+ run(5);
+ return; /* northeast */
+ case 'y':
+ moveplayer(6);
+ return; /* northwest */
+ case 'Y':
+ run(6);
+ return; /* northwest */
+ case 'n':
+ moveplayer(7);
+ return; /* southeast */
+ case 'N':
+ run(7);
+ return; /* southeast */
+ case 'b':
+ moveplayer(8);
+ return; /* southwest */
+ case 'B':
+ run(8);
+ return; /* southwest */
+
+ case '.':
+ if (yrepcount)
+ viewflag = 1;
+ return; /* stay here */
+
+ case 'w':
+ yrepcount = 0;
+ wield();
+ return; /* wield a weapon */
+
+ case 'W':
+ yrepcount = 0;
+ wear();
+ return; /* wear armor */
+
+ case 'r':
+ yrepcount = 0;
+ if (c[BLINDCOUNT]) {
+ cursors();
+ lprcat("\nYou can't read anything when you're blind!");
+ } else if (c[TIMESTOP] == 0)
+ readscr();
+ return; /* to read a scroll */
+
+ case 'q':
+ yrepcount = 0;
+ if (c[TIMESTOP] == 0)
+ quaff();
+ return; /* quaff a potion */
+
+ case 'd':
+ yrepcount = 0;
+ if (c[TIMESTOP] == 0)
+ dropobj();
+ return; /* to drop an object */
+
+ case 'c':
+ yrepcount = 0;
+ cast();
+ return; /* cast a spell */
+
+ case 'i':
+ yrepcount = 0;
+ nomove = 1;
+ showstr();
+ return; /* status */
+
+ case 'e':
+ yrepcount = 0;
+ if (c[TIMESTOP] == 0)
+ eatcookie();
+ return; /* to eat a fortune cookie */
+
+ case 'D':
+ yrepcount = 0;
+ seemagic(0);
+ nomove = 1;
+ return; /* list spells and scrolls */
+
+ case '?':
+ yrepcount = 0;
+ help();
+ nomove = 1;
+ return; /* give the help screen */
+
+ case 'S':
+ clear();
+ lprcat("Saving . . .");
+ lflush();
+ savegame(savefilename);
+ wizard = 1;
+ died(-257); /* save the game - doesn't return */
+ __unreachable();
+
+ case 'Z':
+ yrepcount = 0;
+ if (c[LEVEL] > 9) {
+ oteleport(1);
+ return;
+ }
+ cursors();
+ lprcat("\nAs yet, you don't have enough experience to use teleportation");
+ return; /* teleport yourself */
+
+ case '^': /* identify traps */
+ flag = yrepcount = 0;
+ cursors();
+ lprc('\n');
+ for (j = playery - 1; j < playery + 2; j++) {
+ if (j < 0)
+ j = 0;
+ if (j >= MAXY)
+ break;
+ for (i = playerx - 1; i < playerx + 2; i++) {
+ if (i < 0)
+ i = 0;
+ if (i >= MAXX)
+ break;
+ switch (item[i][j]) {
+ case OTRAPDOOR:
+ case ODARTRAP:
+ case OTRAPARROW:
+ case OTELEPORTER:
+ lprcat("\nIt's ");
+ lprcat(objectname[item[i][j]]);
+ flag++;
+ };
+ }
+ }
+ if (flag == 0)
+ lprcat("\nNo traps are visible");
+ return;