自编C++游戏

背景

周末无聊,于是编了一个类似于cmd的小玩意。
可是越想越不对劲,所以把它改成了一个小游戏。

信息

语言:DEV_C++
源代码已公布!!

打败GG


版本:1.0(正式版)


版本:1.5(番外)


目前最新版本:2.0(英雄版)
源代码:

#include 
#include 
#include 
#include 
#define srandom srand((int)time(0))
#define random(a,b) (rand()%(b-a+1)+a)
#define cl system("cls")
using namespace std;
int x=1000,y=10,apks,doks,opinfs,bigets,comes,gos,japk;
int deapks,dedoks,deopinfs,debigets,decomes,degos;
int dokbuff;
int apklow;
int agas;
int guts;
int bag[10];
int gx=2000;
bool shopbl=0;
int wearthing[10]={0,100,170,210,190,220};
int hurtggb;
int playper;
int pero;
float pert;
int perttime;
int pere;
int peretime;
int perf;
int perftime;
int perfapk;
int perfall;
void start()
{
    char ch='0';
    while(ch!='1')
    {
        cl;
        cout<<"1.开始 2.退出 3.了解背景&操作 4.关于";
        while(!kbhit())
        {
        
        }
        ch = getch();
        if(ch == '2')
            exit(0);
        if(ch == '3')
        {
            cl;
            cout<<"你被选定为FG勇士\n打败FG怪兽——GG获得胜利!"<4)
            yx=1;
        choose(yx);
    }
    else if(int(yxc)==13)
    {
        cl;
        return yx;
    }
    else
    {
        choose(yx);
    }
}
void rewe()
{
    if(apks!=0)apks--;
    if(doks!=0)doks--;
    if(opinfs!=0)opinfs--;
    if(bigets!=0)bigets--;
    if(comes!=0)comes--;
    if(gos!=0)gos--;
}
void help()
{
    cout<<"input:a---普攻"<0)
    {
        cout<<"You can't do it"< 0 || y < 100)
    {
        cout<<"You can't do it";
        rewe();
        return;
    }
    srandom;
    int ap = random(japk + 100 + apklow, japk + 200);
    ap*=2;
    cout<<"You hurt gg "<='0' && chi<='9')
    {
        a=chi-'0';
        if(wearthing[a]>y)
        {
            cout<<"You can't do it"<0)
    {
        cout<<"You can't do it"<0)
    {
        cout<<"You can't do it"<0)
    {
        cout<<"You can't do it"< 0)
        {
            cout<<"You can't do it";
            rewe();
            return;
        }
        srandom;
        int ap = random(japk + 100 + apklow, japk + 200);
        ap*=3;
        cout<<"Take it!!!"< 0)
        {
            cout<<"You can't do it";
            rewe();
            return;
        }
        cout<<"My dream will come true!!!"< 0)
        {
            cout<<"You can't do it";
            rewe();
            return;
        }
        cout<<"Fire!!!"< 0 && perf==0)
        {
            cout<<"You can't do it";
            rewe();
            return;
        }
        if(perfall>950)
        {
            cout<<"I am old.Sorry,I can't do it..."<0)
            peretime--;
        if(peretime==0)
            pere=0;
        /*----判断是否在朱雀圣火效果内----*/
        if(perttime==0)
        {
            pert=1;
        }
        if(perttime>0)
        {
            perttime--;
        }
        /*----判断是否在大灵魂术效果内----*/
        main:
        int ap;
        if(gotime>0)
        {
            gotime--;
            goto goead;
        }
        else if(gotime==0)
            going=false;
        /*----判断是否回避----*/  
        srandom;
        ap = random(20,40);
        if(dokbuff>0)
        {
            dokbuff--;
            ap=floor(ap*0.5);
        }
        ap=floor(ap*pert);
        /*----判断是否防御----*/
        if(perftime>0)
        {
            perfapk+=ap;
            ap=0;
            perftime--;
        }
        /*----判断是否龟图----*/
        goead:
        cout<<"(Press 'h' to get the help)"<0)/*----用gut----*/
            {
                guts--;
                x+=ap;
                cout<<"You use the gut"<0)/*----用aga----*/
            {
                agas--;
                x=700;
                cout<<"You use the aga"<'9')
            {
                shopbl=true;
                cl;
                goto main;
            }
        }
        if(ch=='d')
        {
            dok();
        }
        if(ch=='o')
        {
            opinf();
        }
        if(ch=='g')
        {
            go();
        }
        if(ch=='c')
        {
            come(playper);
        }
        /*----读入----*/
        while(!kbhit())
        {
        }
        cl;
    }
}

欢迎试玩

你可能感兴趣的:(自编C++游戏)