123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- #include "ularn_ask.h"
- #include "dungeon.h"
- #include "header.h"
- #include "player.h"
- #include "ularn_game.h"
- #include "ularn_win.h"
- static int srcount = 0;
- void more(void) {
- Print("\n --- press ");
- Standout("space");
- Print(" to continue --- ");
- get_prompt_input("", " ", 0);
- }
- void clearpager(void) { srcount = 0; }
- void pager(void) {
- if (++srcount >= 22) {
- srcount = 0;
- more();
- ClearText();
- }
- }
- int getyn(void) {
- int i;
- i = get_prompt_input("", "yYnN\033 ", 1);
- if (isspace(i))
- i = ESC;
- return i;
- }
- int getpassword(void) {
- char gpwbuf[9];
- Print("\nEnter Password: ");
- get_password_input(gpwbuf, 8);
- if (strcmp(gpwbuf, password) != 0) {
- Print("\nSorry.\n");
- return 0;
- } else
- return 1;
- }
- int dirsub(int *x, int *y) {
- ActionType ans;
- int d;
- ActionType dir_order[9];
-
- dir_order[0] = ACTION_MOVE_SOUTH;
- dir_order[1] = ACTION_MOVE_EAST;
- dir_order[2] = ACTION_MOVE_NORTH;
- dir_order[3] = ACTION_MOVE_WEST;
- dir_order[4] = ACTION_MOVE_NORTHEAST;
- dir_order[5] = ACTION_MOVE_NORTHWEST;
- dir_order[6] = ACTION_MOVE_SOUTHEAST;
- dir_order[7] = ACTION_MOVE_SOUTHWEST;
- dir_order[8] = 0;
- ans = get_dir_input("\nIn What Direction? ", 1);
- d = 0;
- while (dir_order[d] != ans)
- d++;
- d++;
- Print(dirname[d]);
- *x = playerx + diroffx[d];
- *y = playery + diroffy[d];
- return d;
- }
|