1.1 C++小游戏——创造世界

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#define s Sleep(800);
using namespace std;
int live=5,strength=5;
string bag[100];
int bagi;
void village()
{
    system("cls");
    cout<<"1、村庄任务"<<endl;
    cout<<"2、寻找村庄失踪人(未开放)"<<endl;
    cout<<"3、打村庄封印怪(未开放)"<<endl;
    cout<<"其他:走出村庄"<<endl;
    char bbb;
    bbb=getch();
    if(bbb=='1')
    {
        while(1)
        {
            system("cls");
            cout<<"1、帮助村民捕三条鱼——3点体力值"<<endl;
            cout<<"其他:退出"<<endl;
            char cc;
            cc=getch();
            if(cc=='1')
            {
                int ge=0; 
                while(1)
                {
                    system("cls");
                    cout<<"地点:河流(番外篇)"<<endl;
                    cout<<"1、捞网    其他:退出"<<endl;
                    char fish;
                    fish=getch();
                    if(fish=='1')
                    {
                        int catch_or_not=rand()%100;
                        if(catch_or_not<33)
                        {
                            cout<<"你捞到了一条鱼"<<endl;
                            ge++;
                        }
                        else
                        {
                            cout<<"鱼跑了。"<<endl;
                        }
                        cout<<"按任意键继续";
                        char cccc;
                        cccc=getch();
                    }
                    else
                    {
                        break;
                    }
                }
                if(ge>=3)
                {
                    cout<<"恭喜您完成任务!"<<endl;
                    strength+=3;
                    cout<<"按任意键继续";
                    char dddd;
                    dddd=getch();
                }
            }
            else
            {
                break;
            }
        }
    }
    /* 
    if(bbb=='2')
    {
        cout<<"1、村长——+3格血"<<endl;
        cout<<"2、神秘贸易员——+2格血"<<endl;
        cout<<"3、律师——+1格血"<<endl;
        char people;
        people=getch();
        while(people!='1'&&people!='2'&&people!='3')
        {
            cout<<"1、村长——+3格血"<<endl;
            cout<<"2、神秘贸易员——+2格血"<<endl;
            cout<<"3、律师——+1格血"<<endl;
            people=getch();
        }
        if(people=='1')
        {
            while(1)
            {
                cout<<"向前:F        向后:B        向左:L        向右:R"<<endl;
                char sit;
                sit=getch();
                while(sit!='F'&&sit!='B'&&sit!='L'&&sit!='R')
                {
                    cout<<"向前:F        向后:B        向左:L        向右:R"<<endl;
                    sit=getch();
                }
                int cz=rand()%100;
                if(sit=='F')
                {
                    if(cz<5)
                    {
                        cout<<"恭喜你,找到了村长!!!,生命值+3"<<endl;
                        live+=3; 
                    }
                    cout<<"按任意键继续"<<endl;
                    char yyds;
                    yyds=getch();
                }
                if(sit=='B')
                {
                    if(cz<5)
                    {
                        cout<<"恭喜你,找到了村长!!&

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值