※ 引述《allean.bbs@micro.bio.ncue.edu.tw (allean)》之銘言:
> 點一首歌 100 塊 匿名酌收一千
> 點多首歌時 第一首 1000 塊
> 第 i首 10+1000(i-1)塊
: song.c:song_order()
- if (count_ktv() >= 3) /* 限制點三首 */
- {
- vmsg("過去二十四小時內您已點選過多歌曲");
- return XO_FOOT;
- }
- if (cuser.money < 1000)
- {
- vmsg("要 1000 銀幣才能點歌到看板喔");
- return XO_FOOT;
- }
...
...
annoy = vans("想要匿名嗎(Y/N)?[N] ") == 'y';
+ fd = count_ktv() * 1000 + 100; /* 點第i首要花 100+1000*i 元 */
+ if (annoy)
+ fd += 500; /* 匿名再加 500 */
+ if (cuser.money < fd)
+ {
+ sprintf(buf, "要 %d 銀幣才能點歌到看板喔", fd);
+ vmsg(buf);
+ return XO_FOOT;
+ }
...
...
- cuser.money -= 1000;
+ cuser.monery -= fd;
--
╭┼ Origin: Maple-itoc˙動力核心 processor.tfcis.org
┼┘ Author: itoc 從 itoc.Dorm11.NCTU.edu.tw 發表