回精華區
作者itoc.bbs@processor.tfcis.org (核心動力) 看板: plan
標題Re: 能不能像無名的點歌計費方式 ?
時間動力核心 (2004/10/20 Wed 00:48:55) Updated: 2004/10/20
※ 引述《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 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻