summaryrefslogtreecommitdiffstats
path: root/mbbsd/dark.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/dark.c')
-rw-r--r--mbbsd/dark.c46
1 files changed, 19 insertions, 27 deletions
diff --git a/mbbsd/dark.c b/mbbsd/dark.c
index 4c9c6486..e26dd890 100644
--- a/mbbsd/dark.c
+++ b/mbbsd/dark.c
@@ -1,4 +1,4 @@
-/* $Id: dark.c,v 1.8 2002/07/22 19:02:00 in2 Exp $ */
+/* $Id$ */
#include "bbs.h"
#define RED 1
@@ -33,14 +33,6 @@ brdswap(sint y, sint x, sint ly, sint lx)
brd[ly][lx].value = -1;
}
-static void
-pprints(sint y, sint x, char *s)
-{
- move(y, x);
- clrtoeol();
- prints("%s", s);
-}
-
static sint
Is_win(item att, item det, sint y, sint x, sint ly, sint lx)
{
@@ -370,11 +362,11 @@ main_dark(int fd, userinfo_t * uin)
if (currutmp->turn) {
brd_rand();
send(fd, &brd, sizeof(brd), 0);
- pprints(21, 0, " ���A�O����");
- pprints(22, 0, " ������A�U�F");
+ mouts(21, 0, " ���A�O����");
+ mouts(22, 0, " ������A�U�F");
} else {
recv(fd, &brd, sizeof(brd), 0);
- pprints(21, 0, " ���A�O���");
+ mouts(21, 0, " ���A�O���");
}
move(12, 3);
prints("%s[0��0��]����.%s[0��0��]", currutmp->userid, currutmp->mateid);
@@ -396,7 +388,7 @@ main_dark(int fd, userinfo_t * uin)
end = -1;
break;
}
- ch = igetkey();
+ ch = igetch();
if (ch == I_OTHERDATA) {
ch = recv(fd, &curr, sizeof(curr), 0);
if (ch != sizeof(curr)) {
@@ -412,20 +404,20 @@ main_dark(int fd, userinfo_t * uin)
break;
}
if (curr.end == -3)
- pprints(23, 30, "\033[33m�n�D�X��\033[m");
+ mouts(23, 30, "\033[33m�n�D�X��\033[m");
else if (curr.end == -4)
- pprints(23, 30, "\033[33m�n�D����\033[m");
+ mouts(23, 30, "\033[33m�n�D����\033[m");
else if (curr.end == -5)
- pprints(23, 30, "\033[33m�n�D�s�Y\033[m");
+ mouts(23, 30, "\033[33m�n�D�s�Y\033[m");
else
- pprints(23, 30, "");
+ mouts(23, 30, "");
recv(fd, &brd, sizeof(brd), 0);
my = curr.y;
mx = curr.x;
redraw();
if (curr.end)
- pprints(22, 0, " ������A�U�F");
+ mouts(22, 0, " ������A�U�F");
move(cury[my], curx[mx]);
} else {
if (currutmp->turn == 'p') {
@@ -434,7 +426,7 @@ main_dark(int fd, userinfo_t * uin)
currutmp->turn = 'e';
break;
} else {
- pprints(23, 30, "");
+ mouts(23, 30, "");
*buf = 0;
currutmp->turn = (uin->turn) ? 0 : 1;
}
@@ -442,17 +434,17 @@ main_dark(int fd, userinfo_t * uin)
if (ch == 'y') {
currutmp->color = (currutmp->color == '1') ? '0' : '1';
uin->color = (uin->color == '1') ? '0' : '1';
- pprints(21, 0, (currutmp->color == '1') ? " \033[1;33m���A�������\033[m" : " \033[1;33m���A���¦��\033[m");
+ mouts(21, 0, (currutmp->color == '1') ? " \033[1;33m���A�������\033[m" : " \033[1;33m���A���¦��\033[m");
} else {
- pprints(23, 30, "");
+ mouts(23, 30, "");
currutmp->turn = (uin->turn) ? 0 : 1;
}
} else if (currutmp->turn == 'g') {
if (ch == 'y') {
cont = 1;
- pprints(21, 0, " \033[1;33m���A�������\033[m �i�s�Y");
+ mouts(21, 0, " \033[1;33m���A�������\033[m �i�s�Y");
} else {
- pprints(23, 30, "");
+ mouts(23, 30, "");
currutmp->turn = (uin->turn) ? 0 : 1;
}
}
@@ -460,7 +452,7 @@ main_dark(int fd, userinfo_t * uin)
if (uin->turn == 'g') {
cont = 1;
uin->turn = (currutmp->turn) ? 0 : 1;
- pprints(21, 10, "�i�s�Y");
+ mouts(21, 10, "�i�s�Y");
}
end = playing(fd, currutmp->color - '0', ch, &go_on, uin);
@@ -493,12 +485,12 @@ main_dark(int fd, userinfo_t * uin)
continue;
}
if (!i && currutmp->color == '1') {
- pprints(21, 0, " \033[1;33m���A�������\033[m");
+ mouts(21, 0, " \033[1;33m���A�������\033[m");
i++;
move(cury[my], curx[mx]);
}
if (!i && currutmp->color == '0') {
- pprints(21, 0, " \033[1;33m���A���¦��\033[m");
+ mouts(21, 0, " \033[1;33m���A���¦��\033[m");
i++;
move(cury[my], curx[mx]);
}
@@ -540,7 +532,7 @@ main_dark(int fd, userinfo_t * uin)
}
break;
case -3:
- pprints(22, 0, "�X�ѭ�!! �U���b�����U�a ^_^");
+ mouts(22, 0, "�X�ѭ�!! �U���b�����U�a ^_^");
break;
default:
add_io(0, 0);