满级战斗 3.5

· · 个人记录

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
    cout<<"满级战斗"<<endl;
    cout<<"游戏初始化中";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十"<<endl;
    cout<<"检查最新版本";
     Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十   无更新版本"<<endl;
    cout<<"加载配置中";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十"<<endl;
    cout<<"用户登录中";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十";
    Sleep(150);
    cout<<"×";
    Sleep(150);
    cout<<"十"<<endl; 
    cout<<"登录成功!"<<endl;
    MessageBox(0,"欢迎登录“满级战斗”","Hi~ o(* ̄▽ ̄*)ブ",MB_OK);
    MessageBox(0,"此为3.5最新版本,比2.0新增物品售卖和输入买卖数量功能~","温馨提示",MB_OK);
    MessageBox(0,"作者@蹭饭蔡 侵权必究!","警示",MB_OK);
    MessageBox(0,"兑换码1是123,码2是456,码3是789,凭此码可到兑换区换礼物~每个码只能换一次","温馨提示",MB_OK);
    MessageBox(0,"祝您游玩愉快!","Hi~ o(* ̄▽ ̄*)ブ",MB_OK);
    int money=100,xue=150,jifen=20,dengji=1,shanghai=20,direnxue,direnshang,shoulei=0,c4=0,jijiu=0; 
    int zhanxue,choose_zhan,choose_buy,ma1=123,ma2=456,ma3=789;
    int tuzi=0,houzi=0,mao=0,gou=0,shizi=0,tuzi_t=8,houzi_t=7,mao_t=6,gou_t=5,shizi_t=3;
    int mai; 
    while(1)
    {
        if(tuzi_t==0)  tuzi=0;
        if(houzi_t==0) houzi=0;
        if(mao_t==0)   mao=0;
        if(gou_t==0)   gou=0;
        if(shizi_t==0) shizi=0;
        for(int i=0;i<=2500;i+=100)
        {
            if(jifen>=i&&jifen<i+100)
            {
                dengji=(i+100)/100;
            }
            if(dengji>=25)
            {
                cout<<"达到最高等级:25 游戏结束~";
                return 0; 
            }
        }
        if(dengji>=5&&dengji<10)
        {
            xue=160;
            shanghai=40;
        }
        if(dengji>=10&&dengji<20)
        {
            xue=170;
            shanghai=50;
        }
        if(dengji>=20)
        {
            xue=175;
            shanghai=60;
        }
        cout<<"1:开战!"<<endl;
        cout<<"2:我的信息" <<endl;
        cout<<"3:兑换~"<<endl;
        cout<<"4:退出游戏"<<endl;
        cout<<"5:商店"<<endl;
        cout<<"6:我的动物"<<endl;
        cout<<"7:售卖"<<endl; 
        int choose_main;
        cout<<"请选择:";
        cin>>choose_main;
        if(choose_main==4)
        {
            cout<<"退出就没有了当前数据了~再玩久一点嘛~~"<<endl;
            cout<<"确定退出?  A:确定  B:取消"<<endl;
            char choose_tui;
            cin>>choose_tui;
            if(choose_tui=='A')
            {
                return 0;
            }
            if(choose_tui=='B')
            {
                cout<<"继续游戏"<<endl;
                cout<<endl; 
            }
        }
        if(choose_main==1)
        {
            cout<<"匹配中";
            cout<<".";
            Sleep(50) ;
            cout<<".";
            Sleep(50) ;
            cout<<".";
            Sleep(50) ;
            cout<<".";
            Sleep(50) ;
            cout<<".";
            Sleep(50) ;
            cout<<".";
            Sleep(70) ;
            cout<<endl<<"匹配成功!"<<endl;
            if(dengji<=5)
            {
                direnxue=xue;
                direnshang=shanghai;
            }
            if(dengji>5&&dengji<=10)
            {
                direnxue=xue-20;
                direnshang=shanghai+10;
            }
            if(dengji>10&&dengji<=20)
            {
                direnxue=xue+30;
                direnshang=shanghai-25;
            }
            if(dengji>20)
            {
                cout<<"选择难度:1:高难度一点  2:正常难度";
                int choose_o;
                cin>>choose_o;
                if(choose_o==1)
                {
                    direnshang=shanghai+10;
                    direnxue=xue+30;
                 } 
                if(choose_o==2)
                {
                    direnxue=xue+5;
                    direnshang=shanghai+5;
                }
            }

            zhanxue=xue;
            cout<<"可选择动物:";
            if(tuzi>=1) 
                {
                    cout<<"1.兔子"; 
                } 
            if(houzi>=1)
            {
                cout<<"2.猴子"; 
            }
            if(mao>=1)
            {
                cout<<"3.猫"; 
            }
            if(gou>=1)
            {
                cout<<"4.狗"; 
            }
            if(shizi>=1)
            {
                cout<<"5.狮子"; 
            }
            cout<<"0.不需要";
            int choose_A;
            cin>>choose_A;
            if (choose_A==0)
            {
                cout<<"战斗开始!"<<endl;
            }
            if(choose_A==1&&tuzi>=1)
            {
                shanghai+=10;
                tuzi_t-=1;
            cout<<"战斗开始!"<<endl;
            }
            if(choose_A==2&&houzi>=1)
            {
                shanghai+=13;
                houzi_t-=1;
                cout<<"战斗开始!"<<endl;
            }
            if(choose_A==3&&mao>=1)
            {
                shanghai+=18;
                mao_t-=1;
                cout<<"战斗开始!"<<endl;
            }
            if(choose_A==4&&gou>=1)
            {
                shanghai+=20;
                gou_t-=1;
                cout<<"战斗开始!"<<endl;
            }
            if(choose_A==5&&shizi>=1)
            {
                shanghai+=25;
                shizi_t-=1;
                cout<<"战斗开始!"<<endl;
            }
            while(1)
            {
                cout<<"1.打他!"<<endl<<"2.用手雷("<<shoulei<<")个"<<endl;
                cout<<"3.用C4("<<c4<<")个"<<"4.用急救包回40点血("<<jijiu<<")个"<<endl;
                cout<<"请选择:"; 
                cin>>choose_zhan;
                if(choose_zhan==1)
                {
                    direnxue-=shanghai;
                    cout<<"你的血量"<<zhanxue<<" 敌人血量"<<direnxue<<"(-"<<shanghai<<")"<<endl;
                    Sleep(2000); 
                }
                if(choose_zhan==2)
                {
                    if(shoulei==0)
                    {
                        cout<<"手雷不足!!来不及了!敌人开火啦!"<<endl; 
                    }
                    if(shoulei>0)
                    {
                        cout<<"使用成功!"<<endl;
                        direnxue-=30;
                        cout<<"你的血量"<<zhanxue<<" 敌人血量"<<direnxue<<"(-30)"<<endl;
                        shoulei-=1;
                    }
                }
                if(choose_zhan==3)
                {
                    if(c4==0)
                    {
                        cout<<"C4不足!!来不及了!敌人开火啦!"<<endl; 
                    }
                    if(c4>0)
                    {
                        cout<<"使用成功!"<<endl;
                        direnxue-=60;
                        cout<<"你的血量"<<zhanxue<<" 敌人血量"<<direnxue<<"(-60)"<<endl;
                        c4-=1;
                    }
                }
                if(choose_zhan==4)
                {
                    if(jijiu==0)
                    {
                        cout<<"急救包不足!!来不及了!敌人开火啦!"<<endl;
                    }
                    if(jijiu>0)
                    {
                        cout<<"使用成功!"<<endl;
                        zhanxue+=40;
                        cout<<"你的血量:"<<zhanxue<<"(+40)"; 
                        jijiu-=1;
                     }
                }
                cout<<"敌人攻击了你!你的血量:";
                zhanxue-=direnshang;
                cout<<zhanxue<<"(-"<<direnshang<<")";

                if(zhanxue<=0||direnxue<=0)
                {
                    cout<<"-战斗结束-"<<endl;
                    if(zhanxue<=0&&direnxue>0)
                    {
                        cout<<"你输了!赔50元|扣10积分!"<<endl;
                        money-=10;
                        jifen-=10;
                    }
                    else if(direnxue<=0&&zhanxue>0)
                    {
                        cout<<"你赢啦!得到35元|加20积分!"<<endl;
                        money+=35;
                        jifen+=20;
                     } 
                    else if(direnxue<=0&&zhanxue<=0)
                    {
                        cout<<"平局!!!哈哈  得到10元"<<endl;
                        money+=10; 
                    }
                    break;
                 } 
             } 

            }
        if(choose_main==5)
            {
                cout<<"你有"<<money<<"元"<<endl; 
                cout<<"1.手雷50元"<<endl<<"2.C4 80元"<<endl<<"3.急救包75元"<<endl<<"4.返回"<<endl;
                cout<<"5.兔子10元 6.猴子13元 7.猫18元 8.狗20元  9.狮子25元 "<<endl;
                cout<<"(可以使用时,重复买同一个动物,单局对战伤害不变,但使用机会增加~)"<<endl;
                cout<<"请选择:";
                cin>>choose_buy;
                if(choose_buy==1)
                {
                    if(money<50)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=50)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*50)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*50)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            shoulei+=mai;
                            money-=mai*50;
                        }
                    }
                }
                if(choose_buy==2)
                {
                    if(money<80)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=80)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*80)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*80)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            c4+=mai;
                            money-=mai*80;
                        }
                    }
                     } 
                }
                if(choose_buy==3)
                {
                    if(money<75)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=75)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*75)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*75)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            jijiu+=mai;
                            money-=mai*75;
                        }
                    }
                }
                if(choose_buy==4)
                {
                    cout<<"继续游戏"<<endl<<endl; 
                }
                if(choose_buy==5)
                {
                    if(money<10)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=10)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*10)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*10)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            tuzi+=mai;
                            money-=mai*10;
                            tuzi_t+=mai*7;
                        }
                    }
                }
                if(choose_buy==6)
                {
                    if(money<13)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=13)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*13)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*13)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            houzi+=mai;
                            money-=mai*13;
                            houzi_t+=mai*6;
                        }
                    }
                }
                if(choose_buy==7)
                {
                    if(money<18)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=18)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*18)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*18)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            mao+=mai;
                            money-=mai*18;
                            mao_t+=mai*5;
                        }
                    }
                }
                if(choose_buy==8)
                {
                    if(money<20)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=20)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*20)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*20)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            gou+=mai;
                            money-=mai*20;
                            gou_t+=mai*4;
                        }
                    }
                }
                if(choose_buy==9)
                {
                    if(money<25)
                    {
                        cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                    }
                    if(money>=25)
                    {
                        cout<<"要几个?"<<endl;
                        cin>>mai;
                        if(money<mai*25)
                        {
                            cout<<"钱不够"<<endl<<"继续游戏"<<endl<<endl; 
                        }
                        if(money>=mai*25)
                        {
                            cout<<"购买成功!"<<endl<<"继续游戏"<<endl<<endl; 
                            shizi+=mai;
                            money-=mai*25;
                            shizi_t+=mai*2;
                    }

                }

            }
        if(choose_main==3)
        {
            cout<<"输入兑换码:";
            int ma;
            cin>>ma;
            if(ma==ma1)
            {
                cout<<"正确  获得100元"<<endl<<"继续游戏"<<endl;
                 money+=100;
                 ma1=32745;
             } 
            else if(ma==ma2)
            {
                cout<<"正确  获得100元和50积分"<<endl<<"继续游戏"<<endl;
                 money+=100;
                 jifen+=50; 
                 ma2=32715;
            }
            else if(ma==ma3)
            {
                cout<<"正确  获得120元和60积分"<<endl<<"继续游戏"<<endl;
                 money+=120;
                 jifen+=60; 
                 ma2=32705;
            }
            else if(ma!=ma1&&ma!=ma2&&ma!=ma3)
            {
                cout<<"错误或已经领取"<<endl<<"继续游戏"<<endl;
            }
        }
        if(choose_main==2)
        {
            cout<<"等级:"<<dengji<<"(100积分升一级~)"<<endl;
            cout<<"积分:"<<jifen<<endl;
            cout<<"伤害:"<<shanghai<<endl;
            cout<<"生命:"<<xue<<endl;
            cout<<"你有"<<money<<"元"<<endl;
            cout<<"输入一个数字继续游戏:";
            int jixu;
            cin>>jixu ;
            if(jixu==0)
            {
                cout<<"继续游戏"<<endl<<endl<<endl;
            }
         }
        if(choose_main==6)
        {
            cout<<"你有:"<<endl;
            if(tuzi>=1)
            {
                cout<<"兔子  还能使用"<<tuzi_t<<"次  +10伤害"<<endl;
            }
            if(houzi>=1)
            {
                cout<<"猴子  还能使用"<<houzi_t<<"次 +13伤害"<<endl;
            }
            if(mao>=1)
            {
                cout<<"猫    还能使用"<<mao_t<<"次   +18伤害"<<endl;
            }
            if(gou>=1)
            {
                cout<<"狗    还能使用"<<gou_t<<"次   +20伤害"<<endl; 
            }
            if(shizi>=1)
            {
                cout<<"狮子  还能使用"<<shizi_t<<"次 +25伤害"<<endl; 
            }
            cout<<"即将自动返回,无需操作~"<<endl;
            Sleep(10000);
            cout<<"游戏继续"<<endl<<endl; 
        }
        if(choose_main==7)
        {
            cout<<"加载物品中";
            Sleep(150);
            cout<<"×";
            Sleep(150);
            cout<<"十";
            Sleep(150);
            cout<<"×";
            Sleep(150);
            cout<<"十";
            Sleep(150);
            cout<<"×";
            Sleep(150);
            cout<<"十"<<endl;
            cout<<"你有"<<endl;
            cout<<"1.手雷"<<shoulei<<"个 1个50元"<<endl; 
            cout<<"2.C4  "<<c4<<"个 1个80元"<<endl;
            cout<<"3.急救包"<<jijiu<<"个 1个75元"<<endl;
            cout<<"4.兔子"<<tuzi<<"只 1只10元"<<endl;
            cout<<"5.猴子"<<houzi<<"只 1只13元"<<endl;
            cout<<"6.猫"<<mao<<"只 1只18元"<<endl;
            cout<<"7.狗"<<gou<<"只 1只20元"<<endl;
            cout<<"8.狮子"<<shizi<<"头 1头25元"<<endl; 
            cout<<"要卖什么?"<<endl;
            int mai,maia;
            cin>>mai;
            if(mai==1)
            {
                if(shoulei==0)
                {
                    cout<<"手雷不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(shoulei>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(shoulei>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl; 
                        shoulei-=maia;
                        money+=50*maia; 
                     } 
                    else if(shoulei<maia)
                    {
                        cout<<"手雷不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==2)
            {
                if(c4==0)
                {
                    cout<<"C4不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(c4>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(c4>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        c4-=maia;
                        money+=maia*80;
                     } 
                    else if(c4<maia)
                    {
                        cout<<"C4不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==3)
            {
                if(jijiu==0)
                {
                    cout<<"急救包不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(c4>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(jijiu>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        jijiu-=maia;
                        money+=maia*75;
                     } 
                    else if(jijiu<maia)
                    {
                        cout<<"急救包不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==4)
            {
                if(tuzi==0)
                {
                    cout<<"兔子不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(tuzi>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(tuzi>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        tuzi-=maia;
                        money+=maia*10;
                        tuzi_t-=maia*6; 
                     } 
                    else if(tuzi<maia)
                    {
                        cout<<"兔子不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==5)
            {
                if(houzi==0)
                {
                    cout<<"猴子不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(tuzi>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(houzi>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        houzi-=maia;
                        money+=maia*13;
                        houzi_t-=maia*5; 
                     } 
                    else if(houzi<maia)
                    {
                        cout<<"猴子不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==6)
            {
                if(mao==0)
                {
                    cout<<"猫不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(mao>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(mao>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        mao-=maia;
                        money+=maia*18;
                        mao_t-=maia*4; 
                     } 
                    else if(mao<maia)
                    {
                        cout<<"猫不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==7)
            {
                if(gou==0)
                {
                    cout<<"狗不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(gou>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(gou>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        gou-=maia;
                        money+=maia*20;
                        gou_t-=maia*3; 
                     } 
                    else if(gou<maia)
                    {
                        cout<<"狗不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
            else if(mai==8)
            {
                if(shizi==0)
                {
                    cout<<"狮子不足"<<endl<<"继续游戏"<<endl<<endl;
                }
                else if(shizi>=1)
                {
                    cout<<"卖多少?";
                    cin>>maia;
                    if(shizi>=maia)
                    {
                        cout<<"出售成功!"<<endl<<"继续游戏"<<endl<<endl;
                        shizi-=maia;
                        money+=maia*25;
                        shizi_t-=maia*2; 
                     } 
                    else if(shizi<maia)
                    {
                        cout<<"狮子不足"<<endl<<"继续游戏"<<endl<<endl;
                    }
                }
            }
        }
    } 
}