#include <iostream>
#include <time.h>//使每次呼叫的值不一樣 
#include <fstream>//為了使用存取檔案~開啟資料流 
#include <windows.h>//為了使用GetKeyState()與GetKeyboardState()
#include <string>//為了使用string(字串) 

void start();//點屬性的視窗
void game();//遊戲開始的視窗 
void people();//人物狀態資料視窗 
void pitem();//道具資料 
void uitem();//使用道具-列出
void uuitem(int used2);//使用道具
void pequ();//裝備資料 
void pskill();//技能資料
void uequ();//裝備武器-列出
void uuequ(int used2);//裝備武器 
void checkequi();//卸下裝備後確認用 
void save();//存
void load();//讀
void sleep();//旅店 
void item();//道具店 
void itembuy();//買道具 
void itemsell();//賣道具 
void plusplus();//武器店
void armsplus();//武器精練
void armsbuy();//買武器裝備 
void armssell();//賣武器裝備 
void champaign();//平原
void cave();//洞窟
void tower();//塔 
void action(int r);//動作
void war(int &r);//戰鬥 
void gem(int &r);//寶箱 
int explist();//經驗值表
int checkitem();//確認道具的種類之後回傳 
int checkequ();//確認裝備的種類之後回傳 
int choose(int num,int itemm);//選擇個數 計算金錢 
short map[10][10]={4,4,4,4,4,4,4,4,4,4,//這是平原的地圖 
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,4,4,4,4,4,
                   4,4,4,4,4,1,4,4,4,4};
using namespace std;
typedef unsigned char byte;
string name;//輸入名稱的字串  
byte KeyArray[256];//判斷按鍵用 
char PreKeyArray[256];//判斷按鍵用
int i,Mexp,str=1,vit=1,dex=1,inte=1,spi=1,luc=1,lv=1,exp=0,money=0,point=15;
//str是力量vit是體質dex是敏捷inte是智慧spi是精神luc是幸運lv是等級exp是經驗值money是錢point是點數 
double mp,Mp,hp,Hp;
//Mexp是最大經驗值mp是魔Mp是最大魔hp是血Hp是最大血
bool champmap=false,tower1=false,tower2=false,tower3=false,tower4=false,
tower5=false,tower6=false,tower7=false,tower8=false,tower9=false;
//chammap是平原的地圖tower1是塔1樓~以此類推 
int HP10=1,HP50,HP100,HP150,HP200,HP250,MP10,MP50,MP100,MP150,MP200,MP250,MP300, 
    pro1,pro5,apro1,exitwar,govill,cmap,tmap1,tmap2,tmap3,tmap4,tmap5,tmap6,tmap7,tmap8;
int wo,wo1,wo2,wo3,wo4,wo5,me,me1,me2,me3,me4,me5,si,si1,si2,si3,si4,si5,
    so,so1,so2,so3,so4,so5,br,br1,br2,br3,br4,br5, 
    woo,woo1,woo2,woo3,woo4,woo5,bl,bl1,bl2,bl3,bl4,bl5,cr,cr1,cr2,cr3,cr4,cr5, 
    el,el1,el2,el3,el4,el5,sa,sa1,sa2,sa3,sa4,sa5; 
//道具跟武器還有地圖
//wo木劍me鐵劍si銀劍so子母劍br勇者之劍
//woo是木杖bl是藍寶石杖cr是水晶杖el是元素之杖sa是賢者之杖
//宣告需要的引數以及陣列 
int equw=99;//裝備中的武器 
//////////////////////////////////////////////////////////////////////////////// 
//主選單 
////////////////////////////////////////////////////////////////////////////////
int main()//主選單 
{ 
menu:
    cout << "    > 開始遊戲 " << endl; 
    cout << "      讀取遊戲 " << endl;
    cout << "      結束遊戲 " << endl;
    cout << "               " << endl;
    cout << "你可以按'下'來移動指標與按'Enter'選擇" << endl;
//選單第1
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto menu2;
        }
//下~跳到下面的選單2(menu2) 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            start();
        }
//選擇~跳到下面的開始(start) 
        cout << "請勿按除了'下'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto menu;
    }
menu2:
    cout << "      開始遊戲 " << endl;
    cout << "    > 讀取遊戲 " << endl;
    cout << "      結束遊戲 " << endl;
    cout << "               " << endl;
    cout << "你可以按'下'和'上'移動指標與按'Enter'選擇" << endl;
//選單第2 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto menu;
        }
//上~回到選單1(menu)
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto menu3;
        }
//下~跳到下面的選單3(menu3) 
        if((KeyArray[13]&0x80)!=0)
        {
            load();//呼叫讀檔 
        }
//選擇~跳到下面的讀取存檔(load) 
        cout << "請勿按除了'下'和'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto menu2;
    }
menu3:
    cout << "      開始遊戲 " << endl;
    cout << "      讀取遊戲 " << endl;
    cout << "    > 結束遊戲 " << endl;
    cout << "               " << endl;
    cout << "你可以按'上'移動指標與按'Enter'選擇" << endl;
//選單第3 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto menu2;
        }
//上~回到選單2(menu2)
        if((KeyArray[13]&0x80)!=0)
        {
            exit(0);//離開遊戲
        }
//選擇~跳到下面的結束(exit)
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto menu3;
    }
}
////////////////////////////////////////////////////////////////////////////////
//開始遊戲-點點數 
////////////////////////////////////////////////////////////////////////////////
void start()
{
name://輸入名稱
    cout << "歡迎來到這個小型的RPG世界"<< endl;
    cout << "請輸入你人物想要的名稱" << endl;
    cout << "(可以使用中文、英文以及數字)" << endl;
    cin >> name;
name2://確認 
    system("cls");
    cout << "你的名字是    " << name << endl;
    cout << "確認請按[Y]es 想重新輸入請按[N]o" << endl;
    system("pause");//開始確認 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[89]&0x80)!=0)
        {
            system("cls");
            goto property;
        }
//是~到下面點屬性(menu2)
        if((KeyArray[78]&0x80)!=0)
        {
            system("cls");
            goto name;
        }
//否~跳回輸入名稱的地方(name)
         cout << "請勿按除了[Y]es與[N]o以外的其他按鍵" << endl;
         system("pause");
         system("cls");
         goto name2;
    }
//名字設定視窗結束 
property://屬性 
    cout << "接下來你可以設定你想要增加的屬性"<< endl;
    cout << "一共有六種屬性(力量、體質、敏捷、智慧、精神、幸運)可以點選"<< endl;
    cout << "屬性基礎為1，你有15點可以自由點選，單項目前最高只能點到6"<< endl;
    system("pause");
    system("cls");
pro://開始點選屬性~選單1   
    cout << "你目前的屬性如下" << endl;
    cout << "   > 力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl;    
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'下'來移動指標與按'Enter'來使指標的當前屬性增加1點數值" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(str<6&&point>0)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[40]&0x80)!=0)
            {
                system("cls");
                goto pro2;
            }
//下~到下面點屬性2(pro2)                   
            if((KeyArray[13]&0x80)!=0)
            {          
                str++;
                point--;
                system("cls");
                goto pro;
            }
//確認~當前屬性加1點
            cout << "請勿按除了'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro;
        }
    }//已經點到6點或是沒有點數了 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro2;
        }
//下~到下面點屬性2(pro2)                   
        if((KeyArray[13]&0x80)!=0)
        {
            cout << "該項你已經點到6了或是你已經沒有點數可以點" << endl;
            system("pause");
            system("cls");
            goto pro;
        }
//確認~已經超過了點數 
            cout << "請勿按除了'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro;
    }    
//判斷結束~連接下面一個選單
pro2://選單2 
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "   > 體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl;
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'Enter'來使指標當前的屬性增加1點數值" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(vit<6&&point>0)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                system("cls");
                goto pro;
            }
//上~回到上面點屬性1(pro) 
            if((KeyArray[40]&0x80)!=0)
            {
                system("cls");
                goto pro3;
            }
//下~到下面點屬性3(pro3)                   
            if((KeyArray[13]&0x80)!=0)
            {
                vit++;
                point--;
                system("cls");
                goto pro2;
            }
//確認~當前屬性加1點
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro;
        }
    }//已經點到6點或是沒有點數了 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro;
        }
//上~回到上面點屬性1(pro) 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro3;
        }
//下~到下面點屬性3(pro3)                   
        if((KeyArray[13]&0x80)!=0)
        {
            cout << "該項你已經點到6了或是你已經沒有點數可以點" << endl;
            system("pause");
            system("cls");
            goto pro2;
        }
//確認~已經超過了點數 
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro2;
    }
//判斷結束~連接下面一個選單
pro3://選單3
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "   > 敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl; 
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'Enter'來使指標當前的屬性增加1點數值" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(dex<6&&point>0)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                system("cls");
                goto pro2;
            }
//上~回到上面點屬性2(pro2) 
            if((KeyArray[40]&0x80)!=0)
            {
                system("cls");
                goto pro4;
            }
//下~到下面點屬性4(pro4)                   
            if((KeyArray[13]&0x80)!=0)
            {
                dex++;
                point--;
                system("cls");
                goto pro3;
            }
//確認~當前屬性加1點
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro3;
        }
    }//已經點到6點或是沒有點數了          
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro2;
        }
//上~回到上面點屬性2(pro2) 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro4;
        }
//下~到下面點屬性4(pro4)                   
        if((KeyArray[13]&0x80)!=0)
        {
            cout << "該項你已經點到6了或是你已經沒有點數可以點" << endl;
            system("pause");
            system("cls");
            goto pro3;
        }
//確認~已經超過了點數 
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro3;
    }
//判斷結束~連接下面一個選單
pro4://選單4 
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "   > 智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl; 
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'Enter'來使指標當前的屬性增加1點數值" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(inte<6&&point>0)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                system("cls");
                goto pro3;
            }
//上~回到上面點屬性3(pro3) 
            if((KeyArray[40]&0x80)!=0)
            {
                system("cls");
                goto pro5;
            }
//下~到下面點屬性5(pro5)                   
            if((KeyArray[13]&0x80)!=0)
            {
                inte++;
                point--;
                system("cls");
                goto pro4;
            }
//確認~當前屬性加1點
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro4;
        }
    }//已經點到6點或是沒有點數了          
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro3;
        }
//上~回到上面點屬性3(pro3) 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro5;
        }
//下~到下面點屬性5(pro5)                   
        if((KeyArray[13]&0x80)!=0)
        {                               
            cout << "該項你已經點到6了或是你已經沒有點數可以點" << endl;
            system("pause");
            system("cls");
            goto pro4;
        }
//確認~已經超過了點數 
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro4;
    }
//判斷結束~連接下面一個選單
pro5://選單5 
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "   > 精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl; 
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'Enter'來使指標當前的屬性增加1點數值" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(spi<6&&point>0)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                system("cls");
                goto pro4;
            }
//上~回到上面點屬性4(pro4) 
            if((KeyArray[40]&0x80)!=0)
            {
                system("cls");
                goto pro6;
            }
//下~到下面點屬性6(pro6)                   
            if((KeyArray[13]&0x80)!=0)
            {
                spi++;
                point--;
                system("cls");
                goto pro5;
            }
//確認~當前屬性加1點
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro5;
        }
    }//已經點到6點或是沒有點數了          
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro4;
        }
//上~回到上面點屬性4(pro4) 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro6;
        }
//下~到下面點屬性6(pro6)                   
        if((KeyArray[13]&0x80)!=0)
        {                               
            cout << "該項你已經點到6了或是你已經沒有點數可以點" << endl;
            system("pause");
            system("cls");
            goto pro5;
        }
//確認~已經超過了點數 
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro5;
    }
//判斷結束~連接下面一個選單
pro6://選單6 
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "   > 幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl; 
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'Enter'來使指標當前的屬性增加1點數值" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(luc<6&&point>0)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                system("cls");
                goto pro5;
            }
//上~回到上面點屬性5(pro5) 
            if((KeyArray[40]&0x80)!=0)
            {
                system("cls");
                goto pro7;
            }
//下~到下面點屬性7(pro7)                   
            if((KeyArray[13]&0x80)!=0)
            {
                luc++;
                point--;
                system("cls");
                goto pro6;
            }
//確認~當前屬性加1點
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro6;
        }
    }//已經點到6點或是沒有點數了          
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro5;
        }
//上~回到上面點屬性5(pro5) 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro7;
        }
//下~到下面點屬性7(pro7)                   
        if((KeyArray[13]&0x80)!=0)
        {                               
            cout << "該項你已經點到6了或是你已經沒有點數可以點" << endl;
            system("pause");
            system("cls");
            goto pro6;
        }
//確認~已經超過了點數 
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro6;
    }
pro7://重新分配 
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "   > 重新分配(慎選)    " << endl;
    cout << "     分配結束      " << endl; 
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'Enter'來選擇" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro6;
        }
//上~回到上面點屬性6(pro6) 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto pro8;
        }
//下~到下面點屬性8(pro8)                   
        if((KeyArray[13]&0x80)!=0)
        {
            str=vit=dex=inte=spi=luc=1;
            point=15;
            system("cls");
            goto pro7;
        }
//確認~重置點數
        cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto pro6;
    }
pro8://確定選擇 
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "     重新分配(慎選)    " << endl;
    cout << "   > 分配結束      " << endl; 
    cout << "你目前還有" << point << "點的點數可以自由運用" << endl;
    cout << "-------------------" << endl;
    cout << "力量與攻擊力有關，體質與血量還有防禦有關，敏捷與命中、爆擊率有關" << endl;
    cout << "智慧與魔法攻擊力還有魔量有關，精神與回血、回魔量有關，幸運與閃躲率有關" << endl;
    cout << "-------------------" << endl;
    cout << "你可以按'上'來移動指標與按'Enter'來選擇" << endl;
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    if(point<1)//該點數沒大於6(點了5點)或是點數還有 
    {
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                system("cls");
                goto pro7;
            }
//上~回到上面點屬性7(pro7)               
            if((KeyArray[13]&0x80)!=0)
            {
                system("cls");
                goto check;
            }
//確認
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro8;
        }
    }//還有點數              
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto pro7;
        }
//上~回到上面點屬性7(pro7)                
        if((KeyArray[13]&0x80)!=0)
        {                               
            cout << "你還有屬性點沒點，作者的好意你敢浪費?" << endl;
            system("pause");
            system("cls");
            goto pro8;
        }
//確認~還有點數 
            cout << "請勿按除了'上'和'下'與'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto pro8;
    }
check://確認畫面    
    cout << "你目前的屬性如下" << endl;
    cout << "     力量      " << str << endl;
    cout << "     體質      " << vit << endl;
    cout << "     敏捷      " << dex << endl;
    cout << "     智慧      " << inte << endl;
    cout << "     精神      " << spi << endl;
    cout << "     幸運      " << luc << endl;
    cout << "確認請按[Y]es 想重新輸入請按[N]o" << endl;
    system("pause");//開始確認 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[89]&0x80)!=0)
        {
            system("cls");
            break;
        }
//是~到下面點屬性(menu2)
        if((KeyArray[78]&0x80)!=0)
        {
            str=vit=dex=inte=spi=luc=1;
            point=15;                                 
            system("cls");
            goto property;
        }
//否~跳回設定屬性的開頭 
         cout << "請勿按除了[Y]es與[N]o以外的其他按鍵" << endl;
         system("pause");
         system("cls");
         goto check;
    }
//確認結束
    cout << "一切準備就緒了 " << name << endl;
    cout << "看完故事劇情後，你就會進到村莊裡面" << endl; 
    system("pause");
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[27]&0x80)!=0)
        {
            goto over;
        }
//ESC~跳到下面的跳過(over) 
    system("cls");
    Sleep(1500);
    printf("-");Sleep(500);printf("-");Sleep(500);printf("某");Sleep(500);
    printf("天");Sleep(500);printf("-");Sleep(500);printf("-\n");Sleep(500);
    Sleep(1000);
    printf("今");Sleep(300);printf("天");Sleep(300);printf("本");Sleep(300);
    printf("來");Sleep(300);printf("該");Sleep(300);printf("像");Sleep(300);        
    printf("是");Sleep(300);printf("平");Sleep(300);printf("常");Sleep(300);
    printf("的");Sleep(300);printf("一");Sleep(300);printf("天");Sleep(500);
    printf("，");Sleep(500);printf("這");Sleep(300);printf("村");Sleep(300);
    printf("莊");Sleep(300);printf("的");Sleep(300);printf("人");Sleep(300);
    printf("們");Sleep(300);printf("辛");Sleep(300);printf("勤");Sleep(300);
    printf("的");Sleep(300);printf("工");Sleep(300);printf("作");Sleep(300);
    printf("著\n");Sleep(300);printf("");Sleep(1200);printf("但");Sleep(300);
    printf("事");Sleep(300);printf("情");Sleep(300);printf("總");Sleep(300);
    printf("不");Sleep(300);printf("是");Sleep(300);printf("像");Sleep(300);
    printf("各");Sleep(300);printf("位");Sleep(300);printf("想");Sleep(300);
    printf("的");Sleep(300);printf("一");Sleep(300);printf("樣\n");Sleep(300);
    printf("");Sleep(1200);printf("今");Sleep(300);printf("天\n");Sleep(300);
    printf("");Sleep(1200);printf("對");Sleep(300);printf("於");Sleep(300);
    printf("這");Sleep(300);printf("村");Sleep(300);printf("莊");Sleep(300);
    printf("的");Sleep(300);printf("人");Sleep(300);printf("們");Sleep(300);
    printf("來");Sleep(300);printf("說");Sleep(500);printf("，");Sleep(500);
    printf("是");Sleep(300);printf("個");Sleep(300);printf("悲");Sleep(300);
    printf("劇");Sleep(300);printf("的");Sleep(300);printf("開");Sleep(300);
    printf("始\n");Sleep(300);printf("");Sleep(1200);printf("不");Sleep(300);
    printf("知");Sleep(300);printf("是");Sleep(300);printf("哪");Sleep(300);
    printf("邊");Sleep(300);printf("的");Sleep(300);printf("惡");Sleep(300);
    printf("魔");Sleep(500);printf("，");Sleep(500);printf("來");Sleep(300);
    printf("到");Sleep(300);printf("了");Sleep(300);printf("在");Sleep(300);
    printf("這");Sleep(300);printf("村");Sleep(300);printf("莊");Sleep(300);
    printf("附");Sleep(300);printf("近");Sleep(300);printf("的");Sleep(300);
    printf("一");Sleep(300);printf("座");Sleep(300);printf("廢");Sleep(300);
    printf("墟");Sleep(300);printf("之");Sleep(300);printf("塔\n");Sleep(300);
    printf("");Sleep(1200);printf("順");Sleep(300);printf("便");Sleep(300);
    printf("的");Sleep(500);printf("，");Sleep(500);printf("引");Sleep(300);
    printf("來");Sleep(300);printf("了");Sleep(300);printf("更");Sleep(300);
    printf("多");Sleep(300);printf("的");Sleep(300);printf("災");Sleep(300);
    printf("厄");Sleep(300);printf("之");Sleep(300);printf("源");Sleep(300);
    printf("-");Sleep(500);printf("-");Sleep(1000);printf("怪");Sleep(1000);
    printf("物\n");Sleep(300);printf("");Sleep(1200);printf("頓");Sleep(300);
    printf("時");Sleep(500);printf("，");Sleep(500);printf("這");Sleep(300);
    printf("村");Sleep(300);printf("莊");Sleep(300);printf("便");Sleep(300);
    printf("成");Sleep(300);printf("了");Sleep(300);printf("在");Sleep(300);
    printf("汪");Sleep(300);printf("洋");Sleep(300);printf("中");Sleep(300);
    printf("的");Sleep(300);printf("小");Sleep(300);printf("船");Sleep(500);
    printf("，");Sleep(500);printf("危");Sleep(300);printf("機");Sleep(300);
    printf("四");Sleep(300);printf("處\n");Sleep(300);printf("");Sleep(1200);
    printf("而");Sleep(300);printf("你");Sleep(500);printf("，");Sleep(500);
    cout << name;Sleep(1200);printf("你");Sleep(300);printf("則");Sleep(300);
    printf("是");Sleep(300);printf("這");Sleep(300);printf("村");Sleep(300);
    printf("莊");Sleep(300);printf("唯");Sleep(300);printf("一");Sleep(300);
    printf("的");Sleep(300);printf("救");Sleep(300);printf("星\n");Sleep(300);
    printf("");Sleep(1200);printf("因");Sleep(300);printf("為");Sleep(300);
    printf("你");Sleep(300);printf("是");Sleep(300);printf("個");Sleep(300);
    printf("冒");Sleep(300);printf("險");Sleep(300);printf("者");Sleep(300);
    printf(".");Sleep(300);printf(".");Sleep(300);printf(".");Sleep(300);
    printf("強");Sleep(300);printf("力");Sleep(300);printf("而");Sleep(300);
    printf("且");Sleep(300);printf("勇");Sleep(300);printf("敢");Sleep(300);
    printf("的");Sleep(300);printf("冒");Sleep(300);printf("險");Sleep(300);
    printf("者");Sleep(300);printf(".");Sleep(300);printf(".");Sleep(300);
    printf(".");Sleep(300);printf(".");Sleep(300);printf(".\n");Sleep(2000);   
    system("pause");
    goto over; 
    }
over:
    mp=Mp=static_cast<int>((inte*2+lv*3)*3);
    hp=Hp=static_cast<int>((vit*2+lv*3)*2.5);
    system("cls");
    game();
} 
////////////////////////////////////////////////////////////////////////////////
//遊戲開始-正式開始 
////////////////////////////////////////////////////////////////////////////////
void game()
{
village:   
    cout << "               > 道具店" << endl;
    cout << "                 打鐵舖" << endl;
    cout << "                 旅店" << endl;
    cout << "                 儲存檔案" << endl;
    cout << "                 離開村莊" << endl;
    cout << "                 結束遊戲" << endl;
    cout << "                         " << endl;
    cout << "早安! " << name << " 你現在在村莊裡，請問你要做什麼事情呢?" << endl;
    cout << "你可以按'下'來移動指標與按'Enter'來選擇" << endl;
    cout << "按'Esc'可以檢查你的狀態以及背包" << endl;
    cout << "                                                          " << endl;
//村莊主選單
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto village2;
        }
//下~跳到下面的選單2(village2) 
        if((KeyArray[13]&0x80)!=0)
        {
            item();//道具店 
            goto village;
        }
//選擇~跳到下面的道具(item)
        if((KeyArray[27]&0x80)!=0)
        {
            people();
            goto village;
        }
//ESC~跳到下面的人物(people) 
        cout << "請勿按除了'下'、'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto village;
    }
village2:
    cout << "                 道具店" << endl;
    cout << "               > 打鐵舖" << endl;
    cout << "                 旅店" << endl;
    cout << "                 儲存檔案" << endl;
    cout << "                 離開村莊" << endl;
    cout << "                 結束遊戲" << endl;
    cout << "                         " << endl;
    cout << "早安! " << name << " 你現在在村莊裡，請問你要做什麼事情呢?" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "按'Esc'可以檢查你的狀態以及背包" << endl;
    cout << "                                                          " << endl;
//選單第2 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto village;
        }
//上~回到選單1(village)
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto village3;
        }
//下~跳到下面的選單3(village3) 
        if((KeyArray[13]&0x80)!=0)
        {
            plusplus();//精練
            goto village2;
        }
//選擇~跳到下面的精練(plus)
        if((KeyArray[27]&0x80)!=0)
        {
            people();
            goto village2;
        }
//ESC~
        cout << "請勿按除了'下'和'上'、'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto village2;
    }
village3: 
    cout << "                 道具店" << endl;
    cout << "                 打鐵舖" << endl;
    cout << "               > 旅店" << endl;
    cout << "                 儲存檔案" << endl;
    cout << "                 離開村莊" << endl;
    cout << "                 結束遊戲" << endl;
    cout << "                         " << endl;
    cout << "早安! " << name << " 你現在在村莊裡，請問你要做什麼事情呢?" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "按'Esc'可以檢查你的狀態以及背包" << endl;
    cout << "                                                          " << endl;
//選單第3 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto village2;
        }
//上~回到選單2(village2)
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto village4;
        }
//下~跳到下面的選單4(village4) 
        if((KeyArray[13]&0x80)!=0)
        {
            sleep();//旅店 
            goto village3;
        }
//選擇~跳到下面的旅店(slppe)
        if((KeyArray[27]&0x80)!=0)
        {
            people();
            goto village3;
        }
//ESC~ 
        cout << "請勿按除了'下'和'上'、'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto village3;
    }
village4: 
    cout << "                 道具店" << endl;
    cout << "                 打鐵舖" << endl;
    cout << "                 旅店" << endl;
    cout << "               > 儲存檔案" << endl;
    cout << "                 離開村莊" << endl;
    cout << "                 結束遊戲" << endl;
    cout << "                         " << endl;
    cout << "早安! " << name << " 你現在在村莊裡，請問你要做什麼事情呢?" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "按'Esc'可以檢查你的狀態以及背包" << endl;
    cout << "                                                          " << endl;
//選單第4 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto village3;
        }
//上~回到選單3(village3)
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto village5;
        }
//下~跳到下面的選單5(village5) 
        if((KeyArray[13]&0x80)!=0)
        {
            save();//存檔選單 
            goto village4;
        }
//選擇~跳到下面的存檔(save)
        if((KeyArray[27]&0x80)!=0)
        {
            people();
            goto village4;
        }
//ESC~ 
        cout << "請勿按除了'下'和'上'、'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto village4;
    }
village5: 
    cout << "                 道具店" << endl;
    cout << "                 打鐵舖" << endl;
    cout << "                 旅店" << endl;
    cout << "                 儲存檔案" << endl;
    cout << "               > 離開村莊" << endl;
    cout << "                 結束遊戲" << endl;
    cout << "                         " << endl;
    cout << "早安! " << name << " 你現在在村莊裡，請問你要做什麼事情呢?" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "按'Esc'可以檢查你的狀態以及背包" << endl;
    cout << "                                                          " << endl;
//選單第5 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto village4;
        }
//上~回到選單4(village4)
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto village6;
        }
//下~跳到下面的選單6(village6) 
        if((KeyArray[13]&0x80)!=0)
        {
            champaign();//平原選單 
        }
//選擇~跳到下面的平原(champaign)
        if((KeyArray[27]&0x80)!=0)
        {
            people();
            goto village5;
        }
//ESC
        cout << "請勿按除了'下'和'上'、'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto village5;
    }
village6:
    cout << "                 道具店" << endl;
    cout << "                 打鐵舖" << endl;
    cout << "                 旅店" << endl;
    cout << "                 儲存檔案" << endl;
    cout << "                 離開村莊" << endl;
    cout << "               > 結束遊戲" << endl;
    cout << "                         " << endl;
    cout << "早安! " << name << " 你現在在村莊裡，請問你要做什麼事情呢?" << endl;
    cout << "你可以按'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "按'Esc'可以檢查你的狀態以及背包" << endl;
    cout << "                                                          " << endl;
//選單第6 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto village5;
        }
//上~回到選單5(village5)
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            str=1,vit=1,dex=1,inte=1,spi=1,luc=1,lv=1,exp=0,money=0,point=15,
            HP10=1,HP50=0,HP100=0,HP150=0,HP200=0,HP250=0,
            MP10=0,MP50=0,MP100=0,MP150=0,MP200=0,MP250=0,MP300=0,pro1=0,
            pro5=0,apro1=0,exitwar=0,govill=0,cmap=0,tmap1=0,tmap2=0,tmap3=0,tmap4=0,
            tmap5=0,tmap6=0,tmap7=0,tmap8=0,wo=0,wo1=0,wo2=0,wo3=0,wo4=0,wo5=0,
            me=0,me1=0,me2=0,me3=0,me4=0,me5=0,si=0,si1=0,si2=0,si3=0,si4=0,si5=0,
            so=0,so1=0,so2=0,so3=0,so4=0,so5=0,br=0,br1=0,br2=0,br3=0,br4=0,br5=0, 
            woo=0,woo1=0,woo2=0,woo3=0,woo4=0,woo5=0,bl=0,bl1=0,bl2=0,bl3=0,bl4=0,bl5=0,
            cr=0,cr1=0,cr2=0,cr3=0,cr4=0,cr5=0,el=0,el1=0,el2=0,el3=0,el4=0,el5=0,
            sa=0,sa1=0,sa2=0,sa3=0,sa4=0,sa5=0;
            equw=99; 
            main();
        }
//選擇~跳到下面的平原(champaign)
        if((KeyArray[27]&0x80)!=0)
        {
            people();
            goto village6;
        }
//ESC
        cout << "請勿按除了'上'、'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto village6;
    }
}
//////////////////////////////////////////////////////////////////////////////// 
//經驗值表 
////////////////////////////////////////////////////////////////////////////////
int explist()
{
    if(lv==1) 
    {
        return 5; 
    }
    if(lv==2) 
    {
        return 12; 
    }
    if(lv==3) 
    {
        return 21; 
    }
    if(lv==4) 
    {
        return 32; 
    }
    if(lv==5) 
    {
        return 45; 
    }
    if(lv==6) 
    {
        return 60; 
    }
    if(lv==7) 
    {
        return 77; 
    }
    if(lv==8) 
    {
        return 96; 
    }
    if(lv==9) 
    {
        return 117; 
    }
    if(lv==10) 
    {
        return 140; 
    }
    if(lv==11) 
    {
        return 165; 
    }
    if(lv==12) 
    {
        return 192;
    }
    if(lv==13) 
    {
        return 221; 
    }
    if(lv==14) 
    {
        return 252;
    }
    if(lv==15) 
    {
        return 293; 
    }
    if(lv==16) 
    {
        return 336;
    }
    if(lv==17) 
    {
        return 381; 
    }
    if(lv==18) 
    {
        return 428;
    }
    if(lv==19) 
    {
        return 477;
    }
    if(lv==20) 
    {
        return 528;
    }
    if(lv==21) 
    {
        return 581; 
    }
    if(lv==22) 
    {
        return 636;
    }
    if(lv==23) 
    {
        return 693;
    }
    if(lv==24) 
    {
        return 752;
    }
    if(lv==25) 
    {
        return 813;
    }
    if(lv==26) 
    {
        return 876;
    }
    if(lv==27) 
    {
        return 941;
    }
    if(lv==28) 
    {
        return 1008; 
    }
    if(lv==29) 
    {
        return 1077;
    }
    if(lv==30) 
    {
        return 999999; 
    }
} 
//////////////////////////////////////////////////////////////////////////////// 
//存檔 
////////////////////////////////////////////////////////////////////////////////
void save()
{
    int x=0,y=0; 
    ofstream ofile;
    ofile.open("RPG.sav");
    ofile << lv << endl;
    ofile << exp << endl;
    ofile << str << endl;
    ofile << vit << endl;    
    ofile << dex << endl;
    ofile << inte << endl;
    ofile << spi << endl;
    ofile << luc << endl;
    ofile << point << endl;    
    ofile << money << endl;
    ofile << name << endl;
    ofile << hp << endl;
    ofile << mp << endl;
    ofile << HP10 << endl;
    ofile << HP50 << endl;
    ofile << HP100 << endl;
    ofile << HP150 << endl;
    ofile << HP200 << endl;
    ofile << HP250 << endl;
    ofile << MP10 << endl;
    ofile << MP50 << endl;
    ofile << MP100 << endl;
    ofile << MP200 << endl;
    ofile << MP250 << endl;
    ofile << MP300 << endl;
    ofile << pro1 << endl;
    ofile << pro5 << endl;
    ofile << apro1 << endl;
    ofile << exitwar << endl;
    ofile << govill << endl;
    ofile << cmap << endl;
    ofile << tmap1 << endl;
    ofile << tmap2 << endl;
    ofile << tmap3 << endl;
    ofile << tmap4 << endl;
    ofile << tmap5 << endl;
    ofile << tmap6 << endl;
    ofile << tmap7 << endl;
    ofile << tmap8 << endl;
    ofile << wo << endl;
    ofile << wo1 << endl;
    ofile << wo2 << endl;
    ofile << wo3 << endl; 
    ofile << wo4 << endl;
    ofile << wo5 << endl;
    ofile << me << endl;
    ofile << me1 << endl;
    ofile << me2 << endl;
    ofile << me3 << endl;
    ofile << me4 << endl;
    ofile << me5 << endl;
    ofile << si << endl;
    ofile << si1 << endl;
    ofile << si2 << endl;
    ofile << si3 << endl;
    ofile << si4 << endl;
    ofile << si5 << endl;
    ofile << so << endl;
    ofile << so1 << endl;
    ofile << so2 << endl;
    ofile << so3 << endl;
    ofile << so4 << endl;
    ofile << so5 << endl;
    ofile << br << endl;
    ofile << br1 << endl;
    ofile << br2 << endl;
    ofile << br3 << endl;
    ofile << br4 << endl;
    ofile << br5 << endl;
    ofile << woo << endl;
    ofile << woo1 << endl;
    ofile << woo2 << endl;
    ofile << woo3 << endl;
    ofile << woo4 << endl;
    ofile << woo5 << endl;
    ofile << bl << endl;
    ofile << bl1 << endl;
    ofile << bl2 << endl;
    ofile << bl3 << endl;
    ofile << bl4 << endl;
    ofile << bl5 << endl;
    ofile << cr << endl;
    ofile << cr1 << endl;
    ofile << cr2 << endl;
    ofile << cr3 << endl;
    ofile << cr4 << endl;
    ofile << cr5 << endl;
    ofile << el << endl;
    ofile << el1 << endl;
    ofile << el2 << endl;
    ofile << el3 << endl; 
    ofile << el4 << endl;
    ofile << el5 << endl;
    ofile << sa << endl;
    ofile << sa1 << endl;
    ofile << sa2 << endl; 
    ofile << sa3 << endl;
    ofile << sa4 << endl;
    ofile << sa5 << endl;
    ofile << equw << endl;
    for(y=0;y<10;y++)
    {
        for(x=0;x<10;x++) 
        {
            ofile << map[y][x] << endl;
        }  
    }
    ofile.close();    
    cout << "你已經存檔好了" << endl;
    system("pause");
    system("cls");   
} 
////////////////////////////////////////////////////////////////////////////////
//讀取 
////////////////////////////////////////////////////////////////////////////////
void load()
{ 
    int x=0,y=0;
    ifstream ifile;
    ifile.open("RPG.sav");
    ifile >> lv;
    ifile >> exp;
    ifile >> str;
    ifile >> vit;
    ifile >> dex;
    ifile >> inte;
    ifile >> spi; 
    ifile >> luc;
    ifile >> point;
    ifile >> money;
    ifile >> name;
    ifile >> hp;
    ifile >> mp;
    ifile >> HP10;
    ifile >> HP50;
    ifile >> HP100;
    ifile >> HP150;
    ifile >> HP200;
    ifile >> HP250;
    ifile >> MP10;
    ifile >> MP50; 
    ifile >> MP100; 
    ifile >> MP200; 
    ifile >> MP250; 
    ifile >> MP300; 
    ifile >> pro1; 
    ifile >> pro5; 
    ifile >> apro1; 
    ifile >> exitwar; 
    ifile >> govill; 
    ifile >> cmap; 
    ifile >> tmap1; 
    ifile >> tmap2; 
    ifile >> tmap3; 
    ifile >> tmap4; 
    ifile >> tmap5; 
    ifile >> tmap6; 
    ifile >> tmap7; 
    ifile >> tmap8;
    ifile >> wo; 
    ifile >> wo1; 
    ifile >> wo2; 
    ifile >> wo3; 
    ifile >> wo4; 
    ifile >> wo5; 
    ifile >> me; 
    ifile >> me1; 
    ifile >> me2; 
    ifile >> me3; 
    ifile >> me4; 
    ifile >> me5; 
    ifile >> si; 
    ifile >> si1; 
    ifile >> si2; 
    ifile >> si3; 
    ifile >> si4; 
    ifile >> si5; 
    ifile >> so; 
    ifile >> so1; 
    ifile >> so2; 
    ifile >> so3; 
    ifile >> so4; 
    ifile >> so5; 
    ifile >> br; 
    ifile >> br1; 
    ifile >> br2; 
    ifile >> br3; 
    ifile >> br4; 
    ifile >> br5;
    ifile >> woo; 
    ifile >> woo1; 
    ifile >> woo2; 
    ifile >> woo3; 
    ifile >> woo4; 
    ifile >> woo5; 
    ifile >> bl; 
    ifile >> bl1; 
    ifile >> bl2; 
    ifile >> bl3; 
    ifile >> bl4; 
    ifile >> bl5; 
    ifile >> cr; 
    ifile >> cr1; 
    ifile >> cr2; 
    ifile >> cr3; 
    ifile >> cr4; 
    ifile >> cr5; 
    ifile >> el; 
    ifile >> el1; 
    ifile >> el2; 
    ifile >> el3; 
    ifile >> el4; 
    ifile >> el5; 
    ifile >> sa; 
    ifile >> sa1; 
    ifile >> sa2; 
    ifile >> sa3; 
    ifile >> sa4; 
    ifile >> sa5;    
    ifile >> equw;
    for(y=0;y<10;y++) 
    {
        for(x=0;x<10;x++) 
        {
            ifile >> map[y][x];
        }  
    } 
    ifile.close();
    cout << "已經讀取檔案了" << endl;
    Mp=static_cast<int>((inte*2+lv*3)*3);
    Hp=static_cast<int>((vit*2+lv*3)*2.5);
    system("pause");
    system("cls"); 
    game();
} 
////////////////////////////////////////////////////////////////////////////////
//旅店
////////////////////////////////////////////////////////////////////////////////
void sleep()
{
    system("cls");
sleep: 
    cout << "               > 睡覺    " << endl;
    cout << "                 離開旅店" << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "你好! 這邊是旅店 您可以選擇睡覺或是離開" << endl;
    cout << "睡覺將可以補滿你的魔與血" << endl;
    cout << "你可以按'下'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto sleep2;
        }
//下~回到旅店2(people2)
        if((KeyArray[13]&0x80)!=0)
        {
            cout << "你睡的很熟，今早起來感覺神清氣爽" << endl;
            mp=Mp,hp=Hp;
            system("pause");
            system("cls");
            goto sleep;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto sleep;
    }
sleep2:
    cout << "                 睡覺    " << endl;
    cout << "               > 離開旅店" << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "你好! 這邊是旅店 您可以選擇睡覺或是離開" << endl;
    cout << "睡覺將可以補滿你的魔與血" << endl;
    cout << "你可以按'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto sleep;
        }
//上~回到旅店1(people)
        if((KeyArray[13]&0x80)!=0)
        {
            goto re;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto sleep2;
    }
re:
    system("cls");
} 
////////////////////////////////////////////////////////////////////////////////
//道具店 
////////////////////////////////////////////////////////////////////////////////
void item()
{ 
    system("cls");
item: 
    cout << "               > 購買道具" << endl;
    cout << "                 販賣道具" << endl;
    cout << "                 離開道具店" << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "你好! 這邊是道具店 您可以選擇購買、販賣或是離開" << endl;
    cout << "你可以按'下'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto item2;
        }
//下~回到販賣道具(itemsell2)
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            itembuy(); 
            goto item;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto item;
    }
item2:
    cout << "                 購買道具" << endl;
    cout << "               > 販賣道具" << endl;
    cout << "                 離開道具店" << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                         " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                         " << endl;
    cout << "你好! 這邊是道具店 您可以選擇購買、販賣或是離開" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto item;
        }
//上~回到購買道具(itemsell)
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto item3;
        }
//下~到離開(itemsell3)
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            itemsell(); 
            goto item2;
        }
//選擇 
        cout << "請勿按除了'下'和'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto item2;
    }
item3:
    cout << "                 購買道具  " << endl;
    cout << "                 販賣道具  " << endl;
    cout << "               > 離開道具店" << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "你好! 這邊是道具店 您可以選擇購買、販賣或是離開" << endl;
    cout << "你可以按'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto item2;
        }
//上~回到販賣道具(itemsell2)
        if((KeyArray[13]&0x80)!=0)
        {
            goto re;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto item3;
    }
re:
    system("cls");
} 
////////////////////////////////////////////////////////////////////////////////
//道具店 -買 
////////////////////////////////////////////////////////////////////////////////
void itembuy()
{ 
    int number;
    int num;
    int itemm; 
left1:
    cout << "    補品1/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "  > 補血草                   20  " << endl;
    cout << "    補血粉                   100  " << endl;
    cout << "    補血丸                   200  " << endl;
    cout << "    補血貼布                 300 " << endl;
    cout << "    提神草                   30  " << endl;
    cout << "    提神粉                   150  " << endl;
    cout << "                                 " << endl;
    cout << "  HP+10                      " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left2; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  補血草   " << endl;
            cout << "  HP+10       " << endl;
            number=choose(20,HP10);
            HP10=HP10+number;
            money=money-number*20; 
            goto left1; 
        }
//選擇 
        cout << "請勿按除了'下'和'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left1;
    } 
left2:
    cout << "    補品1/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "    補血草                   20  " << endl;
    cout << "  > 補血粉                   100  " << endl;
    cout << "    補血丸                   200  " << endl;
    cout << "    補血貼布                 300 " << endl;
    cout << "    提神草                   30  " << endl;
    cout << "    提神粉                   150  " << endl;
    cout << "                                 " << endl;
    cout << "  HP+50                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left1; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left3; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  補血粉   " << endl;
            cout << "  HP+50       " << endl;
            number=choose(100,HP50);
            HP50=HP50+number;
            money=money-number*100; 
            goto left2; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left2;
    } 
left3:
    cout << "    補品1/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "    補血草                   20  " << endl;
    cout << "    補血粉                   100  " << endl;
    cout << "  > 補血丸                   200  " << endl;
    cout << "    補血貼布                 300 " << endl;
    cout << "    提神草                   30  " << endl;
    cout << "    提神粉                   150  " << endl;
    cout << "                                 " << endl;
    cout << "  HP+100                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left2; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left4; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  補血丸   " << endl;
            cout << "  HP+100       " << endl;
            number=choose(200,HP100);
            HP100=HP100+number;
            money=money-number*200; 
            goto left3; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left3;
    }
left4:
    cout << "    補品1/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "    補血草                   20  " << endl;
    cout << "    補血粉                   100  " << endl;
    cout << "    補血丸                   200  " << endl;
    cout << "  > 補血貼布                 300 " << endl;
    cout << "    提神草                   30  " << endl;
    cout << "    提神粉                   150  " << endl;
    cout << "                                 " << endl;
    cout << "  HP+150                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left3; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left5; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  補血貼布   " << endl;
            cout << "  HP+150       " << endl;
            number=choose(300,HP150);
            HP150=HP150+number;
            money=money-number*300; 
            goto left4; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left4;
    }
left5:
    cout << "    補品1/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "    補血草                   20  " << endl;
    cout << "    補血粉                   100  " << endl;
    cout << "    補血丸                   200  " << endl;
    cout << "    補血貼布                 300 " << endl;
    cout << "  > 提神草                   30  " << endl;
    cout << "    提神粉                   150  " << endl;
    cout << "                                 " << endl;
    cout << "  MP+10                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left4; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left6; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  提神草   " << endl;
            cout << "  MP+10       " << endl;
            number=choose(30,MP10);
            MP10=MP10+number;
            money=money-number*30; 
            goto left5; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left5;
    }
left6:
    cout << "    補品1/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "    補血草                   20  " << endl;
    cout << "    補血粉                   100  " << endl;
    cout << "    補血丸                   200  " << endl;
    cout << "    補血貼布                 300 " << endl;
    cout << "    提神草                   30  " << endl;
    cout << "  > 提神粉                   150  " << endl;
    cout << "                                 " << endl;
    cout << "  MP+50                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left5; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left7; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  提神粉   " << endl;
            cout << "  MP+50       " << endl;
            number=choose(150,MP50);
            MP50=MP50+number;
            money=money-number*150; 
            goto left6; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left6;
    }
left7:
    cout << "    補品2/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "  > 提神丸                   300  " << endl;
    cout << "    提神噴霧                 450 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "  MP+100                    " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left6; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left8; 
        }
//下
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  提神丸   " << endl;
            cout << "  MP+100       " << endl;
            number=choose(300,MP100);
            MP100=MP100+number;
            money=money-number*300; 
            goto left7; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left7;
    }
left8:
    cout << "    補品2/2    其他              " << endl;
    cout << "                                 " << endl;
    cout << "    提神丸                   300  " << endl;
    cout << "  > 提神噴霧                 450 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "  MP+150                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left7; 
        }
//上 
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto right1;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  提神噴霧  " << endl;
            cout << "  MP+150       " << endl;
            number=choose(450,MP150);
            MP150=MP150+number;
            money=money-number*450; 
            goto left8; 
        }
//選擇 
        cout << "請勿按除了'上'和'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left8;
    }
right1:
    cout << "    補品       其他1/1           " << endl;
    cout << "                                 " << endl;
    cout << "  > 神奇藥水                 1000" << endl;
    cout << "    煙霧彈                   100 " << endl;
    cout << "    傳送捲軸                 50  " << endl;
    cout << "    平原地圖                 200 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "  選擇一屬性永久+1               " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto right2; 
        }
//下
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            goto left1;
        }
//左 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  神奇藥水   " << endl;
            cout << "  選擇一屬性永久+1       " << endl;
            number=choose(1000,pro1);
            pro1=pro1+number;
            money=money-number*1000; 
            goto right1; 
        }
//選擇 
        cout << "請勿按除了'下'和'左'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto right1;
    }
right2:
    cout << "    補品       其他1/1           " << endl;
    cout << "                                 " << endl;
    cout << "    神奇藥水                 1000" << endl;
    cout << "  > 煙霧彈                   100 " << endl;
    cout << "    傳送捲軸                 50  " << endl;
    cout << "    平原地圖                 200 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "  戰鬥脫出                       " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto right1; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto right3; 
        }
//下
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            goto left1;
        }
//左 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  煙霧彈   " << endl;
            cout << "  戰鬥脫出       " << endl;
            number=choose(100,exitwar);
            exitwar=exitwar+number;
            money=money-number*100; 
            goto right2; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'左'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto right2;
    }
right3:
    cout << "    補品       其他1/1           " << endl;
    cout << "                                 " << endl;
    cout << "    神奇藥水                 1000" << endl;
    cout << "    煙霧彈                   100 " << endl;
    cout << "  > 傳送捲軸                 50  " << endl;
    cout << "    平原地圖                 200 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "  直接傳送回村子，戰鬥中無法使用 " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto right2; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto right4; 
        }
//下
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            goto left1;
        }
//左 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  傳送捲軸   " << endl;
            cout << "  直接傳送回村子，戰鬥中無法使用  " << endl;
            number=choose(50,govill);
            govill=govill+number;
            money=money-number*50; 
            goto right3; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'左'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto right3;
    }
right4:
    cout << "    補品       其他1/1           " << endl;
    cout << "                                 " << endl;
    cout << "    神奇藥水                 1000" << endl;
    cout << "    煙霧彈                   100 " << endl;
    cout << "    傳送捲軸                 50  " << endl;
    cout << "  > 平原地圖                 200 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "                                 " << endl;
    cout << "  平原的地圖                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標與按'右'來切換標籤" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto right3; 
        }
//上 
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            goto left1;
        }
//左 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            if(cmap>=1)
            {
                system("cls");
                cout << "  平原地圖    " << endl;
                cout << "  平原的地圖     " << endl;
                cout << "你似乎不需要那麼多地圖吧?" << endl;
                system("pause");
                system("cls"); 
                goto right4; 
            } 
            if(cmap==0)
            {
                cout << "  平原地圖    " << endl;
                cout << "  平原的地圖     " << endl;
                number=choose(200,cmap);  
                cmap=cmap+number;
                if(cmap>1)
                { 
                    cout << "  平原地圖    " << endl;
                    cout << "  平原的地圖     " << endl;
                    cout << "你似乎不需要那麼多地圖吧?" << endl;
                    cout << "你的地圖已經兌換成錢" << endl;
                    cmap=1;
                    money=money-200; 
                    system("pause");
                    system("cls");
                    goto right4;
                } 
                money=money-number*200; 
                goto right4;
            } 
        }
//選擇 
        cout << "請勿按除了'上'和'左'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto right4;
    }
re:
    system("cls");    
} 
////////////////////////////////////////////////////////////////////////////////
//武器店 
////////////////////////////////////////////////////////////////////////////////
void plusplus()
{
    system("cls");
arms: 
    cout << "               > 購買武器  " << endl;
    cout << "                 販賣武器  " << endl;
    cout << "                 武器精練  " << endl;
    cout << "                 離開武器店" << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "你好! 這邊是武器店 您可以選擇購買、販賣、精練或是離開" << endl;
    cout << "你可以按'下'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto arms2; 
        }
//下~到販賣武器(arms2)
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            armsbuy(); 
            goto arms;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto arms;
    }
arms2: 
    cout << "                 購買武器  " << endl;
    cout << "               > 販賣武器  " << endl;
    cout << "                 武器精練  " << endl;
    cout << "                 離開武器店" << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "你好! 這邊是武器店 您可以選擇購買、販賣、精練或是離開" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto arms3;
        }
//下~到武器精練(arms3)
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto arms;
        }
//上~回到購買武器(arms)
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            armssell(); 
            goto arms2;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto arms2;
    } 
arms3:
    cout << "                 購買武器  " << endl;
    cout << "                 販賣武器  " << endl;
    cout << "               > 武器精練  " << endl;
    cout << "                 離開武器店" << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "你好! 這邊是武器店 您可以選擇購買、販賣、精練或是離開" << endl;
    cout << "你可以按'下'和'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto arms4;
        }
//下~到離開(arms4)
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto arms2;
        }
//上~回到販賣武器(arms2)
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            armsplus(); 
            goto arms3;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto arms3;
    }
arms4:
    cout << "                 購買武器  " << endl;
    cout << "                 販賣武器  " << endl;
    cout << "                 武器精練  " << endl;
    cout << "               > 離開武器店" << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "                           " << endl;
    cout << "你好! 這邊是武器店 您可以選擇購買、販賣、精練或是離開" << endl;
    cout << "你可以按'上'來移動指標與按'Enter'來選擇" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto arms3;
        }
//上~回到精練武器(arms3)
        if((KeyArray[13]&0x80)!=0)
        {
            goto re;
        }
//選擇 
        cout << "請勿按除了'上'與'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto arms4;
    }
re:
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//平原 
////////////////////////////////////////////////////////////////////////////////
void champaign()
{
    int x=0,y=0;
    int X=5,Y=9;
    system("cls");
    if(cmap==1)
    {
        champmap=true; 
    } 
    if(champmap==true)//畫出全部地圖 
    {
        short map[10][10]={0,0,0,0,0,0,0,0,0,0,
                           0,0,0,0,0,0,0,0,0,0, 
                           0,0,0,0,0,0,0,3,0,0,
                           0,0,0,0,0,0,0,0,0,0,
                           0,0,0,0,0,0,0,0,0,0,
                           2,0,0,0,0,0,0,0,0,0,
                           0,0,0,0,0,0,0,0,0,0,
                           0,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};                   
draw: 
        for(y=0;y<10;y++) 
        { 
            for(x=0;x<10;x++) 
            { 
                if(map[y][x]==0)
                { 
                    cout << "□";
                } 
                if(map[y][x]==1) 
                { 
                    cout << "○";
                } 
                if(map[y][x]==2) 
                { 
                    cout << "洞";
                } 
                if(map[y][x]==3) 
                {            
                    cout << "塔"; 
                } 
                if(map[y][x]==4) 
                {            
                    cout << "　"; 
                } 
                if(map[y][x]==5) 
                {            
                    cout << "村"; 
                }
            }  
            cout << endl;
        } 
        if(X==5&&Y==9)
        {
            cout << "你目前位置在'○'、'洞'是洞窟、'塔'是廢墟之塔" << endl;
            cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以進入村莊" << endl;
            cout << "                                                          " << endl;    
            system("pause");//停在這邊 
            GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
            GetKeyboardState(KeyArray);//這個是用來比對的 
            for(i=1;i<255;i++)
            {
                PreKeyArray[i]=KeyArray[i];
                if((KeyArray[38]&0x80)!=0)
                {
                    Y--;
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y+1][X]=5; 
                    map[Y][X]=1;
                    goto draw;//畫出地圖 
                }
//上
                if((KeyArray[40]&0x80)!=0)
                {
                    cout << "這邊已經是平原的邊界" << endl;
                    system("pause");
                    system("cls");
                    goto draw;//畫出地圖 
                }
//下
                if((KeyArray[37]&0x80)!=0)
                {
                    X--;
                    hp=hp+spi*lv/7;
                    mp=mp+spi*lv/7;
                    action(1);//呼叫事件 
                    map[Y][X+1]=5; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖  
                }
//左 
                if((KeyArray[39]&0x80)!=0)
                {
                    X++; 
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y][X-1]=5; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//右 
                if((KeyArray[27]&0x80)!=0)
                {
                    people(); 
                    goto draw;//畫出地圖 
                }
//ESC 
                if((KeyArray[13]&0x80)!=0)
                {
                    system("cls");
                    game();//呼叫事件 
                }
//選擇 
                cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
                system("pause");
                system("cls");
                goto draw;//畫出地圖 
            } 
        }
        if(X==0&&Y==5)
        {
            cout << "你目前位置在'○'、'塔'是廢墟之塔、'村'是村莊" << endl;
            cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以進入洞窟" << endl;
            cout << "                                                          " << endl;    
            system("pause");//停在這邊 
            GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
            GetKeyboardState(KeyArray);//這個是用來比對的 
            for(i=1;i<255;i++)
            {
                PreKeyArray[i]=KeyArray[i];
                if((KeyArray[38]&0x80)!=0)
                {
                    Y--;
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7;                     
                    action(1);//呼叫事件 
                    map[Y+1][X]=2; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//上 
                if((KeyArray[40]&0x80)!=0)
                {
                    Y++;
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y-1][X]=2; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//下 
                if((KeyArray[37]&0x80)!=0)
                {
                    cout << "這邊已經是平原的邊界" << endl;
                    system("pause");
                    system("cls");
                    goto draw;//畫出地圖 
                 }
//左 
                if((KeyArray[39]&0x80)!=0)
                {
                    X++; 
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y][X-1]=2; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//右 
                if((KeyArray[27]&0x80)!=0)
                {
                    people(); 
                    goto draw;//畫出地圖 
                }
//ESC 
                if((KeyArray[13]&0x80)!=0)
                {
                    system("cls");                 
                    cave();//呼叫事件 
                }
//選擇 
                cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
                system("pause");
                system("cls");
                goto draw;//畫出地圖 
            } 
        }
        if(X==7&&Y==2)
        {
            cout << "你目前位置在'○'、'洞'是洞窟、'村'是村莊" << endl;
            cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以進入廢墟之塔" << endl;
            cout << "                                                          " << endl;    
            system("pause");//停在這邊 
            GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
            GetKeyboardState(KeyArray);//這個是用來比對的 
            for(i=1;i<255;i++)
            {
                PreKeyArray[i]=KeyArray[i];
                if((KeyArray[38]&0x80)!=0)
                {
                    Y--; 
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y+1][X]=3; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//上 
                if((KeyArray[40]&0x80)!=0)
                {
                    Y++; 
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y-1][X]=3; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//下 
                if((KeyArray[37]&0x80)!=0)
                {
                    X--; 
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y][X+1]=3; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖  
                }
//左 
                if((KeyArray[39]&0x80)!=0)
                {
                    X++; 
                    hp=hp+spi*lv/7; 
                    mp=mp+spi*lv/7; 
                    action(1);//呼叫事件 
                    map[Y][X-1]=3; 
                    map[Y][X]=1;             
                    goto draw;//畫出地圖 
                }
//右 
                if((KeyArray[27]&0x80)!=0)
                {
                    people(); 
                    goto draw;//畫出地圖 
                }
//ESC 
                if((KeyArray[13]&0x80)!=0)
                {
                    system("cls");                 
                    tower();//呼叫事件 
                }
//選擇 
                cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
                system("pause");
                system("cls");
                goto draw;//畫出地圖 
            } 
        }    
        cout << "你目前位置在'○'、'洞'是洞窟、'塔'是廢墟之塔、'村'是村莊" << endl;
        cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以原地休息" << endl;
        cout << "                                                          " << endl;    
        system("pause");//停在這邊 
        GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
        GetKeyboardState(KeyArray);//這個是用來比對的 
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                Y--; 
                if(Y<0)
                {
                    cout << "這邊已經是平原的邊界" << endl;
                    system("pause");
                    Y++;
                    system("cls");
                    goto draw;//畫出地圖 
                }
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y+1][X]=0; 
                map[Y][X]=1;             
                goto draw;//畫出地圖 
            }
//上 
            if((KeyArray[40]&0x80)!=0)
            {
                Y++; 
                if(Y>9)
                {
                    cout << "這邊已經是平原的邊界" << endl;
                    system("pause");
                    Y--;
                    system("cls");
                    goto draw;//畫出地圖 
                }
                hp=hp+spi*lv/7;
                mp=mp+spi*lv/7;
                action(1);//呼叫事件 
                map[Y-1][X]=0; 
                map[Y][X]=1;             
                goto draw;//畫出地圖 
            }
//下 
            if((KeyArray[37]&0x80)!=0)
            {
                X--; 
                if(X<0)
                {
                    cout << "這邊已經是平原的邊界" << endl;
                    system("pause");
                    X++;
                    system("cls");
                    goto draw;//畫出地圖 
                }
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X+1]=0; 
                map[Y][X]=1;             
                goto draw;//畫出地圖  
            }
//左 
            if((KeyArray[39]&0x80)!=0)
            {
                X++; 
                if(X>9)
                {
                    cout << "這邊已經是平原的邊界" << endl;
                    system("pause");
                    X--;
                    system("cls");
                    goto draw;//畫出地圖 
                }
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X-1]=0; 
                map[Y][X]=1;             
                goto draw;//畫出地圖 
            }
//右 
            if((KeyArray[27]&0x80)!=0)
            {
                people(); 
                goto draw;//畫出地圖 
            }
//ESC 
            if((KeyArray[13]&0x80)!=0)
            {
                cout << "你不怕死的在原地休息了一下" << endl;
                system("pause");
                hp=hp+spi*lv/7*2; 
                mp=mp+spi*lv/7*2; 
                action(1);//呼叫事件 
                goto draw;//畫出地圖 
            }
//選擇 
            cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto draw;//畫出地圖 
        }
    }    
//畫出部分 
draw2: 
    for(y=0;y<10;y++) 
    {
        cout << "     ";
        for(x=0;x<10;x++) 
        {
            if(map[y][x]==0)
            { 
                cout << "□";
            } 
            if(map[y][x]==1) 
            { 
                cout << "○";
            } 
            if(map[y][x]==2) 
            { 
                cout << "洞";
            } 
            if(map[y][x]==3) 
            {            
                cout << "塔"; 
            } 
            if(map[y][x]==4) 
            {            
                cout << "　"; 
            } 
            if(map[y][x]==5) 
            {            
                cout << "村"; 
            }
        }  
        cout << endl;
    } 
    if(X==5&&Y==9)
    {
        cout << "你目前位置在'○'、'洞'是洞窟、'塔'是廢墟之塔" << endl;
        cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以進入村莊" << endl;
        cout << "                                                          " << endl;    
        system("pause");//停在這邊 
        GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
        GetKeyboardState(KeyArray);//這個是用來比對的 
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                Y--; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y+1][X]=5; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//上 
            if((KeyArray[40]&0x80)!=0)
            {
                cout << "這邊已經是平原的邊界" << endl;
                system("pause");
                system("cls");
                goto draw2;//畫出地圖 
            }
//下 
            if((KeyArray[37]&0x80)!=0)
            {
                X--; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X+1]=5; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖  
            }
//左 
            if((KeyArray[39]&0x80)!=0)
            {
                X++; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X-1]=5; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//右 
            if((KeyArray[27]&0x80)!=0)
            {
                people(); 
                goto draw2;//畫出地圖 
            }
//ESC 
            if((KeyArray[13]&0x80)!=0)
            {
                system("cls");                 
                game();//呼叫事件 
            }
//選擇 
            cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto draw2;//畫出地圖 
        } 
    }
    if(X==0&&Y==5)
    {
        cout << "你目前位置在'○'、'塔'是廢墟之塔、'村'是村莊" << endl;
        cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以進入洞窟" << endl;
        cout << "                                                          " << endl;    
        system("pause");//停在這邊 
        GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
        GetKeyboardState(KeyArray);//這個是用來比對的 
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                Y--; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y+1][X]=2; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//上 
            if((KeyArray[40]&0x80)!=0)
            {
                Y++; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y-1][X]=2; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//下 
            if((KeyArray[37]&0x80)!=0)
            {
                cout << "這邊已經是平原的邊界" << endl;
                system("pause");
                system("cls");
                goto draw2;//畫出地圖 
             }
//左 
            if((KeyArray[39]&0x80)!=0)
            {
                X++;
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X-1]=2; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//右 
            if((KeyArray[27]&0x80)!=0)
            {
                people(); 
                goto draw2;//畫出地圖 
            }
//ESC 
            if((KeyArray[13]&0x80)!=0)
            {
                system("cls");                 
                cave();//呼叫事件 
            }
//選擇 
            cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto draw2;//畫出地圖 
        } 
    }
    if(X==7&&Y==2)
    {
        cout << "你目前位置在'○'、'洞'是洞窟、'村'是村莊" << endl;
        cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以進入廢墟之塔" << endl;
        cout << "                                                          " << endl;    
        system("pause");//停在這邊 
        GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
        GetKeyboardState(KeyArray);//這個是用來比對的 
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[38]&0x80)!=0)
            {
                Y--; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y+1][X]=3; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//上 
            if((KeyArray[40]&0x80)!=0)
            {
                Y++; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y-1][X]=3; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//下 
            if((KeyArray[37]&0x80)!=0)
            {
                X--; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X+1]=3; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖  
            }
//左 
            if((KeyArray[39]&0x80)!=0)
            {
                X++; 
                hp=hp+spi*lv/7; 
                mp=mp+spi*lv/7; 
                action(1);//呼叫事件 
                map[Y][X-1]=3; 
                map[Y][X]=1;             
                goto draw2;//畫出地圖 
            }
//右 
            if((KeyArray[27]&0x80)!=0)
            {
                people(); 
                goto draw2;//畫出地圖 
            }
//ESC 
            if((KeyArray[13]&0x80)!=0)
            {
                system("cls");                 
                tower();//呼叫事件 
            }
//選擇 
            cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto draw2;//畫出地圖 
        } 
    }    
    cout << "你目前位置在'○'、'洞'是洞窟、'塔'是廢墟之塔、'村'是村莊" << endl;
    cout << "你可以按'方向鍵'來移動與按'Esc'來整理道具、裝備，按'Enter'可以原地休息" << endl;
    cout << "                                                          " << endl;    
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            Y--; 
            if(Y<0)
            {
                cout << "這邊已經是平原的邊界" << endl;
                system("pause");
                Y++;
                system("cls");
                goto draw2;//畫出地圖 
            }
            hp=hp+spi*lv/7; 
            mp=mp+spi*lv/7; 
            action(1);//呼叫事件 
            map[Y+1][X]=0; 
            map[Y][X]=1;             
            goto draw2;//畫出地圖 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            Y++; 
            if(Y>9)
            {
                cout << "這邊已經是平原的邊界" << endl;
                system("pause");
                Y--;
                system("cls");
                goto draw2;//畫出地圖 
            }
            hp=hp+spi*lv/7; 
            mp=mp+spi*lv/7; 
            action(1);//呼叫事件 
            map[Y-1][X]=0; 
            map[Y][X]=1;             
            goto draw2;//畫出地圖 
        }
//下 
        if((KeyArray[37]&0x80)!=0)
        {
            X--; 
            if(X<0)
            {
                cout << "這邊已經是平原的邊界" << endl;
                system("pause");
                X++;
                system("cls");
                goto draw2;//畫出地圖 
            }
            hp=hp+spi*lv/7; 
            mp=mp+spi*lv/7; 
            action(1);//呼叫事件 
            map[Y][X+1]=0; 
            map[Y][X]=1;             
            goto draw2;//畫出地圖  
        }
//左 
        if((KeyArray[39]&0x80)!=0)
        {
            X++; 
            if(X>9)
            {
                cout << "這邊已經是平原的邊界" << endl;
                system("pause");
                X--;
                system("cls");
                goto draw2;//畫出地圖 
            }
            hp=hp+spi*lv/7; 
            mp=mp+spi*lv/7; 
            action(1);//呼叫事件 
            map[Y][X-1]=0; 
            map[Y][X]=1;             
            goto draw2;//畫出地圖 
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            people(); 
            goto draw2;//畫出地圖 
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            cout << "你不怕死的在原地休息了一下" << endl;
            system("pause");
            hp=hp+spi*lv/7*2;
            mp=mp+spi*lv/7*2;
            action(1);//呼叫事件 
            goto draw2;//畫出地圖 
        }
//選擇 
        cout << "請勿按除了'上'和'下'、'左'、'右'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto draw2;//畫出地圖 
    }
}
////////////////////////////////////////////////////////////////////////////////
//計算金錢 
////////////////////////////////////////////////////////////////////////////////
int choose(int num,int itemm)
{
    int number;//選擇的個數 
    if(99-itemm==0)//已經滿了(99個) 
    {
        cout << "做人別太貪心，包包只能裝99個阿" << endl;
        system("pause");
        system("cls");
        return 0; //回傳0代表沒有變化 
    } 
    cout << "一個" << num << "元，你要買幾個?" << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "請輸入0~"<< 99-itemm << "的整數" << endl;
    cin >> number;
    if(number<0||number>99-itemm)//選超過數目的東西 
    { 
        cout << "老闆很忙，別開玩笑了" << endl;    
        system("pause");
        system("cls");
        return 0; //回傳0代表沒有變化 
    }
    if(money<number*num)//錢小於所選的個數乘上價錢 
    {
        cout << "你...似乎不夠錢喔" << endl;    
        system("pause");
        system("cls");
        return 0; //回傳0代表沒有變化
    } 
    if(number>=0||number<=99-itemm)//正常範圍~傳回值 
    { 
        system("cls");
        return number;        
    }
}    
////////////////////////////////////////////////////////////////////////////////
//確認道具種類用
////////////////////////////////////////////////////////////////////////////////
int checkitem()
{ 
    int num=0; 
    if(HP10>0)
    {
        num++; 
    } 
    if(HP50>0)
    {
        num++; 
    } 
    if(HP100>0)
    {
        num++; 
    } 
    if(HP150>0)
    {
        num++; 
    } 
    if(HP200>0)
    {
        num++; 
    } 
    if(HP250>0)
    {
        num++; 
    } 
    if(MP10>0)
    {
        num++; 
    } 
    if(MP50>0)
    {
        num++; 
    } 
    if(MP100>0)
    {
        num++; 
    } 
    if(MP150>0)
    {
        num++; 
    } 
    if(MP200>0)
    {
        num++; 
    } 
    if(MP250>0)
    {
        num++; 
    } 
    if(MP300>0)
    {
        num++; 
    } 
    if(pro1>0)
    {
        num++; 
    } 
    if(pro5>0)
    {
        num++; 
    } 
    if(apro1>0)
    {
        num++; 
    } 
    if(exitwar>0)
    {
        num++; 
    } 
    if(govill>0)
    {
        num++; 
    } 
    if(cmap>0)
    {
        num++; 
    } 
    if(tmap1>0)
    {
        num++; 
    } 
    if(tmap2>0)
    {
        num++; 
    } 
    if(tmap3>0)
    {
        num++; 
    } 
    if(tmap4>0)
    {
        num++; 
    } 
    if(tmap5>0)
    {
        num++; 
    } 
    if(tmap6>0)
    {
        num++; 
    } 
    if(tmap7>0)
    {
        num++; 
    } 
    if(tmap8>0)
    {
        num++; 
    }
    return num; 
}
////////////////////////////////////////////////////////////////////////////////
//確認裝備種類用
////////////////////////////////////////////////////////////////////////////////
int checkequ()
{ 
    int num=0; 
    if(wo>0)
    {
        num++;
    } 
    if(wo1>0)
    {
        num++;
    } 
    if(wo2>0)
    {
        num++;
    } 
    if(wo3>0)
    {
        num++;
    } 
    if(wo4>0)
    {
        num++;
    } 
    if(wo5>0)
    {
        num++;
    } 
    if(me>0)
    { 
        num++;
    } 
    if(me1>0)
    {
        num++;
    } 
    if(me2>0)
    {
        num++;
    } 
    if(me3>0)
    {
        num++;
    } 
    if(me4>0)
    {
        num++;
    } 
    if(me5>0)
    {
        num++;
    } 
    if(si>0)
    { 
        num++;
    } 
    if(si1>0)
    {
        num++;
    } 
    if(si2>0)
    {
        num++;
    } 
    if(si3>0)
    {
        num++;
    } 
    if(si4>0)
    {
        num++;
    } 
    if(si5>0)
    {
        num++;
    } 
    if(so>0)
    { 
        num++;
    } 
    if(so1>0)
    {
        num++;
    } 
    if(so2>0)
    {
        num++;
    } 
    if(so3>0)
    {
        num++;
    } 
    if(so4>0)
    {
        num++;
    } 
    if(so5>0)
    {
        num++;
    } 
    if(br>0)
    { 
        num++;
    } 
    if(br1>0)
    {
        num++;
    } 
    if(br2>0)
    {
        num++;
    } 
    if(br3>0)
    {
        num++;
    } 
    if(br4>0)
    {
        num++;
    } 
    if(br5>0)
    {
        num++;
    } 
    if(woo>0)
    { 
        num++;
    } 
    if(woo1>0)
    {
        num++;
    } 
    if(woo2>0)
    {
        num++;
    } 
    if(woo3>0)
    {
        num++;
    } 
    if(woo4>0)
    {
        num++;
    } 
    if(woo5>0)
    {
        num++;
    } 
    if(bl>0)
    { 
        num++;
    } 
    if(bl1>0)
    {
        num++;
    } 
    if(bl2>0)
    {
        num++;
    } 
    if(bl3>0)
    {
        num++;
    } 
    if(bl4>0)
    {
        num++;
    } 
    if(bl5>0)
    {
        num++;
    } 
    if(cr>0)
    { 
        num++;
    } 
    if(cr1>0)
    {
        num++;
    } 
    if(cr2>0)
    {
        num++;
    } 
    if(cr3>0)
    {
        num++;
    } 
    if(cr4>0)
    {
        num++;
    } 
    if(cr5>0)
    {
        num++;
    } 
    if(el>0)
    { 
        num++;
    } 
    if(el1>0)
    {
        num++;
    } 
    if(el2>0)
    {
        num++;
    } 
    if(el3>0)
    {
        num++;
    } 
    if(el4>0)
    {
        num++;
    } 
    if(el5>0)
    {
        num++;
    } 
    if(sa>0)
    { 
        num++;
    } 
    if(sa1>0)
    {
        num++;
    } 
    if(sa2>0)
    {
        num++;
    } 
    if(sa3>0)
    {
        num++;
    } 
    if(sa4>0)
    {
        num++;
    } 
    if(sa5>0)
    {
        num++;
    }
    return num;
}
////////////////////////////////////////////////////////////////////////////////
//人物--道具資料 
////////////////////////////////////////////////////////////////////////////////
void pitem()
{ 
    int nummitem=0;//計算第1頁的各數用 
    int numitem=checkitem();//道具的種類數 
    cout << "以下是你持有的道具           狀態   > 道具  " << endl;
    cout << "------------------           裝備     技能  " << endl;
    if(numitem>0&&numitem<=12) 
    {
        system("cls");
        cout << "以下是你持有的道具1/1        狀態   > 道具  " << endl;
        cout << "------------------           裝備     技能  " << endl;
    } 
    if(numitem>12&&numitem<=24)
    {
        system("cls");
        cout << "以下是你持有的道具1/2        狀態   > 道具  " << endl;
        cout << "------------------           裝備     技能  " << endl;
    }
    if(numitem>24)
    {
        system("cls");
        cout << "以下是你持有的道具1/3        狀態   > 道具  " << endl;
        cout << "------------------           裝備     技能  " << endl;
    }
    if(HP10>0)
    {
        cout << "   補血草       " << HP10 << endl;
        nummitem++;
    } 
    if(HP50>0)
    {
        cout << "   補血粉       " << HP50 << endl; 
        nummitem++;
    } 
    if(HP100>0)
    {
        cout << "   補血丸       " << HP100 <<endl; 
        nummitem++;
    } 
    if(HP150>0)
    {
        cout << "   補血貼布     " << HP150 << endl; 
        nummitem++;
    } 
    if(HP200>0)
    {
        cout << "   補血藥膏     " << HP200 << endl;
        nummitem++;
    } 
    if(HP250>0)
    {
        cout << "   補血神豆     " << HP250 << endl;
        nummitem++;
    } 
    if(MP10>0)
    {
        cout << "   提神草       " << MP10 << endl;
        nummitem++;
    } 
    if(MP50>0)
    {
        cout << "   提神粉       " << MP50 << endl;
        nummitem++;
    } 
    if(MP100>0)
    {
        cout << "   提神丸       " << MP100 << endl;
        nummitem++; 
    } 
    if(MP150>0)
    {
        cout << "   提神噴霧     " << MP150 << endl;
        nummitem++; 
    } 
    if(MP200>0)
    {
        cout << "   提神貼布     " << MP200 << endl;
        nummitem++; 
    } 
    if(MP250>0)
    {
        cout << "   提神藥膏     " << MP250 << endl;
        nummitem++; 
    } 
    if(nummitem<12) 
    { 
        if(MP300>0)
        {
            cout << "   提神神豆     " << MP300 << endl;
            nummitem++; 
        } 
    } 
    if(nummitem<12) 
    { 
        if(pro1>0)
        {
            cout << "   神奇藥水     " << pro1 << endl;
            nummitem++;  
        } 
    }
    if(nummitem<12) 
    {
        if(pro5>0)
        {
            cout << "   神奇藥膏     " << pro5 << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(apro1>0)
        {
            cout << "   神豆         " << apro1 << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(exitwar>0)
        {
            cout << "   煙霧彈       " << exitwar << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(govill>0)
        {
            cout << "   傳送捲軸     " << govill << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(cmap>0)
        {
            cout << "   平原地圖        " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap1>0)
        {
            cout << "   廢墟之塔地圖1F  " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap2>0)
        {
            cout << "   廢墟之塔地圖2F  " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap3>0)
        {
            cout << "   廢墟之塔地圖3F  " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap4>0)
        {
            cout << "   廢墟之塔地圖4F  " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap5>0)
        {
            cout << "   廢墟之塔地圖5F  " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap6>0)
        {
            cout << "   廢墟之塔地圖6F  " << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(tmap7>0)
        {
            cout << "   廢墟之塔地圖7F  " << endl;
            nummitem++; 
        } 
    }
    if(nummitem<12) 
    {
        if(tmap8>0)
        {
            cout << "   廢墟之塔地圖8F  " << endl;
            nummitem++;
        }
    }
    if(nummitem==12)
    {
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    } 
    if(nummitem==11)
    {
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==10)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==9)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==8)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==7)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==6)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==5)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==4)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==3)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl; 
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==2)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==1)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
    if(nummitem==0)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'下'和'左'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與使用道具" << endl;
    }
} 
////////////////////////////////////////////////////////////////////////////////
//使用道具 
////////////////////////////////////////////////////////////////////////////////
void uitem()
{ 
no:
    int nummitem;//計算個數用 
    int numitem=checkitem();//道具的種類數 
    char flag[12]={'>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
    int X;//繪圖用
    int used2;//選擇的時候用
    int page=1;//頁數 
    bool bMP300=false,bpro1=false,bpro5=false,bapro1=false,bexitwar=false,bgovill=false,
         bcmap=false,btmap1=false,btmap2=false,btmap3=false,btmap4=false,btmap5=false,
         btmap6=false,btmap7=false,btmap8=false;
    bool bbtmap6=false,bbtmap7=false,bbtmap8=false;
    X=0;
    nummitem=0;
    if(numitem==0) 
    {
        cout << "你沒有道具可以使用，請按'Esc'離開" << endl;
        cout << "------------------          " << endl;
        system("pause");//停在這邊 
        GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
        GetKeyboardState(KeyArray);//這個是用來比對的 
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[27]&0x80)!=0)
            {
                goto re;
            }
//ESC
            cout << "請勿按除了'Esc'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto no; 
        }
    } 
    if(numitem>0&&numitem<=12) 
    {
        system("cls");
        cout << "以下是你持有的道具1/1       " << endl;
        cout << "------------------          " << endl;
    } 
    if(numitem>12&&numitem<=24)
    {
        system("cls");
        cout << "以下是你持有的道具1/2       " << endl;
        cout << "------------------          " << endl;
    }
    if(numitem>24)
    {
        system("cls");
        cout << "以下是你持有的道具1/3       " << endl;
        cout << "------------------          " << endl;
    }
po: 
    X=0;
    nummitem=0;
    if(HP10>0)
    {
        cout << " " << flag[X] << " 補血草        " << HP10 << endl;
        nummitem++;
        X++;
    } 
    if(HP50>0)
    {
        cout << " " << flag[X] << " 補血粉        " << HP50 << endl; 
        nummitem++;
        X++;
    }
    if(HP100>0)
    {
        cout << " " << flag[X] << " 補血丸        " << HP100 <<endl; 
        nummitem++;
        X++;
    }
    if(HP150>0)
    {
        cout << " " << flag[X] << " 補血貼布      " << HP150 << endl; 
        nummitem++;
        X++;
    } 
    if(HP200>0)
    {
        cout << " " << flag[X] << " 補血藥膏      " << HP200 << endl;
        nummitem++;
        X++;
    }
    if(HP250>0)
    {
        cout << " " << flag[X] << " 補血神豆      " << HP250 << endl;
        nummitem++;
        X++;
    } 
    if(MP10>0)
    {
        cout << " " << flag[X] << " 提神草        " << MP10 << endl;
        nummitem++;
        X++;
    } 
    if(MP50>0)
    {
        cout << " " << flag[X] << " 提神粉        " << MP50 << endl;
        nummitem++;
        X++;
    } 
    if(MP100>0)
    {
        cout << " " << flag[X] << " 提神丸        " << MP100 << endl;
        nummitem++; 
        X++;
    } 
    if(MP150>0)
    {
        cout << " " << flag[X] << " 提神噴霧      " << MP150 << endl;
        nummitem++; 
        X++;
     } 
    if(MP200>0)
    {
        cout << " " << flag[X] << " 提神貼布      " << MP200 << endl;
        nummitem++; 
        X++;
    } 
    if(MP250>0)
    {
        cout << " " << flag[X] << " 提神藥膏      " << MP250 << endl;
        nummitem++; 
        X++;
    }   
    if(nummitem<12&&MP300>0) 
    { 
        cout << " " << flag[X] << " 提神神豆      " << MP300 << endl;
        nummitem++; 
        X++;
        bMP300=true;
    } 
    if(nummitem<12&&pro1>0) 
    { 
        cout << " " << flag[X] << " 神奇藥水  " << pro1 << endl;
        nummitem++;  
        X++;
        bpro1=true;
    }
    if(nummitem<12&&pro5>0)
    {
        cout << " " << flag[X] << " 神奇藥膏      " << pro5 << endl;
        nummitem++; 
        X++;
        bpro5=true;
    }
    if(nummitem<12&&apro1>0)
    {
        cout << " " << flag[X] << " 神豆          " << apro1 << endl;
        nummitem++; 
        X++;
        bapro1=true;
    }
    if(nummitem<12&&exitwar>0) 
    {
        cout << " " << flag[X] << " 煙霧彈        " << exitwar << endl;
        nummitem++; 
        X++;
        bexitwar=true;
    }
    if(nummitem<12&&govill>0) 
    {
        cout << " " << flag[X] << " 傳送捲軸      " << govill << endl;
        nummitem++; 
        X++;
        bgovill=true;
    }
    if(nummitem<12&&cmap>0) 
    {
        cout << " " << flag[X] << " 平原地圖         " << endl;
        nummitem++; 
        X++;
        bcmap=true;
    }
    if(nummitem<12&&tmap1>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖1F  " << endl;
        nummitem++; 
        X++;
        btmap1=true;        
    }
    if(nummitem<12&&tmap2>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖2F  " << endl;
        nummitem++; 
        X++;
        btmap2=true;
    }
    if(nummitem<12&&tmap3>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖3F  " << endl;
        nummitem++; 
        X++;
        btmap3=true;
    }
    if(nummitem<12&&tmap4>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖4F  " << endl;
        nummitem++; 
        X++;
        btmap4=true;
    }
    if(nummitem<12&&tmap5>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖5F  " << endl;
        nummitem++; 
        X++;
        btmap5=true;
    }
    if(nummitem<12&&tmap6>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖6F  " << endl;
        nummitem++;
        X++;
        btmap6=true;
        bbtmap6=true;
    }
    if(nummitem<12&&tmap7>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖7F  " << endl;
        nummitem++; 
        X++;
        btmap7=true;
        bbtmap7=true;
    }
    if(nummitem<12&&tmap8>0) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖8F  " << endl;
        nummitem++;
        X++;
        btmap8=true;
        bbtmap8=true;
    }
    goto a;
po2:
    X=0;
    nummitem=0;
    if(MP300>0&&bMP300==false)
    {
        cout << " " << flag[X] << " 提神神豆      " << MP300 << endl;
        nummitem++; 
        X++;
    }   
    if(pro1>0&&bpro1==false)
    {
        cout << " " << flag[X] << " 神奇藥水      " << pro1 << endl;
        nummitem++;  
        X++;
    } 
    if(pro5>0&&bpro5==false)
    {
        cout << " " << flag[X] << " 神奇藥膏      " << pro5 << endl;
        nummitem++; 
        X++;
    } 
    if(apro1>0&&bapro1==false)
    {
        cout << " " << flag[X] << " 神豆          " << apro1 << endl;
        nummitem++; 
        X++;
    } 
    if(exitwar>0&&bexitwar==false)
    {
        cout << " " << flag[X] << " 煙霧彈        " << exitwar << endl;
        nummitem++; 
        X++;
    }
    if(govill>0&&bgovill==false)
    {
        cout << " " << flag[X] << " 傳送捲軸      " << govill << endl;
        nummitem++; 
        X++;
    } 
    if(cmap>0&&bcmap==false)
    {
        cout << " " << flag[X] << " 平原地圖         " << endl;
        nummitem++; 
        X++;
    } 
    if(tmap1>0&&btmap1==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖1F  " << endl;
        nummitem++; 
        X++;
    } 
    if(tmap2>0&&btmap2==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖2F  " << endl;
        nummitem++; 
        X++;
    } 
    if(tmap3>0&&btmap3==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖3F  " << endl;
        nummitem++; 
        X++;
    } 
    if(tmap4>0&&btmap4==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖4F  " << endl;
        nummitem++; 
        X++;
    }  
    if(tmap5>0&&btmap5==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖5F  " << endl;
        nummitem++; 
        X++;
    }
    if(nummitem<12&&tmap6>0&&btmap6==false) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖6F  " << endl;
        nummitem++;
        X++;
        bbtmap6=true;
    }
    if(nummitem<12&&tmap7>0&&btmap7==false) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖7F  " << endl;
        nummitem++; 
        X++;
        bbtmap7=true;
    }
    if(nummitem<12&&tmap8>0&&btmap8==false) 
    {
        cout << " " << flag[X] << " 廢墟之塔地圖8F  " << endl;
        nummitem++;
        X++;
        bbtmap8=true;
    }
    goto a;
po3:
    X=0;
    nummitem=0;
    if(tmap6>0&&bbtmap6==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖6F  " << endl;
        nummitem++;
        X++;
    } 
    if(tmap7>0&&bbtmap7==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖7F  " << endl;
        nummitem++; 
        X++;
    } 
    if(tmap8>0&&bbtmap8==false)
    {
        cout << " " << flag[X] << " 廢墟之塔地圖8F  " << endl;
        nummitem++;
        X++;
    }
    goto a;
a:    
    cout << "------------------          " << endl;
    cout << "請按'下'和'上'來移動指標與按'Enter'來使用該物品" << endl;
    cout << "按'左'和'右'來切換頁面，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            if(page==1) 
            { 
                if(numitem>0&&numitem<=12) 
                {
                    cout << "以下是你持有的道具1/1       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                } 
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的道具1/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>24)
                {
                    cout << "以下是你持有的道具1/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                }
            }
            if(page==2)
            {
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的道具2/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>24)
                {
                    cout << "以下是你持有的道具2/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po2;
                        }
                    }
                }
            }
            if(page==3)
            {
                if(numitem>24)
                {
                    cout << "以下是你持有的道具3/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po3;
                        }
                    }
                }
            }
        }
//上
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            if(page==1) 
            { 
                if(numitem>0&&numitem<=12) 
                {
                    cout << "以下是你持有的道具1/1       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                } 
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的道具1/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>24)
                {
                    cout << "以下是你持有的道具1/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                }
            }
            if(page==2)
            {
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的道具2/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>24)
                {
                    cout << "以下是你持有的道具2/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po2;
                        }
                    }
                }
            }
            if(page==3)
            {
                if(numitem>24)
                {
                    cout << "以下是你持有的道具3/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po3;
                        }
                    }
                }
            }
        }
//下
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            if(numitem>0&&numitem<=12) 
            {
                cout << "以下是你持有的道具1/1       " << endl;
                cout << "------------------          " << endl;
                goto po;
            } 
            if(numitem>12&&numitem<=24)
            {
                if(page==2)
                {
                    page=1; 
                    cout << "以下是你持有的道具1/2       " << endl;
                    cout << "------------------          " << endl;
                    goto po;
                }
                if(page==1)
                {
                    cout << "以下是你持有的道具1/2       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
            }
            if(numitem>24)
            {
                if(page==3)
                {
                    page=2; 
                    cout << "以下是你持有的道具2/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po2; 
                }
                if(page==2)
                {
                    page=1;
                    cout << "以下是你持有的道具1/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
                if(page==1)
                {
                    cout << "以下是你持有的道具1/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
            }
        }
//左 
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            if(numitem>0&&numitem<=12) 
            {
                cout << "以下是你持有的道具1/1       " << endl;
                cout << "------------------          " << endl;
                goto po;
            } 
            if(numitem>12&&numitem<=24)
            {
                if(page==1)
                {
                    page=2; 
                    cout << "以下是你持有的道具2/2       " << endl;
                    cout << "------------------          " << endl;
                    if(numitem-12<nummitem)
                    {
                        for(X=0;X<13;X++) 
                        { 
                            if(flag[X]=='>')
                            { 
                                if(X+1>numitem-12) 
                                { 
                                    flag[X]=' ';
                                    flag[numitem-13]='>';
                                } 
                            }
                        }
                    } 
                    goto po2;
                }
                if(page==2)
                {
                    cout << "以下是你持有的道具2/2       " << endl;
                    cout << "------------------          " << endl;
                    goto po2; 
                }
            }
            if(numitem>24)
            {
                if(page==1)
                {
                    page=2; 
                    cout << "以下是你持有的道具2/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po2;
                }
                if(page==2)
                {
                    page=3;
                    cout << "以下是你持有的道具3/3       " << endl;
                    cout << "------------------          " << endl;
                    if(numitem-24<nummitem)
                    {
                        for(X=0;X<13;X++) 
                        { 
                            if(flag[X]=='>')
                            { 
                                if(X+1>numitem-24) 
                                { 
                                    flag[X]=' ';
                                    flag[numitem-25]='>';
                                } 
                            }
                        }
                    }
                    goto po3; 
                }
                if(page==3)
                {
                    cout << "以下是你持有的道具3/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po3; 
                }
            }
        }
//右 
        if((KeyArray[13]&0x80)!=0)
        {
            for(X=0;X<13;X++) 
            { 
                if(flag[X]=='>')
                { 
                    if(page==1)
                    {
                        used2=X+1;
                        system("cls");
                        uuitem(used2);
                        goto no;
                    } 
                    if(page==2)
                    {
                        used2=X+13;
                        system("cls");
                        uuitem(used2);
                        goto no;
                    } 
                    if(page==3)
                    {
                        used2=X+25;
                        system("cls");
                        uuitem(used2);
                        goto no;
                    }
                }
            }
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re; 
        }
//ESC 
        cout << "請勿按除了'下'和'上'、'左'、'右'與'Enter'和'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        if(page==1) 
        { 
            if(numitem>0&&numitem<=12) 
            {
                cout << "以下是你持有的道具1/1       " << endl;
                cout << "------------------          " << endl;
                goto po;
            } 
            if(numitem>12&&numitem<=24)
            {
                cout << "以下是你持有的道具1/2       " << endl;
                cout << "------------------          " << endl;
                goto po;
            }
            if(numitem>24)
            {
                cout << "以下是你持有的道具1/3       " << endl;
                cout << "------------------          " << endl;
                goto po;
            }
        }
        if(page==2)
        {
            if(numitem>12&&numitem<=24)
            {
                cout << "以下是你持有的道具2/2       " << endl;
                cout << "------------------          " << endl;
                goto po2;
            }
            if(numitem>24)
            {
                cout << "以下是你持有的道具2/3       " << endl;
                cout << "------------------          " << endl;
                goto po2;
            }
        }
        if(page==3)
        {
            if(numitem>24)
            {
                cout << "以下是你持有的道具3/3       " << endl;
                cout << "------------------          " << endl;
                goto po3;
            }
        }
    }
re: 
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//確認道具用 
////////////////////////////////////////////////////////////////////////////////
void uuitem(int used2) 
{
    int used;//選擇的時候用
    used=0;
    if(HP10>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto fHP10; 
    }    
    if(HP50>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto fHP50; 
    }
    if(HP100>0)
    {
         used++;
    }
    if(used==used2)
    {
        goto fHP100; 
    }
    if(HP150>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fHP150; 
    }
    if(HP200>0)
    {
        used++;
    }
    if(used==used2)
    {
        goto fHP200; 
    }
    if(HP250>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fHP250; 
    }
    if(MP10>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fMP10;
    }
    if(MP50>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fMP50; 
    }
    if(MP100>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fMP100; 
    }
    if(MP150>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fMP150; 
    }
    if(MP200>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fMP200; 
    }
    if(MP250>0)
    {
        used++;
    }   
    if(used==used2)
    {
        goto fMP250; 
    }
    if(MP300>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fMP300; 
    }
    if(pro1>0)
    {
        used++;
    }
    if(used==used2)
    {
        goto fpro1; 
    }
    if(pro5>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fpro5; 
    }
    if(apro1>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fapro1; 
    }
    if(exitwar>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fexitwar; 
    }
    if(govill>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fgovill; 
    }
    if(cmap>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto fcmap; 
    }
    if(tmap1>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto ftmap1;
    }
    if(tmap2>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto ftmap2; 
    }
    if(tmap3>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto ftmap3; 
    }
    if(tmap4>0)
    {
        used++;
    }  
    if(used==used2)
    {
        goto ftmap4; 
    }
    if(tmap5>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto ftmap5; 
    }
    if(tmap6>0)
    {
        used++;
    } 
    if(used==used2)
    {
        goto ftmap6; 
    }
    if(tmap7>0)
    {
        used++;
    }
    if(used==used2)
    {
        goto ftmap7; 
    }
    if(tmap8>0)
    {
        used++;
    }
    if(used==used2)
    {
        goto ftmap8; 
    }
fHP10: 
    cout << "  補血草        " << endl;
    cout << "  HP+10       " << endl;
    cout << "  你還有 " << HP10 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(hp==Hp)
            { 
                cout << "你的血是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fHP10;
            } 
            hp=hp+10;
            HP10=HP10-1;
            if(hp>Hp)
            { 
                hp=Hp;
            }
            if(HP10==0)
            { 
                goto re;
            }            
            system("cls");
            goto fHP10;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fHP10;
    }
fHP50:
    cout << "  補血粉        " << endl;
    cout << "  HP+50       " << endl;
    cout << "  你還有 " << HP50 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(hp==Hp)
            { 
                cout << "你的血是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fHP50;
            } 
            hp=hp+50;
            HP50=HP50-1;
            if(hp>Hp)
            { 
                hp=Hp;
            }
            if(HP50==0)
            { 
                goto re;
            }            
            system("cls");
            goto fHP50;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fHP50;
    }
fHP100:
    cout << "  補血丸        " << endl;
    cout << "  HP+100       " << endl;
    cout << "  你還有 " << HP100 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(hp==Hp)
            { 
                cout << "你的血是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fHP100;
            } 
            hp=hp+100;
            HP100=HP100-1;
            if(hp>Hp)
            { 
                hp=Hp;
            }
            if(HP100==0)
            { 
                goto re;
            }            
            system("cls");
            goto fHP100;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fHP100;
    }
fHP150:
    cout << "  補血貼布      " << endl;
    cout << "  HP+150       " << endl;
    cout << "  你還有 " << HP150 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(hp==Hp)
            { 
                cout << "你的血是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fHP150;
            } 
            hp=hp+150;
            HP150=HP150-1;
            if(hp>Hp)
            { 
                hp=Hp;
            }
            if(HP150==0)
            { 
                goto re;
            }            
            system("cls");
            goto fHP150;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fHP150;
    }
fHP200:
    cout << "  補血藥膏      " << endl;
    cout << "  HP+200       " << endl;
    cout << "  你還有 " << HP200 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(hp==Hp)
            { 
                cout << "你的血是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fHP200;
            } 
            hp=hp+200;
            HP200=HP200-1;
            if(hp>Hp)
            { 
                hp=Hp;
            }
            if(HP200==0)
            { 
                goto re;
            }            
            system("cls");
            goto fHP200;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fHP200;
    }
fHP250:
    cout << "  補血神豆      " << endl;
    cout << "  HP+250       " << endl;
    cout << "  你還有 " << HP250 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(hp==Hp)
            { 
                cout << "你的血是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fHP250;
            } 
            hp=hp+250;
            HP250=HP250-1;
            if(hp>Hp)
            { 
                hp=Hp;
            }
            if(HP250==0)
            { 
                goto re;
            }            
            system("cls");
            goto fHP250;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fHP250;
    }
fMP10:
    cout << "  提神草        " << endl;
    cout << "  MP+10       " << endl;
    cout << "  你還有 " << MP10 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP10;
            } 
            mp=mp+10;
            MP10=MP10-1;
            if(mp>Mp)
            { 
                mp=Mp;
            }
            if(MP10==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP10;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP10;
    }
fMP50:
    cout << "  提神粉        " << endl;
    cout << "  MP+50       " << endl;
    cout << "  你還有 " << MP50 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP50;
            } 
            mp=mp+50;
            MP50=MP50-1;
            if(mp>Mp)
            { 
                mp=Mp;
            }
            if(MP50==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP50;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP50;
    }
fMP100:
    cout << "  提神丸        " << endl;
    cout << "  MP+100       " << endl;
    cout << "  你還有 " << MP100 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP100;
            } 
            mp=mp+100;
            MP100=MP100-1;
            if(mp>Mp)
            { 
                mp=Mp;
            } 
            if(MP100==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP100;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP100;
    }
fMP150: 
    cout << "  提神噴霧      " << endl;
    cout << "  MP+150       " << endl;
    cout << "  你還有 " << MP150 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP150;
            } 
            mp=mp+150;
            MP150=MP150-1;
            if(mp>Mp)
            { 
                mp=Mp;
            }
            if(MP150==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP150;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP150;
    }
fMP200:
    cout << "  提神貼布      " << endl;
    cout << "  MP+200       " << endl;
    cout << "  你還有 " << MP200 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP200;
            } 
            mp=mp+200;
            MP200=MP200-1;
            if(mp>Mp)
            { 
                mp=Mp;
            }
            if(MP200==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP200;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP200;
    }
fMP250:
    cout << "  提神藥膏      " << endl;
    cout << "  MP+250       " << endl;
    cout << "  你還有 " << MP250 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP250;
            } 
            mp=mp+250;
            MP250=MP250-1;
            if(mp>Mp)
            { 
                mp=Mp;
            }
            if(MP250==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP250;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP250;
    }
fMP300:
    cout << "  提神神豆      " << endl;
    cout << "  MP+300       " << endl;
    cout << "  你還有 " << MP300 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            if(mp==Mp)
            { 
                cout << "你的魔是滿的，不需要這麼浪費" << endl;
                system("pause");
                system("cls");
                goto fMP300;
            } 
            mp=mp+300;
            MP300=MP300-1;
            if(mp>Mp)
            { 
                mp=Mp;
            }
            if(MP300==0)
            { 
                goto re;
            }            
            system("cls");
            goto fMP300;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fMP300;
    }
fpro1:
    cout << "  神奇藥水      " << endl;
    cout << "  選擇一屬性永久+1       " << endl;
    cout << "  你還有 " << pro1 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            pro1=pro1-1;
            point++;
            cout << "你的自由點數已經加1" << endl;
            system("pause");
            if(pro1==0)
            { 
                goto re;
            }            
            system("cls");
            goto fpro1;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fpro1;
    }
fpro5:
    cout << "  神奇藥膏      " << endl;
    cout << "  選擇一屬性永久+5       " << endl;
    cout << "  你還有 " << pro5 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            pro5=pro5-1;
            point=point+5;
            cout << "你的自由點數已經加5" << endl;
            system("pause");
            if(pro5==0)
            { 
                goto re;
            }            
            system("cls");
            goto fpro5;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fpro5;
    }
fapro1:
    cout << "  神豆          " << endl;
    cout << "  全部屬性永久+1       " << endl;
    cout << "  你還有 " << apro1 << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            apro1=apro1-1;
            str++,vit++,dex++,inte++,spi++,luc++;
            cout << "你的所有屬性已經加1" << endl;
            if(apro1==0)
            { 
                goto re;
            }            
            system("cls");
            goto fapro1;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fapro1;
    }
fexitwar:
    cout << "  煙霧彈        " << endl;
    cout << "  戰鬥脫出       " << endl;
    cout << "  你還有 " << exitwar << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            system("pause");
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fapro1;
    }
fgovill:
    cout << "  傳送捲軸      " << endl;
    cout << "  直接傳送回村子，戰鬥中無法使用  " << endl;
    cout << "  你還有 " << govill << " 個" << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來使用1個該物品，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            game();
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto fgovill;
    }
fcmap:
    cout << "  平原地圖         " << endl;
    cout << "  平原的地圖     " << endl;
ftmap1:
    cout << "  廢墟之塔地圖1F  " << endl; 
    cout << "  廢墟之塔1F的地圖     " << endl;
ftmap2:
    cout << "  廢墟之塔地圖2F  " << endl;
    cout << "  廢墟之塔2F的地圖     " << endl;
ftmap3:
    cout << "  廢墟之塔地圖3F  " << endl;
    cout << "  廢墟之塔3F的地圖     " << endl;
ftmap4:
    cout << "  廢墟之塔地圖4F  " << endl;
    cout << "  廢墟之塔1F的地圖     " << endl;
ftmap5:
    cout << "  廢墟之塔地圖5F  " << endl;
    cout << "  廢墟之塔2F的地圖     " << endl;
ftmap6:
    cout << "  廢墟之塔地圖6F  " << endl;
    cout << "  廢墟之塔3F的地圖     " << endl;
ftmap7:
    cout << "  廢墟之塔地圖7F  " << endl;
    cout << "  廢墟之塔7F的地圖     " << endl;
ftmap8:
    cout << "  廢墟之塔地圖8F  " << endl;
    cout << "  廢墟之塔8F的地圖     " << endl;
re:
    system("cls"); 
}
////////////////////////////////////////////////////////////////////////////////
//動作 
////////////////////////////////////////////////////////////////////////////////
void action(int r)
{
    system("cls");
    srand(time(NULL));
    int act;//判斷用
    while(1)//設定act 
    {
        act=rand(); 
        if(act>100&&act<=10000)  
        {
             break; 
        } 
    }
    act=act/100;
    if(r==1)
    {
        if(act>0&&act<=60-(luc/5+1))
        {
            war(r);
        }
        if(act>60-(luc/5+1)&&act<=70)
        {
            gem(r);
        }
        if(act>70&&act<=100)
        {
            cout << "你並沒有發現任何怪異之處" << endl;
            system("pause");
        }
    } 
    if(r==2)
    {
        if(act>0&&act<=65-(luc/5+1))
        {
            war(r);
        }
        if(act>65-(luc/5+1)&&act<=80)
        {
            gem(r);
        }
        if(act>80&&act<=100)
        {
            cout << "你並沒有發現任何怪異之處" << endl;
            system("pause");
        }
    } 
    if(r>=3)
    {
        if(act>0&&act<=75-(luc/5+1))
        {
            war(r);
        }
        if(act>75-(luc/5+1)&&act<=90)
        {
            gem(r);
        }
        if(act>90&&act<=100)
        {
            cout << "你並沒有發現任何怪異之處" << endl;
            cout << "你稍作休息" << endl;
            Sleep(1000); 
            system("pause");
        }
    }
    system("cls");
}      
 ////////////////////////////////////////////////////////////////////////////////
//寶箱 
////////////////////////////////////////////////////////////////////////////////
void gem(int &r)
{ 
    short x[27]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
         ,y[60]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};//武器跟道具種類
    int X,Y; 
    int roll;
found:
    cout << "你發現了一個似乎是寶箱的東西" << endl;
    cout << "按[Y]es可以打開寶箱[N]o可以放棄開啟的機會" << endl;
    system("pause");//開始確認 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[89]&0x80)!=0)
        {
            system("cls");
            goto open;
        }
//是~)
        if((KeyArray[78]&0x80)!=0)
        {                           
            goto re;
        }
//否~
         cout << "請勿按除了[Y]es與[N]o以外的其他按鍵" << endl;
         system("pause");
         system("cls");
         goto found;
    }
open:
    cout << "你將寶箱打了開來" << endl;
    if(r==1)//平原 
    { 
         x[0]=x[1]=x[2]=x[6]=x[7]=x[8]=x[13]=x[16]=x[17]=1;
         y[0]=y[1]=y[2]=y[26]=y[27]=y[28]=1;
    } 
    if(r==2)//洞窟 
    { 
         x[0]=x[1]=x[2]=x[3]=x[6]=x[7]=x[8]=x[9]=x[13]=x[16]=x[17]=1;
         y[0]=y[1]=y[2]=y[3]=y[6]=y[30]=y[31]=y[32]=y[33]=y[36]=1;
    }
    if(r==3)//塔1 
    {
         x[0]=x[1]=x[2]=x[3]=x[6]=x[7]=x[8]=x[9]=x[13]=x[16]=x[17]=x[19]=1;
         y[0]=y[1]=y[2]=y[3]=y[30]=y[31]=y[32]=y[33]=1;
    }
    if(r==4)
    {
         x[0]=x[1]=x[2]=x[3]=x[6]=x[7]=x[8]=x[9]=x[13]=x[16]=x[17]=x[20]=1;
         y[1]=y[2]=y[3]=y[31]=y[32]=y[33]=1;
    }
    if(r==5)
    {
         x[1]=x[2]=x[3]=x[7]=x[8]=x[9]=x[13]=x[16]=x[17]=x[21]=1;
         y[1]=y[2]=y[3]=y[6]=y[31]=y[32]=y[33]=y[36]=1;
    }
    if(r==6)
    {
         x[1]=x[2]=x[3]=x[4]=x[7]=x[8]=x[9]=x[10]=x[13]=x[16]=x[17]=x[22]=1;
         y[2]=y[3]=y[6]=y[32]=y[33]=y[36]=1;
    }
    if(r==7)
    {
         x[2]=x[3]=x[4]=x[5]=x[7]=x[8]=x[9]=x[10]=x[11]=x[14]=x[16]=x[17]=x[23]=1;
         y[3]=y[6]=y[7]=y[33]=y[36]=y[37]=1;
    }
    if(r==8)
    {
         x[3]=x[4]=x[5]=x[7]=x[8]=x[9]=x[10]=x[14]=x[16]=x[17]=x[24]=1;
         y[6]=y[7]=y[8]=y[36]=y[37]=y[38]=1;
    }
    if(r==9)
    {
         x[3]=x[4]=x[5]=x[8]=x[9]=x[10]=x[11]=x[14]=x[16]=x[17]=x[25]=1;
         y[12]=y[13]=y[18]=y[42]=y[43]=y[48]=1;
    }
    if(r==10)//塔8 
    {
         x[3]=x[4]=x[5]=x[9]=x[10]=x[11]=x[12]=x[14]=x[15]=x[16]=x[17]=x[26]=1;
         y[12]=y[13]=y[18]=y[24]=y[42]=y[43]=y[48]=y[54]=1;
    }
roo://骰
    srand(time(NULL));
    while(1)//設定roll 
    {
        roll=rand();
        if(roll>0&&roll<=850)  
        {
             break; 
        } 
    }
    if(roll>0&&roll<=60)//補血草
    {
        if(x[0]==1)
        {
            cout << "你發現了一個補血草" << endl;
            HP10++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>60&&roll<=110)//補血粉 
    {
        if(x[1]==1)
        {
            cout << "你發現了一個補血粉" << endl;
            HP50++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>110&&roll<=150)//補血丸
    {
        if(x[2]==1)
        {
            cout << "你發現了一個補血丸" << endl;
            HP100++; 
            system("pause");
            goto re;
        }
        goto no;
    }
    if(roll>150&&roll<=180)//補血貼布
    {
        if(x[3]==1)
        {
            cout << "你發現了一個補血貼布" << endl;
            HP150++; 
            system("pause");
            goto re;
        }
        goto no;
    }
    if(roll>180&&roll<=200)//補血藥膏
    {
        if(x[4]==1)
        {
            cout << "你發現了一個補血藥膏" << endl;
            HP200++; 
            system("pause");
            goto re;
        }
        goto no;
    }
    if(roll>200&&roll<=210)//補血神豆
    {
        if(x[5]==1)
        {
            cout << "你發現了一個補血神豆" << endl;
            HP250++; 
            system("pause");
            goto re;
        }
        goto no;
    }
    if(roll>210&&roll<=275)//提神草
    {
        if(x[6]==1)
        {
            cout << "你發現了一個提神草" << endl;
            MP10++; 
            system("pause");
            goto re;
        }
        goto no;
    }
    if(roll>275&&roll<=330)//提神粉
    {
        if(x[7]==1)
        {
            cout << "你發現了一個提神粉" << endl;
            MP50++; 
            system("pause");
            goto re;
        }
        goto no;
    }
    if(roll>330&&roll<=375)//提神丸
    {
        if(x[8]==1)
        {
            cout << "你發現了一個提神丸" << endl;
            MP100++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>375&&roll<=410)//提神噴霧
    {
        if(x[9]==1)
        {
            cout << "你發現了一個提神噴霧" << endl;
            MP150++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>410&&roll<=435)//提神貼布
    {
        if(x[10]==1)
        {
            cout << "你發現了一個提神貼布" << endl;
            MP200++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>435&&roll<=450)//提神藥膏
    {
        if(x[11]==1)
        {
            cout << "你發現了一個提神藥膏" << endl;
            MP250++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>450&&roll<=455)//提神神豆
    {
        if(x[12]==1)
        {
            cout << "你發現了一個提神神豆" << endl;
            MP300++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>455&&roll<=465)//神奇藥水
    {
        if(x[13]==1)
        {
            cout << "你發現了一個神奇藥水" << endl;
            pro1++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>465&&roll<=470)//神奇藥膏
    {
        if(x[14]==1)
        {
            cout << "你發現了一個神奇藥膏" << endl;
            pro5++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>470&&roll<=471)//神豆
    {
        if(x[15]==1)
        {
            cout << "你發現了一個神豆" << endl;
            apro1++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>471&&roll<=501)//煙霧彈
    {
        if(x[16]==1)
        {
            cout << "你發現了一個煙霧彈" << endl;
            exitwar++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>501&&roll<=531)//傳送捲軸
    {
        if(y[17]==1)
        {
            cout << "你發現了一個傳送捲軸" << endl;
            govill++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>531&&roll<=551)//木劍 
    {
        if(y[0]==1)
        {
            cout << "你發現了一把木劍" << endl;
            wo++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>551&&roll<=566)//木劍+1 
    {
        if(y[1]==1)
        {
            cout << "你發現了一把木劍+1" << endl;
            wo1++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>566&&roll<=576)//木劍+2 
    {
        if(y[2]==1)
        {
            cout << "你發現了一把木劍+2" << endl;
            wo2++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>576&&roll<=581)//木劍+3 
    {
        if(y[3]==1)
        {
            cout << "你發現了一把木劍+3" << endl;
            wo3++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>581&&roll<=596)//鐵劍 
    {
        if(y[6]==1)
        {
            cout << "你發現了一把鐵劍" << endl;
            me++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>596&&roll<=606)//鐵劍+1 
    {
        if(y[7]==1)
        {
            cout << "你發現了一把鐵劍+1" << endl;
            me1++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>606&&roll<=611)//鐵劍2 
    {
        if(y[8]==1)
        {
            cout << "你發現了一把鐵劍+2" << endl;
            me2++; 
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>611&&roll<=621)//銀劍
    {
        if(y[12]==1)
        {
            cout << "你發現了一把銀劍" << endl;
            si++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>626&&roll<=631)//銀劍+1 
    {
        if(y[13]==1)
        {
            cout << "你發現了一把銀劍+1" << endl;
            si1++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>631&&roll<=651)//木杖 
    {
        if(y[30]==1)
        {
            cout << "你發現了一把木杖" << endl;
            woo++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>651&&roll<=666)//木杖+1 
    {
        if(y[31]==1)
        {
            cout << "你發現了一把木杖+1" << endl;
            woo1++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>666&&roll<=676)//木杖+2 
    {
        if(y[32]==1)
        {
            cout << "你發現了一把木杖+2" << endl;
            woo2++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>676&&roll<=681)//木杖+3 
    {
        if(y[33]==1)
        {
            cout << "你發現了一把木杖+3" << endl;
            woo3++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>681&&roll<=696)//藍寶石杖 
    {
        if(y[36]==1)
        {
            cout << "你發現了一把藍寶石杖" << endl;
            bl++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>696&&roll<=706)//藍寶石杖+1 
    {
        if(y[37]==1)
        {
            cout << "你發現了一把藍寶石杖+1" << endl;
            bl1++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>706&&roll<=711)//藍寶石杖+2 
    {
        if(y[38]==1)
        {
            cout << "你發現了一把藍寶石杖+2" << endl;
            bl2++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>711&&roll<=721)//水晶杖 
    {
        if(y[42]==1)
        {
            cout << "你發現了一把水晶杖" << endl;
            cr++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>721&&roll<=726)//水晶杖+1 
    {
        if(y[43]==1)
        {
            cout << "你發現了一把水晶杖+1" << endl;
            cr1++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>726&&roll<=731)//元素之杖 
    {
        if(y[48]==1)
        {
            cout << "你發現了一把元素之杖" << endl;
            el++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>731&&roll<=732)//勇者之劍 
    {
        if(y[24]==1)
        {
            cout << "你發現了一把勇者之劍" << endl;
            br++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>732&&roll<=733)//賢者之杖 
    {
        if(y[54]==1)
        {
            cout << "你發現了一把賢者之杖" << endl;
            sa++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>733&&roll<=738)//子母劍 
    {
        if(y[18]==1)
        {
            cout << "你發現了一把子母劍" << endl;
            so++;
            system("pause");
            goto re;
        } 
        goto no;
    }
    if(roll>738&&roll<=743)//塔地圖 1 
    {
        if(x[19]==1)
        {
            if(tmap1<1) 
            { 
                cout << "你發現了一張廢墟之塔1樓的地圖" << endl;
                tmap1++;
                system("pause");
                goto re;
            } 
        }
        goto no;
    }
    if(roll>743&&roll<=748)//塔地圖2 
    {
        if(x[20]==1)
        {
            if(tmap2<1) 
            { 
                cout << "你發現了一張廢墟之塔2樓的地圖" << endl;
                tmap2++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>748&&roll<=753)//塔地圖3 
    {
        if(x[21]==1)
        {
            if(tmap3<1) 
            { 
                cout << "你發現了一張廢墟之塔3樓的地圖" << endl;
                tmap3++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>753&&roll<=758)//塔地圖 4 
    {
        if(x[22]==1)
        {
            if(tmap4<1) 
            { 
                cout << "你發現了一張廢墟之塔4樓的地圖" << endl;
                tmap4++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>758&&roll<=763)//塔地圖 5 
    {
        if(x[23]==1)
        {
            if(tmap5<1) 
            { 
                cout << "你發現了一張廢墟之塔5樓的地圖" << endl;
                tmap5++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>763&&roll<=768)//塔地圖 6 
    {
        if(x[24]==1)
        {
            if(tmap6<1) 
            { 
                cout << "你發現了一張廢墟之塔6樓的地圖" << endl;
                tmap6++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>768&&roll<=773)//塔地圖7 
    {
        if(x[25]==1)
        {
            if(tmap7<1) 
            { 
                cout << "你發現了一張廢墟之塔7樓的地圖" << endl;
                tmap7++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>773&&roll<=778)//塔地圖8 
    {
        if(x[26]==1)
        {
            if(tmap8<1) 
            { 
                cout << "你發現了一張廢墟之塔8樓的地圖" << endl;
                tmap8++;
                system("pause");
                goto re;
            } 
        } 
        goto no;
    }
    if(roll>778&&roll<=850)//空 
    {
        cout << "裡面飛出了一樣東西，你來不及觀察就消失了" << endl;
        system("pause");
        goto re; 
    }
no:
    cout << "你迫不及待的往裡頭一看，空........." << endl;
    system("pause");
    system("cls");
re:
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//人物--裝備資料
////////////////////////////////////////////////////////////////////////////////
void pequ()
{ 
    int nummitem=0;//計算第1頁的各數用 
    int numitem=checkequ();//道具的種類數 
    cout << "以下是你持有的裝備           狀態     道具  " << endl;
    cout << "------------------         > 裝備     技能  " << endl;
    if(numitem>0&&numitem<=12)
    {
        system("cls");
        cout << "以下是你持有的裝備1/1        狀態     道具  " << endl;
        cout << "------------------         > 裝備     技能  " << endl;
    } 
    if(numitem>12&&numitem<=24)
    {
        system("cls");
        cout << "以下是你持有的裝備1/2        狀態     道具  " << endl;
        cout << "------------------         > 裝備     技能  " << endl;
    }
    if(numitem>24&&numitem<=36)
    {
        system("cls");
        cout << "以下是你持有的裝備1/3        狀態     道具  " << endl;
        cout << "------------------         > 裝備     技能  " << endl;
    }
    if(numitem>36&&numitem<=48)
    {
        system("cls");
        cout << "以下是你持有的裝備1/4        狀態     道具  " << endl;
        cout << "------------------         > 裝備     技能  " << endl;
    }
    if(numitem>48&&numitem<=60)
    {
        system("cls");
        cout << "以下是你持有的裝備1/5        狀態     道具  " << endl;
        cout << "------------------         > 裝備     技能  " << endl;
    }
    if(wo>0)
    {
        cout << "   木劍         " << wo << endl;
        nummitem++;
    } 
    if(wo1>0)
    {
        cout << "   木劍+1       " << wo1 << endl;
        nummitem++;
    } 
    if(wo2>0)
    {
        cout << "   木劍+2       " << wo2 << endl;
        nummitem++;
    } 
    if(wo3>0)
    {
        cout << "   木劍+3       " << wo3 << endl;
        nummitem++;
    } 
    if(wo4>0)
    {
        cout << "   木劍+4       " << wo4 << endl;
        nummitem++;
    } 
    if(wo5>0)
    {
        cout << "   木劍+5       " << wo5 << endl;
        nummitem++;
    } 
    if(me>0)
    {
        cout << "   鐵劍         " << me << endl;
        nummitem++;
    } 
    if(me1>0)
    {
        cout << "   鐵劍+1       " << me1 << endl;
        nummitem++;
    } 
    if(me2>0)
    {
        cout << "   鐵劍+2       " << me2 << endl;
        nummitem++;
    } 
    if(me3>0)
    {
        cout << "   鐵劍+3       " << me3 << endl;
        nummitem++;
    } 
    if(me4>0)
    {
        cout << "   鐵劍+4       " << me4 << endl;
        nummitem++;
    } 
    if(me5>0)
    {
        cout << "   鐵劍+5       " << me5 << endl;
        nummitem++;
    } 
    if(nummitem<12) 
    { 
        if(si>0)
        { 
            cout << "   銀劍         " << si << endl;
            nummitem++;
        }
    }
    if(nummitem<12) 
    {
        if(si1>0)
        {
            cout << "   銀劍+1       " << si1 << endl;
            nummitem++;
        } 
     } 
   if(nummitem<12) 
    {
        if(si2>0)
        {
            cout << "   銀劍+2       " << si2 << endl;
            nummitem++;
        }
    }
    if(nummitem<12) 
    {
        if(si3>0)
        {
            cout << "   銀劍+3       " << si3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(si4>0)
        {
            cout << "   銀劍+4       " << si4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(si5>0)
        {
            cout << "   銀劍+5       " << si5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(so>0)
        { 
            cout << "   子母劍       " << so << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
    if(so1>0)
        {
            cout << "   子母劍+1     " << so1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(so2>0)
        {
            cout << "   子母劍+2     " << so2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(so3>0)
        {
            cout << "   子母劍+3     " << so3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(so4>0)
        {
            cout << "   子母劍+4     " << so4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(so5>0)
        {
            cout << "   子母劍+5     " << so5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(br>0)
        { 
            cout << "   勇者之劍     " << br << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(br1>0)
        {
            cout << "   勇者之劍+1   " << br1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(br2>0)
        {
            cout << "   勇者之劍+2   " << br2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(br3>0)
        {
            cout << "   勇者之劍+3   " << br3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(br4>0)
        {
            cout << "   勇者之劍+4   " << br4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(br5>0)
        {
            cout << "   勇者之劍+5   " << br5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(woo>0)
        { 
            cout << "   木杖         " << woo << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(woo1>0)
        {
            cout << "   木杖+1       " << woo1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(woo2>0)
        {
            cout << "   木杖+2       " << woo2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(woo3>0)
        {
            cout << "   木杖+3       " << woo3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(woo4>0)
        {
            cout << "   木杖+4       " << woo4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(woo5>0)
        {
            cout << "   木杖+5       " << woo5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(bl>0)
        { 
            cout << "   藍寶石杖     " << bl << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(bl1>0)
        {
            cout << "   藍寶石杖+1   " << bl1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(bl2>0)
        {
            cout << "   藍寶石杖+2   " << bl2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(bl3>0)
        {
            cout << "   藍寶石杖+3   " << bl3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(bl4>0)
        {
            cout << "   藍寶石杖+4   " << bl4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(bl5>0)
        {
            cout << "   藍寶石杖+5   " << bl5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(cr>0)
        { 
            cout << "   水晶杖       " << cr << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(cr1>0)
        {
            cout << "   水晶杖+1     " << cr1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(cr2>0)
        {
            cout << "   水晶杖+2     " << cr2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(cr3>0)
        {
            cout << "   水晶杖+3     " << cr3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(cr4>0)
        {
            cout << "   水晶杖+4     " << cr4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(cr5>0)
        {
            cout << "   水晶杖+5     " << cr5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(el>0)
        { 
            cout << "   元素之杖     " << el << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(el1>0)
        {
            cout << "   元素之杖+1   " << el1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(el2>0)
        {
            cout << "   元素之杖+2   " << el2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(el3>0)
        {
            cout << "   元素之杖+3   " << el3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(el4>0)
        {
            cout << "   元素之杖+4   " << el4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(el5>0)
        {
            cout << "   元素之杖+5   " << el5 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(sa>0)
        { 
            cout << "   賢者之杖     " << sa << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(sa1>0)
        {
            cout << "   賢者之杖+1   " << sa1 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(sa2>0)
        {
            cout << "   賢者之杖+2   " << sa2 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(sa3>0)
        {
            cout << "   賢者之杖+3   " << sa3 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(sa4>0)
        {
            cout << "   賢者之杖+4   " << sa4 << endl;
            nummitem++;
        } 
    }
    if(nummitem<12) 
    {
        if(sa5>0)
        {
            cout << "   賢者之杖+5   " << sa5 << endl;
            nummitem++;
        }
    }
    if(nummitem==12)
    {
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    } 
    if(nummitem==11)
    {
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==10)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==9)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==8)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==7)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==6)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==5)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==4)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==3)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl; 
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
    cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==2)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==1)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
    if(nummitem==0)
    {
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "                                     " << endl;
        cout << "------------------               " << endl;
        cout << "持有金   " << money << "              " << endl;
        cout << "                                      " << endl;
        cout << "你可以按'上'和'右'來移動指標以顯示不同的資訊" << endl;
        cout << "按'Esc'可以離開，按'Enter'可以確認與裝備武器" << endl;
    }
}
////////////////////////////////////////////////////////////////////////////////
//武器店 -買 
////////////////////////////////////////////////////////////////////////////////
void armsbuy()
{ 
    int number;
    int num;
    int itemm; 
left1:
    cout << "    武器1/1              " << endl;
    cout << "                                 " << endl;
    cout << "  > 木劍                     50  " << endl;
    cout << "    鐵劍                     500  " << endl;
    cout << "    木杖                     50 " << endl;
    cout << "    藍寶石杖                 500  " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "  物攻+5   魔攻+2                  " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left2; 
        }
//下
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  木劍   " << endl;
            cout << "  物攻+5   魔攻+2       " << endl;
            number=choose(50,wo);
            wo=wo+number;
            money=money-number*50; 
            goto left1; 
        }
//選擇 
        cout << "請勿按除了'下'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left1;
    } 
left2:
    cout << "    武器1/1              " << endl;
    cout << "                                 " << endl;
    cout << "    木劍                     50  " << endl;
    cout << "  > 鐵劍                     500  " << endl;
    cout << "    木杖                     50 " << endl;
    cout << "    藍寶石杖                 500  " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "  物攻+13   魔攻+4                  " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left1; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left3; 
        }
//下
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  鐵劍   " << endl;
            cout << "  物攻+13   魔攻+4       " << endl;
            number=choose(500,me);
            me=me+number;
            money=money-number*500; 
            goto left2; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left2;
    } 
left3:
    cout << "    武器1/1              " << endl;
    cout << "                                 " << endl;
    cout << "    木劍                     50  " << endl;
    cout << "    鐵劍                     500  " << endl;
    cout << "  > 木杖                     50 " << endl;
    cout << "    藍寶石杖                 500  " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "  物攻+2   魔攻+5                      " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left2; 
        }
//上 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto left4; 
        }
//下
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  木杖   " << endl;
            cout << "  物攻+2   魔攻+5       " << endl;
            number=choose(50,woo);
            woo=woo+number;
            money=money-number*50; 
            goto left3; 
        }
//選擇 
        cout << "請勿按除了'上'和'下'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left3;
    }
left4:
    cout << "    武器1/1              " << endl;
    cout << "                                 " << endl;
    cout << "    木劍                     50  " << endl;
    cout << "    鐵劍                     500  " << endl;
    cout << "    木杖                     50 " << endl;
    cout << "  > 藍寶石杖                 500  " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "                                   " << endl;
    cout << "  物攻+4   魔攻+13                      " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你好! 看到喜歡的儘量挑" << endl;
    cout << "你可以按'上'和'下'來移動指標" << endl;
    cout << "按'Enter'可以選擇、按'Esc'可以回到上一個選單" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto left3; 
        }
//上 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            cout << "  藍寶石杖   " << endl;
            cout << "  物攻+4   魔攻+13       " << endl;
            number=choose(500,bl);
            bl=bl+number;
            money=money-number*500; 
            goto left4; 
        }
//選擇 
        cout << "請勿按除了'上'與'Esc'和'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto left4;
    }
re:
    system("cls");    
}
////////////////////////////////////////////////////////////////////////////////
//裝備武器 
////////////////////////////////////////////////////////////////////////////////
void uequ()
{
no:
    int nummitem;//計算個數用 
    int numitem=checkequ();//裝備的種類數 
    char flag[12]={'>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
    int X;//繪圖用
    int used2;//選擇的時候用
    int page=1;//頁數 
    bool bsi=false,bsi1=false,bsi2=false,bsi3=false,bsi4=false,bsi5=false,//銀劍 
         bso=false,bso1=false,bso2=false,bso3=false,bso4=false,bso5=false,//子母劍 
         bbr=false,bbr1=false,bbr2=false,bbr3=false,bbr4=false,bbr5=false,//勇者之劍 
         bwoo=false,bwoo1=false,bwoo2=false,bwoo3=false,bwoo4=false,bwoo5=false,//木杖
         bbl=false,bbl1=false,bbl2=false,bbl3=false,bbl4=false,bbl5=false,//藍寶石杖          
         bcr=false,bcr1=false,bcr2=false,bcr3=false,bcr4=false,bcr5=false,//水晶杖 
         bel=false,bel1=false,bel2=false,bel3=false,bel4=false,bel5=false,//元素之杖 
         bsa=false,bsa1=false,bsa2=false,bsa3=false,bsa4=false,bsa5=false;//賢者之杖 
    bool bbbr=false,bbbr1=false,bbbr2=false,bbbr3=false,bbbr4=false,bbbr5=false,//勇者之劍 
         bbwoo=false,bbwoo1=false,bbwoo2=false,bbwoo3=false,bbwoo4=false,bbwoo5=false,//木杖
         bbbl=false,bbbl1=false,bbbl2=false,bbbl3=false,bbbl4=false,bbbl5=false,//藍寶石杖          
         bbcr=false,bbcr1=false,bbcr2=false,bbcr3=false,bbcr4=false,bbcr5=false,//水晶杖 
         bbel=false,bbel1=false,bbel2=false,bbel3=false,bbel4=false,bbel5=false,//元素之杖 
         bbsa=false,bbsa1=false,bbsa2=false,bbsa3=false,bbsa4=false,bbsa5=false;//賢者之杖 
    bool bbbbl=false,bbbbl1=false,bbbbl2=false,bbbbl3=false,bbbbl4=false,bbbbl5=false,//藍寶石杖          
         bbbcr=false,bbbcr1=false,bbbcr2=false,bbbcr3=false,bbbcr4=false,bbbcr5=false,//水晶杖 
         bbbel=false,bbbel1=false,bbbel2=false,bbbel3=false,bbbel4=false,bbbel5=false,//元素之杖 
         bbbsa=false,bbbsa1=false,bbbsa2=false,bbbsa3=false,bbbsa4=false,bbbsa5=false;//賢者之杖 
    bool bbbbel=false,bbbbel1=false,bbbbel2=false,bbbbel3=false,bbbbel4=false,bbbbel5=false,//元素之杖 
         bbbbsa=false,bbbbsa1=false,bbbbsa2=false,bbbbsa3=false,bbbbsa4=false,bbbbsa5=false;//賢者之杖 
    X=0;
    nummitem=0;
    if(numitem==0) 
    {
        cout << "你沒有武器可以裝備，請按'Esc'離開" << endl;
        cout << "------------------          " << endl;
        system("pause");//停在這邊 
        GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
        GetKeyboardState(KeyArray);//這個是用來比對的 
        for(i=1;i<255;i++)
        {
            PreKeyArray[i]=KeyArray[i];
            if((KeyArray[27]&0x80)!=0)
            {
                goto re;
            }
//ESC
            cout << "請勿按除了'Esc'以外的其他按鍵" << endl;
            system("pause");
            system("cls");
            goto no; 
        }
    }
    if(numitem>0&&numitem<=12)
    {
        system("cls");
        cout << "以下是你持有的裝備1/1       " << endl;
        cout << "------------------          " << endl;
    } 
    if(numitem>12&&numitem<=24)
    {
        system("cls");
        cout << "以下是你持有的裝備1/2       " << endl;
        cout << "------------------          " << endl;
    }
    if(numitem>24&&numitem<=36)
    {
        system("cls");
        cout << "以下是你持有的裝備1/3       " << endl;
        cout << "------------------          " << endl;
    }
    if(numitem>36&&numitem<=48)
    {
        system("cls");
        cout << "以下是你持有的裝備1/4       " << endl;
        cout << "------------------          " << endl;
    }
    if(numitem>48&&numitem<=60)
    {
        system("cls");
        cout << "以下是你持有的裝備1/5       " << endl;
        cout << "------------------          " << endl;
    }
    if(numitem>60)
    {
        system("cls");
        cout << "以下是你持有的裝備1/6       " << endl;
        cout << "------------------          " << endl;
    }
po:
    X=0;
    nummitem=0;
    if(wo>0)
    {
        cout << " " << flag[X] << " 木劍          " << wo << endl;
        nummitem++;
        X++;
    }
    if(wo1>0)
    {
        cout << " " << flag[X] << " 木劍+1        " << wo1 << endl;
        nummitem++;
        X++;
    }
    if(wo2>0)
    {
        cout << " " << flag[X] << " 木劍+2        " << wo2 << endl;
        nummitem++;
        X++;
    }
    if(wo3>0)
    {
        cout << " " << flag[X] << " 木劍+3        " << wo3 << endl;
        nummitem++;
        X++;
    }
    if(wo4>0)
    {
        cout << " " << flag[X] << " 木劍+4        " << wo4 << endl;
        nummitem++;
        X++;
    }
    if(wo5>0)
    {
        cout << " " << flag[X] << " 木劍+5        " << wo5 << endl;
        nummitem++;
        X++;
    }
    if(me>0)
    {
        cout << " " << flag[X] << " 鐵劍          " << me << endl;
        nummitem++;
        X++;
    }
    if(me1>0)
    {
        cout << " " << flag[X] << " 鐵劍+1        " << me1 << endl;
        nummitem++;
        X++;
    }
    if(me2>0)
    {
        cout << " " << flag[X] << " 鐵劍+2        " << me2 << endl;
        nummitem++;
        X++;
    }
    if(me3>0)
    {
        cout << " " << flag[X] << " 鐵劍+3        " << me3 << endl;
        nummitem++;
        X++;
    }
    if(me4>0)
    {
        cout << " " << flag[X] << " 鐵劍+4        " << me4 << endl;
        nummitem++;
        X++;
    }
    if(me5>0)
    {
        cout << " " << flag[X] << " 鐵劍+5        " << me5 << endl;
        nummitem++;
        X++;
    }
    if(nummitem<12&&si>0) 
    { 
        cout << " " << flag[X] << " 銀劍          " << si << endl;
        nummitem++;
        X++;
        bsi=true;
    }
    if(nummitem<12&&si1>0) 
    { 
        cout << " " << flag[X] << " 銀劍+1        " << si1 << endl;
        nummitem++;
        X++;
        bsi1=true;
    }
    if(nummitem<12&&si2>0) 
    { 
        cout << " " << flag[X] << " 銀劍+2        " << si2 << endl;
        nummitem++;
        X++;
        bsi2=true;
    }
    if(nummitem<12&&si3>0) 
    { 
        cout << " " << flag[X] << " 銀劍+3        " << si3 << endl;
        nummitem++;
        X++;
        bsi3=true;
    }
    if(nummitem<12&&si4>0) 
    { 
        cout << " " << flag[X] << " 銀劍+4        " << si4 << endl;
        nummitem++;
        X++;
        bsi4=true;
    }
    if(nummitem<12&&si5>0) 
    { 
        cout << " " << flag[X] << " 銀劍+5        " << si5 << endl;
        nummitem++;
        X++;
        bsi5=true;
    }
    if(nummitem<12&&so>0) 
    { 
        cout << " " << flag[X] << " 子母劍        " << so << endl;
        nummitem++;
        X++;
        bso=true;
    }
    if(nummitem<12&&so1>0) 
    { 
        cout << " " << flag[X] << " 子母劍+1      " << so1 << endl;
        nummitem++;
        X++;
        bso1=true;
    }
    if(nummitem<12&&so2>0) 
    { 
        cout << " " << flag[X] << " 子母劍+2      " << so2 << endl;
        nummitem++;
        X++;
        bso2=true;
    }
    if(nummitem<12&&so3>0) 
    { 
        cout << " " << flag[X] << " 子母劍+3      " << so3 << endl;
        nummitem++;
        X++;
        bso3=true;
    }
    if(nummitem<12&&so4>0) 
    { 
        cout << " " << flag[X] << " 子母劍+4      " << so4 << endl;
        nummitem++;
        X++;
        bso4=true;
    }
    if(nummitem<12&&so5>0) 
    { 
        cout << " " << flag[X] << " 子母劍+5      " << so5 << endl;
        nummitem++;
        X++;
        bso5=true;
    }
    if(nummitem<12&&br>0) 
    { 
        cout << " " << flag[X] << " 勇者之劍      " << br << endl;
        nummitem++;
        X++;
        bbr=true;
        bbbr=true;
    }
    if(nummitem<12&&br1>0) 
    { 
        cout << " " << flag[X] << " 勇者之劍+1    " << br1 << endl;
        nummitem++;
        X++;
        bbr1=true;
        bbbr1=true; 
    }
    if(nummitem<12&&br2>0) 
    { 
        cout << " " << flag[X] << " 勇者之劍+2    " << br2 << endl;
        nummitem++;
        X++;
        bbr2=true;
        bbbr2=true;
    }
    if(nummitem<12&&br3>0) 
    { 
        cout << " " << flag[X] << " 勇者之劍+3    " << br3 << endl;
        nummitem++;
        X++;
        bbr3=true;
        bbbr3=true;
    }
    if(nummitem<12&&br4>0) 
    { 
        cout << " " << flag[X] << " 勇者之劍+4    " << br4 << endl;
        nummitem++;
        X++;
        bbr4=true;
        bbbr4=true;
    }
    if(nummitem<12&&br5>0) 
    { 
        cout << " " << flag[X] << " 勇者之劍+5    " << br5 << endl;
        nummitem++;
        X++;
        bbr5=true;
        bbbr5=true;
    }
    if(nummitem<12&&woo>0) 
    { 
        cout << " " << flag[X] << " 木杖          " << woo << endl;
        nummitem++;
        X++;
        bwoo=true;
        bbwoo=true;
    }
    if(nummitem<12&&woo1>0) 
    { 
        cout << " " << flag[X] << " 木杖+1        " << woo1 << endl;
        nummitem++;
        X++;
        bwoo1=true;
        bbwoo1=true; 
    }
    if(nummitem<12&&woo2>0) 
    { 
        cout << " " << flag[X] << " 木杖+2        " << woo2 << endl;
        nummitem++;
        X++;
        bwoo2=true;
        bbwoo2=true;
    }
    if(nummitem<12&&woo3>0) 
    { 
        cout << " " << flag[X] << " 木杖+3        " << woo3 << endl;
        nummitem++;
        X++;
        bwoo3=true;
        bbwoo3=true;
    }
    if(nummitem<12&&woo4>0) 
    { 
        cout << " " << flag[X] << " 木杖+4        " << woo4 << endl;
        nummitem++;
        X++;
        bwoo4=true;
        bbwoo4=true;
    }
    if(nummitem<12&&woo5>0) 
    { 
        cout << " " << flag[X] << " 木杖+5        " << woo5 << endl;
        nummitem++;
        X++;
        bwoo5=true;
        bbwoo5=true;
    }
    if(nummitem<12&&bl>0) 
    { 
        cout << " " << flag[X] << " 藍寶石杖      " << bl << endl;
        nummitem++;
        X++;
        bbl=true;
        bbbl=true;
        bbbbl=true;
    }
    if(nummitem<12&&bl1>0) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+1    " << bl1 << endl;
        nummitem++;
        X++;
        bbl1=true;
        bbbl1=true; 
        bbbbl1=true;
    }
    if(nummitem<12&&bl2>0) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+2    " << bl2 << endl;
        nummitem++;
        X++;
        bbl2=true;
        bbbl2=true;
        bbbbl2=true;
    }
    if(nummitem<12&&bl3>0) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+3    " << bl3 << endl;
        nummitem++;
        X++;
        bbl3=true;
        bbbl3=true;
        bbbbl3=true;
    }
    if(nummitem<12&&bl4>0) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+4    " << bl4 << endl;
        nummitem++;
        X++;
        bbl4=true;
        bbbl4=true;
        bbbbl4=true;
    }
    if(nummitem<12&&bl5>0) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+5    " << bl5 << endl;
        nummitem++;
        X++;
        bbl5=true;
        bbbl5=true;
        bbbbl5=true;
    }
    if(nummitem<12&&cr>0) 
    { 
        cout << " " << flag[X] << " 水晶杖        " << cr << endl;
        nummitem++;
        X++;
        bcr=true;
        bbcr=true;
        bbbcr=true;
    }
    if(nummitem<12&&cr1>0) 
    { 
        cout << " " << flag[X] << " 水晶杖+1      " << cr1 << endl;
        nummitem++;
        X++;
        bcr1=true;
        bbcr1=true; 
        bbbcr1=true;
    }
    if(nummitem<12&&cr2>0) 
    { 
        cout << " " << flag[X] << " 水晶杖+2      " << cr2 << endl;
        nummitem++;
        X++;
        bcr2=true;
        bbcr2=true;
        bbbcr2=true;
    }
    if(nummitem<12&&cr3>0) 
    { 
        cout << " " << flag[X] << " 水晶杖+3      " << cr3 << endl;
        nummitem++;
        X++;
        bcr3=true;
        bbcr3=true;
        bbbcr3=true;
    }
    if(nummitem<12&&cr4>0) 
    { 
        cout << " " << flag[X] << " 水晶杖+4      " << cr4 << endl;
        nummitem++;
        X++;
        bcr4=true;
        bbcr4=true;
        bbbcr4=true;
    }
    if(nummitem<12&&cr5>0) 
    { 
        cout << " " << flag[X] << " 水晶杖+5      " << cr5 << endl;
        nummitem++;
        X++;
        bcr5=true;
        bbcr5=true;
        bbbcr5=true;
    }
    if(nummitem<12&&el>0) 
    { 
        cout << " " << flag[X] << " 元素之杖      " << el << endl;
        nummitem++;
        X++;
        bel=true;
        bbel=true;
        bbbel=true;
        bbbbel=true;
    }
    if(nummitem<12&&el1>0) 
    { 
        cout << " " << flag[X] << " 元素之杖+1    " << el1 << endl;
        nummitem++;
        X++;
        bel1=true;
        bbel1=true; 
        bbbel1=true;
        bbbbel1=true;
    }
    if(nummitem<12&&el2>0) 
    { 
        cout << " " << flag[X] << " 元素之杖+2    " << el2 << endl;
        nummitem++;
        X++;
        bel2=true;
        bbel2=true;
        bbbel2=true;
        bbbbel2=true;
    }
    if(nummitem<12&&el3>0) 
    { 
        cout << " " << flag[X] << " 元素之杖+3    " << el3 << endl;
        nummitem++;
        X++;
        bel3=true;
        bbel3=true;
        bbbel3=true;
        bbbbel3=true;
    }
    if(nummitem<12&&el4>0) 
    { 
        cout << " " << flag[X] << " 元素之杖+4    " << el4 << endl;
        nummitem++;
        X++;
        bel4=true;
        bbel4=true;
        bbbel4=true;
        bbbbel4=true;
    }
    if(nummitem<12&&el5>0) 
    { 
        cout << " " << flag[X] << " 元素之杖+5    " << el5 << endl;
        nummitem++;
        X++;
        bel5=true;
        bbel5=true;
        bbbel5=true;
        bbbbel5=true;
      }
    if(nummitem<12&&sa>0) 
    { 
        cout << " " << flag[X] << " 賢者之杖      " << sa << endl;
        nummitem++;
        X++;
        bsa=true;
        bbsa=true;
        bbbsa=true;
        bbbbsa=true;
    }
    if(nummitem<12&&sa1>0) 
    { 
        cout << " " << flag[X] << " 賢者之杖+1    " << sa1 << endl;
        nummitem++;
        X++;
        bsa1=true;
        bbsa1=true; 
        bbbsa1=true;
        bbbbsa1=true;
    }
    if(nummitem<12&&sa2>0) 
    { 
        cout << " " << flag[X] << " 賢者之杖+2    " << sa2 << endl;
        nummitem++;
        X++;
        bsa2=true;
        bbsa2=true;
        bbbsa2=true;
        bbbbsa2=true;
    }
    if(nummitem<12&&sa3>0) 
    { 
        cout << " " << flag[X] << " 賢者之杖+3    " << sa3 << endl;
        nummitem++;
        X++;
        bsa3=true;
        bbsa3=true;
        bbbsa3=true;
        bbbbsa3=true;
    }
    if(nummitem<12&&sa4>0) 
    { 
        cout << " " << flag[X] << " 賢者之杖+4    " << sa4 << endl;
        nummitem++;
        X++;
        bsa4=true;
        bbsa4=true;
        bbbsa4=true;
        bbbbsa4=true;
    }
    if(nummitem<12&&sa5>0) 
    { 
        cout << " " << flag[X] << " 賢者之杖+5    " << sa5 << endl;
        nummitem++;
        X++;
        bsa5=true;
        bbsa5=true;
        bbbsa5=true;
        bbbbsa5=true;
    }
    goto a;
po2:
    X=0;
    nummitem=0;
    if(si>0&&bsi==false)
    {
        cout << " " << flag[X] << " 銀劍          " << si << endl;
        nummitem++;
        X++;
    }
    if(si1>0&&bsi1==false)
    {
        cout << " " << flag[X] << " 銀劍+1        " << si1 << endl;
        nummitem++;
        X++;
    }
    if(si2>0&&bsi2==false)
    {
        cout << " " << flag[X] << " 銀劍+2        " << si2 << endl;
        nummitem++;
        X++;
    }
    if(si3>0&&bsi3==false)
    {
        cout << " " << flag[X] << " 銀劍+3        " << si3 << endl;
        nummitem++;
        X++;
    }
    if(si4>0&&bsi4==false)
    {
        cout << " " << flag[X] << " 銀劍+4        " << si4 << endl;
        nummitem++;
        X++;
    }
    if(si5>0&&bsi5==false)
    {
        cout << " " << flag[X] << " 銀劍+5        " << si5 << endl;
        nummitem++;
        X++;
    }
    if(so>0&&bso==false)
    {
        cout << " " << flag[X] << " 子母劍        " << so << endl;
        nummitem++;
        X++;
    }
    if(so1>0&&bso1==false)
    {
        cout << " " << flag[X] << " 子母劍+1      " << so1 << endl;
        nummitem++;
        X++;
    }
    if(so2>0&&bso2==false)
    {
        cout << " " << flag[X] << " 子母劍+2      " << so2 << endl;
        nummitem++;
        X++;
    }
    if(so3>0&&bso3==false)
    {
        cout << " " << flag[X] << " 子母劍+3      " << so3 << endl;
        nummitem++;
        X++;
    }
    if(so4>0&&bso4==false)
    {
        cout << " " << flag[X] << " 子母劍+4      " << so4 << endl;
        nummitem++;
        X++;
    }
    if(so5>0&&bso5==false)
    {
        cout << " " << flag[X] << " 子母劍+5      " << so5 << endl;
        nummitem++;
        X++;
    }
    if(nummitem<12&&br>0&&bbr==false) 
    { 
        cout << " " << flag[X] << " 勇者之劍      " << br << endl;
        nummitem++;
        X++;
        bbbr=true;
    }
    if(nummitem<12&&br1>0&&bbr1==false) 
    { 
        cout << " " << flag[X] << " 勇者之劍+1    " << br1 << endl;
        nummitem++;
        X++;
        bbbr1=true; 
    }
    if(nummitem<12&&br2>0&&bbr2==false) 
    { 
        cout << " " << flag[X] << " 勇者之劍+2    " << br2 << endl;
        nummitem++;
        X++;
        bbbr2=true;
    }
    if(nummitem<12&&br3>0&&bbr3==false) 
    { 
        cout << " " << flag[X] << " 勇者之劍+3    " << br3 << endl;
        nummitem++;
        X++;
        bbbr3=true;
    }
    if(nummitem<12&&br4>0&&bbr4==false) 
    { 
        cout << " " << flag[X] << " 勇者之劍+4    " << br4 << endl;
        nummitem++;
        X++;
        bbbr4=true;
    }
    if(nummitem<12&&br5>0&&bbr5==false) 
    { 
        cout << " " << flag[X] << " 勇者之劍+5    " << br5 << endl;
        nummitem++;
        X++;
        bbbr5=true;
    }
    if(nummitem<12&&woo>0&&bwoo==false) 
    { 
        cout << " " << flag[X] << " 木杖          " << woo << endl;
        nummitem++;
        X++;
        bbwoo=true;
    }
    if(nummitem<12&&woo1>0&&bwoo1==false) 
    { 
        cout << " " << flag[X] << " 木杖+1        " << woo1 << endl;
        nummitem++;
        X++;
        bbwoo1=true; 
    }
    if(nummitem<12&&woo2>0&&bwoo2==false) 
    { 
        cout << " " << flag[X] << " 木杖+2        " << woo2 << endl;
        nummitem++;
        X++;
        bbwoo2=true;
    }
    if(nummitem<12&&woo3>0&&bwoo3==false) 
    { 
        cout << " " << flag[X] << " 木杖+3        " << woo3 << endl;
        nummitem++;
        X++;
        bbwoo3=true;
    }
    if(nummitem<12&&woo4>0&&bwoo4==false) 
    { 
        cout << " " << flag[X] << " 木杖+4        " << woo4 << endl;
        nummitem++;
        X++;
        bbwoo4=true;
    }
    if(nummitem<12&&woo5>0&&bwoo5==false) 
    { 
        cout << " " << flag[X] << " 木杖+5        " << woo5 << endl;
        nummitem++;
        X++;
        bbwoo5=true;
    }
    if(nummitem<12&&bl>0&&bbl==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖      " << bl << endl;
        nummitem++;
        X++;
        bbbl=true;
        bbbbl=true;
    }
    if(nummitem<12&&bl1>0&&bbl1==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+1    " << bl1 << endl;
        nummitem++;
        X++;
        bbbl1=true; 
        bbbbl1=true;
    }
    if(nummitem<12&&bl2>0&&bbl2==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+2    " << bl2 << endl;
        nummitem++;
        X++;
        bbbl2=true;
        bbbbl2=true;
    }
    if(nummitem<12&&bl3>0&&bbl3==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+3    " << bl3 << endl;
        nummitem++;
        X++;
        bbbl3=true;
        bbbbl3=true;
    }
    if(nummitem<12&&bl4>0&&bbl4==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+4    " << bl4 << endl;
        nummitem++;
        X++;
        bbbl4=true;
        bbbbl4=true;
    }
    if(nummitem<12&&bl5>0&&bbl5==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+5    " << bl5 << endl;
        nummitem++;
        X++;
        bbbl5=true;
        bbbbl5=true;
    }
    if(nummitem<12&&cr>0&&bcr==false) 
    { 
        cout << " " << flag[X] << " 水晶杖        " << cr << endl;
        nummitem++;
        X++;
        bbcr=true;
        bbbcr=true;
    }
    if(nummitem<12&&cr1>0&&bcr1==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+1      " << cr1 << endl;
        nummitem++;
        X++;
        bbcr1=true; 
        bbbcr1=true;
    }
    if(nummitem<12&&cr2>0&&bcr2==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+2      " << cr2 << endl;
        nummitem++;
        X++;
        bbcr2=true;
        bbbcr2=true;
    }
    if(nummitem<12&&cr3>0&&bcr3==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+3      " << cr3 << endl;
        nummitem++;
        X++;
        bbcr3=true;
        bbbcr3=true;
    }
    if(nummitem<12&&cr4>0&&bcr4==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+4      " << cr4 << endl;
        nummitem++;
        X++;
        bbcr4=true;
        bbbcr4=true;
    }
    if(nummitem<12&&cr5>0&&bcr5==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+5      " << cr5 << endl;
        nummitem++;
        X++;
        bbcr5=true;
        bbbcr5=true;
    }
    if(nummitem<12&&el>0&&bel==false) 
    { 
        cout << " " << flag[X] << " 元素之杖      " << el << endl;
        nummitem++;
        X++;
        bbel=true;
        bbbel=true;
        bbbbel=true;
    }
    if(nummitem<12&&el1>0&&bel1==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+1    " << el1 << endl;
        nummitem++;
        X++;
        bbel1=true; 
        bbbel1=true;
        bbbbel1=true;
    }
    if(nummitem<12&&el2>0&&bel2==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+2    " << el2 << endl;
        nummitem++;
        X++;
        bbel2=true;
        bbbel2=true;
        bbbbel2=true;
    }
    if(nummitem<12&&el3>0&&bel3==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+3    " << el3 << endl;
        nummitem++;
        X++;
        bbel3=true;
        bbbel3=true;
        bbbbel3=true;
    }
    if(nummitem<12&&el4>0&&bel4==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+4    " << el4 << endl;
        nummitem++;
        X++;
        bbel4=true;
        bbbel4=true;
        bbbbel4=true;
    }
    if(nummitem<12&&el5>0&&bel5==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+5    " << el5 << endl;
        nummitem++;
        X++;
        bbel5=true;
        bbbel5=true;
        bbbbel5=true;
    }
    if(nummitem<12&&sa>0&&bsa==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖      " << sa << endl;
        nummitem++;
        X++;
        bbsa=true;
        bbbsa=true;
        bbbbsa=true;
    }
    if(nummitem<12&&sa1>0&&bsa1==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+1    " << sa1 << endl;
        nummitem++;
        X++;
        bbsa1=true; 
        bbbsa1=true;
        bbbbsa1=true;
    }
    if(nummitem<12&&sa2>0&&bsa2==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+2    " << sa2 << endl;
        nummitem++;
        X++;
        bbsa2=true;
        bbbsa2=true;
        bbbbsa2=true;
    }
    if(nummitem<12&&sa3>0&&bsa3==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+3    " << sa3 << endl;
        nummitem++;
        X++;
        bbsa3=true;
        bbbsa3=true;
        bbbbsa3=true;
    }
    if(nummitem<12&&sa4>0&&bsa4==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+4    " << sa4 << endl;
        nummitem++;
        X++;
        bbsa4=true;
        bbbsa4=true;
        bbbbsa4=true;
    }
    if(nummitem<12&&sa5>0&&bsa5==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+5    " << sa5 << endl;
        nummitem++;
        X++;
        bbsa5=true;
        bbbsa5=true;
        bbbbsa5=true;
    }
    goto a;
po3:
    X=0;
    nummitem=0;
    if(br>0&&bbbr==false)
    {
        cout << " " << flag[X] << " 勇者之劍      " << br << endl;
        nummitem++;
        X++;
    }
    if(br1>0&&bbbr1==false)
    {
        cout << " " << flag[X] << " 勇者之劍+1    " << br1 << endl;
        nummitem++;
        X++;
    }
    if(br2>0&&bbbr2==false)
    {
        cout << " " << flag[X] << " 勇者之劍+2    " << br2 << endl;
        nummitem++;
        X++;
    }
    if(br3>0&&bbbr3==false)
    {
        cout << " " << flag[X] << " 勇者之劍+3    " << br3 << endl;
        nummitem++;
        X++;
    }
    if(br4>0&&bbbr4==false)
    {
        cout << " " << flag[X] << " 勇者之劍+4    " << br4 << endl;
        nummitem++;
        X++;
    }
    if(br5>0&&bbbr5==false)
    {
        cout << " " << flag[X] << " 勇者之劍+5    " << br5 << endl;
        nummitem++;
        X++;
    }
    if(woo>0&&bbwoo==false)
    {
        cout << " " << flag[X] << " 木杖          " << woo << endl;
        nummitem++;
        X++;
    }
    if(woo1>0&&bbwoo1==false)
    {
        cout << " " << flag[X] << " 木杖+1        " << woo1 << endl;
        nummitem++;
        X++;
    }
    if(woo2>0&&bbwoo2==false)
    {
        cout << " " << flag[X] << " 木杖+2        " << woo2 << endl;
        nummitem++;
        X++;
    }
    if(woo3>0&&bbwoo3==false)
    {
        cout << " " << flag[X] << " 木杖+3        " << woo3 << endl;
        nummitem++;
        X++;
    }
    if(woo4>0&&bbwoo4==false)
    {
        cout << " " << flag[X] << " 木杖+4        " << woo4 << endl;
        nummitem++;
        X++;
    }
    if(woo5>0&&bbwoo5==false)
    {
        cout << " " << flag[X] << " 木杖+5        " << woo5 << endl;
        nummitem++;
        X++;
    }
    if(nummitem<12&&bl>0&&bbbl==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖      " << bl << endl;
        nummitem++;
        X++;
        bbbbl=true;
    }
    if(nummitem<12&&bl1>0&&bbbl1==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+1    " << bl1 << endl;
        nummitem++;
        X++;
        bbbbl1=true;
    }
    if(nummitem<12&&bl2>0&&bbbl2==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+2    " << bl2 << endl;
        nummitem++;
        X++;
        bbbbl2=true;
    }
    if(nummitem<12&&bl3>0&&bbbl3==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+3    " << bl3 << endl;
        nummitem++;
        X++;
        bbbbl3=true;
    }
    if(nummitem<12&&bl4>0&&bbbl4==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+4    " << bl4 << endl;
        nummitem++;
        X++;
        bbbbl4=true;
    }
    if(nummitem<12&&bl5>0&&bbbl5==false) 
    { 
        cout << " " << flag[X] << " 藍寶石杖+5    " << bl5 << endl;
        nummitem++;
        X++;
        bbbbl5=true;
    }
    if(nummitem<12&&cr>0&&bbcr==false) 
    { 
        cout << " " << flag[X] << " 水晶杖        " << cr << endl;
        nummitem++;
        X++;
        bbbcr=true;
    }
    if(nummitem<12&&cr1>0&&bbcr1==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+1      " << cr1 << endl;
        nummitem++;
        X++;
        bbbcr1=true;
    }
    if(nummitem<12&&cr2>0&&bbcr2==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+2      " << cr2 << endl;
        nummitem++;
        X++;
        bbbcr2=true;
    }
    if(nummitem<12&&cr3>0&&bbcr3==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+3      " << cr3 << endl;
        nummitem++;
        X++;
        bbbcr3=true;
    }
    if(nummitem<12&&cr4>0&&bbcr4==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+4      " << cr4 << endl;
        nummitem++;
        X++;
        bbbcr4=true;
    }
    if(nummitem<12&&cr5>0&&bbcr5==false) 
    { 
        cout << " " << flag[X] << " 水晶杖+5      " << cr5 << endl;
        nummitem++;
        X++;
        bbbcr5=true;
    }
    if(nummitem<12&&el>0&&bbel==false) 
    { 
        cout << " " << flag[X] << " 元素之杖      " << el << endl;
        nummitem++;
        X++;
        bbbel=true;
        bbbbel=true;
    }
    if(nummitem<12&&el1>0&&bbel1==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+1    " << el1 << endl;
        nummitem++;
        X++;
        bbbel1=true;
        bbbbel1=true;
    }
    if(nummitem<12&&el2>0&&bbel2==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+2    " << el2 << endl;
        nummitem++;
        X++;
        bbbel2=true;
        bbbbel2=true;
    }
    if(nummitem<12&&el3>0&&bbel3==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+3    " << el3 << endl;
        nummitem++;
        X++;
        bbbel3=true;
        bbbbel3=true;
    }
    if(nummitem<12&&el4>0&&bbel4==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+4    " << el4 << endl;
        nummitem++;
        X++;
        bbbel4=true;
        bbbbel4=true;
    }
    if(nummitem<12&&el5>0&&bbel5==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+5    " << el5 << endl;
        nummitem++;
        X++;
        bbbel5=true;
        bbbbel5=true;
    }
    if(nummitem<12&&sa>0&&bbsa==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖      " << sa << endl;
        nummitem++;
        X++;
        bbbsa=true;
        bbbbsa=true;
    }
    if(nummitem<12&&sa1>0&&bbsa1==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+1    " << sa1 << endl;
        nummitem++;
        X++;
        bbbsa1=true;
        bbbbsa1=true;
    }
    if(nummitem<12&&sa2>0&&bbsa2==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+2    " << sa2 << endl;
        nummitem++;
        X++;
        bbbsa2=true;
        bbbbsa2=true;
    }
    if(nummitem<12&&sa3>0&&bbsa3==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+3    " << sa3 << endl;
        nummitem++;
        X++;
        bbbsa3=true;
        bbbbsa3=true;
    }
    if(nummitem<12&&sa4>0&&bbsa4==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+4    " << sa4 << endl;
        nummitem++;
        X++;
        bbbsa4=true;
        bbbbsa4=true;
    }
    if(nummitem<12&&sa5>0&&bbsa5==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+5    " << sa5 << endl;
        nummitem++;
        X++;
        bbbsa5=true;
        bbbbsa5=true;
    }
    goto a;
po4:
    X=0;
    nummitem=0;
    if(bl>0&&bbbbl==false)
    {
        cout << " " << flag[X] << " 藍寶石杖      " << bl << endl;
        nummitem++;
        X++;
    }
    if(bl1>0&&bbbbl1==false)
    {
        cout << " " << flag[X] << " 藍寶石杖+1    " << bl1 << endl;
        nummitem++;
        X++;
    }
    if(bl2>0&&bbbbl2==false)
    {
        cout << " " << flag[X] << " 藍寶石杖+2    " << bl2 << endl;
        nummitem++;
        X++;
    }
    if(bl3>0&&bbbbl3==false)
    {
        cout << " " << flag[X] << " 藍寶石杖+3    " << bl3 << endl;
        nummitem++;
        X++;
    }
    if(bl4>0&&bbbbl4==false)
    {
        cout << " " << flag[X] << " 藍寶石杖+4    " << bl4 << endl;
        nummitem++;
        X++;
    }
    if(bl5>0&&bbbbl5==false)
    {
        cout << " " << flag[X] << " 藍寶石杖+5    " << bl5 << endl;
        nummitem++;
        X++;
    }
    if(cr>0&&bbbcr==false)
    {
        cout << " " << flag[X] << " 水晶杖        " << cr << endl;
        nummitem++;
        X++;
    }
    if(cr1>0&&bbbcr1==false)
    { 
        cout << " " << flag[X] << " 水晶杖+1      " << cr1 << endl;
        nummitem++;
        X++;
    }
    if(cr2>0&&bbbcr2==false)
    {
        cout << " " << flag[X] << " 水晶杖+2      " << cr2 << endl;
        nummitem++;
        X++;
    }
    if(cr3>0&&bbbcr3==false)
    {
        cout << " " << flag[X] << " 水晶杖+3      " << cr3 << endl;
        nummitem++;
        X++;
    }
    if(cr4>0&&bbbcr4==false)
    {
        cout << " " << flag[X] << " 水晶杖+4      " << cr4 << endl;
        nummitem++;
        X++;
    }
    if(cr5>0&&bbbcr5==false)
    {
        cout << " " << flag[X] << " 水晶杖+5      " << cr5 << endl;
        nummitem++;
        X++;
    }
    if(nummitem<12&&el>0&&bbbel==false) 
    { 
        cout << " " << flag[X] << " 元素之杖      " << el << endl;
        nummitem++;
        X++;
        bbbbel=true;
    }
    if(nummitem<12&&el1>0&&bbbel1==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+1    " << el1 << endl;
        nummitem++;
        X++;
        bbbbel1=true;
    }
    if(nummitem<12&&el2>0&&bbbel2==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+2    " << el2 << endl;
        nummitem++;
        X++;
        bbbbel2=true;
    }
    if(nummitem<12&&el3>0&&bbbel3==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+3    " << el3 << endl;
        nummitem++;
        X++;
        bbbbel3=true;
    }
    if(nummitem<12&&el4>0&&bbbel4==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+4    " << el4 << endl;
        nummitem++;
        X++;
        bbbbel4=true;
    }
    if(nummitem<12&&el5>0&&bbbel5==false) 
    { 
        cout << " " << flag[X] << " 元素之杖+5    " << el5 << endl;
        nummitem++;
        X++;
        bbbbel5=true;
    }
    if(nummitem<12&&sa>0&&bbbsa==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖      " << sa << endl;
        nummitem++;
        X++;
        bbbbsa=true;
    }
    if(nummitem<12&&sa1>0&&bbbsa1==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+1    " << sa1 << endl;
        nummitem++;
        X++;
        bbbbsa1=true;
    }
    if(nummitem<12&&sa2>0&&bbbsa2==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+2    " << sa2 << endl;
        nummitem++;
        X++;
        bbbbsa2=true;
    }
    if(nummitem<12&&sa3>0&&bbbsa3==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+3    " << sa3 << endl;
        nummitem++;
        X++;
        bbbbsa3=true;
    }
    if(nummitem<12&&sa4>0&&bbbsa4==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+4    " << sa4 << endl;
        nummitem++;
        X++;
        bbbbsa4=true;
    }
    if(nummitem<12&&sa5>0&&bbbsa5==false) 
    { 
        cout << " " << flag[X] << " 賢者之杖+5    " << sa5 << endl;
        nummitem++;
        X++;
        bbbbsa5=true;
    }
    goto a;
po5:
    X=0;
    nummitem=0;
    if(el>0&&bbbbel==false)
    {
        cout << " " << flag[X] << " 元素之杖      " << el << endl;
        nummitem++;
        X++;
    }
    if(el1>0&&bbbbel1==false)
    {
        cout << " " << flag[X] << " 元素之杖+1    " << el1 << endl;
        nummitem++;
        X++;
    }
    if(el2>0&&bbbbel2==false)
    {
        cout << " " << flag[X] << " 元素之杖+2    " << el2 << endl;
        nummitem++;
        X++;
    }
    if(el3>0&&bbbbel3==false)
    {
        cout << " " << flag[X] << " 元素之杖+3    " << el3 << endl;
        nummitem++;
        X++;
    }
    if(el4>0&&bbbbel4==false)
    {
        cout << " " << flag[X] << " 元素之杖+4    " << el4 << endl;
        nummitem++;
        X++;
    }
    if(el5>0&&bbbbel5==false)
    {
        cout << " " << flag[X] << " 元素之杖+5    " << el5 << endl;
        nummitem++;
        X++;
    }
    if(sa>0&&bbbbsa==false)
    {
        cout << " " << flag[X] << " 賢者之杖      " << sa << endl;
        nummitem++;
        X++;
    }
    if(sa1>0&&bbbbsa1==false)
    {
        cout << " " << flag[X] << " 賢者之杖+1    " << sa1 << endl;
        nummitem++;
        X++;
    }
    if(sa2>0&&bbbbsa2==false)
    {
        cout << " " << flag[X] << " 賢者之杖+2    " << sa2 << endl;
        nummitem++;
        X++;
    }
    if(sa3>0&&bbbbsa3==false)
    {
        cout << " " << flag[X] << " 賢者之杖+3    " << sa3 << endl;
        nummitem++;
        X++;
    }
    if(sa4>0&&bbbbsa4==false)
    {
        cout << " " << flag[X] << " 賢者之杖+4    " << sa4 << endl;
        nummitem++;
        X++;
    }
    if(sa5>0&&bbbbsa5==false)
    {
        cout << " " << flag[X] << " 賢者之杖+5    " << sa5 << endl;
        nummitem++;
        X++;
    }
a:
    cout << "------------------          " << endl;
    cout << "請按'下'和'上'來移動指標與按'Enter'來裝備該武器" << endl;
    cout << "按'左'和'右'來切換頁面，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            if(page==1) 
            { 
                if(numitem>0&&numitem<=12) 
                {
                    cout << "以下是你持有的裝備1/1       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                } 
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的裝備1/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>24&&numitem<=36)
                {
                    cout << "以下是你持有的裝備1/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備1/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備1/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po;
                        }
                    }
                }
            }
            if(page==2)
            {
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的裝備2/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>24&&numitem<=36)
                {
                    cout << "以下是你持有的裝備2/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備2/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備2/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po2;
                        }
                    }
                }
            }
            if(page==3)
            {
                if(numitem>24&&numitem<=36)
                {
                    cout << "以下是你持有的裝備3/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po3;
                        }
                    }
                }
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備3/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po3;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備3/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po3;
                        }
                    }
                }
            }
            if(page==4)
            {
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備4/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po4;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po4;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備4/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po4;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po4;
                        }
                    }
                }
            }
            if(page==5)
            {
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備5/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==0)
                            {
                                goto po5;
                            }
                            flag[X]=' ';
                            flag[X-1]='>';
                            goto po5;
                        }
                    }
                }
            }
        }
//上
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            if(page==1) 
            { 
                if(numitem>0&&numitem<=12) 
                {
                    cout << "以下是你持有的裝備1/1       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                } 
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的裝備1/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>24&&numitem<=36)
                {
                    cout << "以下是你持有的裝備1/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備1/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備1/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po;
                        }
                    }
                }
            }
            if(page==2)
            {
                if(numitem>12&&numitem<=24)
                {
                    cout << "以下是你持有的裝備2/2       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>24&&numitem<=36)
                {
                    cout << "以下是你持有的裝備2/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備2/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po2;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po2;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備2/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po2;
                            } 
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po2;
                        }
                    }
                }
            }
            if(page==3)
            {
                if(numitem>24&&numitem<=36)
                {
                    cout << "以下是你持有的裝備3/3       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po3;
                        }
                    }
                }
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備3/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po3;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po3;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備3/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po3;
                            } 
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po3;
                        }
                    }
                }
            }
            if(page==4)
            {
                if(numitem>36&&numitem<=48)
                {
                    cout << "以下是你持有的裝備4/4       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po4;
                            }
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po4;
                        }
                    }
                }
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備4/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po4;
                            } 
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po4;
                        }
                    }
                }
            }
            if(page==5)
            {
                if(numitem>48&&numitem<=60)
                {
                    cout << "以下是你持有的裝備5/5       " << endl;
                    cout << "------------------          " << endl;
                    for(X=0;X<13;X++) 
                    { 
                        if(flag[X]=='>')
                        { 
                            if(X==nummitem-1)
                            {
                                goto po5;
                            } 
                            flag[X]=' ';
                            flag[X+1]='>';
                            goto po5;
                        }
                    }
                }
            }
        }
//下 
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            if(numitem>0&&numitem<=12) 
            {
                cout << "以下是你持有的裝備1/1       " << endl;
                cout << "------------------          " << endl;
                goto po;
            } 
            if(numitem>12&&numitem<=24)
            {
                if(page==2)
                {
                    page=1; 
                    cout << "以下是你持有的裝備1/2       " << endl;
                    cout << "------------------          " << endl;
                    goto po;
                }
                if(page==1)
                {
                    cout << "以下是你持有的裝備1/2       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
            }
            if(numitem>24&&numitem<=36)
            {
                if(page==3)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po2; 
                }
                if(page==2)
                {
                    page=1;
                    cout << "以下是你持有的裝備1/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
                if(page==1)
                {
                    cout << "以下是你持有的裝備1/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
            }
            if(numitem>36&&numitem<=48)
            {
                if(page==4)
                {
                    page=3; 
                    cout << "以下是你持有的裝備3/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po3; 
                }
                if(page==3)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po2; 
                }
                if(page==2)
                {
                    page=1;
                    cout << "以下是你持有的裝備1/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
                if(page==1)
                {
                    cout << "以下是你持有的裝備1/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
            }
            if(numitem>48&&numitem<=60)
            {
                if(page==5)
                {
                    page=4; 
                    cout << "以下是你持有的裝備4/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po4; 
                }
                if(page==4)
                {
                    page=3; 
                    cout << "以下是你持有的裝備3/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po3; 
                }
                if(page==3)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po2; 
                }
                if(page==2)
                {
                    page=1;
                    cout << "以下是你持有的裝備1/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
                if(page==1)
                {
                    cout << "以下是你持有的裝備1/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po; 
                }
            }
        }
//左  
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            if(numitem>0&&numitem<=12) 
            {
                cout << "以下是你持有的裝備1/1       " << endl;
                cout << "------------------          " << endl;
                goto po;
            } 
            if(numitem>12&&numitem<=24)
            {
                if(page==1)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/2       " << endl;
                    cout << "------------------          " << endl;
                    if(numitem-12<nummitem)
                    {
                        for(X=0;X<13;X++) 
                        { 
                            if(flag[X]=='>')
                            { 
                                if(X+1>numitem-12) 
                                { 
                                    flag[X]=' ';
                                    flag[numitem-13]='>';
                                } 
                            }
                        }
                    } 
                    goto po2;
                }
                if(page==2)
                {
                    cout << "以下是你持有的裝備2/2       " << endl;
                    cout << "------------------          " << endl;
                    goto po2; 
                }
            }
            if(numitem>24&&numitem<=36)
            {
                if(page==1)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po2;
                }
                if(page==2)
                {
                    page=3;
                    cout << "以下是你持有的裝備3/3       " << endl;
                    cout << "------------------          " << endl;
                    if(numitem-24<nummitem)
                    {
                        for(X=0;X<13;X++) 
                        { 
                            if(flag[X]=='>')
                            { 
                                if(X+1>numitem-24) 
                                { 
                                    flag[X]=' ';
                                    flag[numitem-25]='>';
                                } 
                            }
                        }
                    }
                    goto po3; 
                }
                if(page==3)
                {
                    cout << "以下是你持有的裝備3/3       " << endl;
                    cout << "------------------          " << endl;
                    goto po3; 
                }
            } 
            if(numitem>36&&numitem<=48)
            {
                if(page==1)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po2;
                }
                if(page==2)
                {
                    page=3;
                    cout << "以下是你持有的裝備3/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po3; 
                }
                if(page==3)
                {
                    page=4; 
                    cout << "以下是你持有的裝備4/4       " << endl;
                    cout << "------------------          " << endl;
                    if(numitem-36<nummitem)
                    {
                        for(X=0;X<13;X++) 
                        { 
                            if(flag[X]=='>')
                            { 
                                if(X+1>numitem-36) 
                                { 
                                    flag[X]=' ';
                                    flag[numitem-37]='>';
                                } 
                            }
                        }
                    }
                    goto po4; 
                }
                if(page==4)
                {
                    cout << "以下是你持有的裝備4/4       " << endl;
                    cout << "------------------          " << endl;
                    goto po4; 
                }
            }
            if(numitem>48&&numitem<=60)
            {
                if(page==1)
                {
                    page=2; 
                    cout << "以下是你持有的裝備2/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po2;
                }
                if(page==2)
                {
                    page=3;
                    cout << "以下是你持有的裝備3/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po3;
                }
                if(page==3)
                {
                    page=4; 
                    cout << "以下是你持有的裝備4/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po4;
                }
                if(page==4)
                {
                    page=5;
                    cout << "以下是你持有的裝備5/5       " << endl;
                    cout << "------------------          " << endl;
                    if(numitem-48<nummitem)
                    {
                        for(X=0;X<13;X++) 
                        { 
                            if(flag[X]=='>')
                            { 
                                if(X+1>numitem-48) 
                                { 
                                    flag[X]=' ';
                                    flag[numitem-49]='>';
                                } 
                            }
                        }
                    }
                    goto po5; 
                }
                if(page==5)
                {
                    cout << "以下是你持有的裝備5/5       " << endl;
                    cout << "------------------          " << endl;
                    goto po5; 
                }
            }
        }
//右
        if((KeyArray[13]&0x80)!=0)
        {
            for(X=0;X<13;X++) 
            { 
                if(flag[X]=='>')
                { 
                    if(page==1)
                    {
                        used2=X+1;
                        system("cls");
                        uuequ(used2);
                        goto no;
                    } 
                    if(page==2)
                    {
                        used2=X+13;
                        system("cls");
                        uuequ(used2);
                        goto no;
                    } 
                    if(page==3)
                    {
                        used2=X+25;
                        system("cls");
                        uuequ(used2);
                        goto no;
                    }
                    if(page==4)
                    {
                        used2=X+37;
                        system("cls");
                        uuequ(used2);
                        goto no;
                    }
                    if(page==5)
                    {
                        used2=X+49;
                        system("cls");
                        uuequ(used2);
                        goto no;
                    }
                }
            }
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re; 
        }
//ESC 
        cout << "請勿按除了'下'和'上'、'左'、'右'與'Enter'和'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        if(page==1) 
        { 
            if(numitem>0&&numitem<=12) 
            {
                cout << "以下是你持有的裝備1/1       " << endl;
                cout << "------------------          " << endl;
                goto po;
            } 
            if(numitem>12&&numitem<=24)
            {
                cout << "以下是你持有的裝備1/2       " << endl;
                cout << "------------------          " << endl;
                goto po;
            }
            if(numitem>24&&numitem<=36)
            {
                cout << "以下是你持有的裝備1/3       " << endl;
                cout << "------------------          " << endl;
                goto po;
            }
            if(numitem>36&&numitem<=48)
            {
                cout << "以下是你持有的裝備1/4       " << endl;
                cout << "------------------          " << endl;
                goto po;
            }
            if(numitem>48&&numitem<=60)
            {
                cout << "以下是你持有的裝備1/5       " << endl;
                cout << "------------------          " << endl;
                goto po;
            }
        }
        if(page==2)
        {
            if(numitem>12&&numitem<=24)
            {
                cout << "以下是你持有的裝備2/2       " << endl;
                cout << "------------------          " << endl;
                goto po2;
            }
            if(numitem>24&&numitem<=36)
            {
                cout << "以下是你持有的裝備2/3       " << endl;
                cout << "------------------          " << endl;
                goto po2;
            }
            if(numitem>36&&numitem<=48)
            {
                cout << "以下是你持有的裝備2/4       " << endl;
                cout << "------------------          " << endl;
                goto po2;
            }
            if(numitem>48&&numitem<=60)
            {
                cout << "以下是你持有的裝備2/5       " << endl;
                cout << "------------------          " << endl;
                goto po2;
            }
        }
        if(page==3)
        {
            if(numitem>24&&numitem<=36)
            {
                cout << "以下是你持有的裝備3/3       " << endl;
                cout << "------------------          " << endl;
                goto po3;
            }
            if(numitem>36&&numitem<=48)
            {
                cout << "以下是你持有的裝備3/4       " << endl;
                cout << "------------------          " << endl;
                goto po3;
            }
            if(numitem>48&&numitem<=60)
            {
                cout << "以下是你持有的裝備3/5       " << endl;
                cout << "------------------          " << endl;
                goto po3;
            }
        }
        if(page==4)
        {
            if(numitem>36&&numitem<=48)
            {
                cout << "以下是你持有的裝備4/4       " << endl;
                cout << "------------------          " << endl;
                goto po4;
            }
            if(numitem>48&&numitem<=60)
            {
                cout << "以下是你持有的裝備4/5       " << endl;
                cout << "------------------          " << endl;
                goto po4;
            }
        }
        if(page==5)
        {
            if(numitem>48&&numitem<=60)
            {
                cout << "以下是你持有的裝備5/5       " << endl;
                cout << "------------------          " << endl;
                goto po5;
            }
        }
    }
re: 
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//卸下裝備後確認 
////////////////////////////////////////////////////////////////////////////////
void checkequi() 
{ 
    if(equw==0)
    { 
        wo++; 
    }
    if(equw==1)
    { 
        wo1++;
    }
    if(equw==2)
    { 
        wo2++; 
    }
    if(equw==3)
    { 
        wo3++; 
    }
    if(equw==4)
    { 
        wo4++;
    }
    if(equw==5)
    { 
        wo5++; 
    }
    if(equw==6)
    { 
        me++; 
    }
    if(equw==7)
    { 
        me1++; 
    }
    if(equw==8)
    { 
        me2++; 
    }
    if(equw==9)
    { 
        me3++; 
    }
    if(equw==10)
    { 
        me4++; 
    }
    if(equw==11) 
    { 
        me5++; 
    }
    if(equw==12)
    { 
        si++; 
    }
    if(equw==13)
    { 
        si1++; 
    }
    if(equw==14)
    { 
        si2++; 
    }
    if(equw==15)
    { 
        si3++; 
    }
    if(equw==16)
    { 
        si4++; 
    }
    if(equw==17)
    { 
        si5++; 
    }
    if(equw==18)
    { 
        so++; 
    }
    if(equw==19)
    { 
        so1++; 
    }
    if(equw==20)
    { 
        so2++; 
    }
    if(equw==21)
    { 
        so3++; 
    }
    if(equw==22)
    { 
        so4++; 
    }
    if(equw==23)
    { 
        so5++; 
    }
    if(equw==24)
    { 
        br++; 
    }
    if(equw==25)
    { 
        br1++; 
    }
    if(equw==26)
    { 
        br2++; 
    }
    if(equw==27)
    { 
        br3++; 
    }
    if(equw==28)
    { 
        br4++; 
    }
    if(equw==29)
    { 
        br5++; 
    }
    if(equw==30)
    { 
        woo++; 
    }
    if(equw==31)
    { 
        woo1++; 
    }
    if(equw==32)
    { 
        woo2++; 
    }
    if(equw==33)
    { 
        woo3++; 
    }
    if(equw==34)
    { 
        woo4++; 
    }
    if(equw==35)
    { 
        woo5++; 
    }
    if(equw==36)
    { 
        bl++; 
    }
    if(equw==37)
    { 
        bl1++; 
    }
    if(equw==38)
    { 
        bl2++; 
    }
    if(equw==39)
    { 
        bl3++; 
    }
    if(equw==40)
    { 
        bl4++; 
    }
    if(equw==41)
    { 
        bl5++; 
    }
    if(equw==42)
    { 
        cr++; 
    }
    if(equw==43)
    { 
        cr1++; 
    }
    if(equw==44)
    { 
        cr2++; 
    }
    if(equw==45)
    { 
        cr3++; 
    }
    if(equw==46)
    { 
        cr4++; 
    }
    if(equw==47)
    { 
        cr5++; 
    }
    if(equw==48)
    { 
        el++; 
    }
    if(equw==49)
    { 
        el1++; 
    }
    if(equw==50)
    { 
        el2++; 
    }
    if(equw==51)
    { 
        el3++; 
    }
    if(equw==52)
    { 
        el4++; 
    }
    if(equw==53)
    { 
        el5++; 
    }
    if(equw==54)
    { 
        sa++; 
    }
    if(equw==55)
    { 
        sa1++; 
    }
    if(equw==56)
    { 
        sa2++; 
    }
    if(equw==57)
    { 
        sa3++; 
    }
    if(equw==58)
    { 
        sa4++; 
    }
    if(equw==59)
    { 
        sa5++; 
    }
}
////////////////////////////////////////////////////////////////////////////////
//裝備武器 
////////////////////////////////////////////////////////////////////////////////
void uuequ(int used2)
{ 
    int used;//選擇的時候用
    string eq;
    if(equw==0)
    { 
        eq="木劍"; 
    }
    if(equw==1)
    { 
        eq="木劍+1"; 
    }
    if(equw==2)
    { 
        eq="木劍+2"; 
    }
    if(equw==3)
    { 
        eq="木劍+3"; 
    }
    if(equw==4)
    { 
        eq="木劍+4"; 
    }
    if(equw==5)
    { 
        eq="木劍+5"; 
    }
    if(equw==6)
    { 
        eq="鐵劍"; 
    }
    if(equw==7)
    { 
        eq="鐵劍+1"; 
    }
    if(equw==8)
    { 
        eq="鐵劍+2"; 
    }
    if(equw==9)
    { 
        eq="鐵劍+3"; 
    }
    if(equw==10)
    { 
        eq="鐵劍+4"; 
    }
    if(equw==11) 
    { 
        eq="鐵劍+5"; 
    }
    if(equw==12)
    { 
        eq="銀劍"; 
    }
    if(equw==13)
    { 
        eq="銀劍+1"; 
    }
    if(equw==14)
    { 
        eq="銀劍+2"; 
    }
    if(equw==15)
    { 
        eq="銀劍+3"; 
    }
    if(equw==16)
    { 
        eq="銀劍+4"; 
    }
    if(equw==17)
    { 
        eq="銀劍+5"; 
    }
    if(equw==18)
    { 
        eq="子母劍"; 
    }
    if(equw==19)
    { 
        eq="子母劍+1"; 
    }
    if(equw==20)
    { 
        eq="子母劍+2"; 
    }
    if(equw==21)
    { 
        eq="子母劍+3"; 
    }
    if(equw==22)
    { 
        eq="子母劍+4"; 
    }
    if(equw==23)
    { 
        eq="子母劍+5"; 
    }
    if(equw==24)
    { 
        eq="勇者之劍"; 
    }
    if(equw==25)
    { 
        eq="勇者之劍+1"; 
    }
    if(equw==26)
    { 
        eq="勇者之劍+2"; 
    }
    if(equw==27)
    { 
        eq="勇者之劍+3"; 
    }
    if(equw==28)
    { 
        eq="勇者之劍+4"; 
    }
    if(equw==29)
    { 
        eq="勇者之劍+5"; 
    }
    if(equw==30)
    { 
        eq="木杖"; 
    }
    if(equw==31)
    { 
        eq="木杖+1"; 
    }
    if(equw==32)
    { 
        eq="木杖+2"; 
    }
    if(equw==33)
    { 
        eq="木杖+3"; 
    }
    if(equw==34)
    { 
        eq="木杖+4"; 
    }
    if(equw==35)
    { 
        eq="木杖+5"; 
    }
    if(equw==36)
    { 
        eq="藍寶石杖"; 
    }
    if(equw==37)
    { 
        eq="藍寶石杖+1"; 
    }
    if(equw==38)
    { 
        eq="藍寶石杖+2"; 
    }
    if(equw==39)
    { 
        eq="藍寶石杖+3"; 
    }
    if(equw==40)
    { 
        eq="藍寶石杖+4"; 
    }
    if(equw==41)
    { 
        eq="藍寶石杖+5"; 
    }
    if(equw==42)
    { 
        eq="水晶杖"; 
    }
    if(equw==43)
    { 
        eq="水晶杖+1"; 
    }
    if(equw==44)
    { 
        eq="水晶杖+2"; 
    }
    if(equw==45)
    { 
        eq="水晶杖+3"; 
    }
    if(equw==46)
    { 
        eq="水晶杖+4"; 
    }
    if(equw==47)
    { 
        eq="水晶杖+5"; 
    }
    if(equw==48)
    { 
        eq="元素之杖"; 
    }
    if(equw==49)
    { 
        eq="元素之杖+1"; 
    }
    if(equw==50)
    { 
        eq="元素之杖+2"; 
    }
    if(equw==51)
    { 
        eq="元素之杖+3"; 
    }
    if(equw==52)
    { 
        eq="元素之杖+4"; 
    }
    if(equw==53)
    { 
        eq="元素之杖+5"; 
    }
    if(equw==54)
    { 
        eq="賢者之杖"; 
    }
    if(equw==55)
    { 
        eq="賢者之杖+1"; 
    }
    if(equw==56)
    { 
        eq="賢者之杖+2"; 
    }
    if(equw==57)
    { 
        eq="賢者之杖+3"; 
    }
    if(equw==58)
    { 
        eq="賢者之杖+4"; 
    }
    if(equw==59)
    { 
        eq="賢者之杖+5"; 
    }
equ: 
    if(equw!=99)
    { 
        cout << "你目前裝備的武器是" << eq <<endl;
        cout << "----------------------------" << endl;
    }
    if(equw==99)
    { 
        cout << "你目前沒有裝備任何武器" <<endl;
        cout << "----------------------------" << endl;
    }
    used=0;
    if(wo>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto wo; 
    }  
    if(wo1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto wo1; 
    }  
    if(wo2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto wo2; 
    }  
    if(wo3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto wo3; 
    }  
    if(wo4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto wo4; 
    }  
    if(wo5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto wo5; 
    } 
    if(me>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto me; 
    }  
    if(me1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto me1; 
    }  
    if(me2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto me2; 
    }  
    if(me3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto me3; 
    }  
    if(me4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto me4; 
    }  
    if(me5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto me5; 
    } 
    if(si>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto si; 
    }  
    if(si1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto si1; 
    }  
    if(si2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto si2; 
    }  
    if(si3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto si3; 
    }  
    if(si4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto si4; 
    }  
    if(si5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto si5; 
    } 
    if(so>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto so; 
    }  
    if(so1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto so1; 
    }  
    if(so2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto so2; 
    }  
    if(so3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto so3; 
    }  
    if(so4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto so4; 
    }  
    if(so5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto so5; 
    } 
    if(br>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto br; 
    }  
    if(br1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto br1; 
    }  
    if(br2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto br2; 
    }  
    if(br3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto br3; 
    }  
    if(br4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto br4; 
    }  
    if(br5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto br5; 
    } 
    if(woo>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto woo; 
    }  
    if(woo1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto woo1; 
    }  
    if(woo2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto woo2; 
    }  
    if(woo3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto woo3; 
    }  
    if(woo4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto woo4; 
    }  
    if(woo5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto woo5; 
    }
    if(bl>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto bl; 
    }  
    if(bl1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto bl1; 
    }  
    if(bl2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto bl2; 
    }  
    if(bl3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto bl3; 
    }  
    if(bl4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto bl4; 
    }  
    if(bl5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto bl5; 
    } 
    if(cr>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto cr; 
    }  
    if(cr1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto cr1; 
    }  
    if(cr2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto cr2; 
    }  
    if(cr3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto cr3; 
    }  
    if(cr4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto cr4; 
    }  
    if(cr5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto cr5; 
    }
    if(el>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto el; 
    }  
    if(el1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto el1; 
    }  
    if(el2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto el2; 
    }  
    if(el3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto el3; 
    }  
    if(el4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto el4; 
    }  
    if(el5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto el5; 
    } 
    if(sa>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto sa; 
    }  
    if(sa1>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto sa1; 
    }  
    if(sa2>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto sa2; 
    }  
    if(sa3>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto sa3; 
    }  
    if(sa4>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto sa4; 
    }  
    if(sa5>0)
    {
        used++; 
    }
    if(used==used2)
    {
        goto sa5; 
    }
wo:
    cout << "  木劍          " << endl;
    cout << "  物攻+5   魔攻+2    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            wo--;
            checkequi();
            equw=0;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
wo1:
    cout << "  木劍+1        " << endl;
    cout << "  物攻+7   魔攻+4    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            wo1--;
            checkequi();
            equw=1;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
wo2:
    cout << "  木劍+2        " << endl;
    cout << "  物攻+9   魔攻+6    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            wo2--;
            checkequi();
            equw=2;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
wo3:
    cout << "  木劍+3        " << endl;
    cout << "  物攻+11  魔攻+8    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            wo3--;
            checkequi();
            equw=3;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
wo4:
    cout << "  木劍+4        " << endl;
    cout << "  物攻+13  魔攻+10    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            wo4--;
            checkequi();
            equw=4;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
wo5:
    cout << "  木劍+5        " << endl;
    cout << "  物攻+15  魔攻+12    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            wo5--;
            checkequi();
            equw=5;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
me:
    cout << "  鐵劍          " << endl;
    cout << "  物攻+13  魔攻+4    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            me--;
            checkequi();
            equw=6;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
me1:
    cout << "  鐵劍+1        " << endl;
    cout << "  物攻+16  魔攻+7    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            me1--;
            checkequi();
            equw=7;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
me2:
    cout << "  鐵劍+2        " << endl;
    cout << "  物攻+19  魔攻+11    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            me2--;
            checkequi();
            equw=8;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
me3:
    cout << "  鐵劍+3        " << endl;
    cout << "  物攻+22  魔攻+13    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            me3--;
            checkequi();
            equw=9;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
me4:
    cout << "  鐵劍+4        " << endl;
    cout << "  物攻+25  魔攻+16    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            me4--;
            checkequi();
            equw=10;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
me5:
    cout << "  鐵劍+5        " << endl;
    cout << "  物攻+28  魔攻+19    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            me5--;
            checkequi();
            equw=11;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
si:
    cout << "  銀劍          " << endl;
    cout << "  物攻+25  魔攻+7    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            si--;
            checkequi();
            equw=12;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
si1:
    cout << "  銀劍+1          " << endl;
    cout << "  物攻+29  魔攻+11    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            si1--;
            checkequi();
            equw=13;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
si2:
    cout << "  銀劍+2          " << endl;
    cout << "  物攻+33  魔攻+15    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            si2--;
            checkequi();
            equw=14;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
si3:
    cout << "  銀劍+3          " << endl;
    cout << "  物攻+37  魔攻+19    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            si3--;
            checkequi();
            equw=15;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
si4:
    cout << "  銀劍+4        " << endl;
    cout << "  物攻+41  魔攻+23    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            si4--;
            checkequi();
            equw=16;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
si5:
    cout << "  銀劍+5        " << endl;
    cout << "  物攻+45  魔攻+27    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            si5--;
            checkequi();
            equw=17;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
so:
    cout << "  子母劍        " << endl;
    cout << "  物攻+37  魔攻+15    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            so--;
            checkequi();
            equw=18;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
so1:
    cout << "  子母劍+1        " << endl;
    cout << "  物攻+42  魔攻+20    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            so1--;
            checkequi();
            equw=19;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
so2:
    cout << "  子母劍+2      " << endl;
    cout << "  物攻+47  魔攻+25    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            so2--;
            checkequi();
            equw=20;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
so3:
    cout << "  子母劍+3        " << endl;
    cout << "  物攻+52  魔攻+30    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            so3--;
            checkequi();
            equw=21;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
so4:
    cout << "  子母劍+4        " << endl;
    cout << "  物攻+57  魔攻+35    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            so4--;
            checkequi();
            equw=22;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
so5:
    cout << "  子母劍+5        " << endl;
    cout << "  物攻+62  魔攻+40    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            so5--;
            checkequi();
            equw=23;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
br:
    cout << "  勇者之劍        " << endl;
    cout << "  物攻+47  魔攻+20    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            br--;
            checkequi();
            equw=24;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
br1:
    cout << "  勇者之劍+1        " << endl;
    cout << "  物攻+53  魔攻+26    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            br1--;
            checkequi();
            equw=25;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
br2:
    cout << "  勇者之劍+2      " << endl;
    cout << "  物攻+59  魔攻+32    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            br2--;
            checkequi();
            equw=26;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
br3:
    cout << "  勇者之劍+3        " << endl;
    cout << "  物攻+65  魔攻+38    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            br3--;
            checkequi();
            equw=27;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
br4:
    cout << "  勇者之劍+4        " << endl;
    cout << "  物攻+71  魔攻+44    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            br4--;
            checkequi();
            equw=28;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
br5:
    cout << "  勇者之劍+5        " << endl;
    cout << "  物攻+77  魔攻+50    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            br5--;
            checkequi();
            equw=29;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
woo:
    cout << "  木杖        " << endl;
    cout << "  物攻+2   魔攻+5    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            woo--;
            checkequi();
            equw=30;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
woo1:
    cout << "  木杖+1        " << endl;
    cout << "  物攻+4   魔攻+7    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            woo1--;
            checkequi();
            equw=31;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
woo2:
    cout << "  木杖+2      " << endl;
    cout << "  物攻+6   魔攻+9    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            woo2--;
            checkequi();
            equw=32;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
woo3:
    cout << "  木杖+3        " << endl;
    cout << "  物攻+8   魔攻+11    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            woo3--;
            checkequi();
            equw=33;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
woo4:
    cout << "  木杖+4        " << endl;
    cout << "  物攻+10  魔攻+13    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            woo4--;
            checkequi();
            equw=34;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
woo5:
    cout << "  木杖+5        " << endl;
    cout << "  物攻+12  魔攻+15    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            woo5--;
            checkequi();
            equw=35;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
bl:
    cout << "  藍寶石杖        " << endl;
    cout << "  物攻+4   魔攻+13    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            bl--;
            checkequi();
            equw=36;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
bl1:
    cout << "  藍寶石杖+1        " << endl;
    cout << "  物攻+7   魔攻+16    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            bl1--;
            checkequi();
            equw=37;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
bl2:
    cout << "  藍寶石杖+2      " << endl;
    cout << "  物攻+10  魔攻+19    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            bl2--;
            checkequi();
            equw=38;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
bl3:
    cout << "  藍寶石杖+3        " << endl;
    cout << "  物攻+13  魔攻+22    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            bl3--;
            checkequi();
            equw=39;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
bl4:
    cout << "  藍寶石杖+4        " << endl;
    cout << "  物攻+16  魔攻+25    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            bl4--;
            checkequi();
            equw=40;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
bl5:
    cout << "  藍寶石杖+5        " << endl;
    cout << "  物攻+19  魔攻+28    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            bl5--;
            checkequi();
            equw=41;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
cr:
    cout << "  水晶杖        " << endl;
    cout << "  物攻+7   魔攻+25    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            cr--;
            checkequi();
            equw=42;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
cr1:
    cout << "  水晶杖+1        " << endl;
    cout << "  物攻+11  魔攻+29    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            cr1--;
            checkequi();
            equw=43;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
cr2:
    cout << "  水晶杖+2      " << endl;
    cout << "  物攻+15  魔攻+33    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            cr2--;
            checkequi();
            equw=44;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
cr3:
    cout << "  水晶杖+3        " << endl;
    cout << "  物攻+19  魔攻+37    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            cr3--;
            checkequi();
            equw=45;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
cr4:
    cout << "  水晶杖+4        " << endl;
    cout << "  物攻+23  魔攻+41    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            cr4--;
            checkequi();
            equw=46;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
cr5:
    cout << "  水晶杖+5        " << endl;
    cout << "  物攻+27  魔攻+45    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            cr5--;
            checkequi();
            equw=47;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
el:
    cout << "  元素之杖        " << endl;
    cout << "  物攻+15   魔攻+37    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            el--;
            checkequi();
            equw=48;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
el1:
    cout << "  元素之杖+1        " << endl;
    cout << "  物攻+20  魔攻+42    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            el1--;
            checkequi();
            equw=49;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
el2:
    cout << "  元素之杖+2      " << endl;
    cout << "  物攻+25  魔攻+47    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            el2--;
            checkequi();
            equw=50;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
el3:
    cout << "  元素之杖+3        " << endl;
    cout << "  物攻+30  魔攻+52    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            el3--;
            checkequi();
            equw=51;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
el4:
    cout << "  元素之杖+4        " << endl;
    cout << "  物攻+35  魔攻+57    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            el4--;
            checkequi();
            equw=52;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
el5:
    cout << "  元素之杖+5        " << endl;
    cout << "  物攻+40  魔攻+62    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            el5--;
            checkequi();
            equw=53;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
sa:
    cout << "  賢者之杖        " << endl;
    cout << "  物攻+20   魔攻+47    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            sa--;
            checkequi();
            equw=54;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
sa1:
    cout << "  賢者之杖+1        " << endl;
    cout << "  物攻+26  魔攻+53    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            sa1--;
            checkequi();
            equw=55;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
sa2:
    cout << "  賢者之杖+2      " << endl;
    cout << "  物攻+32  魔攻+59    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            sa2--;
            checkequi();
            equw=56;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
sa3:
    cout << "  賢者之杖+3        " << endl;
    cout << "  物攻+38  魔攻+65    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            sa3--;
            checkequi();
            equw=57;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
sa4:
    cout << "  賢者之杖+4        " << endl;
    cout << "  物攻+44  魔攻+71    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            sa4--;
            checkequi();
            equw=58;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
sa5:
    cout << "  賢者之杖+5        " << endl;
    cout << "  物攻+50  魔攻+77    " << endl;
    cout << "------------------          " << endl;
    cout << "請按'Enter'來裝備該武器，按'Esc'可以離開" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[13]&0x80)!=0)
        {
            sa5--;
            checkequi();
            equw=59;
            goto re;
        }
//選擇
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC 
        cout << "請勿按除了'Enter'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto equ;
    }
re:
    system("cls"); 
}
////////////////////////////////////////////////////////////////////////////////
//人物狀態資訊 
////////////////////////////////////////////////////////////////////////////////
void people()
{
    Mexp=explist();
    system("cls");
people:
    cout << "以下是你的基本資料         > 狀態     道具  " << endl;
    cout << "------------------           裝備     技能  " << endl;
    cout << "   名字       " << name << "               " << endl;
    cout << "   等級       " << lv << "                 " << endl;
    cout << "   血         " << hp << "/" << Hp << "    " << endl;
    cout << "   魔         " << mp << "/" << Mp << "    " << endl;
    cout << "   經驗值     " << exp << "/" << Mexp << " " << endl;
    cout << "   力量       " << str << "                " << endl;
    cout << "   體質       " << vit << "                " << endl;
    cout << "   敏捷       " << dex << "                " << endl;
    cout << "   智慧       " << inte << "               " << endl;
    cout << "   精神       " << spi << "                " << endl;
    cout << "   幸運       " << luc << "                " << endl;
    cout << "   未分配點數 " << point << "              " << endl;
    cout << "------------------                    " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你可以按'下'和'右'來移動指標以顯示不同的資訊" << endl;
    cout << "按'Esc'可以離開，按'Enter'可以分配屬性點數" << endl;
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto people2;
        }
//下~跳到下面的裝備列表(people2)
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto people3;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC~跳到下面的離開(re) 
        cout << "請勿按除了'下'和'右'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto people;
    }
people2:
    pequ();//呼叫裝備資料
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto people;
        }
//上~回到人物資訊(people)
        if((KeyArray[39]&0x80)!=0)
        {
            system("cls");
            goto people4;
        }
//右 
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            uequ();
            goto people2;
        }
//ENTER
        cout << "請勿按除了'上'和'右'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto people2;
    }
people3:             
    pitem();//呼叫道具資料 
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            goto people;
        }
//左 
        if((KeyArray[40]&0x80)!=0)
        {
            system("cls");
            goto people4;
        }
//下~
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC
        if((KeyArray[13]&0x80)!=0)
        {
            system("cls");
            uitem();
            goto people3;
        }
//ENTER 
        cout << "請勿按除了'下'和'左'與'Esc'、'Enter'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto people3;
    }
people4:
    pskill();//呼叫技能資料
    system("pause");//停在這邊 
    GetKeyState(VK_UP);//函數的內容隨便用哪個Virtual Key Code代替都行 
    GetKeyboardState(KeyArray);//這個是用來比對的 
    for(i=1;i<255;i++)
    {
        PreKeyArray[i]=KeyArray[i];
        if((KeyArray[38]&0x80)!=0)
        {
            system("cls");
            goto people3;
        }
//上~回到道具資訊(people3)
        if((KeyArray[37]&0x80)!=0)
        {
            system("cls");
            goto people2;
        }
//左
        if((KeyArray[27]&0x80)!=0)
        {
            goto re;
        }
//ESC
        cout << "請勿按除了'上'和'左'與'Esc'以外的其他按鍵" << endl;
        system("pause");
        system("cls");
        goto people4;
    }
re:
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//塔 
////////////////////////////////////////////////////////////////////////////////
void tower()
{
    system("cls"); 
    system("pause");
    system("cls");
}      
////////////////////////////////////////////////////////////////////////////////
//洞窟
////////////////////////////////////////////////////////////////////////////////
void cave()
{
    system("cls"); 
    system("pause");
    system("cls");
}      
////////////////////////////////////////////////////////////////////////////////
//道具店 -賣 
////////////////////////////////////////////////////////////////////////////////
void itemsell()
{ 
    cout << "賣" << endl;
    system("pause");
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//武器店 -賣 
////////////////////////////////////////////////////////////////////////////////
void armssell()
{ 
    cout << "賣" << endl;
    system("pause");
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//武器店 -精練 
////////////////////////////////////////////////////////////////////////////////
void armsplus()
{ 
    cout << "精練" << endl;
    system("pause");
    system("cls");
} 
////////////////////////////////////////////////////////////////////////////////
//戰鬥 
////////////////////////////////////////////////////////////////////////////////
void war(int &r)
{ 
    cout << "怪物" << endl;
    system("pause");
    system("cls");
}
////////////////////////////////////////////////////////////////////////////////
//人物--技能資料
////////////////////////////////////////////////////////////////////////////////
void pskill()
{ 
    cout << "以下是你學會的技能           狀態     道具  " << endl;
    cout << "------------------           裝備   > 技能  " << endl;
    cout << "                                     " << endl;    
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "                                     " << endl;
    cout << "------------------               " << endl;
    cout << "持有金   " << money << "              " << endl;
    cout << "                                      " << endl;
    cout << "你可以按'上'和'左'來移動指標以顯示不同的資訊" << endl;
    cout << "按'Esc'可以離開，按'Enter'可以確認與使用技能" << endl;
}














