c++文字游戏_废弃医院篇2.0

简介
玩家在游戏中控制一个角色在废弃医院中进行探险和战斗。以下是这个游戏的玩法说明:

起始设置:玩家在废弃医院的房间中醒来,可以选择与旁边的熟睡人互动或离开房间。选择离开房间后,玩家获得一根木棍和一些金币,可以选择拿上木棍,开始冒险之旅。

战斗系统:玩家会遇到不同种类的丧尸,如日本丧尸、肿瘤丧尸、双剑丧尸等,可以选择攻击或逃跑。在战斗中,玩家可以选择不同的武器和护甲来提升伤害和防御能力,战斗中双方会互相造成伤害,直到一方血量降至0。

商店系统:玩家可以在游戏中的自动售卖机购买武器、护甲和血量恢复道具,金币可以在商店中使用。购买不同的装备可以提升玩家在战斗中的生存能力。

血量恢复:玩家可以在游戏中获得血袋、血瓶、血包和血箱等道具来恢复血量,不同道具恢复的血量量不同。

最终BOSS战:玩家在游戏中会遇到强大的BOSS丧尸,如死亡追踪者ex,需要与之进行决战。玩家需要在战斗中选择合适的战斗策略和装备来击败BOSS,获得游戏的胜利。

游戏胜利:当玩家成功击败最终BOSS后,游戏会通知玩家获得胜利,并展示游戏的结局。

这是一个基于文字冒险和战斗的游戏,玩家需要在游戏中不断提升自己的装备和策略,战胜各种丧尸,最终挑战强大的BOSS,体验冒险的乐趣。希望这个玩法说明能帮助您更好地理解这个游戏的玩法机制。如果您有任何疑问或需要进一步解释,请随时告诉我。

代码

#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
int au=10;
int xue=100;
int wuqi[10] = {2,4,5,7,9,9,12,14,16,100};
string wuqi_name[10]= {"手","木棍","铁管","菜刀","消防斧","铁锤","《蝴蝶刀》","《古剑》","《《天狼双节棍》》","激光炮"};
int wu=0;
int fangjv[7] = {0,2,4,6,10,13,100};
string fang_name[10]= {"白衣","厚重羽绒服","警用防弹衣","军用防弹衣","防爆服","《《狼牌战斗服》》","动力机甲"};
int fa=0;
int jxue[4] = {16,34,50,100};
string jxue_nmae[4]= {"血袋","血瓶","血包","血箱"};
int jx;
int migo[10][16] = { {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},
    {1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1},
    {0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0},
    {0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1},
    {0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1},
    {1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0},
    {0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1},
    {1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0}
};
void sc(string text, int shi) {
    for (int i=0; i<text.size(); i++) {//侵权必究
        cout<<text[i];
        Sleep(shi);
    }
    return;
}
void zangboII() {
    srand((unsigned)time(NULL));
    int c;
    int sui=random(1,3);
    string text;
    int dx=25;
    if(sui==1) {

        text="你遇到了一个日本丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;

        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            cout<<"获得血脉加持buff"<<endl;
            cout<<"获得抗战精神buff"<<endl;
            cout<<"获得血脉觉醒buff"<<endl;
            cout<<"获得祖宗疆土buff"<<endl;
            cout<<"获得力量buff"<<endl;
            cout<<"获得速度buff"<<endl;
            cout<<"获得幸运buff"<<endl;

            cout<<"获得领域buff"<<endl<<endl<<endl;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]+3+3+3+3+3+3<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他没了";//侵权必究
                    cout<<"你获得了"<<25<<"金币"<<endl;
                    au+=25;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,10-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,10-fangjv[fa]);//侵权必究
                cout<<"<<祖宗保佑>>   血+5"<<endl;
                xue+5;
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    } else if(sui==2) {

        int dx=4;
        text="你遇到了一个肉瘤丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;
        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他爆炸了";//侵权必究
                    int zha=random(3,14);
                    cout<<"你受到了"<<zha<<"点伤害"<<endl;
                    xue-=zha;
                    cout<<"你获得了"<<34<<"金币"<<endl;
                    au+=34;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,10-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,10-fangjv[fa]);//侵权必究
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    } else {
        int dx=10;
        text="你遇到了一个双剑丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;
        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他没了";//侵权必究
                    cout<<"你获得了"<<16<<"金币"<<endl;
                    cout<<"你获得了铁锤"<<endl;
                    cout<<"1.拿上"<<endl;
                    cin>>c;
                    cout<<endl;
                    system("pause") ;
                    system("cls");
                    if(c==1) {
                        wu=4;
                    }
                    au+=16;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,2-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,2-fangjv[fa]);//侵权必究
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    }
}
void zangboIII() {
    srand((unsigned)time(NULL));
    int c;
    int sui=random(1,3);
    string text;
    int dx=34;
    if(sui==1) {

        text="你遇到了一个暴君丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;

        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            cout<<"获得能量加持buff"<<endl;
            cout<<"获得抗战精神buff"<<endl;
            cout<<"获得反抗buff"<<endl;
            cout<<"获得幸运buff"<<endl;

            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]+3+3+3+3<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他没了";//侵权必究
                    cout<<"你获得了"<<34<<"金币"<<endl;
                    au+=34;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,16-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,16-fangjv[fa]);//侵权必究
                cout<<"<<能量补充>>   血+8"<<endl;
                xue+8;
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    } else if(sui==2) {

        int dx=4;
        text="你遇到了一个V型变异丧尸实验体ex";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;
        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他消逝了";//侵权必究
                    int zha=random(3,5);
                    cout<<"你受到了"<<zha<<"点伤害"<<endl;
                    xue-=zha;
                    cout<<"你获得了"<<45<<"金币"<<endl;
                    au+=45;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,16-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,16-fangjv[fa]);//侵权必究
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    } else {
        int dx=10;
        text="你遇到了一个领主丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;
        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他没了";//侵权必究
                    cout<<"你获得了"<<20<<"金币"<<endl;
                    cout<<"你获得了《蝴蝶刀》"<<endl;
                    cout<<"1.拿上"<<endl;
                    cin>>c;
                    cout<<endl;
                    system("pause") ;
                    system("cls");
                    if(c==1) {
                        wu=5;
                    }
                    au+=20;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,16-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,16-fangjv[fa]);//侵权必究
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    }
}
void zangbo() {
    srand((unsigned)time(NULL));
    int c;
    int sui=random(1,3);
    string text;
    int dx=5;
    if(sui==1) {

        text="你遇到了一个丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;
        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他没了";//侵权必究
                    cout<<"你获得了"<<10<<"金币"<<endl;
                    au+=10;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,2-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,2-fangjv[fa]);//侵权必究
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    } else if(sui==2) {

        int dx=4;
        text="你遇到了一个自爆丧尸";
        sc(text,25);
        cout<<endl<<endl<<endl<<endl<<endl;
        cout<<"1.攻击 2.逃跑"<<endl;
        cin>>c;
        cout<<endl;
        system("pause") ;
        system("cls");
        if(c==1) {
            int x=xue;
            while(1) {
                cout<<"你对它造成了"<<wuqi[wu]<<"点伤害。"<<endl;
                dx-=wuqi[wu];
                if(dx<=0) {
                    cout<<"他爆炸了";//侵权必究
                    int zha=random(2,14);
                    cout<<"你受到了"<<zha<<"点伤害"<<endl;
                    xue-=zha;
                    cout<<"你获得了"<<15<<"金币"<<endl;
                    au+=15;
                    break;//侵权必究
                }
                cout<<"你受了"<<max(1,2-fangjv[fa])<<"点伤害。"<<endl;
                xue-=max(1,2-fangjv[fa]);//侵权必究
                if(xue<=0) {
                    cout<<"你没了";
                    break;
                }
            }
            system("pause");
            system("cls");//侵权必究
        } else {
            sui=random(1,3);
            if(sui==3) {
                cout<<"逃跑不是太成功   -10血"<<endl;
                system("pause");
                system("cls");//侵权必究
                xue-=10;
            } else {
                cout<<"逃跑成功"<<endl;
                system("pause");
                system("cls");//侵权必究
            }
        }
    } else {
        int dx=10;
        text="你遇到了一个钢盔丧尸";
        sc(text,25);
        cout<<endl<<endl<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值