【C++(游戏程序)】好消息!《荒野乱斗-机器人危机》已正式完成

兄弟们,我虽然来迟了,但还是祝大家新年快乐

耗时两个月,根据B站作者BigSnake-FrostKay的小说《荒野乱斗-机器人危机》改编的游戏已经做好了,以下是游戏代码,由于作者技术有限,会有些缺陷,加上项目开始制作的时间是原作者整改剧情之前,所以剧情会部分不符,谢谢大家

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
#define in input
int suiji(int n){
    srand((unsigned)time(NULL));
    return rand()%n;
}
typedef void (*point)();
int rnum,zhangjie=1,bnum,xnum,input,boolboss=0,boolstory=1,battle=0;
char xingbie='m';
struct player{
    string name;
    int b,hp,lev,_b,__b,_hp,bsum,hpsum;
    int dunbuff,yunbuff,fanjibuff,b_buff,shoushang,chongneng,chongnengsum;
    long long exp,expsum,coin;
}p={"玩家",1600,5400,1,0,0,0,5400,1600,0,0,0,0,0,0,5,0,100,100};
struct brawler{
    string name,skill;
    int b,hp,chongnengsum;
    bool jiesuo;
}h[5]={{"贝尔","雷霆标记",1040,2600,4,1},{"山姆","碎骨指虎",1600,5400,5,1},{"布洛克","摇滚轰炸",1160,2400,6,0},{"P先生","助手出击",1400,2200,5,0},{"巴斯特","蒙太奇",1400,5200,5,0}};
struct boss{
    string name,skill;
    int b,hp,chongnengsum,yun,dunbuff,plusexp,pluscoin;
    bool jiesuo,shoushang;
}r[3]={{"小罗","小心地滑",1980,6400,4,0,0,750,500,0,0}};
boss bshizhuang={"小罗","小心地滑",1980,6400,0,0,0,750,500,0,0};  //失控后的小罗攻击是1级时的1.5倍,血量是1级时的2倍 
struct xiaoguai{
    string name;
    int b,hp,dengji,plusexp,pluscoin;
    bool shoshang,yun;
}robot[12]={{"左轮手枪机器人_初级",630,2000,1,60,55,0,0},{"拳击机器人_初级",260,4800,1,60,55,0,0},{"小型机器人_初级",450,3400,1,60,55,0,0},{"左轮手枪机器人_中级",1130,3600,2,120,100,0,0},{"拳击机器人_中级",1130,6800,2,120,100,0,0},{"小型机器人_中级",720,5400,2,120,100,0,0},{"左轮手枪机器人_高级",1450,4600,3,230,160,0,0},{"拳击机器人_高级",470,11000,3,230,160,0,0},{"小型机器人_高级",960,6900,3,230,160,0,0},{"左轮手枪机器人_终极",1760,6700,4,450,310,0,0},{"拳击机器人_终极",730,16200,4,450,310,0,0 },{"小型机器人_终极",1120,10800,4,450,310,0,0}};
xiaoguai rshizhuang; 
//实在找不到部分机器人的攻击/血量数据,一部分值是自己乱编的,见谅(多 次 测 量 取 平 均 值) 2024-2-4
//输入太多中文,在代码中出现乱码了,但程序应该是正常的 2024-2-4 
struct place{
    const string name;
    bool jiesuo;
};
place difang[3]={"仓库",1,"机器人工厂",1,"雪漫大酒店",0};
place xiaoxi[3]={{"小罗是因为P先生歧视他失控",0},{"小罗失控时的笑声中有8比特的声音",0},{"小罗及其他机器人失控是被人操控",0}};
string voice_luo[3]={"我奉陪到底!","P先生天天压榨我,现在我要反抗!","Feel the freezing!"};
struct goods{
    string name;
    int prize;
    string gong;
    int sum;
}thing[5]={{"麦克斯饮料",15,"恢复600点生命值",3},{"巴利的酒",30,"恢复1200点生命值",3},{"黑鸦飞刀",20,"下次攻击对敌人造成的伤害增加350点生命值(有伤害加成效果时无法使用)",3},{"佩佩手雷",50,"减少敌方2000点生命值",3},{"道格热狗",40,"恢复1600点生命值",3}};
void enter(){
    system("pause");
    system("cls");
}
void enter_(){
    system("pause");
}
void m(){
    cout<<(xingbie=='m'?p.name:"山姆");
}
void f(){
    cout<<(xingbie=='m'?"贝尔":p.name);
}
void expplus(){
    int levplus=0;
    while(1){
        if(p.exp>=p.expsum){
            p.exp-=p.expsum;
            p.expsum+=50;
            p._b+=30;p._hp+=40;p.coin+=50;
            p.bsum+=10;
            p.lev++;
            levplus++;
        }
        else{
            break;
        }
        p.bsum=p.b+p._b+p.__b;
        p.hpsum=p.hp+p._hp;
    }
    if(levplus){
        cout<<p.name;
        printf("升%d级!伤害增加%d,血量增加%d,获得金币%d",levplus,levplus*30,levplus*40,levplus*50);
    } 
}
void zhuangtai(){
    system("cls");
    cout<<"你的名字:"<<p.name<<" 使用的英雄:"<<h[rnum].name<<" 技能:"<<h[rnum].skill<<"\n";
    printf("技能充能状态:%d/%d\n",p.chongneng,p.chongnengsum);
    printf("等级:%d 经验:%lld/%lld\n",p.lev,p.exp,p.expsum);
    cout<<"伤害:"<<p.b<<"+"<<p._b<<"+"<<p.__b<<"="<<p.bsum<<" 伤害加成buff剩余回合:"<<p.b_buff; 
    cout<<"\n健康值:"<<p.hp<<"+"<<p._hp<<"="<<p.hpsum<<"/"<<p.hp+p._hp<<"\n";
    printf("眩晕状态:%d 护盾buff:%d 伤害反弹buff:%d\n",p.yunbuff,p.dunbuff,p.fanjibuff);
    enter();
}
void story1(){
    system("cls");
    cout<<"第一章 机器人造反\n";
    enter();
    cout<<"(战斗过程中,"<<(xingbie=='m'?"你(山姆)":"山姆")<<"因忘记自己的指虎损坏而使用指虎使指虎散架)\n\n";Sleep(750);
    cout<<"战斗一会儿后,"<<(xingbie=='m'?"贝尔":"你(贝尔)")<<"和"<<(xingbie=='m'?"你(山姆)":"山姆")<<"躲进了一个仓库\n\n";Sleep(750);
    cout<<(xingbie=='m'?"你(山姆)":"山姆")<<"(疑惑):这些机器人为什么会失控呢?还把我的指虎给崩掉了。\n\n";enter_();
    cout<<(xingbie=='m'?"贝尔":"你(贝尔)")<<"的手机: 紧急消息,BS大陆的机器人集体失控,看到机器人的幸存者最好躲起来!\n\n";enter_();
    cout<<(xingbie=='m'?"贝尔":"你(贝尔)")<<":怎么办,整个BS大陆的机器人都变得异常,况且我们还捅了老窝……\n\n";enter_();
    cout<<"???:芜!任何邪恶,终将绳之以法!\n\n";enter_();
    cout<<(xingbie=='m'?"贝尔":"你(贝尔)")<<"(生气):山姆,这个时候你就别玩梗了,你指虎都没了,再玩梗我们就比它们先一步被绳之以法了!\n\n";enter_();
    cout<<(xingbie=='m'?"你(山姆)":"山姆")<<":我没说话啊。\n\n";enter_();
    cout<<"一个长得像猴子的人(突然出现):芜!是我啦!\n\n";enter_();
    cout<<(xingbie=='m'?"你(山姆)":"山姆")<<":这位仁兄,请问你是猴吗?\n\n";enter_();
    cout<<"猴人:芜!什么猴,我才不是猴,吃我一… \n\n";Sleep(750);
    cout<<(xingbie=='m'?"你(山姆)":"山姆")<<":(打了猴人一拳)\n\n";enter_();
    cout<<"猴人:大哥大哥,我错了,我叫布洛克,我也是因为机器人的失控才逃出来的。\n\n";enter_();
    cout<<"(与此同时,机器人砸开了仓库门)\n\n";Sleep(750);
    cout<<"(布洛克使用一号随身妙具【火箭助推器】,使三人原地起跳,并轰炸了一片区域破坏了剩余的机器人。)\n\n";enter_();
    cout<<"布洛克(开心):跟着音乐节拍舞动吧\n\n";enter_();
    cout<<(xingbie=='m'?"贝尔":"你(贝尔)")<<":现在还不是舞动的时候,乱斗小镇现在出了乱子,我们必须去查看!\n\n";enter_();
    cout<<"布洛克:芜!等等我!\n\n";enter_();
    cout<<"(来到小镇,他们看到了破烂不堪的一幕。)\n\n";enter();
    cout<<"完成剧情!获得金币*50,经验*10,解锁新角色布洛克,解锁第二章剧情。\n\n";
    p.coin+=50;
    p.exp+=10;
    h[2].jiesuo=1;
    zhangjie++;
    enter();
}
void story2(){
    system("cls");
    cout<<"第二章 暴力P先生\n";
    enter();
    cout<<"(三人来到充满灾难的小镇。)\n\n";Sleep(750);
    m();cout<<":看来不只是工厂的机器人失控了……\n\n";enter_();
    f();cout<<":只凭我们三人是掀不起多大的波澜的,况且山姆的指虎已经损坏… \n\n";enter_();
    m();cout<<"(佩戴上崭新的碎骨指虎):那个,在我们去小镇的途中我顺便把指虎修好了。\n\n";enter_();
    cout<<"(一个机器人出现在";m();cout<<"山姆面前。)\n\n";Sleep(500);
    m();cout<<"(交叉拳):Cross!\n\n";Sleep(500);cout<<"机器人被击退。\n\n";
    Sleep(500);m();cout<<"还发射出指虎,指虎刺穿了机器人,使机器人无法继续运转。\n\n";Sleep(500);
    m();cout<<"(吸回指虎)\n\n";enter_();
    cout<<"布洛克(赞赏):芜!这指虎厉害啊,考虑低价卖给我呗?\n\n";enter_();
    m();cout<<"(给了布洛克一拳):Hook!\n\n";enter_();
    cout<<"一个穿西装的企鹅(出现):三位兄贵救救我!\n\n";enter_();
    cout<<"布洛克:嗯?P先生?你不在雪漫大酒店看着你那两个员工跑出来干什么?\n\n";enter_();
    cout<<"(P先生是雪漫大酒店的老板兼行李搬运工,因真实姓名不详,所以大家都叫他P先生。)\n\n";Sleep(500);
    cout<<"布洛克:不用废话了,我们送你回雪漫大...\n\n";Sleep(500);
    cout<<"P先生(愤怒地将行李箱砸在布洛克身上。)\n(策划:日常迫害布洛克。)\n\n";Sleep(750);
    cout<<"P先生:我有一个机器人员工在酒店造反,我无奈之下只能逃出来。\n\n";enter_();
    m();cout<<"(将事情的经过讲给P先生。)\n\n";Sleep(500);
    cout<<"P先生:机器人失控?为什么我不知道这件事?\n\n";enter_();
    m();cout<<":现在该考虑的是我们的安全,因为有一群持枪的机器人向我们走来了!\n\n";Sleep(750);
    cout<<"(一群持左轮手枪的机器人向他们走来。)\n\n";enter_();
    cout<<"布洛克(思维混乱):现在我们怎么办?\n\n";enter_();
    cout<<"P先生(拿着一个行李箱狠狠地砸向机器人):你们想知道我是怎么搬运行李的吗?我就是这么搬运行李的!\n\n";enter_();
    cout<<"(P先生的行李箱砸毁了无数个机器人。)\n\n";Sleep(500);
    cout<<"(随后P先生架设了一个基地,里面钻出了无数个小小P。)\n\n";Sleep(500);
    cout<<"P先生:我编程两年半的基地啊,出来吧,小小P大军!\n(策划:小黑籽是吧)\n\n";Sleep(500);
    cout<<"(小小P喷射的子弹和P先生扔出的行李箱,轻松把机器人们全部消灭。)\n\n";
    cout<<"(众人往雪漫大酒店的方向走。)";enter_();
    f();cout<<":老P我记得你还有个员工来着。 \n\n";enter_();
    cout<<"P先生(自责):对啊,我怎么把他忘了?我太不称职了,居然把他忘掉了…\n\n";enter_();
    f();cout<<":现在不是自责的时候,快去雪漫大酒店!\n\n";Sleep(500);
    cout<<"(众人往雪漫大酒店的方向走。)\n\n";enter_();
    cout<<"(到了雪漫大酒店,P先生没有管他们,直接冲进酒店,看自己的员工。)\n\n";enter_();
    cout<<"P先生:格尔!小罗!\n\n";enter_();
    cout<<"(格尔躲在角落里,而小罗却在大闹酒店。)\n\n";enter_();
    cout<<"小罗:P先生我要你痛不欲生!我要让你失去雪漫大酒店!\n\n";enter_();
    cout<<"P先生(向小罗那边跑去):我去阻止他,你们快去救格尔!小罗,停下你的行为!";enter();
    cout<<"完成剧情!获得金币*50,经验*10,解锁新角色P先生,解锁新地方P先生的酒店,遇见新boss小罗,打败小罗后解锁第三章剧情。\n\n";
    p.coin+=50;
    p.exp+=10;
    h[3].jiesuo=1;
    boolstory=0;
    difang[2].jiesuo=1;
    boolboss=1;
    zhangjie++;
    bnum=0;
    enter();
}
point story[3]={story1,story2};
void boss1(){
                                int freez=0;
                                system("cls");
                                bshizhuang=r[0];
                                bshizhuang.chongnengsum=0;
                                xuanze:
                                printf("小罗:这是我的个人恩怨,轮不到你们插手!\n现在退缩还来得及,输入1开战,输入0逃跑");
                                cin>>input;
                                xiaoxi[0].jiesuo=1;
                                xiaoxi[1].jiesuo=1;
                                if(!(input==1||input==0)){
                                    printf("\n\n小罗:只有两个选项,你还想选C吗!!!\n(策划:材料题:材料没涉及的,请在答题卡上填“C”(doge))\n(小罗:谁问你了?再问先收拾你)\n(HomeStarling534:我问的(doge)\n(小罗:差不多得了,你们策划组偏题了,回归正题!)\n\n");
                                    enter();  //最偏题的一集 
                                    goto xuanze;
                                }
                                else if(input==0){
                                    printf("\n\n小罗:算你识相\n\n");
                                    enter();
                                    return ;
                                }
                                else{
                                    printf("\n\n小罗:既然你们非要打仗,那我就成全你们!\n\n");
                                    enter();
                                }
                                while(1){
                                    zhandou:
                                    cout<<bshizhuang.name<<"扑了过来!\n\n\n";
                                    battle:
                                    if(!p.yunbuff){
                                        printf("该怎么办?\n\n1.攻击 2.使用技能(技能充能状态:%d/%d) 3.使用道具 \n4.查看状态(冰冻值:%d/7) 5.查看boss状态  6.逃跑",p.chongneng,p.chongnengsum,freez);
                                        cin>>input;
                                        switch(input){
                                            case 1:{
                                                bshizhuang.hp-=p.bsum;
                                                if(p.chongneng<p.chongnengsum) p.chongneng++;
                                                if(p.b_buff){
                                                    p.b_buff--;
                                                    if(!p.b_buff) p.__b=0;
                                                }                                    
                                                printf("\n\n成功对敌人造成%d点伤害!\n\n",p.bsum);
                                                enter();
                                                goto jiqiren;
                                                break;
                                            }
                                            case 2:{
                                                if(p.chongneng==p.chongnengsum){
                                                    p.chongneng=0;
                                                    switch(rnum){
                                                        case 0:{
                                                            if(p.b_buff){
                                                                printf("\n\n该技能无法在有攻击加成buff时使用...\n\n");
                                                                enter();                                                                
                                                            }
                                                            else{
                                                                p.b_buff+=2;
                                                                p.__b+=500;
                                                                p.bsum=p.b+p._b+p.__b;
                                                                printf("\n\n成功标记敌人,两回合内普攻伤害增加500\n\n");
                                                                enter();                                                            
                                                            }
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 1:{
                                                            bshizhuang.hp-=1200;
                                                            printf("\n\n成功对敌人造成1200伤害\n\n");
                                                            enter();
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 2:{
                                                            bshizhuang.hp-=2080;
                                                            printf("\n\n成功对敌人造成2080伤害\n\n");
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 3:{
                                                            if(p.b_buff){
                                                                printf("\n\n该技能无法在有攻击加成buff时使用...\n\n");
                                                                enter();                                                                
                                                            }
                                                            else{
                                                                p.b_buff+=3;
                                                                p.__b+=260;
                                                                p.hpsum=p.hp+p._hp-p.hpsum>1400?p.hpsum+1400:p.hp+p._hp;
                                                                p.bsum=p.b+p._b+p.__b;
                                                                printf("\n\n成功使用技能,血量增加1400,3回合内普攻伤害增加260\n\n");
                                                                enter();                                                            
                                                            }
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 4:{
                                                            p.fanjibuff+=2;
                                                            printf("\n\n成功获得2回合伤害反弹buff\n\n");
                                                            enter();
                                                            break;
                                                        }
                                                    }                                                    
                                                }
                                                else{
                                                    printf("\n\n技能未充满\n\n");
                                                    enter();
                                                    goto battle;
                                                }
                                                break;
                                            }
                                            case 3:{
                                                system("cls");
                                                cout<<"金币:"<<p.coin<<"\n";
                                                cout<<"道具:";
                                                for(int i=0;i<=4;i++){
                                                    cout<<i+1<<"."<<thing[i].name<<":"<<thing[i].sum<<" ";
                                                }
                                                cout<<"\n\n输入物品对应数字使用物品,输入其他数字返回\n";
                                                cin>>input;
                                                if(1<=input&&input<=5){
                                                    if(thing[input-1].sum>0){
                                                        switch (input){
                                                        case 1:
                                                            p.hpsum=(p.hp+p._hp-p.hpsum>=600)?p.hpsum+600:p.hp+p._hp; 
                                                            thing[0].sum--;
                                                            cout<<"血量增加600,麦克斯饮料-1\n\n";
                                                            goto battle;
                                                            break;
                                                        case 2:
                                                            p.hpsum=(p.hp+p._hp-p.hpsum>=1200)?p.hpsum+1200:p.hp+p._hp;
                                                            thing[1].sum--;
                                                            cout<<"血量增加1200,巴利的酒-1\n\n";
                                                            goto battle;
                                                            break;
                                                        case 3:
                                                            if(!p.__b){
                                                                p.__b=350;p.b_buff++;p.bsum=p.b+p._b+p.__b;
                                                                if(p.chongneng<p.chongnengsum) p.chongneng++;
                                                                thing[2].sum--;
                                                                printf("伤害增加成功!\n\n伤害:%d\n\n",p.bsum);
                                                            }
                                                            else{
                                                                printf("有伤害加成buff,暂时无法使用该道具\n\n伤害buff剩余回合:%d\n\n",p.b_buff);
                                                            }
                                                            goto battle;
                                                            break;
                                                        case 4:
                                                            bshizhuang.hp-=2000;
                                                            thing[3].sum--;
                                                            printf("成功对敌人造成2000伤害!\n\n");
                                                            enter();
                                                            goto jiqiren;
                                                            break;
                                                        case 5:
                                                            p.hpsum=(p.hp+p._hp-p.hpsum>=1600)?p.hpsum+1600:p.hp+p._hp;
                                                            thing[4].sum--;
                                                            cout<<"血量增加1600,道格热狗-1\n\n";
                                                            break;
                                                        }
                                                    }
                                                    else cout<<"物品数量不足...\n\n";
                                                }
                                                else{
                                                    system("cls");
                                                    goto battle;
                                                    break;
                                                }
                                                enter();
                                                goto battle;
                                                break;
                                            }
                                            case 4:{
                                                zhuangtai();
                                                goto battle;
                                                break;
                                            }
                                            case 5:{
                                                system("cls");
                                                  cout<<"boss:"<<bshizhuang.name;
                                                cout<<"\n伤害:"<<bshizhuang.b;
                                                cout<<"\n健康值:"<<bshizhuang.hp<<"/"<<r[bnum].hp<<"\n";
                                                printf("眩晕状态:%d\n技能充能状态:%d/%d\n",bshizhuang.yun,bshizhuang.chongnengsum,r[bnum].chongnengsum);
                                                enter();
                                                goto battle;
                                                break;
                                            }
                                            case 6:{
                                                system("cls");
                                                printf("逃跑成功!\n\n");
                                                enter();
                                                goto jieshu;
                                            }
                                        } 
                                    }
                                    else{
                                        printf("\n\n处于眩晕状态,无法攻击\n眩晕状态:%d",p.yunbuff);
                                        p.yunbuff--;
                                        enter();
                                    }
                                    jiqiren:
                                    system("cls");
                                    if(!bshizhuang.yun){
                                        if(bshizhuang.hp>0){
                                            if(bshizhuang.chongnengsum==r[bnum].chongnengsum){
                                                p.yunbuff=1;
                                                bshizhuang.chongnengsum=0;
                                                printf("小罗使用技能");
                                                cout<<bshizhuang.skill;
                                                printf(",对你造成1回合眩晕效果\n\n"); //因为时间有限,没有做小罗技能真正的效果(逐渐增加攻击目标的冰冻值),而是直接让敌人眩晕,见谅 
                                                freez=7;
                                                p.yunbuff=1;
                                                cout<<"小罗:"<<voice_luo[suiji(3)]<<"\n";
                                                enter();
                                            }
                                            else{
                                                if(p.dunbuff) {
                                                p.dunbuff--;
                                                printf("\n\nboss反击,但被你的护盾挡住了\n\n护盾buff剩余回合:%d\n\n",p.dunbuff);
                                                enter();
                                                }
                                                else if(p.fanjibuff){
                                                    p.fanjibuff--;
                                                    bshizhuang.hp-=bshizhuang.b;
                                                    printf("\n\nboss反击,但因为你的伤害反弹buff受到%d点伤害\n\n伤害反弹buff剩余回合:%d\n\n",bshizhuang.b,p.fanjibuff);
                                                    if(rshizhuang.hp<=0){
                                                        goto win;
                                                    }
                                                    enter();
                                                } 
                                                else{
                                                    p.hpsum-=bshizhuang.b;
                                                    printf("\n\nboss反击!造成%d伤害\n\n",bshizhuang.b);
                                                    freez=7-freez>=3?freez+3:7;
                                                    bshizhuang.chongnengsum++;
                                                    if(freez==7&&p.yunbuff==0){
                                                        p.yunbuff=1;
                                                        printf("冰冻值已满,小罗对你造成眩晕效果!\n\n");
                                                        freez=0; 
                                                    }
                                                    else printf("小罗攻击对你造成3点冰冻值\n\n");
                                                    cout<<"小罗:"<<voice_luo[suiji(3)]<<"\n";
                                                    enter();
                                                }
                                                if(p.hpsum<=0){
                                                    printf("血量为0,战斗失败...\n\n");
                                                    p.hpsum=p.hp+p._hp;
                                                    enter();
                                                    break;
                                                }
                                                }
                                            }
                                            else{
                                                win:
                                                system("cls");
                                                p.exp+=bshizhuang.plusexp,p.coin+=bshizhuang.pluscoin,boolstory=1,boolboss=0;
                                                printf("小罗:难道...这就是我的命运吗...\n\n");
                                                Sleep(500);
                                                printf("小罗:我只是...想为我自己讨个公道啊...\n\n");
                                                Sleep(500);                                            
                                                printf("小罗:我终究...还是一败涂地...\n");
                                                Sleep(500);    
                                                printf("\n\n战斗胜利!获得经验%d,金币%d,解锁下一章剧情\n\n",bshizhuang.plusexp,bshizhuang.pluscoin);
                                                expplus();
                                                enter();
                                                break;
                                            }
                                        }
                                        else{
                                            printf("\n\n机器人处于眩晕状态,无法攻击\n\n");
                                            enter();
                                        }
                                    }    
                                jieshu:
                                return ;
}
point battleboss[1]={boss1};
int main(){
    p.dunbuff=0,p.b_buff=0,p.exp=0,p.yunbuff=0;
    p.lev=1,p.expsum=100;
    for(int i=1;i<=29;++i){
        cout<<"\n\n\n\n\n\n\n                                  Loading......\n                         ";
        for(int j=1;j<=i;++j) cout<<"-";
        cout<<"=>";
        for(int j=1;j<=29-i;++j) cout<<"_";
        system("cls");
    }
    for(int i=1;i<=37;i++) printf(" ");
    printf("公告栏\n");
    printf("亲爱的朋友们:\n    由于原作者FK对剧情进行整改,而本游戏于原作者整改前开始制作,部分剧情会与小说不符,第三、四章剧情、第四章boss迪克以及其他必要的更新也没能做出来,请见谅,谢谢\n    祝\n游戏愉快!\n");
    for(int i=1;i<=52;i++) printf(" ");
    printf("你们的策划/程序猿:程序猿杰瑞\n"); 
    for(int i=1;i<=72;i++) printf(" ");
    printf("2024/2/8\n");
    enter();
    printf("\n\n\n欢迎来到《荒野乱斗-机器人危机!》\n(原作者:BigSnake-FrostKay(FK) 策划兼程序员:禾呈序猿杰瑞)\n\n");
    Sleep(1000);
    printf("月黑风高之下,山姆和贝尔准备返回金臂帮的基地。山姆的指虎已经损坏,要回去修理\n\n然而,机器人工厂的机器人突然失控......\n\n");
    Sleep(1000);
    printf("玩家们,你们做好战斗和发掘真相的准备了吗?\n\n\n");
    for(int i=1;i<=33;i++) printf(" ");
    printf("健康游戏忠告:\n");
    for(int i=1;i<=26;i++) printf(" ");
    printf("抵制不良游戏,拒绝盗版游戏。\n");
    for(int i=1;i<=26;i++) printf(" ");
    printf("注意自我保护,谨防受骗上当。\n");
    for(int i=1;i<=26;i++) printf(" ");
    printf("适度游戏益脑,沉迷游戏伤身。\n");
    for(int i=1;i<=26;i++) printf(" ");
    printf("合理安排时间,享受健康生活。\n");
    enter();
    printf("(温馨提示:1.输入数字时,不要输入大于2147483647或小于-2147483648的数或输入非数字的字符 2.输入字符串时,不要打空格 否则程序会卡住!)");
    Sleep(2000);
    enter();
    flag1:
    printf("您的性别(输入m:男 输入f(大小写敏感):女 性别决定初始角色(男山姆,女贝尔))");
    cin>>xingbie;
    if(xingbie=='m'){
        p.b=h[1].b,p.hp=h[1].hp,p.chongneng=0,p.chongnengsum=h[1].chongnengsum,p.hpsum=h[1].hp,p.bsum=h[1].b;
        rnum=1;
    }
    else if(xingbie=='f'){
        p.b=h[0].b,p.hp=h[0].hp,p.chongneng=0,p.chongnengsum=h[0].chongnengsum,p.hpsum=h[0].hp,p.bsum=h[0].b;
        rnum=0;
    }
    else{
        printf("\n\n\n输入错误...");
        Sleep(1000);
        system("cls");
        goto flag1;
        }
    flag2:
    system("cls");
    printf("\n\n\n您的名字(不超过10字)");
    cin>>p.name;
    if(p.name.length()<=20){
        printf("\n\n\n开始游戏!");
        enter();
    }
    else{
        printf("名字超过10字!");
        enter();
        goto flag2;
    }
    while(1){
        printf("输入你的操作:\n1.查看剧情 2.与本章boss决战 3.对话 4.移动 5.背包\n6.查看状态 7.查看/切换角色 8.关于我们 9.查看作者日志");
        cin>>input;
        switch(input){
            case 1:{
                system("cls");
                if(boolstory){
                    if(1<=zhangjie&&zhangjie<=2){
                        story[zhangjie-1]();
                    }
                    else{
                        cout<<"暂时没有新的剧情...\n\n\n";
                        enter();
                    }
                }
                else{
                    cout<<"暂时没有剧情,请先打败本章boss或等新版本更新章节\n\n\n";
                    enter();
                }
                break;
            }
            case 2:{
                system("cls");
                if(boolboss){
                    system("cls");
                    battleboss[bnum]();
                }
                else{
                    printf("暂时没有boss...\n\n");
                    enter();                    
                }
                break;
            }
            case 3:{
                printf("你要和谁对话?\n1.机器人向导帕哲 其他数字:退出");
                cin>>input;
                system("cls");
                switch(input){
                    case 1:{
                        printf("帕哲:你好,我是这里的向导,别问我为什么没有失控,谁让策划让我当NPC的\n");
                        Sleep(500);
                        printf("帕哲:你想干什么?1.查看已知消息 其他:退出");
                        cin>>input;
                        switch(input){
                            case 1:{
                                for(int i=0;i<=2;i++) if(xiaoxi[i].jiesuo) cout<<1<<"."<<xiaoxi[i].name<<'\n';
                                enter();
                                break;
                            }
                            default:{
                                system("cls");
                                break;
                            }
                        }
                        break;
                    }
                    default:{
                        system("cls");
                        break;
                    }
                }
                break;
            }
            case 4:{
                system("cls");
                printf("你要去哪里?\n");
                for(int i=0;i<=2;++i){
                    cout<<i+1<<"."<<difang[i].name<<(difang[i].jiesuo?"\n":"(未解锁)\n");
                }
                cin>>input;
                if(1<=input&&input<=3){
                    if(difang[input-1].jiesuo){
                        switch (input) {
                        case 1:
                            system("cls");
                            cout<<"这里是仓库,用金币交换物资,买点什么?\n";
                            for(int i=0;i<=4;++i){
                                cout<<i+1<<"、"<<thing[i].name<<"(价格:"<<thing[i].prize<<" "<<thing[i].gong<<"\n";
                            }
                            cout<<"其他数字:退出\n";
                            cin>>input;
                            if(1<=input&&input<=5){
                                if(p.coin>=thing[input-1].prize){
                                    thing[input-1].sum++;
                                    p.coin-=thing[input-1].prize;
                                    cout<<thing[input-1].name<<":"<<thing[input-1].sum;
                                    cout<<"\n金币:"<<p.coin<<"\n";
                                    enter();
                                }
                                else{
                                    cout<<"金币不足...\n";
                                    enter();
                                }
                            }
                            else{
                                cout<<"\n\n欢迎下次光临!\n";
                                enter();
                            }
                            break;
                        case 2:
                            system("cls");                                            
                            printf("请选择你想去的工厂区域:\n\n1.初级区域\n2.中级区域\n3.高级区域\n4.终极区域\n\n其他数字:退出");
                            cin>>input;                
                            system("cls");
                            if(1<=input&&input<=4){
                                system("cls");
                                xnum=suiji(3)+(input-1)*3;
                                rshizhuang=robot[xnum];
                                while(1){
                                    zhandou:
                                    cout<<rshizhuang.name<<"扑了过来!\n\n\n";
                                    battle:
                                    if(!p.yunbuff){
                                        printf("该怎么办?\n\n1.攻击 2.使用技能(技能充能状态:%d/%d) 3.使用道具 \n4.查看状态 5.查看机器人状态  6.逃跑",p.chongneng,p.chongnengsum);
                                        cin>>input;
                                        switch(input){
                                            case 1:{
                                                rshizhuang.hp-=p.bsum;
                                                if(p.chongneng<p.chongnengsum) p.chongneng++;
                                                if(p.b_buff){
                                                    p.b_buff--;
                                                    if(!p.b_buff) p.__b=0;
                                                }                                    
                                                printf("\n\n成功对敌人造成%d点伤害!\n\n",p.bsum);
                                                enter();
                                                goto jiqiren;
                                                break;
                                            }
                                            case 2:{
                                                if(p.chongneng==p.chongnengsum){
                                                    p.chongneng=0;
                                                    switch(rnum){
                                                        case 0:{
                                                            if(p.b_buff){
                                                                printf("\n\n该技能无法在有攻击加成buff时使用...\n\n");
                                                                enter();                                                                
                                                            }
                                                            else{
                                                                p.b_buff+=2;
                                                                p.__b+=500;
                                                                p.bsum=p.b+p._b+p.__b;
                                                                printf("\n\n成功标记敌人,两回合内普攻伤害增加500\n\n");
                                                                enter();                                                            
                                                            }
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 1:{
                                                            rshizhuang.hp-=1200;
                                                            printf("\n\n成功对敌人造成1200伤害\n\n");
                                                            enter();
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 2:{
                                                            rshizhuang.hp-=2080;
                                                            printf("\n\n成功对敌人造成2080伤害\n\n");
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 3:{
                                                            if(p.b_buff){
                                                                printf("\n\n该技能无法在有攻击加成buff时使用...\n\n");
                                                                enter();                                                                
                                                            }
                                                            else{
                                                                p.b_buff+=3;
                                                                p.__b+=260;
                                                                p.hpsum=p.hp+p._hp-p.hpsum>1400?p.hpsum+1400:p.hp+p._hp;
                                                                p.bsum=p.b+p._b+p.__b;
                                                                printf("\n\n成功使用技能,血量增加1400,3回合内普攻伤害增加260\n\n");
                                                                enter();                                                            
                                                            }
                                                            goto battle;
                                                            break;
                                                        }
                                                        case 4:{
                                                            p.fanjibuff+=2;
                                                            printf("\n\n成功获得2回合伤害反弹buff\n\n");
                                                            enter();
                                                            break;
                                                        }
                                                    }                                                    
                                                }
                                                else{
                                                    printf("\n\n技能未充满\n\n");
                                                    enter();
                                                    goto battle;
                                                }
                                                break;
                                            }
                                            case 3:{
                                                system("cls");
                                                cout<<"金币:"<<p.coin<<"\n";
                                                cout<<"道具:";
                                                for(int i=0;i<=4;i++){
                                                    cout<<i+1<<"."<<thing[i].name<<":"<<thing[i].sum<<" ";
                                                }
                                                cout<<"\n\n输入物品对应数字使用物品,输入其他数字返回\n";
                                                cin>>input;
                                                if(1<=input&&input<=5){
                                                    if(thing[input-1].sum>0){
                                                        switch (input){
                                                        case 1:
                                                            p.hpsum=(p.hp+p._hp-p.hpsum>=600)?p.hpsum+600:p.hp+p._hp; 
                                                            thing[0].sum--;
                                                            cout<<"血量增加600,麦克斯饮料-1\n\n";
                                                            goto battle;
                                                            break;
                                                        case 2:
                                                            p.hpsum=(p.hp+p._hp-p.hpsum>=1200)?p.hpsum+1200:p.hp+p._hp;
                                                            thing[1].sum--;
                                                            cout<<"血量增加1200,巴利的酒-1\n\n";
                                                            goto battle;
                                                            break;
                                                        case 3:
                                                            if(!p.__b){
                                                                p.__b=350;p.b_buff++;p.bsum=p.b+p._b+p.__b;
                                                                if(p.chongneng<p.chongnengsum) p.chongneng++;
                                                                thing[2].sum--;
                                                                printf("伤害增加成功!\n\n伤害:%d\n\n",p.bsum);
                                                            }
                                                            else{
                                                                printf("有伤害加成buff,暂时无法使用该道具\n\n伤害buff剩余回合:%d\n\n",p.b_buff);
                                                            }
                                                            goto battle;
                                                            break;
                                                        case 4:
                                                            rshizhuang.hp-=2000;
                                                            thing[3].sum--;
                                                            printf("成功对敌人造成2000伤害!\n\n");
                                                            enter();
                                                            goto jiqiren;
                                                            break;
                                                        case 5:
                                                            p.hpsum=(p.hp+p._hp-p.hpsum>=1600)?p.hpsum+1600:p.hp+p._hp;
                                                            thing[4].sum--;
                                                            cout<<"血量增加1600,道格热狗-1\n\n";
                                                            break;
                                                        }
                                                    }
                                                    else cout<<"物品数量不足...\n\n";
                                                }
                                                else{system("cls");break;}
                                                enter();
                                                goto battle;
                                                break;
                                            }
                                            case 4:{
                                                zhuangtai();
                                                goto battle;
                                                break;
                                            }
                                            case 5:{
                                                system("cls");
                                                  cout<<"机器人:"<<rshizhuang.name;
                                                printf("等级:%d\n",rshizhuang.dengji);
                                                cout<<"伤害:"<<rshizhuang.b;
                                                cout<<"\n健康值:"<<rshizhuang.hp<<"/"<<robot[xnum].hp<<"\n";
                                                printf("眩晕状态:%d\n",rshizhuang.yun);
                                                enter();
                                                goto battle;
                                                break;
                                            }
                                            case 6:{
                                                system("cls");
                                                printf("逃跑成功!\n\n");
                                                enter();
                                                goto jieshu;
                                            }
                                        } 
            
                                    }
                                    else{
                                        printf("\n\n处于眩晕状态,无法攻击\n眩晕状态:%d",p.yunbuff);
                                        p.yunbuff--;
                                        enter();
                                    }
                                    jiqiren:
                                    system("cls");
                                    if(!rshizhuang.yun){
                                        if(rshizhuang.hp>0){
                                            if(p.dunbuff) {
                                                p.dunbuff--;
                                                printf("\n\n机器人反击,但被你的护盾挡住了\n\n护盾buff剩余回合:%d\n\n",p.dunbuff);
                                                enter();
                                            }
                                            else if(p.fanjibuff){
                                                p.fanjibuff--;
                                                rshizhuang.hp-=rshizhuang.b;
                                                printf("\n\n机器人反击,但因为你的伤害反弹buff受到%d点伤害\n\n伤害反弹buff剩余回合:%d\n\n",rshizhuang.b,p.fanjibuff);
                                                if(rshizhuang.hp<=0){
                                                    goto win;
                                                }
                                                enter();
                                            } 
                                            else{
                                                p.hpsum-=rshizhuang.b;
                                                printf("\n\n机器人反击!造成%d伤害\n\n",rshizhuang.b);
                                                enter();
                                            }
                                            if(p.hpsum<=0){
                                                printf("血量为0,战斗失败...\n\n");
                                                p.hpsum=p.hp+p._hp;
                                                enter();
                                                break;
                                            }
                                        }
                                        else{
                                            win:
                                            system("cls");
                                            p.exp+=rshizhuang.plusexp,p.coin+=rshizhuang.pluscoin;
                                            printf("\n\n战斗胜利!获得经验%d,金币%d\n\n",rshizhuang.plusexp,rshizhuang.pluscoin);
                                            expplus();
                                            enter();
                                            break;
                                        }
                                    }
                                    else{
                                        printf("\n\n机器人处于眩晕状态,无法攻击\n\n");
                                        enter();
                                    }
                                }
                            }    
                            jieshu:
                            break;
                        case 3:
                            system("cls");
                            cout<<"格尔:你是?\n";
                            Sleep(500);
                            printf("格尔:原来是你呀,孩子!这才过去多久,差点认不出你了\n\n");                            
                            room:
                            printf("格尔:100金币就可以住上一晚上,回满健康值,是否开房?金币:%lld 1.是 0.否",p.coin);
                            cin>>input;
                            if(input==1){
                                if(p.coin>=100){
                                    p.coin-=100;
                                    cout<<"\n\n格尔:P先生叫我,我先走了。晚安,睡个好觉!\n\n\n";
                                    p.hpsum=p.hp+p._hp;
                                    Sleep(1000);
                                    printf("第二天\n\n\n");
                                    Sleep(200);
                                    printf("健康值已满 健康值:%d\n\n金币:%lld\n\n\n",p.hpsum,p.coin);
                                    enter();                                
                                }
                                else{
                                    cout<<"\n\n金币不足...\n\n";
                                    enter();
                                }
                            }
                            else if(input==0){
                                cout<<"格尔:欢迎下次再来!\n";
                                enter();
                            }
                            else{
                                cout<<"输入错误...";
                                enter();
                                goto room;
                            }
                            break;
                        }
                    }
                    else{
                        cout<<"该区域未解锁...\n\n";
                        enter();
                    }
                }
                else{
                    cout<<"\n\n暂时没有该区域...\n\n";
                    enter();
                }
                break;
            }
            case 5:{
                system("cls");
                cout<<"金币:"<<p.coin<<"\n";
                cout<<"道具:";
                for(int i=0;i<=4;i++){
                    cout<<i+1<<"."<<thing[i].name<<":"<<thing[i].sum<<" ";
                }
                cout<<"\n\n输入物品对应数字使用物品,输入其他数字返回\n";
                cin>>input;
                if(1<=input&&input<=5){
                    if(thing[input-1].sum>0){
                        switch (input){
                        case 1:
                            p.hpsum=(p.hp+p._hp-p.hpsum>=600)?p.hpsum+600:p.hp+p._hp; 
                            thing[0].sum--;
                            cout<<"血量增加600,麦克斯饮料-1\n\n";
                            break;
                        case 2:
                            p.hpsum=(p.hp+p._hp-p.hpsum>=1200)?p.hpsum+1200:p.hp+p._hp;
                            thing[1].sum--;
                            cout<<"血量增加1200,巴利的酒-1\n\n";
                            break;
                        case 3:
                            cout<<"非战斗状态,无法使用该道具\n\n";
                            break;
                        case 4:
                            cout<<"非战斗状态,无法使用该道具\n\n";
                            break;
                        case 5:
                            p.hpsum=(p.hp+p._hp-p.hpsum>=1600)?p.hpsum+1600:p.hp+p._hp;
                            thing[0].sum--;
                            cout<<"血量增加1600,道格热狗-1\n\n";
                            break;
                        }
                    }
                    else cout<<"物品数量不足...\n\n";
                }
                else{
                    system("cls");
                    break;
                }
                enter();
                break;
            }
            case 6:{
                zhuangtai();
                break;
            }
            case 7:{
                system("cls");
                cout<<"贝尔:"<<(h[0].jiesuo?"(已解锁)":"(未解锁)");
                printf(":攻击:%d 生命值:%d 技能充能所需普攻次数:%d\n技能:",h[0].b,h[0].hp,h[0].chongnengsum);
                cout<<h[0].skill<<":"<<"标记敌人,提升500伤害,持续2回合\n";
                cout<<"山姆:"<<(h[1].jiesuo?"(已解锁)":"(未解锁)");
                printf(":攻击:%d 生命值:%d 技能充能所需普攻次数:%d\n技能:",h[1].b,h[1].hp,h[1].chongnengsum);
                cout<<h[1].skill<<":"<<"对敌人造成1200伤害\n";
                cout<<"布洛克:"<<(h[2].jiesuo?"(已解锁)":"(未解锁)");
                printf(":攻击:%d 生命值:%d 技能充能所需普攻次数:%d\n技能:",h[2].b,h[2].hp,h[2].chongnengsum);
                cout<<h[2].skill<<":"<<"对敌人造成2080伤害\n";
                cout<<"P先生:"<<(h[3].jiesuo?"(已解锁)":"(未解锁)");
                printf(":攻击:%d 生命值:%d 技能充能所需普攻次数:%d\n技能:",h[3].b,h[3].hp,h[3].chongnengsum);
                cout<<h[3].skill<<":"<<"血量恢复1400;伤害提升260,持续3回合\n";
                cout<<"巴斯特:"<<(h[4].jiesuo?"(已解锁)":"(未解锁)");
                printf(":攻击:%d 生命值:%d 技能充能所需普攻次数:%d\n技能:",h[4].b,h[4].hp,h[4].chongnengsum);
                cout<<h[4].skill<<":"<<"获得伤害反弹buff,持续2回合\n";                                        
                printf("输入对应数字切换你想切换的英雄:\n");
                for(int i=0;i<=4;i++) cout<<i+1<<"."<<h[i].name<<(h[i].jiesuo?"(已解锁)":"(未解锁)")<<" ";
                printf("\n其他数字:退出");
                cin>>input;
                if(1<=input&&input<=5){
                    if(h[input-1].jiesuo){
                        p.b=h[input-1].b,p.chongneng=0,p.chongnengsum=h[input-1].chongnengsum,p.bsum=h[input-1].b+p._b+p.__b;
                        int SWAP=p.hp+p._hp-p.hpsum;
                        p.hp=h[input-1].hp,p.hpsum=p.hp+p._hp-SWAP;
                        rnum=input-1;
                        printf("\n\n切换成功!\n");
                        enter();
                    }
                    else{
                        printf("\n\n该英雄未解锁...\n\n");
                        enter();
                    }
                }
                else system("cls");                                
                break;
            }
            case 8:{
                system("cls");
                cout<<"感谢帽子们的支持!我们会做得更好!(帽子是FrostKay对粉丝的称呼)\n\n\n"<<"小说原作者:BigSnakeFrostKay 策划/程序:禾呈序猿杰瑞 \n程序部分参与:HomeStarling534(策划的信奥班好朋友)\n\n\n同时,也感谢原作者BigSnakeFrostKay的建议和信奥班老师的指点,以及部分朋友提供的英雄数据!\n\n\n";
                enter();
                break;
            }
            case 9:{
                system("cls");
                for(int i=1;i<=34;i++) printf(" ");
                printf("策划的工作日志\n\n");
                printf("2023/12/4:开始产生该项目的灵感\n");
                printf("2023/12/10:获得原作者BigSnakeFrostKay的同意,发布第一个宣传片\n");
                printf("2023/12/11~2023/12/15:完成剧情部分->第一章\n");
                printf("2023/12/17:发布第二个宣传片\n");
                printf("2023/12/24:完成移动部分->仓库,正式入驻CSDN,发布第三个宣传片\n");
                printf("接下来的时间直到2024/1/17,备战期末考,项目暂停\n");
                printf("2024/1/20~2024/1/27:虽然不补课了,但因作业较多,这段时间项目基本没动,除2024/1/22完成第二章剧情\n");
                printf("2024/1/28~2024/1/31:完成移动部分->雪曼大酒店,道具使用,状态查看,英雄切换\n");
                printf("2024/2/3~2024/2/4:搜集机器人攻击、生命值数据,最终部分数据收集不到,所以部分数据并非原游戏《荒野乱斗》中的机器人小怪的真实数据,见谅\n");
                printf("2024/2/4~2024/2/6:完成移动->机器人工厂的与机器人的战斗,在加载界面添加健康游戏忠告\n");
                printf("2024/2/7:检查并修复bug、完成与boss决战的部分,写公告栏\n");
                printf("2024/2/8:检查并修复bug、完成与NPC对话的部分、做最后的完善、写工作日志\n");
                printf("因为本人技术有限,C++版暂时没有能力做出图画,只有文字,见谅,感谢大家的支持!\n");
                enter();
                break;
            } 
            default:
                printf("\n\n\n输入错误...");
                Sleep(750);
                system("cls");
                break;
        }
    }
    return 0;
}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值