我的世界

· · 个人记录


#include<bits/stdc++.h>
#define clean() system("cls")
#define sleep Sleep
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<time.h>
#include<direct.h>
//https://www.bilibili.com/opus/189576459128205353 
using namespace std;
int i,j,k,win[20],x,type;
string p[20];
struct zombies{
    int hp,sh,huo,fy,dj;
    void next()
    {
        if(huo)hp-=2;
        if(hp<=0)return;
    }
}zb;
struct wq{
    string name;
    int naij,sh,fl,nj,hyfj;
    void kill(zombies &x)
    {       
        x.hp-=ceil((sh+fl)*1.0/(1+x.fy*1.0/20));
        x.huo=hyfj*3;
    }
    void print()
    {cout<<name<<' '<<naij<<' '<<sh<<' '<<fl<<' '<<nj<<' '<<hyfj;cout<<'\n';}
    void read(){cin>>name>>naij>>sh>>fl>>nj>>hyfj;}
}now;
struct player{
    string name;
    int hp,jy,dp;
    int jie,cnt,fd,sum,fy,fjs,bstt,sw;
    int ljgl,bjgl,jz,smhf,gold,td,zs,lbs;
    int mb;
    bool jn[5];
    wq a[300];
    struct food{
        int hf,zl,many;
        void cd(){cout<<hf<<' '<<zl<<' '<<many<<'\n';}
    }foods[100001];
    struct fj{
        int naij,bh,fy,nj;
        void print()
        {
            cout<<name<<' '<<naij<<' '<<bh<<' '<<fy<<' '<<nj<<' ';
        }
        void read()
        {
            cin>>name>>naij>>bh>>fy>>nj;
        }
        string name;
    }d[10];
    struct Nu{
        int sh,f,had,naij;
        void cd()
        {
            cout<<f<<' '<<had<<" "<<sh<<' '<<naij<<'\n';
        }
        void dd()
        {
            cin>>f>>had>>sh>>naij;
        }
        void kill(zombies &x)
        {
            if(f)x.hp-=10,f=0,naij--;
            else f=1;
            if(naij==0)had=0;
        }
    }nu;
    void print()
    {
        cout<<name<<":hp:"<<hp<<" 饥饿值:"<<jie;
        if(smhf)cout<<"\n效果:生命恢复";
        cout<<"\n武器:";cout<<"\n";
        for(int i=1;i<=cnt;i++)
        {
            if(a[i].name=="")continue;
            cout<<i<<':'<<a[i].name;
            if(a[i].fl||a[i].nj||a[i].hyfj)cout<<'[';
            if(a[i].fl)cout<<"锋利"<<a[i].fl;
            if(a[i].nj)cout<<"耐久"<<a[i].nj;
            if(a[i].hyfj)cout<<"火焰附加"<<a[i].hyfj;
            if(a[i].fl||a[i].nj||a[i].hyfj)cout<<']';
            cout<<"伤害"<<a[i].sh+a[i].fl<<" 现有耐久:"<<a[i].naij;
            cout<<'\n';
        }
        if(nu.had)
        {
            cout<<cnt+1<<":弩,伤害10";
            if(nu.f)cout<<"发射";
            else cout<<"填装";
            cout<<"\n";
        }
        for(int i=1;i<=4;i++)
        {
            if(d[i].name=="")continue;
            cout<<d[i].name;
            if(d[i].bh||d[i].nj)
            {
                cout<<'[';
                if(d[i].bh)cout<<"保护"<<d[i].bh;
                if(d[i].nj)cout<<"耐久"<<d[i].nj;
                cout<<']';
            }
            cout<<'\n';
        }
        if(dp)cout<<"副手:盾牌\n";
        if(bstt)cout<<"不死图腾:"<<bstt<<"个\n";
    }
    void cd()
    {
        freopen("cd1_9.txt","w",stdout);
        cout<<hp<<' '<<jy<<' '<<dp<<' '<<jie<<' '<<cnt<<' '<<fd<<' '<<fjs<<' '<<bjgl<<' '<<ljgl<<' ';
        for(int i=1;i<=cnt;i++)a[i].print();
        for(int i=1;i<=fd;i++)foods[i].cd();
        for(int i=1;i<=fjs;i++)d[i].print();
        for(int i=1;i<=14;i++)cout<<win[i]<<' ';
        nu.cd();
        cout<<bstt<<' ';
        cout<<td<<' '<<lbs<<' '<<zs<<' '<<gold<<' '<<mb<<' ';
        exit(0);
    }
    void dd()
    {
        cin>>hp>>jy>>dp>>jie>>cnt>>fd>>fjs>>bjgl>>ljgl;
        for(int i=1;i<=cnt;i++)a[i].read();
        for(int i=1;i<=fd;i++)cin>>foods[i].hf>>foods[i].zl>>foods[i].many;
        for(int i=1;i<=fjs;i++)d[i].read();
        for(int i=1;i<=14;i++)cin>>win[i];
        nu.dd();
        cin>>bstt>>td>>lbs>>zs>>gold>>mb;
    }
    void eat()
    {
        cout<<"选择食物";
        cout<<"1:金苹果"<<foods[1].many<<'\n';
        cout<<"2:金胡萝卜"<<foods[2].many<<'\n';
        cout<<"3:面包无限个\n";
        cin>>x;
        if(foods[x].many>0)
        {
            if(foods[x].zl==1)hp+=8,jie+=4;
            if(foods[x].zl==2)jie+=15;
            if(foods[x].zl==3)jie+=7;
            foods[x].many--;
        }
    }
    void hf()
    {
        if(jie>=20)jie--,hp+=2;
        else if(jie>=18)jie--,hp++;
        else if(sum==10)jie--,sum=1;
        if(jie==0)hp--;
        if(smhf)hp+=2;
    }
    void ss(double sh)
    {
        if(dp)
        {
            int cx=rand()%5;
            if(cx>=3)cout<<"你用盾牌格挡了伤害\n";
        }
        double p=0;
        for(int i=1;i<=4;i++)
            p+=0.04*d[i].bh;
        sh-=sh*p;
        sh=floor(sh);
        p=0;
        for(int i=1;i<=4;i++)
            p+=0.04*d[i].fy;
        sh=floor(sh*(1-p));
        hp-=sh;
        if(hp<=0&&bstt)
        {
            bstt--;
            hp=20;
            jie=20;
        }
    }
}players;
void getc(){if(getch()!='\n')cout<<'\n';}
void addwq(wq x,player &players)
{
    for(int i=1;;i++)
        if(players.a[i].name=="")
        {
            players.a[i]=x;
            if(players.cnt<i)players.cnt=i;
            return;
        }
}
void pve(player &x,zombies &y)
{
    int tmp;players.sum=0;
    cout<<"对战开始!";getc();
    while(x.hp>0)
    {
        cout<<"你:\n";
        players.print();
        cout<<"对手:血量";
        cout<<y.hp<<" 伤害"<<y.sh<<'\n';
        cout<<"0是食物\n";
        if(players.jn[1])cout<<"-1:技能,拼死(消耗经验20点)"; 
        cin>>tmp;
        if(tmp==0)
        {
            players.eat();
            players.hp-=ceil(zb.sh*1.0/(1+players.fy*1.0/20));
            continue;
        }
        if(tmp==-1)
        {
            cout<<"技能,拼死!";
            players.jy-=10;
            players.hp=players.hp*1.0/1.5;
            y.hp/=4;
        }
        if(players.a[tmp].naij)
        {
            players.a[tmp].kill(y);
            if(rand()%players.ljgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/1.25),players.a[tmp].naij--,cout<<"连击!",players.jie--;
            else if(rand()%players.bjgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/2),cout<<"暴击!",players.jie--;
            players.a[tmp].naij--;
            players.sum++;
            if(players.a[tmp].naij<0)players.a[tmp].naij=0;
        }
        if(y.hp<=0)
        {
            cout<<"你赢了!";
            players.jy+=100;
            sleep(500);
            return;
        }
        players.ss(zb.sh);
        sleep(300);
        clean();
    }
    if(players.hp<=0&&!players.sw)
    {
        cout<<"you die";
        exit(0);
    }
}
void p1()
{
    cout<<"这是Minecraft世界";getc();clean();
    cout<<"一个声音响起了……………………";getc();
    cout<<players.name<<",你需要活下去!";
    cout<<"我相信你!";getc();
    cout<<"你先来打一只僵尸试试水吧";getc();clean();
    cout<<"一只僵尸出现在你眼前!";getc();
    zb.hp=20;zb.sh=2;
    pve(players,zb);if(players.hp<=0)return;
    players.hp=20;
    cout<<"\n小伙子,不错嘛,再来!\n";
    zb.hp=30;zb.fy=2;zb.sh=3;
    pve(players,zb);
    win[1]=2;win[2]=1;
}
void p2()
{
    now.naij=130;
    now.sh=6;now.name="石剑";
    addwq(now,players);
    players.d[3].name="金护腿";
    players.d[3].fy=3;
    players.d[3].naij=45;
    players.d[3].bh=2;
    players.d[4].name="铁靴子";
    players.d[4].bh=1;
    players.d[4].naij=300;
    players.d[4].fy=2;
    players.hp=30;
    cout<<"你来啦,那你先在这里生存一会儿";getc();
    cout<<"那个声音再次响起";getc();
    clean();
    cout<<players.name<<":他是谁啊?";getc();
    cout<<"不管了!\n";
    cout<<"一只僵尸:不管了,那好,我来了";getc();
    zb.hp=20;zb.fy=10;zb.sh=5;
    pve(players,zb);
    win[2]=2;win[3]=1;
}
void p3()
{
    players.hp=30;
    cout<<"哦,你挺过来了";getc();
    cout<<"晚上,你得到-404 46 -7251那边";getc();
    cout<<"出发吧";getc();
    cout<<players.name<<":行吧";getc();clean();
    cout<<"过了一会儿,天黑了";getc();
    cout<<"一只僵尸出现在了眼前!手里还拿着一把铁剑!";getc();
    cout<<"请选择:1,跑走;2,战斗";
    cin>>x;
    if(x==2)
    {
        zb.hp=15;
        zb.sh=7;
        pve(players,zb);
        if(players.hp<=0)
        {
            cout<<"you died";
            getc();
            return;
        }
        cout<<"随着僵尸的死亡,一把铁剑从他身上掉落!";
        now.name="铁剑";now.naij=300;
        now.sh=5;now.fl=1;now.hyfj=1;
        addwq(now,players);
    }
    clean();
    cout<<"经历过长途跋涉,你来到了那个坐标";getc();
    cout<<"这里有个箱子";getc();
    cout<<"随着箱子的打开,你得经验增加了!";getc();
    cout<<"一本书出现在了眼前";getc();
    cout<<"书上写道:你好,如果你愿意做大事,请去-1000552 41 147801613";getc();
    cout<<"你:啥玩意儿,跑步吗";getc();
    players.jy+=40;
    players.fjs+=2;
    players.d[1].fy=1;
    players.d[1].naij=60;
    players.d[1].name="皮革头盔";
    players.d[2].fy=3;
    players.d[2].naij=60;
    players.d[2].name="皮革胸甲";
    win[3]=2;win[4]=1;
    return;
}
void p4()
{
    players.hp=30;
    cout<<"在晚上,你决定出发去哪个坐标";getc();
    cout<<"可是,晚上有很多怪";getc();clean();
    cout<<"注意,僵尸很多!";getc();
    cout<<"第一战!";getc();
    zb.hp=15;zb.sh=5;
    pve(players,zb);
    cout<<"第二战!";getc();
    zb.hp=20;zb.sh=3;
    players.hp+=7;
    pve(players,zb);
    cout<<"第三战!";getc();
    zb.hp=50;zb.sh=2;
    pve(players,zb);
    cout<<"最后一战!";getc();
    players.hp=30;
    zb.hp=40;zb.sh=4;
    pve(players,zb);
    cout<<"你成功了";getc();
    cout<<"恭喜获得盾牌";getc(); 
    players.d[3].name="铁护腿";
    players.d[3].fy=5;
    players.d[3].bh=1;
    players.dp=1;
    win[4]=2;win[5]=1;
}
void p5()
{
    players.hp=30;
    cout<<"你开始跑步(下面要跑10秒,愿意的话Enter)";getc();
    cout<<"经历了长途跋涉, 你来到了坐标";getc();
    cout<<"小伙子,你来了,你需要进行pvp,打赢了,就能加入兵团";getc();
    cout<<"请选择,是否挑战,对手十分强大(1,0)";cin>>x;
    win[6]=2;
    p[6]="练武场";
    if(x==0)
    {
        cout<<"小伙子,欢迎再来挑战.";getc();
        cout<<"对了,你的主情节中的练武场开放了";getc();
        return;
    }
    zb.hp=30;zb.sh=4;players.sw=1;
    pve(players,zb);
    players.sw=0;
    if(players.hp<=0)
    {
        cout<<"小伙子,欢迎再来挑战.";getc();
        cout<<"对了,你的主情节中的练武场开放了";getc();
    }
    else
    {
        cout<<"好的,我给你登记一下";getc();
        cout<<"请打开网页 https://www.luogu.com.cn/team/75096 ,加入团队";getc();
        cout<<"如果不行的话,那就免了";getc();
    }
    win[6]=2;win[7]=1;
}
void p7()
{
    cout<<"你好,恭喜加入我们";getc();
    cout<<"在这里,你需要与我们一起行动,主要是守卫村庄,你去man村";getc();
    cout<<"你在疑惑中,前往了man村";getc();clean();
    cout<<"这时候,一声号角声传来";getc();
    cout<<"劫掠开始了,你:我艹";getc();
    zb.hp=20;zb.sh=3;
    pve(players,zb);
    players.hp+=10;
    players.nu.had=1;
    players.nu.sh=7;
    zb.hp=20;zb.sh=5;
    pve(players,zb);
    players.hp+=10;
    players.hp+=10;
    zb.hp=100;zb.sh=2;
    pve(players,zb);
    cout<<"你击退了袭击!";
    now.name="铁斧";now.sh=8;now.naij=400;
    now.hyfj=1;now.fl=2;
    cout<<"你拾起了铁斧和盾牌";getc();
    players.dp=1;
    cout<<"你:真危险";getc();
    cout<<"恭喜获得村庄英雄效果!";
    cout<<"村民送你了一把金胡萝卜";players.foods[2].many+=10;
    win[7]=2;win[8]=1;
}
void p8()
{
    cout<<"在劫掠兽身上,你找到了一张纸:";getc();
    cout<<"传Him命令,进攻Man村";getc();
    cout<<"你告诉了村长,村长大惊失措,告诉你了一个故事";getc();
    clean();
    cout<<"Him是这个世界的暗神,创世神是notch\n";
    cout<<"他率领着大量亡灵士兵,截肢生物\n";
    cout<<"他的目标是占领主世界\n";
    cout<<"notch认为,应当勇闯末地,杀死Him\n";
    cout<<"但是,去往末地需要12颗末影之眼,虽然这不算什么,但是末地之行\n";
    cout<<"危险万分,你最好得做好准备";
    cout<<"按Enter键跳过";char lll;
    while((lll=getch())!='\n'&&lll!=' ');
    clean();
    cout<<"你决定,今天就去下界,收集物资!!!";getc();
    cout<<"你找到了岩浆池,浇筑了传送门";getc();
    players.cnt++;
    players.d[1].name="金头盔";
    players.d[1].fy=2;
    players.d[1].bh=4;
    players.d[2].name="钻石胸甲";
    players.d[2].fy=8;
    players.d[2].nj=2;
    players.d[2].naij=4;
    cout<<"勇往直下";getc();
    win[8]=2;win[9]=1;
}
void p9()
{
    cout<<"你看着眼前的下界,迷茫了起来";getc();
    cout<<"下界要塞会在哪里呢";getc();
    cout<<"你看到了一只猪灵,他向你冲来!";getc();
    zb.hp=20;zb.fy=13;zb.sh=6;
    players.hp=30;
    pve(players,zb);
    clean();
    cout<<"你在下界漫无目的走着";getc();
    cout<<"突然,你找到了下界堡垒!";getc();
    cout<<"你搜刮了物资,物资+1,力量弩";getc();
    players.nu.sh=12;
    players.foods[1].many+=7;
    cout<<"这时,你发现了烈焰人刷怪笼";getc();
    cout<<"你收收集起了烈焰棒";getc();int ppp=0;
    while(ppp<=5)
    {
        cout<<"烈焰棒:"<<ppp<<"根\n";getc();
        zb.hp=15;zb.sh=3;zb.fy=4;
        players.hp+=10;
        pve(players,zb);
        ppp+=!(rand()%2);
    }
    cout<<"收集完毕!";getc();
    clean();
    cout<<"下界之旅上结束";win[9]=2;win[10]=1;
}
void p10()
{
    cout<<"你在收集完烈焰棒后,开始击杀凋零骷髅,因为Man村村长告诉你,1个凋零骷髅头可以酿造生命恢复(无限)秒";getc();
    zb.hp=20;zb.sh=5;
    pve(players,zb);
    cout<<"很幸运,你直接拿到了一个";getc();
    cout<<"你赶回了家,Man村村长给你酿成了药水";getc();players.smhf=1;
    cout<<"你回到下界,发现了凋零骷髅的老兄:Grox(不知道自己去查)";
    cout<<"\n一场大战不可避免!";getc();
    zb.hp=30;zb.sh=6;zb.fy=10;
    pve(players,zb);
    cout<<"还好,你打赢了他";getc();
    cout<<"你拿走了他的装备";getc();
    players.d[4].name="下界合金靴";getc();
    players.d[4].fy=4;
    players.d[4].naij=100000;
    players.d[4].bh=2;
    players.d[3].name="铁护腿";
    players.d[3].fy=5;
    players.d[3].bh=4;
    players.d[3].nj=3;
    clean();
    cout<<"你在奔跑,要去2,2";getc();
    int x=1,y=1;
    while(x!=2&&y!=2)
    {
        cout<<"当前坐标"<<x<<','<<y<<'\n';
        cout<<"wasd控制你\n";
        char ppp;ppp=getch();
        if(ppp=='w')x--;
        if(ppp=='a')y--;
        if(ppp=='s')x++;
        if(ppp=='d')y++;
    }
    clean();
    cout<<"你找到了猪灵堡垒";getc();
    cout<<"你挖到了很多金子";getc();players.gold=100;
    cout<<"你选择如何获得末影珍珠?(1,抢;2,用金子交易)";int ppp;
    cin>>ppp;
    if(ppp==1)
    {
        cout<<"你被猪灵围殴死了";getc();
        return;
    }
    while(1)
    {
        cout<<"你现有金子"<<players.gold<<",7个可以换一个末影珍珠";
        cout<<"\n是否交易?(1,0)";int cx;cin>>cx;
        if(cx==1&&players.gold>=7)players.gold-=7;
        else break;
    }
    cout<<"你回到了村庄,并且获得了很多铁";getc();
    players.td+=45;
    cout<<"你可以在菜单中使用-1使用商店了!";getc();
    cout<<"接下来,就得进入末地了";getc();
    cout<<"其中有个彩蛋(99%)";getc();
    win[10]=2;win[11]=1;
}
void p11()
{
    cout<<"到这里,你应该也得拥有一些技能了";getc();
    if(type==1)cout<<"获得技能,超级连击",getc(),players.ljgl=1;
    else cout<<"获得技能,精准暴击",getc(),players.bjgl=1,players.ljgl=3;
    cout<<"获得技能:拼死一击(对手血量/4,自己/1.5),消耗经验10";getc();
    players.jn[1]=1;
    cout<<"获得技能,你干嘛哈哎哟(假的)";getc();
    cout<<"获得食物,泥敢嘛矮药(假的)";getc();
    cout<<"获得武器:附魔下界合金剑";getc();
    now.name="下界合金剑";getc();
    now.sh=9;now.fl=3;now.hyfj=2;now.naij=2e9;
    addwq(now,players);
    cout<<"行了,去末地吧";getc();
    clean();
    cout<<"The end";
    cout<<"你发现了末影水晶和末影龙";getc();
    cout<<"是否攻击?(1去,0不去)";int x;cin>>x;
    if(x==0)return ;
    cout<<"你要开始摧毁末影水晶了!";getc();
    x=0;
    while(x<=10)
    {
        int tmp=rand()%10+20;
        clean();
        cout<<"现在这个水晶高度"<<tmp<<",用什么攻击?(1弩,2搭高,消耗木板*)"<<tmp<<'\n';
        int opt;cin>>opt;
        if(opt==1)
        {
            cout<<"你消耗了4点经验";
            players.jy-=4;
            players.jy=max(players.jy,0);
        }
        else
        {
            cout<<"你消耗了一些木板\n";
            players.mb-=tmp;
            players.mb=max(0,players.mb-5);
        }
        x++;
    }
    clean();
    cout<<"水晶摧毁完毕,末影龙开始盘旋(10个回合),猛攻!";getc();
    zb.hp=500;
    for(int i=1;i<=10;i++)
    {
        players.print();
        cout<<"末影龙\n血量:"<<zb.hp<<"\n";
        cout<<"快点攻击!(不含技能)\n";int tmp;
        cin>>tmp;
        if(players.a[tmp].naij)
        {
            players.a[tmp].kill(zb);
            if(rand()%players.ljgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/1.25),players.a[tmp].naij--,cout<<"连击!",players.jie--;
            else if(rand()%players.bjgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/2),cout<<"暴击!",players.jie--;
            players.a[tmp].naij--;
            players.sum++;
            if(players.a[tmp].naij<0)players.a[tmp].name="";
        }
    }
    cout<<"末影龙向你喷射了龙息!";getc();
    if(rand()%10)
    {
        cout<<"你被打到了,hp-10";getc();
        players.hp-=10;
    }
    else cout<<"还好,你躲过去了",getc();
    clean();
    cout<<"加油!末影龙还有"<<zb.hp<<"点血量";getc();
    cout<<"你开始射击末影龙!";getc();
    cout<<"吱~噔!";zb.hp-=12;getc();
    zb.hp=max(zb.hp,200);
    cout<<"经过5轮射击,末影龙还剩"<<zb.hp<<"点血量";
    cout<<"这时候,末影龙又一次降落了!";getc();
    for(int i=1;i<=3;i++)
    {
        players.print();
        cout<<"末影龙\n血量:"<<zb.hp<<"\n";
        cout<<"快点攻击!(不含技能)\n";int tmp;
        cin>>tmp;
        if(players.a[tmp].naij)
        {
            players.a[tmp].kill(zb);
            if(rand()%players.ljgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/1.25),players.a[tmp].naij--,cout<<"连击!",players.jie--;
            else if(rand()%players.bjgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/2),cout<<"暴击!",players.jie--;
            players.a[tmp].naij--;
            players.sum++;
            if(players.a[tmp].naij<0)players.a[tmp].name="";
        }
    }
    cout<<"但是不过三次攻击,末影龙就起飞了,而且把你撞飞!";getc();
    x=rand()%50000;
    if(x==0)cout<<"你摔死了",players.cd(),exit(0);
    if(x<=10000)cout<<"你落地水成功",getc();
    else cout<<"你摔在了黑曜石柱上hp-7",getc(),players.hp-=7;
    cout<<"你吃了点东西:";getc();clean();
    players.eat();
    cout<<"末影龙再次发射龙息!";
    if(rand()%10)
    {
        cout<<"你被打到了,hp-10";getc();
        players.hp-=10;
    }
    else cout<<"还好,你躲过去了",getc();
    clean();
    if(zb.hp<=10&&rand()%3==0)cout<<"末影龙被你射死了!",getc();
    else
    {
        cout<<"末影龙来了,猛攻!\n";
        for(int i=1;i<=40;i++)
        {
            players.print();
            cout<<"末影龙\n血量:"<<zb.hp<<"\n";
            cout<<"快点攻击!(不含技能)\n";int tmp;
            cin>>tmp;
            if(players.a[tmp].naij)
            {
                players.a[tmp].kill(zb);
                if(rand()%players.ljgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/1.25),players.a[tmp].naij--,cout<<"连击!",players.jie--;
                else if(rand()%players.bjgl==0)zb.hp-=ceil((players.a[tmp].sh+players.a[tmp].fl)*1.0/(1+zb.fy*1.0/20)/2),cout<<"暴击!",players.jie--;
                players.a[tmp].naij--;
                players.sum++;
                if(players.a[tmp].naij<0)players.a[tmp].name="";
            }
            if(zb.hp<=0)break;
        }
        if(zb.hp>0)
        {
            cout<<"你,被末影龙击飞,还剩1滴血";getc();
            cout<<"你吃下附魔金苹果,再次攻击!";getc();
            cout<<"末影龙被你杀死了!!!";getc();
        }
    }
    cout<<"解放末地!";getc();
    players.jy+=1000000;
    cout<<"你:末影龙是打败了,但是Him又去哪里了?";getc();
    win[11]=2;win[12]=1;win[13]=1;
}
void p12()
{
    players.hp=30;
    cout<<"你深入末地,远程折跃";getc();
    cout<<"这时,你发现了一艘末地船,并进入搜刮了物资";getc();
    players.d[1].name="钻石头盔";
    players.d[1].bh=4;
    players.d[1].fy=3;
    players.d[1].naij=1000;
    players.d[3].bh=5;
    cout<<"但是,Grox再次出现!";getc();
    zb.hp=40;zb.fy=90;zb.sh=5;
    pve(players,zb);
    if(players.hp>0)cout<<"你胜利了!";
    else cout<<"you died",exit(0);
    cout<<"你回到了主世界";getc();
    win[12]=2;
}
void p13()
{
    cout<<"Man村村长发现你回来了,惊喜万分,送你了亿点经验(真的100000000点!)";
    getc();players.jy+=100000000;
    cout<<"你是个合格的pvp高手!";getc();
    cout<<"村长说:'不过,Him还没死。'";getc();
    cout<<"你可以大胆一试!";getc();
    win[13]=2;win[14]=1;
}
void p14()
{
    getc();
    cout<<"Him:你终于来了";getch();
    cout<<"再见";getc();
    players.hp=50;
    zb.hp=400;zb.fy=80;zb.sh=7;
    pve(players,zb);
    cout<<"你杀死了Him?";getc();
    cout<<"没有,在最后一刻,Him逃走了";getc();
    players.jy+=100000;
}
void pvp(player &players,int lever)
{
    players.hp=max(players.hp,30);
    zb.hp=20+5*(lever-1);
    zb.sh=1+lever;
    pve(players,zb);
    cout<<"战胜!";getc();
}
void print1()
{
    for(i=1;i<=14;i++)
    {
        cout<<i<<':';
        if(win[i]==2)cout<<p[i]<<" win";
        if(win[i]==1)cout<<p[i]<<" go";
        if(!win[i])cout<<"还未解锁";
        cout<<"\n";
    }
}
void shop()
{
    cout<<"欢迎来到商店";getc();
    while(1)
    {
        cout<<"0退出";
        cout<<"兑换内容:\n钻石*4换不死图腾*1\n铁*4换钻石*1\n";
        cin>>x;
        if(x==0)return ;
        if(x==1&&players.zs>=4)
        {
            players.zs-=4;
            players.bstt++;
        }
        if(x==2&&players.td>=4)
        {
            players.td-=4;
            players.zs++;
        }
    }
}
int main()
{
    srand(time(NULL));
    cout<<"我的世界beta1.12文字游戏";getc();
    cout<<"请下载正版";getc();
    cout<<"请输入游戏名:";cin>>players.name;
    cout<<"嘿,你有存档要读吗?(1,0)";cin>>x;
    if(x==1)players.dd();
    else
    {
        now.name="木剑";now.sh=5;now.naij=60;
        for(int i=1;i<=10;i++)players.a[i].name="";
        addwq(now,players);
        players.foods[1].hf=2;
        players.foods[1].many=8;
        players.foods[3].zl=3;
        cout<<"请选择角色:1,史蒂夫(连击率高);2,艾利克斯(暴击率高)";
        cin>>type;
        if(type==1)players.ljgl=4,players.bjgl=7;
        else players.ljgl=7,players.bjgl=4;
    }
    if(win[10])players.smhf=1;
    p[1]="初来乍到";
    p[2]="白天探索";
    p[3]="夜晚得宝";
    p[4]="披荆斩棘";
    p[5]="兵团pvp!";
    win[6]=1;
    p[6]="PVP";
    p[7]="任务";
    p[8]="传说";
    p[9]="下界之旅·上";
    p[10]="下界之旅·下";
    p[11]="末地屠龙";
    p[12]="深入末地";
    p[13]="庆祝";
    win[1]=1;
    while(1)
    {
        players.jie=20;
        clean();
        print1();
        cout<<"请选择(0是保存并退出):";cin>>x;
        if(x==0)players.cd(),exit(0);
        players.hp=20;
        if(!win[x])cout<<"未解锁";
        else 
        {
            if(x==1)p1();
            if(x==2)p2();
            if(x==3)p3();
            if(x==4)p4();
            if(x==5)p5();
            if(x==6)
            {
                cout<<"请选择怪物等级:";
                cin>>x;
                pvp(players,x);
            }
            if(x==7)p7();
            if(x==8)p8();
            if(x==9)p9();
            if(x==10)p10();
            if(x==11)p11();
            if(x==12)p12();
            if(x==13)p13();
            if(x==14)p14();
            if(x==-1)shop();
        }
    }
}