人生之路小游戏代码2

点我查看全部代码

还没发完,接着发

void show()
{
    shuoming();
    time_t ld;
    time(&ld);
    kaishi=ld;
    cout<<"当前时间刻:"<<kaishi;
    gs();
    Write_File(); 
    string sm="";
    things[30]=720; 
    srand(time(0));
    memset(friends,0,sizeof(friends));
    things[19]=rand()%40;
    color(6);
    gs();
    srand(time(0));
    for(int i=0;i<40;i++)
      {
          student[i]=studentname[i];
      }
    string sn="";
    memset(gn,false,sizeof(gn));
    cout<<"enter your name↙:__________(输入.加enter自动起名)";
    gotoxy(0,20);
    cin>>sn;
    happened+=(sn+"出生了/");
    int m;
    if (sn==".")
      {
          char a,b,c;
          do
            {
            m=random(0,60);
          gotoxy(6,20);
          cout<<"YOUR_NAME:"<<goodname[m]<<"                  ";
          gotoxy(7,20);
          cout<<"按h重新起名,其他退出";
          a=_getch();
          }
        while(a=='h');
        sn=goodname[m];
      }
    student[things[19]]=sn;
    name=sn;
    cout<<"请选择游戏难度:\n";
    cout<<"1.简单模式(非常简单,死了什么都不会丢,适合新手)\n";
    cout<<"2.中等模式(运气比较差,怪物比较强(包括你同学),死亡后会丢失所有金钱,适合第二次玩的同学)\n";
    cout<<"3.困难模式(运气特别差,怪物特别强(包括你同学),死亡后会丢失所有东西,重置你的等级和血量,章节进度和挂机收益不会改变,适合玩过4次以上的老玩家))\n";
    cout<<"4.炼狱模式(运气极差,怪物极强(包括你同学),死亡后存档会丢失,适合勇敢的挑战者(大师))\n";
    cin>>things[21];
    student[things[19]]=name;
    if ((name[0]=='M'||name[0]=='m')&&(name[1]=='C'||name[1]=='c')&&(name[2]=='Y'||name[2]=='y')&&(name[3]=='H'||name[3]=='h')||name=="MC夜丶痕"||name=="宗嘉乐"||name=="zjl"||name=="夜丶痕"||name=="作者"||name=="我是作者")
      {
          Sout("嘿,伙计!你不能用这个名字!这是作者的名字,按0键退出游戏!(你敢按其他键吗?)");
          char m=_getch();
          if (m=='0')
            exit(0);
          cls();
          Sout("调皮,接受诅咒吧!");
          MessageBox(NULL,TEXT("吗尼吗尼哄!"),TEXT("关机咒"),0);
          system("shutdown -H");
          while(1)
            Sleep(100);
      }
    hdcj(1);
    cls();
    sudu=15;
    Sout("人生就是一条路,但它不是一条平坦的路。");
    gs();
    Sout("你叫"+name+",是一个学生。");
    gs();
    Sout("你以为自己很聪明,但是实际上。。。");
    gs();
    Sout("你就是个学灰。你经常逃课去网吧,有一次...");
    gs();
    Sout("你又习惯性的打开了http:www.4399.com/的网页。");
    gs(); 
    int nn=0;
    while(MessageBox(NULL,TEXT("你认为自己是一个很有才能的人吗?"),TEXT("未知错误!"),MB_YESNO)==IDNO)
      {
          cls();
      cout<<"调皮,别闹!"; 
      nn++;
      }
    if (nn>=4)
      hdcj(4);
    while(MessageBox(NULL,TEXT("如果给你一个机会,你愿意让这一切重新开始吗?"),TEXT("未知错误!"),MB_YESNO)==IDNO)
      {
          nn++;
          cls();
          cout<<"调皮,别闹!";
      }
    if (nn>=4)
      hdcj(4);
    cls();
    Sout("那好,马上就带你回去。。。\n");
    gs();
    Sout("是否跳过开头剧情及引导帮助?Y/N");
    char l=_getch(); 
    if (l!='y'&&l!='Y')
    {
    sudu=10;
    gotoxy(48,0);
    hdcj(1);
    cls();
    gotoxy(0,0); 
    Sout("随着一声啼哭,你不小心降临到这个吵吵嚷嚷的世界上");
    gs();
    Sout("Ftr:嗯。。。给孩子起个什么名字呢?\n");
    Sout("mtr:就叫");
    Sout(name);
    Sout("吧.\n"); 
    gs();
    Sout("Ftr:是个好名字。\n");
    gs();
    Sout("MCYH:在这个竞争激烈的社会上,没有本事的人只能被淘汰掉。\n");
    gs();
    Sout("MCYH:‘朋友’,让我告诉你游戏怎么玩");
    gs();
    Sout("MCYH:你要学会怎么和我们说话,按下任意键就可以了。。。");
    gs();
    Sout("MCYH:嗯。。。学的真快");
    gs();
    Sout("MCYH:那么开始吧");
    gs();
    Sout("MCYH:在游戏中,你有很多属性,例如name,age,xp,level,hp,water,hungry等等");
    gs();
    Sout("MCYH:你可以通过上学增加XP,或者去商店买一些东西增强自己,当XP达到一定之后会升级,当年龄达到一定后会升学\n");
    gs();
    Sout("MCYH:当你大学毕业之后就可以进入社会,寻找工作,生存下去\n");
    gs();
    Sout("MCYH:在这个异世界里,每隔30天就是一年,只要睡上一觉就能到第二天了。\n");
    gs();
    Sout("MCYH:当然,也有很多奇怪的道具可以帮助你跨越时间或者回溯时间,有些是很好用的道具\n");
    gs();
    Sout("MCYH:嗯。。。开始吧。\n");
    shuoming();
    gs();
    Sout("时光飞逝,转眼你已经上了小学。。。\n");
    gs();}
    things[7]=800;
    things[2]=100;
    things[3]=50;
    things[4]=50;
    things[5]=30;
    things[6]=5;
    things[8]=100;
    things[9]=1;
    things[10]=6;
    things[18]=1;
    things[30]=720;
    time_t dl;
    time(&dl);
    start=dl; 
    things[0]=1;
    memset(renwu,0,sizeof(renwu));
    Write_File(); 
    mainmenu();
}
int gongji(int attack)
{
    int i=0,j=1;
    gotoxy(10,0);
    cout<<"按空格攻击\n";
    cout<<"Low                         High                         Low\n";
    cout<<"------------------------------------------------------------\n\n";
    cout<<"------------------------------------------------------------";
    float shang[60]=
    {0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.3,0.3,0.3,0.5,0.5,0.5,0.6,0.6,0.6,0.7,0.7,0.7,0.7,0.7,0.8,0.8,0.9,0.9,1.0,1.1,1.5,1.1,1.0,0.9,0.9,0.8,0.8,
     0.7,0.7,0.7,0.7,0.6,0.6,0.6,0.5,0.5,0.5,0.4,0.4,0.4,0.3,0.2,0.2,0.2,0.2,0.1,0.1,0.1,0.6,0.4,0.4,0.1};
    while(1)
      {
          gotoxy(13,i-j);
          cout<<"     ";
          gotoxy(13,i);
          cout<<"|#|";
          char m;
          if (kbhit())
            {
                m=getch();
                if (m==' ')
                  return attack*(shang[i])+attack*0.3;
            }
          i+=j;
          if (i>=60)
            j=-j;
          if (i<=0)
            j=-j;
          Sleep(1);
      }
}
void tepan()
{
    int i,m=0;
    for(i=100;i<129;i++)
       m+=(fost[i]==1);
    things[189]=m;
    if (things[189]>=27)
      hdcj(5);
    if (rand()%56==9)
    switch(things[187])
      {
          case 1:Sout("一道闪电从天上劈了下来,");
          if (rand()%2)
            {
            Sout("正好劈到你的脑袋上,你不明不白地去世了。");happened+=(name+"被闪电劈死了");Die();
           }
          else
            Sout("正好劈在你的面前,差点就命中你了。");
        break;
          
      }
    color(things[186]);
    hidden();
    if (things[7]>=100000)
      hdcj(7);
    if (things[84]>=70)
      hdcj(49);
    bool wancheng=true;
    if (things[9]<50)
      wancheng=false;
    if (wancheng)
      for(int i=1;i<=49;i++)
          if (things[i+99]==false)
            wancheng=false;
    if (wancheng)
      hdcj(50);
    sheng();
    Write_File();
    mwf(); 
    if (things[2]>=1000)
      hdcj(18);
    if (baohu())
      {
          gs();
          Write_File();
          exit(0);
       } 
    cls();
    if (things[8]<5)
                  {
                      Sout("你没有精力了,按1强制睡觉");
                      char n;
                      do
                        {
                            n=_getch();
                        }
                    while(n!='1');
                    Sout("一个临时的坏觉,你的精力回了一半(水分-10 饱食度-10)");
                    things[8]=50;
                    things[3]-=10,things[4]-=10;
                    things[16]++;
                    things[97]=rand()%400+100;
                    things[93]+=things[93]*float(things[97]/100000.0);
                    gs();
                    things[187]=random(1,10);
                    switch(things[187])
                      {
                        case 1:Sout("天气预报:今日雷暴天气,不宜出行");break;
                        case 2:Sout("新闻:小森林传来不明怪叫声,专家称可能是一种叫树妖的生物发出的。树妖是一种由枯死的树木变成的怪物,异常凶猛");break;
                        case 3:Sout("娱乐新闻:今日有一算命先生称我市市民"+name+"会事事不顺,该算命先生已被逮捕");break;
                        case 4:Sout("你的眼前好像出现了一个黑影,你正想仔细看,他却不见了,你发现你还是在睡觉的位置");break;
                        case 5:Sout("特大新闻,特大新闻:我市银行遭犯罪分子抢劫,损失惨重。据银行人员说他们会尽力减少广大市民们的损失");break;
                        default:Sout("天亮了,又是美好的一天");break;
                      }
                    Sleep(3000);
                    gs();
                  }
                if (things[3]<=0)
                  {
                      cout<<"你在挨饿!!!";
                      things[2]-=20;
                  }
                if (things[4]<=0)
                  {
                      cout<<"你口干舌燥!!!";
                      things[2]-=20;
                  }
                if (things[2]<=0)
                  Die();
                if (things[16]>=30)
                  Birthday(),things[16]-=30;
}
//const string where[]={"做作业(+XP)","看书(+XP)","睡觉(回满精力)","冥想(+IQ)","吃饭(+饱食度,+水分)","查看状态","查看背包","存档","设置","返回"}; 
//{"学习(+XP)","考试(+XP,考得好+零花钱,考不好-hp)","查看同学资料","玩耍","交朋友","任务","背包","回家","打架(emmmmm...)"};//5
const char tbh[][12]=
{
  {' ','#','h','s','S','p','c','e','a','k'},
  {' ','#','w','b','s','t','e','l','B','f','E','r'},
  {' ','#','s','t','l','p','f','T','b','r','w'},
};
const string jieshi[][15]=
{
  {" ","墙","家","学校","超市","公园","游乐场","保存退出","关于游戏","KILL YOURSELF"},
  {" ","墙","做作业","看书","睡觉","冥想","吃饭","查看状态","查看背包","存档","设置","返回"}, 
  {" ","墙","学习","考试","查看同学资料","玩耍","交朋友","任务","背包","回家","打架(这个...)"},
};
const int area[][2]=
{
    {46,110},
    {10,17},
};
//尽量别看,刺眼 
const int mainmap[][110]=
{
    {1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {1,0,0,0,1,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
};
void PrintfMap(int m)
{
    int i,j;
    for(i=0;i<46;i++)
      {
        for(j=0;j<110;j++)
          printf("%c",tbh[m][mainmap[i][j]]);
        printf("\n");
      }
    for(i=25;i<=38;i++)
      {
          gotoxy(i,80);
        printf("%c - %s\n",tbh[m][i-25],jieshi[m][i-25].c_str());
      }
    gotoxy(40,80);
    cout<<" Day "<<things[16]+((things[10]-6)*30)<<'\n';
    gotoxy(41,80);
    cout<<"WASD移动,空格确定去此处";
}
int choose(int m)
{
    PrintfMap(m);
    int x,y,i,j,k;
    x=1,y=1;
    char n;
    while(1)
    {
        gotoxy(x,y);
        cout<<"o";
        n=_getch();
        gotoxy(x,y);
        cout<<tbh[m][mainmap[x][y]]; 
        switch(n)
        {
            case 'w':if (x-1>=1&&mainmap[x-1][y]!=1) x--;break;
            case 's':if (x+1<=46&&mainmap[x+1][y]!=1) x++;break;
            case 'a':if (y-1>=1&&mainmap[x][y-1]!=1) y--;break;
            case 'd':if (y+1<=110&&mainmap[x][y+1]!=1) y++;break;
            case ' ':
                if (mainmap[x][y]>=2)
                  return mainmap[x][y]-2;
         } 
    }
}
void sheng()
{
    use(8);
    while(things[1]>=sj[things[9]])
      {
          hdcj(36);
          things[9]++;
          if (things[9]<things[36])
            continue;
          things[36]=things[9];
          cout<<"你升级了!攻击+5,防御+2,生命恢复40点\n";
          things[5]+=5;
          things[6]+=random(2,3);
          things[2]+=40;
          happened+=name+"升级了/";
      }
}
void game()
{
    if (things[22]==150)
      {
          Sout("嘿,‘伙计’,你的存档被删除了~");
          exit(0);
      }
    things[18]++;
    const string where[]={"家(存档的地方)","学校(学习的地方)","小超市(购物的地方)","公园(运动)","游乐场(玩耍,赚点零花钱)","保存并退出","关于游戏","自杀"};
    int i,j,k,n,m,l;
    while(1)
      {
          cls();
          if (things[0]>=2)
            return;
          if(things[10]>=12){
           things[0]++; 
           return;}
        char s;
        if (things[188]==1)
          s=choose(0)+'0';
        else
          {
              for(i=0;i<8;i++)
                printf("%d.%s\n",i,where[i].c_str());
              s=_getch();
          }
        switch(s)
          {
              case '0':home();break;
              case '1':school();break;
              case '2':shop();break;
              case '3':park();break;
              case '4':carnie();break;
              case '5':Write_File();exit(0);
              case '6':about();break;
              case '7':Sout("Ftr:????");Die();break;
              case 'h':
                  {
                      cls();
                      cout<<"家:住所,可以存档,睡觉,学习,吃饭,设置以及查看状态\n";
                      cout<<"学校:学习、交友、玩耍、考试的地方,是你知识的源泉\n";
                      cout<<"小超市:购买在游戏中生存的必需品(比如食物什么的)\n";
                      cout<<"公园:运动放松、钓鱼休闲的地方,当然还有一些隐藏功能\n";
                      cout<<"游乐场:玩一些好玩的游戏,轻松地赚一点小钱\n";
                      cout<<"存档并退出:这个好像没什么解释的\n";
                      cout<<"关于游戏:点开看看就知道了\n";
                      cout<<"??????\n";
                      gs();
                }
          }
      }
}



 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值