summaryrefslogtreecommitdiffstats
path: root/mbbsd/cal.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-24 04:14:20 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-24 04:14:20 +0800
commitb282f3c6dca2a15ef4da7ee6c1f970e5ae926b67 (patch)
treef56efde1e7cab917738b51472fc83df42c2cbf69 /mbbsd/cal.c
parent8e3a8b2bcaadc819bf4bfa5fd7d36d8701d2076c (diff)
downloadpttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.tar
pttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.tar.gz
pttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.tar.bz2
pttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.tar.lz
pttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.tar.xz
pttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.tar.zst
pttbbs-b282f3c6dca2a15ef4da7ee6c1f970e5ae926b67.zip
reoragnize functions
mprints, pprints -> mouts remove useless refresh, pressanykey(), sleep,... git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1833 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cal.c')
-rw-r--r--mbbsd/cal.c54
1 files changed, 7 insertions, 47 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c
index dca13c4d..3430ae75 100644
--- a/mbbsd/cal.c
+++ b/mbbsd/cal.c
@@ -96,18 +96,13 @@ osong(char *defaultid)
/* Jaky 一人一天點一首 */
if (!strcmp(buf, Cdatedate(&cuser.lastsong)) && !HAS_PERM(PERM_SYSOP)) {
move(22, 0);
- outs("你今天已經點過囉,明天再點吧....");
- refresh();
- pressanykey();
-
+ vmsg("你今天已經點過囉,明天再點吧....");
unlockutmpmode();
return 0;
}
if (cuser.money < 200) {
move(22, 0);
- outs("點歌要200銀唷!....");
- refresh();
- pressanykey();
+ vmsg("點歌要200銀唷!....");
unlockutmpmode();
return 0;
}
@@ -262,18 +257,12 @@ inmailbox(int m)
int
p_cloak()
{
- char buf[4];
- getdata(b_lines - 1, 0,
- currutmp->invisible ? "確定要現身?[y/N]" : "確定要隱身?[y/N]",
- buf, sizeof(buf), LCECHO);
- if (buf[0] != 'y')
+ if (getans(currutmp->invisible ? "確定要現身?[y/N]" : "確定要隱身?[y/N]") != 'y')
return 0;
if (cuser.money >= 19) {
vice(19, "付費隱身");
currutmp->invisible %= 2;
- outs((currutmp->invisible ^= 1) ? MSG_CLOAKED : MSG_UNCLOAK);
- refresh();
- safe_sleep(1);
+ vmsg((currutmp->invisible ^= 1) ? MSG_CLOAKED : MSG_UNCLOAK);
}
return 0;
}
@@ -282,10 +271,7 @@ p_cloak()
int
p_from()
{
- char ans[4];
-
- getdata(b_lines - 2, 0, "確定要改故鄉?[y/N]", ans, sizeof(ans), LCECHO);
- if (ans[0] != 'y')
+ if (getans("確定要改故鄉?[y/N]") != 'y')
return 0;
reload_money();
if (cuser.money < 49)
@@ -305,8 +291,7 @@ p_exmail()
int n;
if (cuser.exmailbox >= MAX_EXKEEPMAIL) {
- prints("容量最多增加 %d 封,不能再買了。", MAX_EXKEEPMAIL);
- refresh();
+ vmsg("容量最多增加 %d 封,不能再買了。", MAX_EXKEEPMAIL);
return 0;
}
snprintf(buf, sizeof(buf),
@@ -393,9 +378,7 @@ p_give()
snprintf(genbuf, sizeof(genbuf), "%s\t給%s\t%d\t%s",
cuser.userid, id, money - tax, ctime(&now));
log_file(FN_MONEY, genbuf, 1);
- genbuf[0] = 'n';
- getdata(3, 0, "要自行書寫紅包袋嗎?[y/N]", genbuf, 2, LCECHO);
- mail_redenvelop(cuser.userid, id, money - tax, genbuf[0]);
+ mail_redenvelop(cuser.userid, id, money - tax, getans("要自行書寫紅包袋嗎?[y/N]"));
}
return 0;
}
@@ -444,26 +427,3 @@ p_sysinfo(void)
return 0;
}
-/* 小計算機 */
-#if 0
-static void
-ccount(float *a, float b, int cmode)
-{
- switch (cmode) {
- case 0:
- case 1:
- case 2:
- *a += b;
- break;
- case 3:
- *a -= b;
- break;
- case 4:
- *a *= b;
- break;
- case 5:
- *a /= b;
- break;
- }
-}
-#endif