outro(0);
}
-void clearscreen(void) {
- /* Somehow we need to clear the screen */
-#ifdef __BORLANDC__
- extern void clrscr(void);
- clrscr();
-#else
- if (curses) {
- wclear(stdscr);
- wrefresh(stdscr);
- } else {
- // proutn("\033[2J"); /* Hope for an ANSI display */
- /* much more in that old-TTY spirit to just throw linefeeds */
- int i;
- for (i = 0; i < screenheight; i++)
- putchar('\n');
- }
-#endif
+void waitfor(void) {
+/* wait for user action -- OK to do nothing if on a TTY */
+#ifdef SERGEEV
+ getche();
+#endif /* SERGEEV */
}
void pause_game(int i) {
+ char *prompt;
#ifndef SERGEEV
- char buf[BUFSIZ], *prompt;
+ char buf[BUFSIZ];
#else /* SERGEEV */
- char *prompt;
drawmaps(0);
setwnd(5);
#endif /* SERGEEV */
proutn(prompt);
fgets(buf, sizeof(buf), stdin);
if (i != 0) {
- clearscreen();
+ /* much more in that old-TTY spirit to throw linefeeds */
+ int j;
+ for (j = 0; j < screenheight; j++)
+ putchar('\n');
}
linecount = 0;
}
#endif /* SERGEEV */
}
+void warble(void)
+/* sound and visual effects for teleportation */
+{
+#ifdef SERGEEV
+ int posx, posy;
+ posx=wherex();
+ posy=wherey();
+ drawmaps(1);
+ setwnd(4);
+ gotoxy(posx,posy);
+ sound(50);
+ delay(1000);
+ nosound();
+#else
+ prouts(" . . . . . ");
+#endif /* SERGEEV */
+}
+
+void setpassword(void) {
#ifndef SERGEEV
-void getline(char *line, int max) {
-#else /* SERGEEV */
-void cgetline(char *line, int max) {
+ while (TRUE) {
+ scan();
+ strcpy(game.passwd, citem);
+ chew();
+ if (*game.passwd != 0) break;
+ proutn("Please type in a secret password-");
+ }
+#else
+ int i;
+ for(i=0;i<3;i++) game.passwd[i]=(char)(97+(int)(Rand()*25));
+ game.passwd[3]=0;
#endif /* SERGEEV */
+}
+
+void getline(char *line, int max) {
if (curses) {
#ifndef SERGEEV
wgetnstr(stdscr, line, max);