Exemplo n.º 1
0
int pip_job_workA()
{
/*  ├————┼——————————————————————┤*/
/*  │家庭管理│待人接物 + N , 扫地洗衣 + N , 烹饪技巧 + N  │*/
/*  │        │和父亲的关系 + N , 疲劳 + 1 , 感受 - 2      │*/
/*  ├————┼——————————————————————┤*/
/*  │家庭管理│若 体    力 - RND (疲劳) >=   5 则工作成功  │*/
/*  ├————┼——————————————————————┤*/  
    float class;
    long workmoney;
    
    workmoney=0;       
    class=(d.hp*100/d.maxhp)-d.tired;        
    d.maxhp+=rand()%2;
    d.shit+=rand()%3+5;
    count_tired(3,7,"Y",100,1);
    d.hp-=(rand()%2+4);
    d.happy-=(rand()%3+4);
    d.satisfy-=rand()%3+4;
    d.affect-=7+rand()%7;
    if(d.affect<=0)
       d.affect=0;
    show_job_pic(11);
    if(class>=75)
    {
      d.cookskill+=rand()%2+7;    
      d.homework+=rand()%2+7;
      d.family+=rand()%3+4;
      d.relation+=rand()%3+4;
      workmoney=80+(d.cookskill*2+d.homework+d.family)/40;
      pressanykey("家事很成功喔..多一点钱给你..");
    }
    else if(class<75 && class>=50)
Exemplo n.º 2
0
int pip_basic_kiss()/*Ç×Ç×*/
{
     if(rand()%2>0)
       {
          d.happy+=rand()%3+4;
          d.satisfy+=rand()%2+1;
       }
     else
       {
          d.happy+=rand()%2+1;
          d.satisfy+=rand()%3+4;
       }
     count_tired(1,2,"N",100,1);
     d.shit+=rand()%5+4;
     d.relation+=rand()%2;
     move(4,0);
     show_usual_pic(3);
     if(d.shit<60)
      {
       pressanykey("À´Âï! à£Ò»¸ö.....");
      }
     else
      {
       pressanykey("Ç×Ì«¶àÒ²ÊÇ»áÔàËÀµÄà¸....");
      }
     return 0;
}
Exemplo n.º 3
0
int
pip_play_sport()
{    /*运动 */
    count_tired(3, 8, "Y", 100, 1);
    d.weight -= (rand() % 3 + 2);
    d.satisfy += rand() % 2 + 3;
    if (d.satisfy > 100)
        d.satisfy = 100;
    d.shit += rand() % 5 + 10;
    d.hp -= (rand() % 2 + 8);
    d.maxhp += rand() % 2;
    d.speed += (2 + rand() % 3);
    move(4, 0);
    show_play_pic(10);
    temppress("运动好处多多啦...");
    return 0;
}
Exemplo n.º 4
0
int
pip_play_kite()
{    /*风筝 */
    count_tired(4, 4, "Y", 100, 0);
    d.weight += (rand() % 2 + 2);
    d.satisfy += rand() % 3 + 12;
    if (d.satisfy > 100)
        d.satisfy = 100;
    d.happy += rand() % 5 + 10;
    d.shit += rand() % 5 + 6;
    d.hp -= (rand() % 2 + 7);
    d.affect += rand() % 4 + 6;
    move(4, 0);
    show_play_pic(16);
    temppress("放风筝真好玩啦...");
    return 0;
}
Exemplo n.º 5
0
int
pip_play_date()
{    /*约会 */
    if (d.money < 150) {
        temppress("你钱不够多啦! 约会总得花点钱钱");
    } else {
        count_tired(3, 6, "Y", 100, 1);
        d.happy += rand() % 5 + 12;
        d.shit += rand() % 3 + 5;
        d.hp -= rand() % 4 + 8;
        d.satisfy += rand() % 5 + 7;
        d.character += rand() % 3 + 1;
        d.money = d.money - 150;
        move(4, 0);
        show_play_pic(11);
        temppress("约会去  呼呼");
    }
    return 0;
}
Exemplo n.º 6
0
int
pip_play_KTV()
/*KTV*/
{
    if (d.money < 250) {
        temppress("你钱不够多啦! 唱歌总得花点钱钱");
    } else {
        count_tired(10, 10, "Y", 100, 0);
        d.satisfy += rand() % 2 + 20;
        if (d.satisfy > 100)
            d.satisfy = 100;
        d.happy += rand() % 3 + 20;
        d.shit += rand() % 5 + 6;
        d.money -= 250;
        d.hp += (rand() % 2 + 6);
        d.art += rand() % 4 + 3;
        move(4, 0);
        show_play_pic(17);
        temppress("你说你  想要逃...");
    }
    return 0;
}
Exemplo n.º 7
0
/*减肥*/
int pip_change_weight()
{
    char genbuf[5];
    char inbuf[256];
    int weightmp;
    
    move(b_lines-1, 0);
    clrtoeol();
    show_special_pic(2);
#ifdef MAPLE
    //% getdata(b_lines-1,1, "你的选择是? [Q]离开:", genbuf, 2, 1, 0);    
    getdata(b_lines-1,1, "\xc4\xe3\xb5\xc4\xd1\xa1\xd4\xf1\xca\xc7? [Q]\xc0\xeb\xbf\xaa:", genbuf, 2, 1, 0);    
#else
    //% getdata(b_lines-1,1, "你的选择是? [Q]离开:", genbuf, 2, DOECHO, YEA);
    getdata(b_lines-1,1, "\xc4\xe3\xb5\xc4\xd1\xa1\xd4\xf1\xca\xc7? [Q]\xc0\xeb\xbf\xaa:", genbuf, 2, DOECHO, YEA);
#endif  // END MAPLE
    if (genbuf[0]=='1'|| genbuf[0]=='2'|| genbuf[0]=='3'|| genbuf[0]=='4')
    { 
      switch(genbuf[0])
      {
        case '1':
          if(d.money<80)
          {
            //% pressanykey("传统增胖要80元喔....你不够钱啦...");
            pressanykey("\xb4\xab\xcd\xb3\xd4\xf6\xc5\xd6\xd2\xaa80\xd4\xaa\xe0\xb8....\xc4\xe3\xb2\xbb\xb9\xbb\xc7\xae\xc0\xb2...");
          }
          else
          {
#ifdef MAPLE
            //% getdata(b_lines-1,1, "需花费80元(3~5公斤),你确定吗? [y/N]", genbuf, 2, 1, 0);
            getdata(b_lines-1,1, "\xd0\xe8\xbb\xa8\xb7\xd180\xd4\xaa(3\xa1\xab5\xb9\xab\xbd\xef)\xa3\xac\xc4\xe3\xc8\xb7\xb6\xa8\xc2\xf0? [y/N]", genbuf, 2, 1, 0);
#else
            //% getdata(b_lines-1,1, "需花费80元(3~5公斤),你确定吗? [y/N]", genbuf, 2, DOECHO, YEA);
            getdata(b_lines-1,1, "\xd0\xe8\xbb\xa8\xb7\xd180\xd4\xaa(3\xa1\xab5\xb9\xab\xbd\xef)\xa3\xac\xc4\xe3\xc8\xb7\xb6\xa8\xc2\xf0? [y/N]", genbuf, 2, DOECHO, YEA);
#endif  // END MAPLE
            if(genbuf[0]=='Y' || genbuf[0]=='y')
            {
              weightmp=3+rand()%3;
              d.weight+=weightmp;
              d.money-=80;
              d.maxhp-=rand()%2;
              d.hp-=rand()%2+3;
              show_special_pic(3);
              //% sprintf(inbuf, "总共增加了%d公斤",weightmp);
              sprintf(inbuf, "\xd7\xdc\xb9\xb2\xd4\xf6\xbc\xd3\xc1\xcb%d\xb9\xab\xbd\xef",weightmp);
              pressanykey(inbuf);
            }
            else
            {
              //% pressanykey("回心转意罗.....");
              pressanykey("\xbb\xd8\xd0\xc4\xd7\xaa\xd2\xe2\xc2\xde.....");
            }
          }
          break;
          
        case '2':
#ifdef MAPLE
          //% getdata(b_lines-1,1, "增一公斤要30元,你要增多少公斤呢? [请填数字]:", genbuf, 4, 1, 0);
          getdata(b_lines-1,1, "\xd4\xf6\xd2\xbb\xb9\xab\xbd\xef\xd2\xaa30\xd4\xaa\xa3\xac\xc4\xe3\xd2\xaa\xd4\xf6\xb6\xe0\xc9\xd9\xb9\xab\xbd\xef\xc4\xd8? [\xc7\xeb\xcc\xee\xca\xfd\xd7\xd6]:", genbuf, 4, 1, 0);
#else
          //% getdata(b_lines-1,1, "增一公斤要30元,你要增多少公斤呢? [请填数字]:", genbuf, 4, DOECHO, YEA);
          getdata(b_lines-1,1, "\xd4\xf6\xd2\xbb\xb9\xab\xbd\xef\xd2\xaa30\xd4\xaa\xa3\xac\xc4\xe3\xd2\xaa\xd4\xf6\xb6\xe0\xc9\xd9\xb9\xab\xbd\xef\xc4\xd8? [\xc7\xeb\xcc\xee\xca\xfd\xd7\xd6]:", genbuf, 4, DOECHO, YEA);
#endif  // END MAPLE
          weightmp=atoi(genbuf);
          if(weightmp<=0)
          {
            //% pressanykey("输入有误..放弃罗...");          
            pressanykey("\xca\xe4\xc8\xeb\xd3\xd0\xce\xf3..\xb7\xc5\xc6\xfa\xc2\xde...");          
          }
          else if(d.money>(weightmp*30))
          {
            //% sprintf(inbuf, "增加%d公斤,总共需花费了%d元,确定吗? [y/N]",weightmp,weightmp*30);
            sprintf(inbuf, "\xd4\xf6\xbc\xd3%d\xb9\xab\xbd\xef\xa3\xac\xd7\xdc\xb9\xb2\xd0\xe8\xbb\xa8\xb7\xd1\xc1\xcb%d\xd4\xaa\xa3\xac\xc8\xb7\xb6\xa8\xc2\xf0? [y/N]",weightmp,weightmp*30);
#ifdef MAPLE
            getdata(b_lines-1,1,inbuf, genbuf, 2, 1, 0);
#else
            getdata(b_lines-1,1,inbuf, genbuf, 2, DOECHO, YEA);
#endif  // END MAPLE
            if(genbuf[0]=='Y' || genbuf[0]=='y')
            {
                d.money-=weightmp*30;
                d.weight+=weightmp;
                d.maxhp-=(rand()%2+2);
                count_tired(5,8,"N",100,1);
                d.hp-=(rand()%2+3);
                d.sick+=rand()%10+5;
                show_special_pic(3);
                //% sprintf(inbuf, "总共增加了%d公斤",weightmp);
                sprintf(inbuf, "\xd7\xdc\xb9\xb2\xd4\xf6\xbc\xd3\xc1\xcb%d\xb9\xab\xbd\xef",weightmp);
                pressanykey(inbuf);
            }
            else
            {
              //% pressanykey("回心转意罗.....");
              pressanykey("\xbb\xd8\xd0\xc4\xd7\xaa\xd2\xe2\xc2\xde.....");
            }
          }
          else
          {
            //% pressanykey("你钱没那麽多啦.......");            
            pressanykey("\xc4\xe3\xc7\xae\xc3\xbb\xc4\xc7\xf7\xe1\xb6\xe0\xc0\xb2.......");            
          }
          break;        
          
        case '3':
          if(d.money<80)
          {
            //% pressanykey("传统减肥要80元喔....你不够钱啦...");
            pressanykey("\xb4\xab\xcd\xb3\xbc\xf5\xb7\xca\xd2\xaa80\xd4\xaa\xe0\xb8....\xc4\xe3\xb2\xbb\xb9\xbb\xc7\xae\xc0\xb2...");
          }
          else
          {
#ifdef MAPLE
            //% getdata(b_lines-1,1, "需花费80元(3~5公斤),你确定吗? [y/N]", genbuf, 2, 1, 0);
            getdata(b_lines-1,1, "\xd0\xe8\xbb\xa8\xb7\xd180\xd4\xaa(3\xa1\xab5\xb9\xab\xbd\xef)\xa3\xac\xc4\xe3\xc8\xb7\xb6\xa8\xc2\xf0? [y/N]", genbuf, 2, 1, 0);
#else
            //% getdata(b_lines-1,1, "需花费80元(3~5公斤),你确定吗? [y/N]", genbuf, 2, DOECHO, YEA);
            getdata(b_lines-1,1, "\xd0\xe8\xbb\xa8\xb7\xd180\xd4\xaa(3\xa1\xab5\xb9\xab\xbd\xef)\xa3\xac\xc4\xe3\xc8\xb7\xb6\xa8\xc2\xf0? [y/N]", genbuf, 2, DOECHO, YEA);
#endif  // END MAPLE
            if(genbuf[0]=='Y' || genbuf[0]=='y')
            {
              weightmp=3+rand()%3;
              d.weight-=weightmp;
              if(d.weight<0)
                   d.weight=0;
              d.money-=100;
              d.maxhp+=rand()%2;
              d.hp-=rand()%2+3;
              show_special_pic(4);
              //% sprintf(inbuf, "总共减少了%d公斤",weightmp);
              sprintf(inbuf, "\xd7\xdc\xb9\xb2\xbc\xf5\xc9\xd9\xc1\xcb%d\xb9\xab\xbd\xef",weightmp);
              pressanykey(inbuf);
            }
            else
            {
              //% pressanykey("回心转意罗.....");
              pressanykey("\xbb\xd8\xd0\xc4\xd7\xaa\xd2\xe2\xc2\xde.....");
            }
          }        
          break;
        case '4':
#ifdef MAPLE
          //% getdata(b_lines-1,1, "减一公斤要30元,你要减多少公斤呢? [请填数字]:", genbuf, 4, 1, 0);
          getdata(b_lines-1,1, "\xbc\xf5\xd2\xbb\xb9\xab\xbd\xef\xd2\xaa30\xd4\xaa\xa3\xac\xc4\xe3\xd2\xaa\xbc\xf5\xb6\xe0\xc9\xd9\xb9\xab\xbd\xef\xc4\xd8? [\xc7\xeb\xcc\xee\xca\xfd\xd7\xd6]:", genbuf, 4, 1, 0);
#else
          //% getdata(b_lines-1,1, "减一公斤要30元,你要减多少公斤呢? [请填数字]:", genbuf, 4, DOECHO, YEA);
          getdata(b_lines-1,1, "\xbc\xf5\xd2\xbb\xb9\xab\xbd\xef\xd2\xaa30\xd4\xaa\xa3\xac\xc4\xe3\xd2\xaa\xbc\xf5\xb6\xe0\xc9\xd9\xb9\xab\xbd\xef\xc4\xd8? [\xc7\xeb\xcc\xee\xca\xfd\xd7\xd6]:", genbuf, 4, DOECHO, YEA);
#endif  // END MAPLE
          weightmp=atoi(genbuf);
          if(weightmp<=0)
          {
            //% pressanykey("输入有误..放弃罗...");
            pressanykey("\xca\xe4\xc8\xeb\xd3\xd0\xce\xf3..\xb7\xc5\xc6\xfa\xc2\xde...");
          }          
          else if(d.weight<=weightmp)
          {
            //% pressanykey("你没那麽重喔.....");
            pressanykey("\xc4\xe3\xc3\xbb\xc4\xc7\xf7\xe1\xd6\xd8\xe0\xb8.....");
          }
          else if(d.money>(weightmp*30))
          {
            //% sprintf(inbuf, "减少%d公斤,总共需花费了%d元,确定吗? [y/N]",weightmp,weightmp*30);
            sprintf(inbuf, "\xbc\xf5\xc9\xd9%d\xb9\xab\xbd\xef\xa3\xac\xd7\xdc\xb9\xb2\xd0\xe8\xbb\xa8\xb7\xd1\xc1\xcb%d\xd4\xaa\xa3\xac\xc8\xb7\xb6\xa8\xc2\xf0? [y/N]",weightmp,weightmp*30);
#ifdef MAPLE
            getdata(b_lines-1,1,inbuf, genbuf, 2, 1, 0);
#else
            getdata(b_lines-1,1,inbuf, genbuf, 2, DOECHO, YEA);
#endif  // END MAPLE
            if(genbuf[0]=='Y' || genbuf[0]=='y')
            {
                d.money-=weightmp*30;
                d.weight-=weightmp;
                d.maxhp-=(rand()%2+2);
                count_tired(5,8,"N",100,1);
                d.hp-=(rand()%2+3);
                d.sick+=rand()%10+5;
                show_special_pic(4);
                //% sprintf(inbuf, "总共减少了%d公斤",weightmp);
                sprintf(inbuf, "\xd7\xdc\xb9\xb2\xbc\xf5\xc9\xd9\xc1\xcb%d\xb9\xab\xbd\xef",weightmp);
                pressanykey(inbuf);
            }
            else
            {
              //% pressanykey("回心转意罗.....");
              pressanykey("\xbb\xd8\xd0\xc4\xd7\xaa\xd2\xe2\xc2\xde.....");
            }
          }
          else
          {
            //% pressanykey("你钱没那麽多啦.......");            
            pressanykey("\xc4\xe3\xc7\xae\xc3\xbb\xc4\xc7\xf7\xe1\xb6\xe0\xc0\xb2.......");            
          }
          break;
      }
    }
    return 0;
}
Exemplo n.º 8
0
int
pip_play_stroll()
{    /*散步 */
    int lucky;

    count_tired(3, 3, "Y", 100, 0);
    lucky = rand() % 7;
    if (lucky == 2) {
        d.happy += rand() % 3 + rand() % 3 + 9;
        d.satisfy += rand() % 3 + rand() % 3 + 3;
        d.shit += rand() % 3 + 3;
        d.hp -= (rand() % 3 + 5);
        move(4, 0);
        if (rand() % 2 > 0)
            show_play_pic(1);
        else
            show_play_pic(2);
        temppress("遇到朋友罗  真好.... ^_^");
    } else if (lucky == 3) {
        d.money += 100;
        d.happy += rand() % 3 + 6;
        d.satisfy += rand() % 3 + 4;
        d.shit += rand() % 3 + 3;
        d.hp -= (rand() % 3 + 4);
        move(4, 0);
        show_play_pic(3);
        temppress("捡到了100元了..耶耶耶....");
    }

    else if (lucky == 4) {
        if (rand() % 2 > 0) {
            d.happy -= (rand() % 2 + 5);
            move(4, 0);
            d.hp -= (rand() % 3 + 3);
            show_play_pic(4);
            if (d.money >= 50) {
                d.money -= 50;
                temppress("掉了50元了..呜呜呜....");
            } else {
                d.money = 0;
                d.hp -= (rand() % 3 + 3);
                temppress("钱掉光光了..呜呜呜....");
            }
            d.shit += rand() % 3 + 2;
        } else {
            d.happy += rand() % 3 + 5;
            move(4, 0);
            show_play_pic(5);
            if (d.money >= 50) {
                d.money -= 50;
                d.hp -= (rand() % 3 + 3);
                temppress("用了50元了..不可以骂我喔....");
            } else {
                d.money = 0;
                d.hp -= (rand() % 3 + 3);
                temppress("钱被我偷用光光了..:p");
            }
            d.shit += rand() % 3 + 2;
        }
    } else if (lucky == 5) {
        d.happy += rand() % 3 + 6;
        d.satisfy += rand() % 3 + 5;
        d.shit += 2;
        move(4, 0);
        if (rand() % 2 > 0)
            show_play_pic(6);
        else
            show_play_pic(7);
        temppress("好棒喔捡到玩具了说.....");
    } else if (lucky == 6) {
        d.happy -= (rand() % 3 + 10);
        d.shit += (rand() % 3 + 20);
        move(4, 0);
        show_play_pic(9);
        temppress("真是倒楣  可以去买爱国奖券");
    } else {
        d.happy += rand() % 3 + 3;
        d.satisfy += rand() % 2 + 1;
        d.shit += rand() % 3 + 2;
        d.hp -= (rand() % 3 + 2);
        move(4, 0);
        show_play_pic(8);
        temppress("没有特别的事发生啦.....");
    }
    return 0;
}
Exemplo n.º 9
0
int
pip_play_guess()
{    /* 猜拳程式 */
    int com;
    int pipkey;
    struct tm *qtime;
    time_t now;

    time(&now);
    qtime = localtime(&now);
    d.satisfy += (rand() % 3 + 2);
    count_tired(2, 2, "Y", 100, 1);
    d.shit += rand() % 3 + 2;
    do {
        if (d.death == 1 || d.death == 2 || d.death == 3)
            return 0;
        if (pip_mainmenu(0))
            return 0;
        move(b_lines - 2, 0);
        clrtoeol();
        move(b_lines, 0);
        clrtoeol();
        move(b_lines, 0);
        prints
        ("\033[1;44;37m  猜拳选单  \033[46m[1]我出剪刀 [2]我出石头 [3]我出布啦 [4]猜拳记录 [Q]跳出:         \033[m");
        move(b_lines - 1, 0);
        clrtoeol();
        pipkey = igetkey();
        switch (pipkey) {
#ifdef MAPLE
            case Ctrl('R'):
                if (currutmp->msgs[0].last_pid) {
                    show_last_call_in();
                    my_write(currutmp->msgs[0].last_pid,
                             "水球丢回去:");
                }
                break;
#endif    // END MAPLE
            case '4':
                situ();
                break;
        }
    } while ((pipkey != '1') && (pipkey != '2') && (pipkey != '3')
             && (pipkey != 'q') && (pipkey != 'Q'));

    com = rand() % 3;
    move(18, 0);
    clrtobot();
    switch (com) {
        case 0:
            outs("小鸡:剪刀\n");
            break;
        case 1:
            outs("小鸡:石头\n");
            break;
        case 2:
            outs("小鸡:布\n");
            break;
    }

    move(17, 0);

    switch (pipkey) {
        case '1':
            outs("你  :剪刀\n");
            if (com == 0)
                tie();
            else if (com == 1)
                lose();
            else if (com == 2)
                win();
            break;
        case '2':
            outs("你 :石头\n");
            if (com == 0)
                win();
            else if (com == 1)
                tie();
            else if (com == 2)
                lose();
            break;
        case '3':
            outs("你 :布\n");
            if (com == 0)
                lose();
            else if (com == 1)
                win();
            else if (com == 2)
                tie();
            break;
        case 'q':
            break;
    }
    return 0;
}
Exemplo n.º 10
0
int
pip_play_outing()
{    /*郊游 */
    int lucky;
    char buf[256];

    if (d.money < 250) {
        temppress("你钱不够多啦! 旅游总得花点钱钱");
    } else {
        d.weight += rand() % 2 + 1;
        d.money -= 250;
        count_tired(10, 45, "N", 100, 0);
        d.hp -= rand() % 10 + 20;
        if (d.hp >= d.maxhp)
            d.hp = d.maxhp;
        d.happy += rand() % 10 + 12;
        d.character += rand() % 5 + 5;
        d.satisfy += rand() % 10 + 10;
        lucky = rand() % 4;
        if (lucky == 0) {
            d.maxmp += rand() % 3;
            d.art += rand() % 2;
            show_play_pic(12);
            if (rand() % 2 > 0)
                temppress
                ("心中有一股淡淡的感觉  好舒服喔....");
            else
                temppress("云水 闲情 心情好多了.....");
        } else if (lucky == 1) {
            d.art += rand() % 3;
            d.maxmp += rand() % 2;
            show_play_pic(13);
            if (rand() % 2 > 0)
                temppress
                ("有山有水有落日  形成一幅美丽的画..");
            else
                temppress("看着看着  全身疲惫都不见罗..");
        } else if (lucky == 2) {
            d.love += rand() % 3;
            show_play_pic(14);
            if (rand() % 2 > 0)
                temppress("看  太阳快没入水中罗...");
            else
                temppress("听说这是海边啦  你说呢?");
        } else if (lucky == 3) {
            d.maxhp += rand() % 3;
            show_play_pic(15);
            if (rand() % 2 > 0)
                temppress
                ("让我们疯狂在夜里的海滩吧....呼呼..");
            else
                temppress
                ("凉爽的海风迎面袭来  最喜欢这种感觉了....");
        }
        if ((rand() % 301 + rand() % 200) % 100 == 12) {
            lucky = 0;
            clear();
            sprintf(buf,
                    "\033[1;41m  星空战斗鸡 ~ %-10s                                                    \033[0m",
                    d.name);
            show_play_pic(0);
            move(17, 10);
            prints("\033[1;36m亲爱的 \033[1;33m%s ~\033[0m", d.name);
            move(18, 10);
            prints
            ("\033[1;37m看到你这样努力的培养自己的能力  让我心中十分的高兴喔..\033[m");
            move(19, 10);
            prints
            ("\033[1;36m小天使我决定给你奖赏鼓励鼓励  偷偷地帮助你一下....^_^\033[0m");
            move(20, 10);
            lucky = rand() % 7;
            if (lucky == 6) {
                prints
                ("\033[1;33m我将帮你的各项能力全部提升百分之五喔......\033[0m");
                d.maxhp = d.maxhp * 105 / 100;
                d.hp = d.maxhp;
                d.maxmp = d.maxmp * 105 / 100;
                d.mp = d.maxmp;
                d.attack = d.attack * 105 / 100;
                d.resist = d.resist * 105 / 100;
                d.speed = d.speed * 105 / 100;
                d.character = d.character * 105 / 100;
                d.love = d.love * 105 / 100;
                d.wisdom = d.wisdom * 105 / 100;
                d.art = d.art * 105 / 100;
                d.brave = d.brave * 105 / 100;
                d.homework = d.homework * 105 / 100;
            }

            else if (lucky <= 5 && lucky >= 4) {
                prints
                ("\033[1;33m我将帮你的战斗能力全部提升百分之十喔.......\033[0m");
                d.attack = d.attack * 110 / 100;
                d.resist = d.resist * 110 / 100;
                d.speed = d.speed * 110 / 100;
                d.brave = d.brave * 110 / 100;
            }

            else if (lucky <= 3 && lucky >= 2) {
                prints
                ("\033[1;33m我将帮你的魔法能力和生命力全部提升百分之十喔.......\033[0m");
                d.maxhp = d.maxhp * 110 / 100;
                d.hp = d.maxhp;
                d.maxmp = d.maxmp * 110 / 100;
                d.mp = d.maxmp;
            } else if (lucky <= 1 && lucky >= 0) {
                prints
                ("\033[1;33m我将帮你的感受能力全部提升百分之二十喔....\033[0m");
                d.character = d.character * 110 / 100;
                d.love = d.love * 110 / 100;
                d.wisdom = d.wisdom * 110 / 100;
                d.art = d.art * 110 / 100;
                d.homework = d.homework * 110 / 100;
            }

            temppress("请继续加油喔...");
        }
    }
    return 0;
}
Exemplo n.º 11
0
static int			/* 回傳 歲數 */
pip_time_update()
{
  int oldtm, tm;

  /* 固定時間做的事 */

  if ((time(0) - last_time) >= PIP_CHECK_PERIOD)
  {
    do
    {
      d.shit += rand() % 3 + 3;		/* 不做事,還是會變髒的 */
      d.tired -= 2;			/* 不做事,疲勞當然減低啦 */
      d.sick += rand() % 4 - 2;		/* 不做事,病氣會隨機率增加減少或增加少許 */
      d.happy += rand() % 4 - 2;	/* 不做事,快樂會隨機率增加減少或增加少許 */
      d.satisfy += rand() % 4 - 2;	/* 不做事,滿足會隨機率增加減少或增加少許 */
      d.hp -= rand() % 3 + d.sick / 10;	/* 不做事,肚子也會餓咩,也會因生病降低一點 */

      last_time += PIP_CHECK_PERIOD;	/* 下次更新時間 */
    } while ((time(0) - last_time) >= PIP_CHECK_PERIOD);

    /* 檢查年齡 */

    oldtm = d.bbtime / 60 / 30;			/* 更新前幾歲了 */
    d.bbtime += time(0) - start_time;		/* 更新小雞的時間(年齡) */
    start_time = time(0);
    tm = d.bbtime / 60 / 30;			/* 更新後幾歲了 */

    /* itoc.010815.註解: 如果小雞一直在次選單中(例如戰鬥修行),
       那麼會因為很久(超過30分鐘即一歲)沒有執行 pip_time_update() 而一次加好多歲 */

    /* itoc.010815: 一次過好多歲會少加好多次過生日的好處,不予修正,作為虐待小雞的處罰 :p */

    if (tm != oldtm)		/* 歲數更新前後如果不同,表示長大了 */
    {
      /* 長大時的增加改變值 */
      count_tired(1, 7, 0, 100, 0);	/* 恢復疲勞 */
      d.happy += rand() % 5 + 5;
      d.satisfy += rand() % 5;
      d.wisdom += 10;
      d.character += rand() % 5;
      d.money += 500;
      d.seeroyalJ = 1;			/* 一年可以見王子一次 */
      pip_write_file();			/* 自動儲存 */

      vs_head("電子養小雞", str_site);
      show_basic_pic(20);		/* 生日快樂 */
      vmsg("小雞過生日了");

      /* 收穫季 */
      if (tm % 2 == 0)		/* 二年一次收穫季 */
        pip_race_main();

      /* 結局 */
      if (tm >= 21 && (d.wantend == 4 || d.wantend == 5 || d.wantend == 6))	/* 玩到 20 歲 */
        pip_ending_screen();
    }
  }
  else
  {
    tm = d.bbtime / 60 / 30;	/* 如果沒有 update,也要回傳 tm(歲數) */
  }

  /* 偶發事件 */

  oldtm = rand() % 2000;	/* 借用 oldtm 做亂數 */
  if (oldtm == 0 && tm >= 15 && d.charm >= 300 && d.character >= 300)
    pip_marriage_offer();	/* 商人來求婚 */
  else if (oldtm > 1998)
    pip_meet_divine();		/* 隨機遇到占卜師 */
  else if (oldtm > 1996)
    pip_meet_sysop();		/* 隨機遇到 SYSOP */
  else if (oldtm > 1994)
    pip_meet_smith();		/* 隨機遇到鐵匠 */

  /* 檢查一些常變動的值是否爆掉 */
  /* itoc.010815: 在 pip_time_update() 中不必檢查 shit/tired/sick >100 或 happy/satisfy/hp < 0
     而在 pip_refresh_screen() 檢查並順道宣告死亡 */

  if (d.shit < 0)
    d.shit = 0;
  if (d.tired < 0)
    d.tired = 0;
  if (d.sick < 0)
    d.sick = 0;

  if (d.happy > 100)
    d.happy = 100;
  if (d.satisfy > 100)
    d.satisfy = 100;
  if (d.hp > d.maxhp)
    d.hp = d.maxhp;

  return tm;
}