summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-27 09:35:04 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-27 09:35:04 +0800
commit95c901b5e0ce59134b89bcc31dc52043e0bdafc3 (patch)
treed631eb450271ccf9f32ce46cd7e268a7dc790e1b /mbbsd
parentefb64bb91a13ea9f7551d8b3ae66620516e086ff (diff)
downloadpttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.tar
pttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.tar.gz
pttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.tar.bz2
pttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.tar.lz
pttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.tar.xz
pttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.tar.zst
pttbbs-95c901b5e0ce59134b89bcc31dc52043e0bdafc3.zip
complete assess
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1264 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/assess.c25
-rw-r--r--mbbsd/bbs.c10
-rw-r--r--mbbsd/talk.c11
3 files changed, 25 insertions, 21 deletions
diff --git a/mbbsd/assess.c b/mbbsd/assess.c
index 02498263..059fc078 100644
--- a/mbbsd/assess.c
+++ b/mbbsd/assess.c
@@ -1,20 +1,21 @@
#include "bbs.h"
+/* do (*num) + n, n is integer. */
inline static void inc(unsigned char *num, int n)
{
- if (SALE_MAXVALUE - *num >= n)
- (*num) += n;
- else
- (*num) = SALE_MAXVALUE;
-}
-
-inline static void dec(unsigned char *num, int n)
-{
- if (*num < n)
- (*num) -= n;
- else
- (*num) = 0;
+ if (n > 0){
+ if (SALE_MAXVALUE - *num < n)
+ (*num) = SALE_MAXVALUE;
+ else
+ (*num) += n;
+ }
+ else {
+ if (*num < n)
+ (*num) = 0;
+ else
+ (*num) -= n;
+ }
}
void inc_goodpost(int uid, int num)
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index eb4c627d..478c7a37 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1602,10 +1602,12 @@ mark_post(int ent, fileheader_t * fhdr, char *direct)
fhdr->filemode ^= FILE_MARKED;
- if (fhdr->filemode)
- inc_goodpost(searchuser(fhdr->owner), fhdr->recommend);
- else
- inc_badpost(searchuser(fhdr->owner), fhdr->recommend);
+ if (!(fhdr->filemode & FILE_BID)){
+ if (fhdr->filemode & FILE_MARKED)
+ inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10);
+ else
+ inc_goodpost(searchuser(fhdr->owner), -1 * (fhdr->recommend / 10));
+ }
substitute_record(direct, fhdr, sizeof(*fhdr), ent);
substitute_check(fhdr);
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index b1a3d712..07c94c45 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -358,11 +358,12 @@ my_query(char *uident)
26 - strlen(muser.userid) - strlen(muser.username), "",
money[i]);
if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible))
- prints(" (%d)", muser.money);
+ prints(" ($%d)", muser.money);
prints("\n");
+
prints("《上站次數》%d次", muser.numlogins);
move(2, 40);
- prints("《文章篇數》%d篇\n", muser.numposts);
+ prints("《文章篇數》%d篇 (佳作%d/劣文%d)\n", muser.numposts, muser.goodpost, muser.badpost);
prints("\033[1;33m《目前動態》%-28.28s\033[m",
(uentp && isvisible_stat(currutmp, uentp, fri_stat)) ?
@@ -374,15 +375,15 @@ my_query(char *uident)
prints("《上次上站》%-28.28s《上次故鄉》%s\n",
Cdate(&muser.lastlogin),
(muser.lasthost[0] ? muser.lasthost : "(不詳)"));
- prints("《文章評比》 優 %-3d 劣 %-3d 《競標評比》 優 %-3d 劣 %-3d\n",
- muser.goodpost, muser.badpost,
- muser.goodsale, muser.badsale);
prints("《五子棋戰績》%3d 勝 %3d 敗 %3d 和 "
"《象棋戰績》%3d 勝 %3d 敗 %3d 和\n",
muser.five_win, muser.five_lose, muser.five_tie,
muser.chc_win, muser.chc_lose, muser.chc_tie);
+ prints("《競標評比》 優 %d / 劣 %d", muser.goodsale, muser.badsale);
+ move(6, 40);
if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible))
prints("《 性 別 》%-28.28s\n", sex[muser.sex % 8]);
+
showplans(uident);
pressanykey();
return FULLUPDATE;