C++小游戏---------哈利波特(2)

case 4:
            if (money < 20000) DriveOut();
            else
            {
                money -= 20000;
                cout << "店主:一路走好!" << endl;
                bag[13]++;
            }
            break;
        case 5:
            if (money < 25000) DriveOut();
            else
            {
                money -= 25000;
                cout << "店主:一路走好!" << endl;
                bag[10]++;
            }
            break;
        case 6:
            if (money < 20000) DriveOut();
            else
            {
                money -= 20000;
                cout << "店主:一路走好!" << endl;
                bag[17]++;
            }
            break;
        case 7:
            if (money < 15000) DriveOut();
            else
            {
                money -= 15000;
                cout << "店主:一路走好!" << endl;
                bag[15]++;
            }
            break;
        default:
            break;
    }
    return 0;
}
int NoticeBoard(int l, int x, int y)
{
    if (l == 10 && x == 6 && y == 1)
    {
        system("cls");
        cout << "跟着'*'走" << endl;
        cout << "     ——作者" << endl;
        _getch();
    }
    if (l == 10 && x == 8 && y == 12)
    {
        system("cls");
        cout << "走吧,谁叫你不听命令呢..." << endl;
        cout << "                  ——作者" << endl;
        _getch();
    }
    if (l == 12 && x == 3 && y == 1)
    {
        system("cls");
        cout << "杀出重围!" << endl;
        cout << "      ——作者" << endl;
        _getch();
    }
    if (l == 12 && x < 4 && y == 20)
    {
        system("cls");
        cout << "恭喜通过一半!往下走继续..." << endl;
        cout << "       ——作者" << endl;
        _getch();
    }
    if (l == 12 && x > 4 && y == 20)
    {
        system("cls");
        cout << "恭喜通过一半!往上走继续..." << endl;
        cout << "       ——作者" << endl;
        _getch();
    }
    if (l == 12 && x == 10)
    {
        system("cls");
        cout << "拿走全部奖励吧!" << endl;
        cout << "       ——作者" << endl;
        _getch();
    }
    else
    {
        system("cls");
        cout << "回去吧,你来错地方了..." << endl;
        _getch();
    }
    return 0;
}
int checkpoint(int l)
{
    bool is[101][101];
    for (int i = 0; i < 100; i++)
        for (int j = 0; j < 100; j++)
            is[i][j] = false;
    int x = 1, y = 1;
    string a[100];
    if (l == 1)
    {
        a[0] = "######";
        a[1] = "I    o";
        a[2] = "######";
    }
    else if (l == 2)
    {
        a[0] = "#######";
        a[1] = "I    1#";
        a[2] = "#### ##";
        a[3] = "##1  ##";
        a[4] = "#### ##";
        a[5] = "#P    o";
        a[6] = "#######";
    }
    else if (l == 3)
    {
        a[0] = "#########";
        a[1] = "I #  1#S#";
        a[2] = "# ## ##1#";
        a[3] = "# 2     #";
        a[4] = "#### ## #";
        a[5] = "#P1  #o #";
        a[6] = "#########";
    }
    else if (l == 4)
    {
        a[0] = "#######o#######";
        a[1] = "I       #P3   #";
        a[2] = "#       ##### #";
        a[3] = "#         1P  #";
        a[4] = "#       ##### #";
        a[5] = "#S      #    2#";
        a[6] = "######### #####";
        a[7] = "#P121 2 1  11P#";
        a[8] = "###############";
    }
    else if (l == 5)
    {
        a[0] = "###############";
        a[1] = "I 3     #P3   #";
        a[2] = "# 3 #   ##### #";
        a[3] = "# 2 #     1   #";
        a[4] = "# 2 # # ##### #";
        a[5] = "# 1 # #P#    2#";
        a[6] = "#####2S## ###o#";
        a[7] = "#P1 1 # 1   1P#";
        a[8] = "###############";
    }
    else if (l == 6)
    {
        a[0] = "###############";
        a[1] = "#   11  2  6PP#";
        a[2] = "#2# #P#########";
        a[3] = "#2##### #S#   o";
        a[4] = "I       #2# ###";
        a[5] = "# #####  11 ###";
        a[6] = "# #P##### #####";
        a[7] = "#1112       4P#";
        a[8] = "###############";
        x = 4;
    }
    else if (l == 7)
    {
        a[0] = "###############";
        a[1] = "#3 4#  P#  # B#";
        a[2] = "#1# #9## 1#  3#";
        a[3] = "#1#6# 9#  # ###";
        a[4] = "I #7   94 # # o";
        a[5] = "# #1 3 ##  P# #";
        a[6] = "# ########### #";
        a[7] = "#       1  P  #";
        a[8] = "###############";
        x = 4;
    }
    else if (l == 8)
    {
        a[0]  = "#################";
        a[1]  = "#PPPPPPPPPPPPPPP#";
        a[2]  = "#P#############P#";
        a[3]  = "#PPPP 9999999 PP#";
        if (rand() % 100 < 7) a[4] = "#################";
        else a[4] = "######### #######";
        a[5]  = "#2 2#2 2#9##2  P#";
        a[6]  = "# # # # # #22#  #";
        a[7]  = "# # # # # # #22##";
        a[8]  = "I # # # # # # # o";
        a[9]  = "##22# # # # # # #";
        a[10] = "#  #22# #3# # # #";
        a[11] = "#P  2##2 5 2#2 2#";
        a[12] = "#################";
        x = 8;
    }
    else if (l == 9)
    {
        a[0] = "#################";
        a[1] = "I     9###9     I";
        a[2] = "#      # #      #";
        a[3] = "#    ##P9P##    #";
        a[4] = "#   9# 9o9 #9   #";
        a[5] = "#    ##P9P##    #";
        a[6] = "#      # #      #";
        a[7] = "I     9###9     I";
        a[8] = "#################";
        if (rand() % 2) x = 7;
        if (rand() % 2) y = 15;
    }
    else if (l == 10)
    {
        a[0] = "#############################";
        a[1] = "#00*****009***P0000000000000#";
        a[2] = "#0*9000*00*000*0**P000000000#";
        a[3] = "#0*000**00*0#0*0900*****00**o";
        a[4] = "#0*00**00*90#0******000****0#";
        a[5] = "#0*00*00**00#0000000***00000#";
        a[6] = "#T*00*90*00##################";
        a[7] = "I**000***00#================I";
        a[8] = "############T################";
        x = 7;
        y = 1;
    }
    else if (l == 11)
    {
        a[0] = "#############################";
        a[1] = "#        33344555#P         #";
        a[2] = "#22222P  33344566#P         ##";
        a[3] = "#11   2  33344567#7 8 8 8 8 9######################";
        a[4] = "I 1   2  33344567           999999999999999  PPPPo#";
        a[5] = "#11   2  33344567#7 8 8 8 8 9######################";
        a[6] = "#22222P  33344566#P         ##";
        a[7] = "#        33344555#P         #";
        a[8] = "#############################";
        x = 4;
        y = 1;
    }
    else if (l == 12)
    {
        a[0] = "###################################################";
        a[1] = "#999999999999999999.T.999999999P999999999999999999#";
        a[2] = "#9999999999.99.99.99T.999999999P999999999999999999#";
        a[3] = "#T9...99.99999999999T.999999999P9999999999999999..#";
        a[4] = "I...9.9.9999.999.99...999999999P9999999999999999.X#";
        a[5] = "#T9...99999999.99999T.999999999P9999999999999999..#";
        a[6] = "#9999999.99.999.99.9T.999999999P999999999999999999#";
        a[7] = "#99999.9999999999999T.999999999P999999999999999999#";
        a[8] = "###################################################";
        a[9] = "#oPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP #";
        a[10] = "#################################################T#";
        x = 4;
        y = 1;
    }
    else
    {
        a[0] = "#############################";
        a[1] = "#T                         T#";
        a[2] = "#                           #";
        a[3] = "#                           #";
        a[4] = "#                           #";
        a[5] = "#                           #";
        a[6] = "#                           #";
        a[7] = "I o                        T#";
        a[8] = "#############################";
        x = 7;
        y = 1;
//        for (int i = 0; i < 100; i++)
//            for (int j = 0; j < 100; j++) is[i][j] = true;
    }
    a[x][y] = '@';
    while (1)
    {
        is[x - 1][y - 1] = true;
        is[x - 1][y] = true;
        is[x - 1][y + 1] = true;
        is[x][y - 1] = true;
        is[x][y] = true;
        is[x][y + 1] = true;
        is[x + 1][y - 1] = true;
        is[x + 1][y] = true;
        is[x + 1][y + 1] = true;
        system("cls");
        cout << "生命:" << health << "/" << maxhealth << endl;
        cout << "攻击:" << attack << endl;
        cout << "防御:" << defense << endl;
        for (int i = 0; i < 25; i++)
        {
            for (int j = 0; j < 50; j++)
            {
                if (is[i][j]) cout << a[i][j];
                else cout << "0";
            }
            cout << endl;
        }
        int ch;
        ch = _getch();
        if (ch == 'a')
        {
            if ('0' < a[x][y - 1] && a[x][y - 1] <= '9')
            {
                cout << "你遇到了" << (int)(a[x][y - 1] - '0') << "级怪物,迎战吧!";
                fight("怪物", 1000 * (a[x][y - 1] - '0'), 250 * (a[x][y - 1] - '0'), 10 * (a[x][y - 1] - '0'), 12, 50 * (a[x][y - 1] - '0'));
                if (dead)
                {
                    Sleep(1000);
                    return 0;
                }
                a[x][y - 1] = '@';
                a[x][y] = ' ';
                y--;
                a[x][y] = ' ';
            }
            else if (a[x][y - 1] == 'I')
            {
                cout << "你是否要退出?" << endl;
                cout << "1确定 2取消" << endl;
                int num;
                cin >> num;
                if (num == 1)
                {
                    break;
                }
            }
            else if (a[x][y - 1] == 'o')
            {
                cout << "你通关了" << endl;
                if (nowlevel + 1 == l)
                {
                    nowlevel++;
                }
                _getch();
                return 0;
            }
            else if (a[x][y - 1] == 'P')
            {
                int m1 = rand() % 50;
                int m2 = rand() % 2;
                int m3 = rand() % 2;
                int m4 = rand() % 2;
                int m5 = rand() % 2;
                int m6 = rand() % 2;
                cout << "你获得了:" << endl;
                cout << m1 << "元" << endl;
                cout << m2 << "瓶生命药水" << endl;
                cout << m3 << "瓶防御药水" << endl;
                cout << m4 << "瓶攻击药水" << endl;
                cout << m5 << "瓶经验药水" << endl;
                cout << m6 << "瓶全幅药水" << endl;
                money += m1;
                bag[19] += m2;
                bag[20] += m3;
                bag[21] += m4;
                bag[22] += m5;
                bag[23] += m6;
                _getch();
                a[x][y - 1] = '@';
                a[x][y] = ' ';
                y--;
            }
            else if (a[x][y - 1] == 'S')
            {
                poisonshop();
            }
            else if (a[x][y - 1] == 'B')
            {
                bookshop();
            }
            else if (a[x][y - 1] == 'T')
            {
                NoticeBoard(l, x, y - 1);
            }
            else if (a[x][y - 1] == '0' && l == 10)
            {
                a[x][y] = '0';
                x = 7;
                y = 12;
                a[x][y] = '@';
            }
            else if (a[x][y - 1] == 'X' && l == 12)
            {
                a[x][y] = ' ';
                x = 9;
                y = 49;
                a[x][y] = '@';
            }
            else if (a[x][y - 1] != '#')
            {
                a[x][y - 1] = '@';
                a[x][y] = ' ';
                y -= 1;
            }
            if (l == 9 && x == 4 && y == 12)
            {
                a[x][y - 2] = '@';
                a[x][y] = ' ';
                y -= 2;
            }
        }
        if (ch == 'd')
        {
            if ('0' < a[x][y + 1] && a[x][y + 1] <= '9')
            {
                cout << "你遇到了" << (int)(a[x][y + 1] - '0') << "级怪物,迎战吧!";
                fight("怪物", 1000 * (a[x][y + 1] - '0'), 250 * (a[x][y + 1] - '0'), 10 * (a[x][y + 1] - '0'), 12, 50 * (a[x][y + 1] - '0'));
                if (dead)
                {
                    Sleep(1000);
                    return 0;
                }
                a[x][y + 1] = '@';
                a[x][y] = ' ';
                y++;
                a[x][y] = ' ';
            }
            else if (a[x][y + 1] == 'I')
            {
                cout << "你是否要退出?" << endl;
                cout << "1确定 2取消" << endl;
                int num;
                cin >> num;
                if (num == 1)
                {
                    break;
                }
            }
            else if (a[x][y + 1] == 'o')
            {
                cout << "你通关了" << endl;
                if (nowlevel + 1 == l)
                {
                    nowlevel++;
                }
                _getch();
                return 0;
            }
            else if (a[x][y + 1] == 'P')
            {
                int m1 = rand() % 50;
                int m2 = rand() % 2;
                int m3 = rand() % 2;
                int m4 = rand() % 2;
                int m5 = rand() % 2;
                int m6 = rand() % 2;
                cout << "你获得了:" << endl;
                cout << m1 << "元" << endl;
                cout << m2 << "瓶生命药水" << endl;
                cout << m3 << "瓶防御药水" << endl;
                cout << m4 << "瓶攻击药水" << endl;
                cout << m5 << "瓶经验药水" << endl;
                cout << m6 << "瓶全幅药水" << endl;
                money += m1;
                bag[19] += m2;
                bag[20] += m3;
                bag[21] += m4;
                bag[22] += m5;
                bag[23] += m6;
                _getch();
                a[x][y + 1] = '@';
                a[x][y] = ' ';
                y++;
            }
            else if (a[x][y + 1] == 'S')
            {
                poisonshop();
            }
            else if (a[x][y + 1] == 'B')
            {
                bookshop();
            }
            else if (a[x][y + 1] == 'T')
            {
                NoticeBoard(l, x, y + 1);
            }
            else if (a[x][y + 1] == '0' && l == 10)
            {
                a[x][y] = '0';
                x = 7;
                y = 12;
                a[x][y] = '@';
            }
            else if (a[x][y + 1] == 'X' && l == 12)
            {
                a[x][y] = ' ';
                x = 9;
                y = 49;
                a[x][y] = '@';
            }
            else if (a[x][y + 1] != '#')
            {
                a[x][y + 1] = '@';
                a[x][y] = ' ';
                y++;
            }
            if (l == 9 && x == 4 && y == 4)
            {
                a[x][y + 2] = '@';
                a[x][y] = ' ';
                y += 2;
            }
        }
        if (ch == 'w')
        {
            if ('0' < a[x - 1][y] && a[x - 1][y] <= '9')
            {
                cout << "你遇到了" << (int)(a[x - 1][y] - '0') << "级怪物,迎战吧!";
                fight("怪物", 1000 * (a[x - 1][y] - '0'), 250 * (a[x - 1][y] - '0'), 10 * (a[x - 1][y] - '0'), 12, 50 * (a[x - 1][y] - '0'));
                if (dead)
                {
                    Sleep(1000);
                    return 0;
                }
                a[x - 1][y] = '@';
                a[x][y] = ' ';
                x--;
                a[x][y] = ' ';
            }
            else if (a[x - 1][y] == 'I')
            {
                cout << "你是否要退出?" << endl;
                cout << "1确定 2取消" << endl;
                int num;
                cin >> num;
                if (num == 1)
                {
                    break;
                }
            }
            else if (a[x - 1][y] == 'o')
            {
                cout << "你通关了" << endl;
                if (nowlevel + 1 == l)
                {
                    nowlevel++;
                }
                _getch();
                return 0;
            }
            else if (a[x - 1][y] == 'P')
            {
                int m1 = rand() % 50;
                int m2 = rand() % 2;
                int m3 = rand() % 2;
                int m4 = rand() % 2;
                int m5 = rand() % 2;
                int m6 = rand() % 2;
                cout << "你获得了:" << endl;
                cout << m1 << "元" << endl;
                cout << m2 << "瓶生命药水" << endl;
                cout << m3 << "瓶防御药水" << endl;
                cout << m4 << "瓶攻击药水" << endl;
                cout << m5 << "瓶经验药水" << endl;
                cout << m6 << "瓶全幅药水" << endl;
                money += m1;
                bag[19] += m2;
                bag[20] += m3;
                bag[21] += m4;
                bag[22] += m5;
                bag[23] += m6;
                _getch();
                a[x - 1][y] = '@';
                a[x][y] = ' ';
                x--;
            }
            else if (a[x - 1][y] == 'S')
            {
                poisonshop();
            }
            else if (a[x - 1][y] == 'B')
            {
                bookshop();
            }
            else if (a[x - 1][y] == 'T')
            {
                NoticeBoard(l, x - 1, y);
            }
            else if (a[x - 1][y] == '0' && l == 10)
            {
                a[x][y] = '0';
                x = 7;
                y = 12;
                a[x][y] = '@';
            }
            else if (a[x - 1][y] == 'X' && l == 12)
            {
                a[x][y] = ' ';
                x = 9;
                y = 49;
                a[x][y] = '@';
            }
            else if (a[x - 1][y] != '#')
            {
                a[x - 1][y] = '@';
                a[x][y] = ' ';
                x -= 1;
            }
        }
        if (ch == 's')
        {
            if (a[x + 1][y] == ' ')
            {
                a[x + 1][y] = '@';
                a[x][y] = ' ';
                x += 1;
            }
            else if ('0' < a[x + 1][y] && a[x + 1][y] <= '9')
            {
                cout << "你遇到了" << (int)(a[x + 1][y] - '0') << "级怪物,迎战吧!";
                fight("怪物", 1000 * (a[x + 1][y] - '0'), 250 * (a[x + 1][y] - '0'), 10 * (a[x + 1][y] - '0'), 12, 50 * (a[x + 1][y] - '0'));
                if (dead)
                {
                    Sleep(1000);
                    return 0;
                }
                a[x + 1][y] = '@';
                a[x][y] = ' ';
                x++;
                a[x][y] = ' ';
            }
            else if (a[x + 1][y] == 'I')
            {
                cout << "你是否要退出?" << endl;
                cout << "1确定 2取消" << endl;
                int num;
                cin >> num;
                if (num == 1)
                {
                    break;
                }
            }
            else if (a[x + 1][y] == 'o')
            {
                cout << "你通关了" << endl;
                if (nowlevel + 1 == l)
                {
                    nowlevel++;
                }
                _getch();
                return 0;
            }
            else if (a[x + 1][y] == 'P')
            {
                int m1 = rand() % 50;
                int m2 = rand() % 2;
                int m3 = rand() % 2;
                int m4 = rand() % 2;
                int m5 = rand() % 2;
                int m6 = rand() % 2;
                cout << "你获得了:" << endl;
                cout << m1 << "元" << endl;
                cout << m2 << "瓶生命药水" << endl;
                cout << m3 << "瓶防御药水" << endl;
                cout << m4 << "瓶攻击药水" << endl;
                cout << m5 << "瓶经验药水" << endl;
                cout << m6 << "瓶全幅药水" << endl;
                money += m1;
                bag[19] += m2;
                bag[20] += m3;
                bag[21] += m4;
                bag[22] += m5;
                bag[23] += m6;
                _getch();
                a[x + 1][y] = '@';
                a[x][y] = ' ';
                x++;
            }
            else if (a[x + 1][y] == 'S')
            {
                poisonshop();
            }
            else if (a[x + 1][y] == 'B')
            {
                bookshop();
            }
            else if (a[x + 1][y] == 'T')
            {
                NoticeBoard(l, x + 1, y);
            }
            else if (a[x + 1][y] == '0' && l == 10)
            {
                a[x][y] = '0';
                x = 7;
                y = 12;
                a[x][y] = '@';
            }
            else if (a[x + 1][y] == 'X' && l == 12)
            {
                a[x][y] = ' ';
                x = 9;
                y = 49;
                a[x][y] = '@';
            }
            else if (a[x + 1][y] != '#')
            {
                a[x + 1][y] = '@';
                a[x][y] = ' ';
                x++;
            }
        }
    }
    return 0;
}
int MM()
{
    if (amm == 0)
    {
        int lie = 0;
        cout << "....建议45级打,飘升80级...." << endl;
        cout << "攻击即可获得:" << endl;
        cout << "抽奖券*100 技能书昏昏倒地或技能书铁甲咒 全幅药水*50";
        cout << " 金币*2000 经验石X*50" << endl;
        cout << " 1攻击 2变强后再来" << endl;
        int a;
        cin >> a;
        if (a == 1)
        {
            cout << "你来到了魔法部大门" << endl;
            Sleep(1000);
            cout << "魔法部大门看守:你来这干嘛!" << endl;
            Sleep(1000);
            cout << "1抢劫! 2办事的。" << endl;
            cin >> a;
            if (a == 1) cout << "魔法部大门看守:拦下他!" << endl;
            else
            {
                if (camp) cout << "魔法部大门看守:不可能,你是伏地魔的人!" << endl;
                else
                {
                    cout << "魔法部大门看守仔细一看。" << endl;
                    Sleep(1000);
                    cout << "魔法部大门看守:他是哈利波特的人,抓了他问哈利波特下落!" << endl;
                }
            }
            Sleep(1000);
            fight("大门看守", 2000, 200, 20, 0, 1000);
            if (dead) return 0;
            fight("大门看守", 2000, 200, 20, 0, 1000);
            if (dead) return 0;
            cout << "增加100滴血" << endl;
            health += 100;
            Sleep(1000);
            cout << "你踢开了大门" << endl;
            Sleep(1000);
            cout << "里面的几个雕像活了" << endl;
            Sleep(1000);
            fight("雕像", 10000, 200, 20, 0, 500);
            if (dead) return 0;
            fight("雕像", 10000, 200, 20, 0, 500);
            if (dead) return 0;
            fight("雕像", 10000, 200, 20, 0, 500);
            if (dead) return 0;
            cout << "增加500滴血" << endl;
            health += 500;
            cout << "你杀死了雕像后, 正准备往楼上走" << endl;
            Sleep(1000);
            cout << "突然一群员工跑了过来" << endl;
            Sleep(1000);
            cout << "员工:这是你干你的吗" << endl;
            Sleep(1000);
            cout << "1,撒谎  其他,是!" << endl;
            cin >> a;
            if (a == 1)
            {
                cout << "员工:是谁干的?" << endl;
                Sleep(1000);
                cout << "你随便指了一个员工" << endl;
                Sleep(1000);
                cout << "他!" << endl;
                Sleep(1000);
                cout << "那群员工匆匆跑了过去" << endl;
                Sleep(1000);
                cout << "你赶快跑上楼梯" << endl;
                Sleep(1000);
                lie = 1;
            }
            else
            {
                cout << "员工:干掉他!" << endl;
                Sleep(1000);
                fight("员工", 3000, 200, 100, 14, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 14, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 14, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 15, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 17, 1000);
                if (dead) return 0;
                if (rand() % 3 == 0)
                {
                    cout << "你获得了技能书铁甲咒" << endl;
                    bag[7]++;
                    Sleep(1000);
                }
                cout << "你赶快跑上楼梯" << endl;
                health += 500;
            }
            Sleep(1000);
            cout << "你遇到了副部长" << endl;
            Sleep(1000);
            fight("副部长", 10000, 1000, 100, 20, 3000);
            health += 5000;
            if (dead) return 0;
            if (lie)
            {
                cout << "上次的员工跑了过来" << endl;
                Sleep(1000);
                cout << "员工:你,你骗了我们!" << endl;
                Sleep(1000);
                fight("员工", 3000, 200, 100, 14, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 14, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 14, 1000);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 15, 1500);
                if (dead) return 0;
                fight("员工", 3000, 200, 100, 17, 2000);
                if (dead) return 0;
                if (rand() % 3 == 0)
                {
                    cout << "你获得了技能书铁甲咒" << endl;
                    bag[7]++;
                    Sleep(1000);
                }
                health += 500;
            }
            cout << "你遇到了部长";
            fight("部长", 15000, 1500, 150, 20, 4000);
            if (dead) return 0;
            cout << "你获得:" << endl;
            cout << "抽奖券*100 技能书昏昏倒地或技能书铁甲咒 全幅药水*50";
            cout << " 金币*2000 经验石X*50" << endl;
            bag[0] += 100;
            bag[8]++;
            bag[23] += 50;
            money += 2000;
            bag[5] += 50;
            amm = 1;
            Sleep(3000);
        }
        else if (a == 2) return 0;
        else
        {
            cout << "请勿乱输";
            Sleep(1000);
        }
    }
    else
    {
        cout << "你已占领魔法部 可以进入以下地方" << endl;
        cout << "0,退出 1,泡温泉 2,矿洞" << endl;
        int b;
        cin >> b;
        switch (b)
        {
            case 0:
                break;
            case 1:
                time_t c_start, t_start, c_end, t_end;
                c_start = clock();
                t_start = time(NULL);
                cout << "正在泡温泉 按下任意键停止" << endl;
                _getch();
                c_end = clock();
                t_end = time(NULL);
                cout << "你获得" << (int)difftime(c_end, c_start) / 100 << "元" << endl;
                cout << "你获得" << (int)difftime(c_end, c_start) / 10 << "经验" << endl;
                experience += (int)difftime(c_end, c_start) / 10;
                money += (int)difftime(c_end, c_start) / 100;
                _getch();
                break;
            case 2:
                cout << "你走进矿洞" << endl;
                Sleep(1000);
                ict++;
                if (ict == 5) cout << "你不小心靠在墙上,触发了机关" << endl;
                else if (ict > 5) cout << "你找到原来触发机关的地方,按下那块岩石,密道又出现了" << endl;
                cout << "0,退出 1,挖矿";
                if (ict > 4) cout << " 2,暗道";
                cout << endl;
                int c;
                cin >> c;
                if (c == 1) dig();
                else if (c == 2 && ict > 4)
                {
                    cout << "你走进暗道" << endl;
                    _getch();
                    cout << "你发现了一个完全不同的世界,里面充满了怪物" << endl;
                    _getch();
                    cout << "每去一个地方都有可能遇到他们" << endl;
                    _getch();
                    cout << "但你有一种直觉,穿过这个森林,就能找到某些东西" << endl;
                    _getch();
                    MessageBox(0, TEXT("建议 生命>60000 攻击>20000 防御>2000 速度>1000 时来打"), TEXT("重要提示"), MB_OK);
                    if (MessageBox(0, TEXT("用 wasd 移动,o出口,I入口,@你"), TEXT("重要提示"), MB_OKCANCEL | MB_ICONINFORMATION) != IDOK)
                    {
                        MessageBox(0, TEXT("下次再来吧!"), TEXT("重要提示"), MB_OK);
                        return 0;
                    };
                    cout << "开始吧!" << endl;
                    maze();
                }
                else cout << "请勿乱输" << endl;
                Sleep(1000);
                break;
        }
    }
    return 0;
}
int finalfight(string Hname)
{
    int hisH = 1000000000, hisA = 1000000, hisD = 500000, hisSP = 5000;
    int hfaint = 0, hhurt = 0, hbeat = 0;
    int mfaint = 0, mhurt = 0;
    dead = false;
    int ha = hisA;
    int his = hisA + hisD + hisH;
    while (1)
    {
        if (hfaint > 0)
        {
            if (rand() % 3 == 0)
            {
                cout << "对方使用技能:咒立停!停止了魔咒" << endl;
                hfaint = 1;
            }
            hfaint -= 1;
        }
        if (hbeat == 1)
        {
            if (rand() % 10 == 0)
            {
                cout << "对方一躲,躲过了你的石头" << endl;
                hbeat = 0;
            }
            else
            {
                cout << "对方躲闪不急,石头正好撞在他的鼻子上 扣血50滴" << endl;
                hisH -= 50;
            }
        }
        if (mfaint > 0)
        {
            if (Sl[6]) mfaint = 0;
            else mfaint -= 1;
        }
        if (mhurt > 0)
        {
            if (Sl[6]) mhurt = 0;
            else
            {
                mhurt -= 1;
                cout << "你的心像被一把刀刺穿了一样 扣血200滴" << endl;
                health -= 200;
            }
        }
        if (mfaint <= 0)
        {
            if (rand() % 3 && Sl[0])
            {
                cout << "你使用技能快快复苏 生命增加200" << endl;
                health += 200;
            }
            if (rand() % 3 && Sl[1])
            {
                cout << "你使用技能铁甲护身 生命增加100 防御增加50" << endl;
                health += 100;
                defense += 50;
            }
            if (rand() % 3 && Sl[2])
            {
                cout << "你使用技能昏昏倒地 " << Hname << "一回合之内不能攻击" << endl;
                hfaint += 1;
            }
            if (rand() % 3 && Sl[3])
            {
                cout << "你使用技能神锋无影 攻击增加200 对方扣血200滴" << endl;
                hisH -= 200;
                attack += 200;
            }
            if (rand() % 3 && Sl[5])
            {
                if (rand() % 10)
                {
                    cout << "你使用技能统统石化 " << Hname << "二回合之内不能攻击" << endl;
                    hfaint += 2;
                }
                else
                {
                    cout << "你使用技能统统石化 " << Hname << "十回合之内不能攻击" << endl;
                    hfaint += 10;
                }
            }
            if (rand() % 4 == 0 && Sl[7])
            {
                cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
                hisH = monsterfight(Hname, hisH, hisA, hisD, 23, hisSP);
                if (hisH < 1)
                {
                    cout << "对方死亡" << endl;
                    Sleep(1000);
                    cout << "全部人都来庆祝你" << endl;
                    Sleep(1000);
                    cout << "突然," << Hname << "的魔杖一转,指向了你。" << endl;
                    Sleep(1000);
                    cout << "里面发出一束红色的光柱" << endl;
                    Sleep(1000);
                    cout << "你连忙拿魔杖一挡" << endl;
                    Sleep(1000);
                    cout << "那光柱击中你的魔杖,爆炸了" << endl;
                    Sleep(1000);
                    cout << "你的魔杖断了" << endl;
                    Sleep(1000);
                    cout << "你被炸出20多米" << endl;
                    Sleep(1000);
                    cout << "未完待续..." << endl;
                    Sleep(10000);
                    return 0;
                }
                if (Sl[0])
                {
                    cout << "在对方和石怪的战斗中,你已经恢复了2000生命" << endl;
                    if (maxhealth < health + 2000) health = maxhealth;
                    else  health += 2000;
                }
            }
            if (rand() % 4 == 0 && Sl[8])
            {
                cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
            }
            if (rand() % 3 && Sl[9])
            {
                cout << "你使用技能万弹齐发!变出几十块石头" << endl;
                hbeat = 1;
            }
            if (rand() % 3 && Sl[10])
            {
                cout << "你使用技能钻心咒!对方将疼痛5回合" << endl;
                hhurt += 5;
            }
            if (rand() % 3 && Sl[11])
            {
                cout << "魂魄出窍!你使用夺魂咒,企图让" << Hname << "自己攻击自己!" << endl;
                Sleep((rand() % 2000) + 1000);
                cout << Hname << "被你控制了,开始攻击自己" << endl;
                Sleep(700);
                int ran = rand() % 40 - 20;
                if (hisA + ran > hisD)
                {
                    cout << "对方发起进攻 自己扣血" << hisH - hisD + ran << "滴 剩余" << hisH - (hisA - hisD + ran) << "滴" << endl;
                    hisH -= hisA - hisD + ran;
                }
                else cout << "对方发起进攻 自己扣血0滴 剩余" << hisH << "滴" << endl;
            }
            if (rand() % 2 && Sl[12])
            {
                cout << "你使用技能阿瓦达索命 " << Hname << "扣血" << hisH - hisH / 4 << "滴" << endl;
                hisH /= 4;
            }
            Sleep(1000);
            int ran = rand() % 40 - 20;
            if (rand() % 10000 > hisSP)
            {
                if (attack + ran > hisD)
                {
                    cout << "你发起进攻 " << Hname << "扣血" << attack - hisD + ran << "滴 剩余" << hisH - (attack - hisD + ran) << "滴" << endl;
                    hisH -= attack - hisD + ran;
                }
                else cout << "你发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
            }
            else
            {
                if (rand() % 2) cout << "你一脚踹了过去,但没有踢中" << endl;
                else
                {
                    cout << "你一脚踹了过去,但只擦着了腰" << endl;
                    if ((attack / 3) + ran > hisD)
                    {
                        cout << Hname << "扣血" << (attack / 3) + ran - hisD << "滴 剩余" << hisH - ((attack / 3) + ran - hisD) << "滴" << endl;
                        hisH -= (attack / 3) + ran - hisD;
                    }
                    else  cout << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
                }
            }
        }
        Sleep(700);
        if (hhurt > 0)
        {
            hhurt -= 1;
            cout << "对方因中了你的钻心咒,正捂着心大叫呢 扣血200滴" << endl;
            hisH -= 200;
        }
        if (hisH <= 0)
        {
            if (rand() % 3 == 0)
            {
                cout << "对方发动技能:恢复如初 满血复活" << endl;
                hisH = ha;
                Sleep(1000);
            }
            else
            {
                cout << "对方死亡"<< endl;
                Sleep(1000);
                cout << "全部人都来庆祝你" << endl;
                Sleep(1000);
                cout << "突然," << Hname << "的魔杖一转,指向了你。" << endl;
                Sleep(1000);
                cout << "里面发出一束红色的光柱" << endl;
                Sleep(1000);
                cout << "你连忙拿魔杖一挡" << endl;
                Sleep(1000);
                cout << "那光柱击中你的魔杖,爆炸了" << endl;
                Sleep(1000);
                cout << "你的魔杖断了" << endl;
                Sleep(1000);
                cout << "你被炸出20多米" << endl;
                Sleep(1000);
                cout << "未完待续..." << endl;
                Sleep(10000);
                return 0;
            }
        }
        if (rand() % 3 == 0)
        {
            cout << "对方发动技能:快快复苏  生命加200" << endl;
            hisH += 200;
        }
        if (rand() % 3 == 0)
        {
            cout << "对方发动技能:盔甲护身  生命加50 防御增加50" << endl;
            hisH += 50;
            hisD += 50;
        }
        if (rand() % 3 == 0)
        {
            cout << "对方使用技能神锋无影 攻击增加200 扣血200滴" << endl;
            health -= 200;
            hisA += 200;
        }
        if (rand() % 3 == 0)
        {
            cout << "对方使用技能昏昏倒地 " << name << "一回合之内不能攻击" << endl;
            mfaint += 1;
        }
        if (rand() % 3 == 0)
        {
            if (rand() % 10)
            {
                cout << "对方使用技能统统石化 " << name << "二回合之内不能攻击" << endl;
                mfaint += 2;
            }
            else
            {
                cout << "对方使用技能统统石化 " << name << "十回合之内不能攻击" << endl;
                mfaint += 10;
            }
        }
        if (rand() % 3 == 0)
        {
            cout << "对方使用技能阿瓦达索命 " << name << "扣血" << health - health / 4 << "滴" << endl;
            health /= 4;
        }
        Sleep(1000);
        if (hfaint <= 0)
        {
            int ran = rand() % 40 - 20;
            if (rand() % 10000 > speed)
            {
                if (hisA + ran > defense)
                {
                    cout << Hname << "发起进攻 " << "你扣血" << hisA - defense + ran << "滴 剩余" << health - (hisA - defense + ran) << "滴" << endl;
                    health -= hisA - defense + ran;
                }
                else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
            }
            else
            {
                if (rand() % 2) cout << Hname << "一脚踹了过来,但没有踢中" << endl;
                else
                {
                    if ((hisA / 3) + ran > hisD)
                    {
                        cout << Hname << "发起进攻 你扣血" << (hisA / 3) + ran - defense << "滴 剩余" << health - ((hisA / 3) + ran - defense) << "滴" << endl;
                        health -= ((hisA / 3) + ran - defense);
                    }
                    else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
                }
            }
            Sleep(1000);
            if (health <= 0)
            {
                if (Sl[6] && rand() % 2)
                {
                    cout << "你发动技能:恢复如初 满血复活" << endl;
                    health = maxhealth;
                    Sleep(1000);
                }
                else
                {
                    cout << "你死亡";
                    health = 20;
                    dead = true;
                    return 0;
                }
            }
        }
    }
    return 0;
}
int main()
{
    int isbreak;
    isbreak = false;
    if (MessageBox(0, TEXT("除输入名字外,请不要输入任何字符,否则将导致游戏崩溃!"), TEXT("重要提示"), MB_OKCANCEL | MB_ICONINFORMATION) != IDOK)
    {
        MessageBox(0, TEXT("既然你不同意,那就别玩了"), TEXT("重要提示"), MB_OK);
        return 0;
    };
    srand((unsigned)time(NULL));
    cout << "                              1.2.9 \n";
    cout << "      MagicWorld--HarryPotter       \n";
    cout << "                                    \n";
    cout << "         / >                        \n";
    cout << "        /    >          /           \n";
    cout << "       < _____ >       /            \n";
    cout << "        |-O--O-|      /             \n";
    cout << "       /   == - .    /              \n";
    cout << "     /           . [  ]             \n";
    cout << "       /      /` ___/               \n";
    cout << "                                    \n";
    cout << "                             by evan\n";
    cout << "输入‘start’开始游戏                  \n";
    string start;
    cin >> start;
    for (int i = 8; i < 100; i++) wandname[i] = "1";
    if (start == "start")
    {
        int i;
        system("cls");
        for (i = 0; i < 20; i++)
        {
            cout << "loading..." << endl << "--------------------------" << endl << "   ";
            for (int j = 0; j <= i % 5; j++) cout << "+==+";
            cout << "   " << endl << "--------------------------" << endl;
            switch (rand() % 4)
            {
                case 0:
                    cout << "打怪是升级和提升战力的好方法。" << endl;
                    break;
                case 1:
                    cout << "开始游戏时记得选择阵营。" << endl;
                    break;
                case 2:
                    cout << "退出时要保存。" << endl;
                    break;
                case 3:
                    cout << "新手开始游戏时会有3瓶经验药水1张抽奖券。" << endl;
                    break;
            }
            Sleep(250);
            system("cls");
        }
        while (1)
        {
            isbreak = false;
            cout << "1,登录 2,注册";
            int a;
            cin >> a;
            if (a == 1) login();
            else Reg();
            while (1)
            {
                if (isbreak)
                {
                    break;
                }
                system("cls");
                cout << "魔法人士:" << name << endl;
                cout << "势力:";
                if (camp) cout << "伏地魔" << endl;
                else cout << "哈利波特" << endl;
                cout << "生命:" << health << "/" << maxhealth << endl;
                cout << "攻击:" << attack << endl;
                cout << "防御:" << defense << endl;
                cout << "速度:" << speed << endl;
                cout << "等级:" << level << endl;
                cout << "经验:" << experience << "/" << level * 100 << endl;
                cout << "金币:" << money << endl;
                cout << "1,魔法部(攻击即可占领) 2,大街(杀人/阻止食死徒) 3,";
                if (camp) cout << "霍格沃茨(哈利波特不在) ";
                else cout << "伏地魔总部(伏地魔不在) ";
                cout << "4,霍格沃茨(最后战场) 5,奥利凡德魔杖商店 6,抽奖 7,经验石店 8,背包 9,工厂 10,材料店 11,任务 12,终极任务 13,副本 14,保存 ";
                if (camp) cout << "15, 医疗兵(伏地魔的)";
                else cout << "15, 庞弗雷女士 ";
                cout << "16,改变参数(测试专用 需要密码) 17,设置 18,登出" << endl;
                cin >> a;
                switch (a)
                {
                    case 1:
                        MM();
                        break;
                    case 2:
                        street();
                        break;
                    case 3:
                        for (int i = 1; i < 100; i++)
                        {
                            cout << "|";
                            for (int j = 0; j < 10 && i < 100; j++, i++)
                            {
                                if (nowlevel + 1 < i) cout << " " << i << " |";
                                else cout << ":" << i << ":|";
                            }
                            cout << endl;
                        }
                        int num;
                        cin >> num;
                        if (nowlevel + 1 < num) cout << "你未解锁这关" << endl;
                        else checkpoint(num);
                        Sleep(1000);
                        break;
                    case 4:
                        if (camp)
                        {
                            if (f) finalfight("哈利·波特");
                            else cout << "你需要先寻找哈利波特的下落" << endl;
                        }
                        else
                        {
                            if (f) finalfight("伏地魔");
                            else cout << "你需要先寻找伏地魔的下落" << endl;
                        }
                        Sleep(1000);
                        break;
                    case 5:
                        cout << "1 柳条独角兽尾毛魔杖   100元" << endl;
                        cout << "2 胡桃木龙神经魔杖     200元" << endl;
                        cout << "3 鹅耳枥木魔杖        550元" << endl;
                        cout << "4 柳条魔杖            1200元" << endl;
                        cout << "5 花心木魔杖          3650元" << endl;
                        cout << "6 冬青木凤凰羽毛魔杖   5780元" << endl;
                        cout << "7 紫杉木凤凰羽毛魔杖   7120元" << endl;
                        cout << "8 老魔杖              50000元" << endl;
                        cout << "0 退出              0元" << endl;
                        int b;
                        cin >> b;
                        switch (b)
                        {
                            case 1:
                                buywand(6, 100);
                                system("cls");
                                break;
                            case 2:
                                buywand(7, 200);
                                system("cls");
                                break;
                            case 3:
                                buywand(8, 550);
                                system("cls");
                                break;
                            case 4:
                                buywand(9, 1200);
                                system("cls");
                                break;
                            case 5:
                                buywand(10, 3650);
                                system("cls");
                                break;
                            case 6:
                                buywand(11, 5780);
                                system("cls");
                                break;
                            case 7:
                                buywand(12, 7120);
                                system("cls");
                                break;
                            case 8:
                                buywand(13, 50000);
                                system("cls");
                                break;
                            default:
                                break;
                        }
                        break;
                    case 6:
                        LD();
                        break;
                    case 7:
                        cout << "1 经验石R      100元    100经验" << endl;
                        cout << "2 经验石SR     200元    250经验" << endl;
                        cout << "3 经验石SSR    400元    500经验" << endl;
                        cout << "4 经验石SSS    1000元   1200经验" << endl;
                        cout << "5 经验石X      2000元   2500经验" << endl;
                        cout << "0 退出         0元      0经验" << endl;
                        int c;
                        cin >> c;
                        switch (c)
                        {
                            case 1:
                                buy(1, 100);
                                system("cls");
                                break;
                            case 2:
                                buy(2, 200);
                                system("cls");
                                break;
                            case 3:
                                buy(3, 550);
                                system("cls");
                                break;
                            case 4:
                                buy(4, 1200);
                                system("cls");
                                break;
                            case 5:
                                buy(5, 3650);
                                system("cls");
                                break;
                            default:
                                break;
                        }
                        break;
                    case 8:
                        cout << "1,查看魔杖 2,查看药水 3,查看经验石 4,学习技能" << endl;
                        cin >> b;
                        if (b == 1) w();
                        else if (b == 2) p();
                        else if (b == 3) e();
                        else if (b == 4) s();
                        else
                        {
                            cout << "请勿乱输" << endl;
                            Sleep(1000);
                        }
                        break;
                    case 9:
                        int material1, material2, mn1, mn2;
                        cout << "1,制作 2,查看材料";
                        cin >> material1;
                        if (material1 == 1)
                        {
                            cout << "你要用什么杖芯?" << endl;
                            for (int ij = 0; ij < 9; ij++) cout << ij + 1 << "," << Material1name[ij] << " " << bag[ij + 24] << "个" << endl;
                            cin >> material1;
                            cout << "几个?" << endl;
                            cin >> mn1;
                            cout << "你要用什么木材?" << endl;
                            for (int ij = 0; ij < 10; ij++) cout << ij + 1 << "," << Material2name[ij] << " " << bag[ij + 33] << "个" << endl;
                            cin >> material2;
                            cout << "几个?" << endl;
                            cin >> mn2;
                            make(material1 + 23, material2 + 32, mn1, mn2);
                            break;
                        }
                        else if (material1 == 2)
                        {
                            cout << "杖芯:" << endl;
                            for (int ij = 0; ij < 9; ij++) cout << ij + 1 << "," << Material1name[ij] << " " << bag[ij + 24] << "个" << endl;
                            cout << "木材:" << endl;
                            for (int ij = 0; ij < 10; ij++) cout << ij + 1 << "," << Material2name[ij] << " " << bag[ij + 33] << "个" << endl;
                            _getch();
                        }
                        else cout << "请勿乱输";
                        break;
                    case 10:
                        break;
                    case 11:
                        if (xy == 1)
                        {
                            if (ane == 0) cout << "再闯 1 关副本";
                            else if (ane == 1) cout << "买两件商品";
                            else if (ane == 2) cout << "回血一次";
                            else if (ane == 3) cout << "杀死10个人";
                            cout << "(" << D_Of_C << "/" << OK << ")" << endl;
                            if (D_Of_C >= OK)
                            {
                                cout << "任务完成!!";
                                maxhealth += 200;
                                health += 200;
                                defense += 20;
                                xy = 0;
                                bag[43]++;
                            }
                            Sleep(1000);
                        }
                        else
                        {
                            ane = rand() % 4;
                            D_Of_C = 0;
                            xy = 1;
                            if (ane == 0)
                            {
                                cout << "再闯 1 关副本";
                                OK = 1;
                            }
                            else if (ane == 1)
                            {
                                cout << "买两件商品";
                                OK = 2;
                            }
                            else if (ane == 2)
                            {
                                cout << "回血一次";
                                OK = 1;
                            }
                            else if (ane == 3)
                            {
                                cout << "杀死10个人";
                                OK = 10;
                            }
                            Sleep(1000);
                        }
                        break;
                    case 12:
                        if (xy1 == 1)
                        {
                            if (ane1 == 0)
                            {
                                if (camp)  cout << "杀死1个邓布利多";
                                else cout << "杀死1个纳尼吉";
                            }
                            else if (ane1 == 1) cout << "消耗5000元";
                            else if (ane1 == 2)
                            {
                                if (camp) cout << "杀死5个穆迪";
                                else cout << "杀死5个卢修斯·马尔福";
                            }
                            else if (ane1 == 3) cout << "杀死100个生物";
                            else if (ane1 == 4) cout << "再升10级";
                            cout << "(" << D_Of_C1 << "/" << OK1 << ")" << endl;
                            if (D_Of_C1 >= OK1)
                            {
                                cout << "任务完成!!" << endl;
                                xy1 = 0;
                                cout << "增加500元 攻击力+10 防御力+10 生命+500" << endl;
                                money += 500;
                                attack += 200;
                                health += 1000;
                                maxhealth += 1000;
                                defense += 150;
                                bag[43] += 5;
                            }
                            Sleep(1000);
                        }
                        else
                        {
                            ane1 = rand() % 5;
                            D_Of_C1 = 0;
                            xy1 = 1;
                            if (ane1 == 0)
                            {
                                if (camp) cout << "杀死1个邓布利多";
                                else cout << "杀死1个纳尼吉";
                                OK1 = 1;
                            }
                            else if (ane1 == 1)
                            {
                                cout << "消耗5000元";
                                OK1 = 5000;
                            }
                            else if (ane1 == 2)
                            {
                                if (camp) cout << "杀死5个穆迪";
                                else cout << "杀死5个卢修斯·马尔福";
                                OK1 = 5;
                            }
                            else if (ane1 == 3)
                            {
                                cout << "杀死100个生物";
                                OK1 = 100;
                            }
                            else if (ane1 == 4)
                            {
                                cout << "再升10级";
                                OK1 = 10;
                            }
                            Sleep(1000);
                        }
                        break;
                    case 13:
                        cout << "1 金钱副本" << LE1 << "级  2 经验副本" << LE2 << "级" << endl;
                        int y;
                        cin >> y;
                        if (y == 1)
                        {
                            for (int i = 0; i < LE1 % 5; i++)
                            {
                                if (rand() % 3 == 0) fight2("木人桩", 1500, 100, 10, 0, 1000);
                                else if (rand() % 3 == 1) fight2("沙包", 3000, 50, 20, 0, 1000);
                                else fight2("木板", 1000, 100, 10, 0, 1000);
                                if (dead) break;
                            }
                            for (int i = 0; i < (LE1 / 5) % 25; i++)
                            {
                                if (dead) break;
                                if (rand() % 3 == 0) fight2("石人桩(这有吗)", 3000, 200, 20, 0, 2000);
                                else if (rand() % 3 == 1) fight2("石包(这有吗)", 6000, 100, 60, 0, 2000);
                                else fight2("石板", 3000, 300, 30, 0, 2000);
                            }
                            for (int i = 0; i < (LE1 / 25) % 125; i++)
                            {
                                if (dead) break;
                                if (rand() % 3 == 0) fight2("铁人桩(这有吗)", 6000, 400, 40, 0, 4000);
                                else if (rand() % 3 == 1) fight2("铁包(这有吗)", 12000, 200, 120, 0, 4000);
                                else fight2("铁板", 6000, 400, 40, 0, 4000);
                            }
                            for (int i = 0; i < (LE1 / 125) % 625; i++)
                            {
                                if (dead) break;
                                if (rand() % 3 == 0) fight2("金人桩(这有吗)", 12000, 800, 80, 0, 6500);
                                else if (rand() % 3 == 1) fight2("金包(这有吗)", 24000, 400, 240, 0, 6500);
                                else fight2("金板", 12000, 800, 80, 0, 6500);
                            }
                            if (!dead)
                            {
                                LE1++;
                                if (ane == 0) D_Of_C++;
                            }
                        }
                        if (y == 2)
                        {
                            for (int i = 0; i < LE2 % 5; i++)
                            {
                                if (rand() % 3 == 0) fight1("木人桩", 1500, 100, 10, 0, 1000);
                                else if (rand() % 3 == 1) fight1("沙包", 3000, 50, 20, 0, 1000);
                                else fight1("木板", 1000, 100, 10, 0, 1000);
                                if (dead) break;
                            }
                            for (int i = 0; i < (LE2 / 5) % 25; i++)
                            {
                                if (dead) break;
                                if (rand() % 3 == 0) fight1("石人桩(这有吗)", 3000, 200, 20, 0, 1000);
                                else if (rand() % 3 == 1) fight1("石包(这有吗)", 6000, 100, 60, 0, 1000);
                                else fight1("石板", 3000, 300, 30, 0, 1000);
                            }
                            for (int i = 0; i < (LE2 / 25) % 125; i++)
                            {
                                if (dead) break;
                                if (rand() % 3 == 0) fight1("铁人桩(这有吗)", 6000, 400, 40, 0, 4000);
                                else if (rand() % 3 == 1) fight1("铁包(这有吗)", 12000, 200, 120, 0, 4000);
                                else fight1("铁板", 6000, 400, 40, 0, 4000);
                            }
                            for (int i = 0; i < (LE2 / 125) % 625; i++)
                            {
                                if (dead) break;
                                if (rand() % 3 == 0) fight1("金人桩(这有吗)", 12000, 800, 80, 0, 6500);
                                else if (rand() % 3 == 1) fight1("金包(这有吗)", 24000, 400, 240, 0, 6500);
                                else fight1("金板", 12000, 800, 80, 0, 6500);
                            }
                            if (!dead)
                            {
                                LE2++;
                                if (ane == 0) D_Of_C++;
                            }
                        }
                        break;
                    case 14:
                        save();
                        cout << "保存成功!";
                        Sleep(1000);
                        break;
                    case 15:
                        Hos();
                        Sleep(1000);
                        break;
                    case 16:
                        int pw;
                        cout << "密码:";
                        cin >> pw;
                        if (pw == 1212)
                        {
                            cout << "0~42,改变背包 43,金币 44,等级 45,经验 46,生命 47,防御 48,攻击 49,最大生命 50,进入魔法部权力(0没有 0<有) 51,速度" << endl;
                            int num1, num2;
                            cout << "几号:";
                            cin >> num1;
                            cout << "改变成:";
                            cin >> num2;
                            if (num1 <= 42) bag[num1] = num2;
                            else
                            {
                                switch (num1)
                                {
                                    case 43:
                                        money = num2;
                                        break;
                                    case 44:
                                        level = num2;
                                        break;
                                    case 45:
                                        experience = num2;
                                        break;
                                    case 46:
                                        health = num2;
                                        break;
                                    case 47:
                                        defense = num2;
                                        break;
                                    case 48:
                                        attack = num2;
                                        break;
                                    case 49:
                                        maxhealth = num2;
                                        break;
                                    case 50:
                                        amm = num2;
                                        break;
                                    case 51:
                                        speed = num2;
                                        break;
                                    default:
                                        break;
                                }
                            }
                            levelup();
                            cout << "改变成功";
                        }
                        else cout << "密码错误" << endl;
                        Sleep(1000);
                        break;
                    case 17:
                        cout << "1,关卡攻略 2,关卡功能" << endl;
                        int xd;
                        cin >> xd;
                        if (xd == 1) system("start https://paste.ubuntu.com/p/2YQBCmYvSb/");
                        if (xd == 2)
                        {
                            cout << "我们先介绍一下图标" << endl;
                            cout << "╔═══╗  ╔═══╗  ╔═══╗  ╔═══╗" << endl;
                            cout << "║ @ ║  ║ I ║  ║ o ║  ║ # ║" << endl;
                            cout << "╚═══╝  ╚═══╝  ╚═══╝  ╚═══╝" << endl;
                            cout << "你自己   出口    入口    墙" << endl;
                            cout << "╔═══╗  ╔═══╗  ╔═══╗  ╔═══╗" << endl;
                            cout << "║ 1 ║  ║ 2 ║  ║ 3 ║  ║ 4 ║" << endl;
                            cout << "╚═══╝  ╚═══╝  ╚═══╝  ╚═══╝" << endl;
                            cout << "1级怪   2级怪   3级怪  4级怪" << endl;
                            cout << "命1000 命2000  命3000 命4000" << endl;
                            cout << "攻250  攻500   攻750  攻1000" << endl;
                            cout << "防10   防20    防30   防40" << endl;
                            cout << "速50   速100   速150  速200" << endl;
                            cout << "╔═══╗  ╔═══╗  ╔═══╗  ╔═══╗" << endl;
                            cout << "║ 5 ║  ║ 6 ║  ║ 7 ║  ║ 8 ║" << endl;
                            cout << "╚═══╝  ╚═══╝  ╚═══╝  ╚═══╝" << endl;
                            cout << "5级怪   6级怪   7级怪  8级怪" << endl;
                            cout << "命5000 命6000  命7000 命8000" << endl;
                            cout << "攻1250 攻1500  攻1750 攻2000" << endl;
                            cout << "防50   防60    防70   防80" << endl;
                            cout << "速250  速300   速350  速400" << endl;
                            cout << "╔═══╗  ╔═══╗  ╔═══╗  ╔═══╗" << endl;
                            cout << "║ 9 ║  ║ S ║  ║ B ║  ║ T ║" << endl;
                            cout << "╚═══╝  ╚═══╝  ╚═══╝  ╚═══╝" << endl;
                            cout << "9级怪  药水商店  书店   告示牌" << endl;
                            cout << "命9000" << endl;
                            cout << "攻2250" << endl;
                            cout << "防90" << endl;
                            cout << "速450" << endl;
                            cout << "╔═══╗" << endl;
                            cout << "║ X ║" << endl;
                            cout << "╚═══╝" << endl;
                            cout << "传送机" << endl;
                            cout << "输入图标了解详细,0退出" << endl;
                            string st;
                            cin >> st;
                            if (st == "@") system("start https://paste.ubuntu.com/p/cdJPnhXddT/");
                            else if (st == "I" || st == "i") system("start https://paste.ubuntu.com/p/h5npMzvDBX/");
                            else if (st == "o" || st == "O") system("start https://paste.ubuntu.com/p/By6Fdyq9wq/");
                            else if (st == "#") system("start https://paste.ubuntu.com/p/DswXYhVGFn/");
                            else if (st <= "9" && st >= "1") system("start https://paste.ubuntu.com/p/4vZDjY7fX4/");
                            else if (st == "S" || st == "s") system("start https://paste.ubuntu.com/p/SvSTDGrcD3/");
                            else if (st == "B" || st == "b") system("start https://paste.ubuntu.com/p/MMqwYn63N9/");
                            else if (st == "T" || st == "t") system("start https://paste.ubuntu.com/p/mXgfbyhGGJ/");
                            else if (st == "X" || st == "x") system("start https://paste.ubuntu.com/p/M6svDYryGt/");
                            else if (st == "0");
                            else cout << "请勿乱输" << endl;
                            Sleep(1000);
                        }
                        break;
                    case 18:
                        isbreak = true;
                }
                levelup();
            }
        }
    }
}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值