经过测试,该游戏可以在dev-c++运行,如下:
```cpp
#include <bits/stdc++.h>
using namespace std;
struct wippen {
long long gong, fang;
string name;
int money;
string zuoyong;
int spj;
int level;
bool canuse = 0;
};
struct plant {
string name;
int money;
int g_money;
};
int money_zj = 10, blood = 30, bloodyuan = 30, level = 1;
int yiyaobao;
char bq[100][100] = {
"--------------------------",
"| |",
"| |",
"| 白棋 |",
"| |",
"--------------------------",
"| ",
"| ",
"| ",
"| ",
"| ",
"| "
};
vector<wippen>vec;
vector<wippen>wuqiku1;
vector<plant>plant_all;
bool gly_close = 0;
int gly[11];
void choujiang1() {//584558
cout << "抽奖需要消耗10000金币,是否抽奖(y/n)(抽管理员)?\n";
int t = rand() % 100;
char c;
cin >> c;
if (c == 'y') {
if (money_zj >= 10000 && !gly_close) {
money_zj -= 10000;
int tt = rand() % 100;
int cc = 0;
if (tt < 20) {
cc = 1;
} else if (tt < 29) {
cc = 2;
} else if (tt < 40) {
cc = 3;
} else if (tt < 50) {
cc = 4;
} else if (tt < 62) {
cc = 5;
} else if (tt < 70) {
cc = 6;
} else if (tt < 83) {
cc = 7;
} else if (tt < 90) {
cc = 8;
} else if (tt < 92) {
cc = 9;
} else {
cc = 10;
}
cout << "恭喜抽到管理员碎片" << cc << endl;
gly[cc] ++ ;
int c = 0;
for (int i = 0; i < 10; i ++ ) {
if (gly[i] == 0) {
c = 1;
}
}
if (!c) {
if (!gly_close) {
cout << "收集成功,获得管理员\n";
gly_close = 1;
money_zj = INT_MAX / 2;
wuqiku1.push_back({0, 0, "二向箔", 0, "秒杀敌人(管理员专属)", 1});
plant_all.push_back({"金桔(管理员专属)", 10000, 8888});
}
}
} else {
cout << "钱不够\n";
}
}
}
void skywippen() {
if (rand() % 40 == 1) {
cout << "天降武器!\n";
cout << "你获得了:";
int t = rand() % 100;
if (t < 39) {
cout << "电磁炮弹\n";
vec.push_back({100000, 0, "电磁炮弹", 100500, "向敌人发动攻击力为100000的攻击", 0, 1});
for (int i = 0; i < vec.size() - 1; i ++ ) {
if (vec[i].name == "电磁炮弹") {
vec[i].level ++ ;
vec.pop_back();
break;
}
}
}
if (t >= 39 && t < 39 + 29) {
cout << "等离子炮\n";
vec.push_back({120000, 0, "等离子炮", 125000, "向敌人发动攻击力为120000的攻击", 0, 1});
for (int i = 0; i < vec.size() - 1; i ++ ) {
if (vec[i].name == "等离子炮") {
vec[i].level ++ ;
vec.pop_back();
break;
}
}
}
if (t >= 39 + 29 && t < 39 + 29 + 19) {
cout << "伽马射线\n";
vec.push_back({500000, 0, "伽马射线", 566666, "向敌人发动攻击力为500000的攻击", 0, 1});
for (int i = 0; i < vec.size() - 1; i ++ ) {
if (vec[i].name == "伽马射线") {
vec[i].level ++ ;
vec.pop_back();
break;
}
}
}
if (t >= 39 + 19 + 29 && t < 39 + 19 + 29 + 4) {
cout << "反物质导弹\n";
vec.push_back({1000000, 0, "反物质导弹", 30000000, "向敌人发动攻击力1000000", 0, 1});
for (int i = 0; i < vec.size() - 1; i ++ ) {
if (vec[i].name == "反物质导弹") {
vec[i].level ++ ;
vec.pop_back();
break;
}
}
}
if (t >= 39 + 19 + 29 + 4) {
cout << "宇宙黑暗森林广播器\n";
vec.push_back({5000000, 0, "宇宙黑暗森林广播器", 8000000, "利用黑暗森林法则向敌人发动攻击力为5000000的攻击", 0, 1});
for (int i = 0; i < vec.size() - 1; i ++ ) {
if (vec[i].name == "宇宙黑暗森林广播器") {
vec[i].level ++ ;
vec.pop_back();
break;
}
}
}
}
}
void three_body() {
int t = rand() % 100;
if (t == 0) {
if (yiyaobao == 0) {
cout << "三日临空,世界毁灭,脱水,脱水!\n";
bloodyuan = max(1, bloodyuan - 100);
level = max(1, level - 5);
} else {
yiyaobao -- ;
}
}
if (t >= 1 && t <= 3) {
if (yiyaobao == 0) {
cout << "双日凌空,世界毁灭,脱水,脱水!\n";
bloodyuan = max(1, bloodyuan - 80);
level = max(1, level - 3);
} else {
yiyaobao -- ;
}
}
if (t == 4) {
if (yiyaobao == 0) {
cout << "飞星不动,大撕裂,世界毁灭,脱水,脱水!\n";
bloodyuan = max(1, bloodyuan - 1000);
level = max(1, level - 30);
} else {
yiyaobao -- ;
}
}
if (t == 5) {
if (yiyaobao == 0) {
cout << "三日连珠,世界毁灭,脱水,脱水!\n";
bloodyuan = max(1, bloodyuan - 120);
level = max(1, level - 6);
} else {
yiyaobao -- ;
}
}
}
int fhq = 0;
void hacker() {
int t = rand() % 20;
if (t <= 1) {
if (fhq == 0) {
cout << "黑客来袭,你的所有指标全部变成1\n";
money_zj = 1, level = 1, bloodyuan = 1;
} else {
fhq -- ;
}
}
}
void tp() {
bloodyuan = max(bloodyuan, 1);
level = max(level, 1);
}
int ludeng = 0;
int main() {
srand(time(NULL));
cout << "欢迎来玩猫头鹰游戏(owl game)。\n";
cout << "你是一只有钱猫头鹰,住在一个别墅里。\n";
cout << "但是你的邻居机甲猫头鹰的骚扰让你难以入眠\n";
cout << "开始抵抗吧,勇士!\n";
cout << "是否打开管理员模式?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
cout << "请输入密码(6位):\n";
string s;
cin >> s;
if (s == "hjyowl") {
gly_close = 1;
cout << "输入正确,已打开管理员模式\n";
money_zj = INT_MAX / 2;
wuqiku1.push_back({0, 0, "二向箔", 0, "秒杀敌人(管理员专属)", 1});
plant_all.push_back({"金桔(管理员专属)", 10000, 8888});
bloodyuan = INT_MAX / 2;
} else {
cout << "输入错误\n";
}
}
wuqiku1.push_back({1, 0, "赤手空拳", 0, "向敌人发动攻击力为1的攻击", 0, 1});
wuqiku1.push_back({10, 0, "小刀", 10, "向敌人发动攻击力为10的攻击", 0, 1});
wuqiku1.push_back({30, 0, "大刀", 25, "向敌人发动攻击力为30的攻击", 0, 1});
wuqiku1.push_back({50, 0, "砍刀", 40, "向敌人发动攻击力为50的攻击", 0, 1});
wuqiku1.push_back({15, 0, "剑", 14, "向敌人发动攻击力为15的攻击", 0, 1});
wuqiku1.push_back({40, 0, "锤子", 36, "向敌人发动攻击力为36的攻击", 0, 1});
wuqiku1.push_back({666, 0, "无敌旋风锤", 630, "向敌人发动攻击力为666的攻击", 0, 1});
wuqiku1.push_back({13, 0, "匕首", 13, "向敌人发动攻击力为13的攻击", 0, 1});
wuqiku1.push_back({0, 100, "防御盾", 150, "使敌人对你的攻击减少100", 0, 1});
wuqiku1.push_back({1000, 0, "大型防御盾", 1400, "使敌人对你的攻击减少1000", 0, 1});
wuqiku1.push_back({10000, 0, "迫击炮", 8888, "向敌人发动攻击力为10000的攻击", 0, 1});
wuqiku1.push_back({100, 0, "机关枪", 90, "向敌人发动攻击力为100的攻击", 0, 1});
wuqiku1.push_back({30000, 0, "轰炸机", 26666, "向敌人发动攻击力为30000的攻击", 0, 1});
wuqiku1.push_back({15000, 0, "大炮", 14444, "向敌人发动攻击力为15000的攻击", 0, 1});
wuqiku1.push_back({60000, 0, "追踪导弹", 56666, "向敌人发动攻击力为60000的攻击", 0, 1});
wuqiku1.push_back({90000, 0, "大型追踪导弹", 84444, "向敌人发动攻击力为90000的攻击", 0, 1});
wuqiku1.push_back({0, 1000000, "无敌防御盾", 1666666, "使敌人对你的攻击减少1000000", 0, 1});
wuqiku1.push_back({88888,0,"核弹",100000,"向敌人发动88888的攻击",0,1});
wuqiku1.push_back({100000, 0, "电磁炮弹", 100500, "向敌人发动攻击力为100000的攻击", 0, 1});
wuqiku1.push_back({105000,0,"低级星际舰队",200000,"向敌人发动攻击力为100500的攻击",0,1});
wuqiku1.push_back({120000, 0, "等离子炮", 125000, "向敌人发动攻击力为120000的攻击", 0, 1});
wuqiku1.push_back({500000, 0, "伽马射线", 566666, "向敌人发动攻击力为500000的攻击", 0, 1});
wuqiku1.push_back({800000,0,"次声波核武器",888888,"向敌人发动800000的攻击",0,1});
wuqiku1.push_back({1000000, 0, "反物质导弹", 30000000, "向敌人发动攻击力1000000", 0, 1});
wuqiku1.push_back({3000000, 0, "球状闪电", 3000000, "向敌人发动攻击力为30000000的攻击,有20%的概率无法造成伤害", 2, 1});
wuqiku1.push_back({5000000, 0, "宇宙黑暗森林广播器", 8000000, "利用黑暗森林法则向敌人发动攻击力为5000000的攻击", 0, 1});
wuqiku1.push_back({10000000, 0, "高级星际舰队", 20000000, "向敌人发动10000000的攻击",0,1});
wuqiku1.push_back({20000000,0,"太阳",50000000,"向敌人发射太阳,爆炸后造成20000000点伤害",0,1});
vec.push_back(wuqiku1[0]);
int plant_money_all = 0;
vector<plant>my_plant;
plant_all.push_back({"苹果", 100, 20});
plant_all.push_back({"小白菜", 10, 2});
plant_all.push_back({"西瓜", 20, 15});
while (level < 30) {
skywippen();
tp();
bloodyuan ++ ;
if (rand() % 30 == 0) {
cout << "机甲猫头鹰突然来袭,你被降了2级\n";
level -= 2;
}
money_zj += plant_money_all;
cout << "你要干什么? 1.去另外的一个邻居hjyowl的商店买武器 2.买植物 3.向机甲猫头鹰开战 4.啥也不干 5.抽奖\n";
int op;
cin >> op;
if (op == 1) {
cout << "你好啊,邻居。你要买点什么? \n";
cout << "有以下物品\n";
for (int i = 0; i < wuqiku1.size(); i ++ ) {
cout << i + 1 << "." << wuqiku1[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= wuqiku1.size()) {
cout << "输入错误!!!\n";
continue;
} else {
if (wuqiku1[id].money > money_zj) {
cout << "钱不够\n";
} else {
cout << "该武器的攻击力为:" << wuqiku1[id].gong;
cout << "\n该武器的防御力为:" << wuqiku1[id].fang;
cout << "\n该武器所需的钱:" << wuqiku1[id].money;
cout << "\n该武器的名字:" << wuqiku1[id].name << endl;
cout << "该武器的作用为:" << wuqiku1[id].zuoyong << endl;
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
cout << "购买成功.\n";
cout << "邻居再见!\n";
vec.push_back(wuqiku1[id]);
money_zj -= wuqiku1[id].money;
if (wuqiku1[id].money >= 1000) {
level += 2;
} else {
level ++ ;
}
for (int j = 0; j < vec.size() - 1; j ++ ) {
if (vec.back().name == vec[j].name && !vec.back().spj) {
vec[j].level ++ ;
vec.pop_back();
}
}
} else {
cout << "邻居再见\n";
}
}
}
} else if (op == 2) {
cout << "你要买什么植物?\n";
cout << "有以下植物\n";
for (int i = 0; i < plant_all.size(); i ++ ) {
cout << plant_all[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= plant_all.size()) {
cout << "输入错误\n";
} else if (money_zj < plant_all[id].money) {
cout << "钱不够\n";
} else {
cout << "该植物的价格为:" << plant_all[id].money << endl;
cout << "该植物每一轮可以为你贡献" << plant_all[id].g_money << "元\n";
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
money_zj -= plant_all[id].money;
plant_money_all += plant_all[id].g_money;
}
}
} else if (op == 3) {
blood = bloodyuan;
int fpblood = (rand() % 20 + 1) * level;
int c = fpblood;
int fpgong = (rand() % 5 + 1) * level;
int fpfang = (rand() % 8 + 1) * level;
while (1) {
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "他的攻击力为" << fpgong << endl;
cout << "他的防御力是" << fpfang << endl;
cout << "现在该你操作 你要用什么武器\n";
cout << "你的血量为" << blood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")" << "等级:" << vec[i].level << "(威力的几倍)\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
if (vec[id].spj == 1) {
cout << "二向箔打击!机甲猫头鹰直接秒杀\n";
bloodyuan += 100, level += 100;
break;
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
}
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
continue;
}
cout << "ok\n";
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
cout << "机甲猫头鹰对你造成了" << max(0ll, fpgong - vec[id].fang * vec[id].level) << "点伤害\n";
blood -= max(0ll, fpgong - vec[id].fang * vec[id].level);
if (blood < 0) {
cout << "你死了\n";
cout << "降了5级\n";
level -= 5;
cout << "血量少了5\n";
bloodyuan -= 5;
goto endd;
}
}
} else if (op == 4) {
continue;
} else {
choujiang1();
}
endd:
;
}
cout << "恭喜你进入第二阶段\n";
cout << "由于机甲猫头鹰的失败,所以你和机甲猫头鹰跨时空来到了三体星系进行对决\n";
cout << "勇士,抵抗起来吧!\n";
while (level < 60) {
skywippen();
tp();
bloodyuan += 10;
three_body();
bool c = 0;
if (rand() % 100 == 1) {
c = 1;
}
if (rand() % 30 == 0) {
cout << "机甲猫头鹰突然来袭,你被降了2级\n";
level -= 2;
}
money_zj += plant_money_all;
cout << "你要干什么? 1.去另外的一个邻居hjyowl的商店买武器 2.买植物 3.向机甲猫头鹰开战 4.啥也不干 5.买医药包(防止三体灾害)\n";
if (c) {
cout << "机甲猫头鹰对你发动了突袭,你只能点3了\n";
}
int op;
cin >> op;
if (c) {
op = 3;
}
if (op == 1) {
cout << "你好啊,邻居。你要买点什么? \n";
cout << "有以下物品\n";
for (int i = 0; i < wuqiku1.size(); i ++ ) {
cout << i + 1 << "." << wuqiku1[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= wuqiku1.size()) {
cout << "输入错误!!!\n";
continue;
} else {
if (wuqiku1[id].money > money_zj) {
cout << "钱不够\n";
} else {
cout << "该武器的攻击力为:" << wuqiku1[id].gong;
cout << "\n该武器的防御力为:" << wuqiku1[id].fang;
cout << "\n该武器所需的钱:" << wuqiku1[id].money;
cout << "\n该武器的名字:" << wuqiku1[id].name << endl;
cout << "该武器的作用为:" << wuqiku1[id].zuoyong << endl;
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
cout << "购买成功.\n";
cout << "邻居再见!\n";
vec.push_back(wuqiku1[id]);
money_zj -= wuqiku1[id].money;
if (wuqiku1[id].money >= 1000) {
level += 2;
} else {
level ++ ;
}
for (int j = 0; j < vec.size() - 1; j ++ ) {
if (vec.back().name == vec[j].name && !vec.back().spj) {
vec[j].level ++ ;
vec.pop_back();
}
}
} else {
cout << "邻居再见\n";
}
}
}
} else if (op == 2) {
cout << "你要买什么植物?\n";
cout << "有以下植物\n";
for (int i = 0; i < plant_all.size(); i ++ ) {
cout << plant_all[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= plant_all.size()) {
cout << "输入错误\n";
} else if (money_zj < plant_all[id].money) {
cout << "钱不够\n";
} else {
cout << "该植物的价格为:" << plant_all[id].money << endl;
cout << "该植物每一轮可以为你贡献" << plant_all[id].g_money << "元\n";
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
money_zj -= plant_all[id].money;
plant_money_all += plant_all[id].g_money;
}
}
} else if (op == 3) {
blood = bloodyuan;
int fpblood = (rand() % 30 + 1) * level;
int c = fpblood;
int fpgong = (rand() % 7 + 1) * level;
int fpfang = (rand() % 10 + 1) * level;
while (1) {
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "他的攻击力为" << fpgong << endl;
cout << "他的防御力是" << fpfang << endl;
cout << "现在该你操作 你要用什么武器\n";
cout << "你的血量为" << blood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")" << "等级:" << vec[i].level << "(威力的几倍)\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
if (vec[id].spj == 1) {
cout << "二向箔打击!机甲猫头鹰直接秒杀\n";
bloodyuan += 100, level += 100;
break;
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
}
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
continue;
}
cout << "ok\n";
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
cout << "机甲猫头鹰对你造成了" << max(0ll, fpgong - vec[id].fang * vec[id].level) << "点伤害\n";
blood -= max(0ll, fpgong - vec[id].fang * vec[id].level);
if (blood < 0) {
cout << "你死了\n";
cout << "降了5级\n";
level -= 5;
cout << "血量少了5\n";
bloodyuan -= 5;
goto endd;
}
}
} else if (op == 5) {
cout << "医药包10元一个,你要买几个(医药包为一次型)?\n";
int x;
cin >> x;
if (money_zj < x * 10) {
cout << "钱不够\n";
} else {
cout << "购买成功\n";
yiyaobao += x;
money_zj -= x * 10;
}
} else if (op == 4) {
continue;
} else {
choujiang1();
}
enddd:
;
}
cout << "恭喜你进入第三阶段\n";
cout << "由于机甲猫头鹰的失败,所以你和机甲猫头鹰跨时空来到了黑客帝国进行对决\n";
cout << "勇士,抵抗起来吧!\n";
while (level < 150) {
skywippen();
tp();
bloodyuan += 20;
hacker();
bool c = 0;
if (rand() % 100 == 1) {
c = 1;
}
if (rand() % 30 == 0) {
cout << "机甲猫头鹰突然来袭,你被降了2级\n";
level -= 2;
}
money_zj += plant_money_all;
cout << "你要干什么? 1.去另外的一个邻居hjyowl的商店买武器 2.买植物 3.向机甲猫头鹰开战 4.啥也不干 5.买防火墙(防止黑客灾害)\n";
if (c) {
cout << "机甲猫头鹰对你发动了突袭,你只能选择3了\n";
}
int op;
cin >> op;
if (c) {
op = 3;
}
if (op == 1) {
cout << "你好啊,邻居。你要买点什么? \n";
cout << "有以下物品\n";
for (int i = 0; i < wuqiku1.size(); i ++ ) {
cout << i + 1 << "." << wuqiku1[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= wuqiku1.size()) {
cout << "输入错误!!!\n";
continue;
} else {
if (wuqiku1[id].money > money_zj) {
cout << "钱不够\n";
} else {
cout << "该武器的攻击力为:" << wuqiku1[id].gong;
cout << "\n该武器的防御力为:" << wuqiku1[id].fang;
cout << "\n该武器所需的钱:" << wuqiku1[id].money;
cout << "\n该武器的名字:" << wuqiku1[id].name << endl;
cout << "该武器的作用为:" << wuqiku1[id].zuoyong << endl;
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
cout << "购买成功.\n";
cout << "邻居再见!\n";
vec.push_back(wuqiku1[id]);
money_zj -= wuqiku1[id].money;
if (wuqiku1[id].money >= 1000) {
level += 2;
} else {
level ++ ;
}
for (int j = 0; j < vec.size() - 1; j ++ ) {
if (vec.back().name == vec[j].name && !vec.back().spj) {
vec[j].level ++ ;
vec.pop_back();
}
}
} else {
cout << "邻居再见\n";
}
}
}
} else if (op == 2) {
cout << "你要买什么植物?\n";
cout << "有以下植物\n";
for (int i = 0; i < plant_all.size(); i ++ ) {
cout << plant_all[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= plant_all.size()) {
cout << "输入错误\n";
} else if (money_zj < plant_all[id].money) {
cout << "钱不够\n";
} else {
cout << "该植物的价格为:" << plant_all[id].money << endl;
cout << "该植物每一轮可以为你贡献" << plant_all[id].g_money << "元\n";
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
money_zj -= plant_all[id].money;
plant_money_all += plant_all[id].g_money;
}
}
} else if (op == 3) {
blood = bloodyuan;
int fpblood = (rand() % 30 + 1) * level;
int c = fpblood;
int fpgong = (rand() % 7 + 1) * level;
int fpfang = (rand() % 10 + 1) * level;
while (1) {
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "他的攻击力为" << fpgong << endl;
cout << "他的防御力是" << fpfang << endl;
cout << "现在该你操作 你要用什么武器\n";
cout << "你的血量为" << blood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")" << "等级:" << vec[i].level << "(威力的几倍)\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
if (vec[id].spj == 1) {
cout << "二向箔打击!机甲猫头鹰直接秒杀\n";
bloodyuan += 100, level += 100;
break;
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
}
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
continue;
}
cout << "ok\n";
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
cout << "机甲猫头鹰对你造成了" << max(0ll, fpgong - vec[id].fang * vec[id].level) << "点伤害\n";
blood -= max(0ll, fpgong - vec[id].fang * vec[id].level);
if (blood < 0) {
cout << "你死了\n";
cout << "降了5级\n";
level -= 5;
cout << "血量少了5\n";
bloodyuan -= 5;
goto endd;
}
}
} else if (op == 5) {
cout << "防火墙5元一个,你要买几个(防火墙为一次性)?\n";
int x;
cin >> x;
if (money_zj < x * 5) {
cout << "钱不够\n";
} else {
cout << "购买成功\n";
fhq += x;
money_zj -= x * 5;
}
} else if (op == 4) {
continue;
} else {
choujiang1();
}
endddd:
;
}
cout << "恭喜你进入第四阶段\n";
cout << "由于机甲猫头鹰的失败,所以你和机甲猫头鹰跨时空来到了迷雾城市进行对决\n";
cout << "勇士,抵抗起来吧!\n";
bool zh = 0;
while (level < 200) {
skywippen();
tp();
bloodyuan += 20;
bool c = 0;
if (rand() % 10 == 1) {
cout << "起雾了,你被机甲猫头鹰突袭了!\n";
zh = 1;
}
if (zh && rand() % 6 == 1) {
cout << "起风了,迷雾消失了\n";
zh = 0;
}
if (zh && ludeng == 0) {
bloodyuan -= 100;
level -= 5;
tp();
}
if (zh && ludeng > 0) {
zh = 0;
ludeng -- ;
}
if (rand() % 100 == 1) {
c = 1;
}
if (rand() % 30 == 0) {
cout << "机甲猫头鹰突然来袭,你被降了2级\n";
level -= 2;
}
money_zj += plant_money_all;
cout << "你要干什么? 1.去另外的一个邻居hjyowl的商店买武器 2.买植物 3.向机甲猫头鹰开战 4.啥也不干 5.买路灯(防止迷雾)\n";
if (c) {
cout << "机甲猫头鹰对你发动了突袭,你只能选择3了\n";
}
int op;
cin >> op;
if (c) {
op = 3;
}
if (op == 1) {
cout << "你好啊,邻居。你要买点什么? \n";
cout << "有以下物品\n";
for (int i = 0; i < wuqiku1.size(); i ++ ) {
cout << i + 1 << "." << wuqiku1[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= wuqiku1.size()) {
cout << "输入错误!!!\n";
continue;
} else {
if (wuqiku1[id].money > money_zj) {
cout << "钱不够\n";
} else {
cout << "该武器的攻击力为:" << wuqiku1[id].gong;
cout << "\n该武器的防御力为:" << wuqiku1[id].fang;
cout << "\n该武器所需的钱:" << wuqiku1[id].money;
cout << "\n该武器的名字:" << wuqiku1[id].name << endl;
cout << "该武器的作用为:" << wuqiku1[id].zuoyong << endl;
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
cout << "购买成功.\n";
cout << "邻居再见!\n";
vec.push_back(wuqiku1[id]);
money_zj -= wuqiku1[id].money;
if (wuqiku1[id].money >= 1000) {
level += 2;
} else {
level ++ ;
}
for (int j = 0; j < vec.size() - 1; j ++ ) {
if (vec.back().name == vec[j].name && !vec.back().spj) {
vec[j].level ++ ;
vec.pop_back();
}
}
} else {
cout << "邻居再见\n";
}
}
}
} else if (op == 2) {
cout << "你要买什么植物?\n";
cout << "有以下植物\n";
for (int i = 0; i < plant_all.size(); i ++ ) {
cout << plant_all[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= plant_all.size()) {
cout << "输入错误\n";
} else if (money_zj < plant_all[id].money) {
cout << "钱不够\n";
} else {
cout << "该植物的价格为:" << plant_all[id].money << endl;
cout << "该植物每一轮可以为你贡献" << plant_all[id].g_money << "元\n";
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
money_zj -= plant_all[id].money;
plant_money_all += plant_all[id].g_money;
}
}
} else if (op == 3) {
blood = bloodyuan;
int fpblood = (rand() % 250 + 1) * level;
int c = fpblood;
\
int fpgong = (rand() % 70 + 1) * level;
int fpfang = (rand() % 50 + 1) * level;
while (1) {
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "他的攻击力为" << fpgong << endl;
cout << "他的防御力是" << fpfang << endl;
cout << "现在该你操作 你要用什么武器\n";
cout << "你的血量为" << blood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")" << "等级:" << vec[i].level << "(威力的几倍)\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
if (vec[id].spj == 1) {
cout << "二向箔打击!机甲猫头鹰直接秒杀\n";
bloodyuan += 100, level += 100;
break;
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
}
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
continue;
}
cout << "ok\n";
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
if (fpblood < 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endd;
}
cout << "机甲猫头鹰对你造成了" << max(0ll, fpgong - vec[id].fang * vec[id].level) << "点伤害\n";
blood -= max(0ll, fpgong - vec[id].fang * vec[id].level);
if (blood < 0) {
cout << "你死了\n";
cout << "降了5级\n";
level -= 5;
cout << "血量少了5\n";
bloodyuan -= 5;
goto endd;
}
}
} else if (op == 5) {
cout << "路灯500元一个,你要买几个(路灯为一次性)?\n";
int x;
cin >> x;
if (money_zj < x * 500) {
cout << "钱不够\n";
} else {
cout << "购买成功\n";
ludeng += x;
money_zj -= x * 500;
}
} else if (op == 4) {
continue;
} else {
choujiang1();
}
enddddd:
;
}
cout << "所有武器等级回归一级(钱会退还).\n";
for (int i = 0 ; i < vec.size(); i ++ ) {
if (vec[i].level > 1) {
money_zj += (vec[i].level - 1) * vec[i].money;
vec[i].level = 1;
}
}
cout << "恭喜你进入第五阶段\n";
cout << "由于机甲猫头鹰的失败,所以你和机甲猫头鹰跨时空来到了原始时代进行对决\n";
cout << "勇士,抵抗起来吧!\n";
while (level < 300) {
skywippen();
bloodyuan += 5;
bool c = 0;
if (rand() % 100 == 1) {
c = 1;
}
if (rand() % 30 == 0) {
cout << "机甲猫头鹰突然来袭,你被降了5级\n";
level -= 5;
}
money_zj += plant_money_all;
cout << "你要干什么? 1.去另外的一个邻居hjyowl的商店买武器 2.买植物 3.向机甲猫头鹰开战 4.啥也不干\n";
if (c) {
cout << "机甲猫头鹰对你发动了突袭,你只能选择3了\n";
}
int op;
cin >> op;
if (c) {
op = 3;
}
if (op == 1) {
cout << "你好啊,邻居。你要买点什么? \n";
cout << "有以下物品\n";
for (int i = 0; i < wuqiku1.size(); i ++ ) {
cout << i + 1 << "." << wuqiku1[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= wuqiku1.size()) {
cout << "输入错误!!!\n";
continue;
} else {
if (wuqiku1[id].money > money_zj) {
cout << "钱不够\n";
} else {
cout << "该武器的攻击力为:" << wuqiku1[id].gong;
cout << "\n该武器的防御力为:" << wuqiku1[id].fang;
cout << "\n该武器所需的钱:" << wuqiku1[id].money;
cout << "\n该武器的名字:" << wuqiku1[id].name << endl;
cout << "该武器的作用为:" << wuqiku1[id].zuoyong << endl;
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
cout << "购买成功.\n";
cout << "邻居再见!\n";
vec.push_back(wuqiku1[id]);
money_zj -= wuqiku1[id].money;
if (wuqiku1[id].money >= 1000) {
level += 2;
} else {
level ++ ;
}
} else {
cout << "邻居再见\n";
}
}
}
} else if (op == 2) {
cout << "你要买什么植物?\n";
cout << "有以下植物\n";
for (int i = 0; i < plant_all.size(); i ++ ) {
cout << plant_all[i].name << endl;
}
cout << "你要买第几个?\n";
int id;
cin >> id;
id -- ;
if (id < 0 || id >= plant_all.size()) {
cout << "输入错误\n";
} else if (money_zj < plant_all[id].money) {
cout << "钱不够\n";
} else {
cout << "该植物的价格为:" << plant_all[id].money << endl;
cout << "该植物每一轮可以为你贡献" << plant_all[id].g_money << "元\n";
cout << "是否购买?(y/n)\n";
char c;
cin >> c;
if (c == 'y') {
money_zj -= plant_all[id].money;
plant_money_all += plant_all[id].g_money;
}
}
} else if (op == 3) {
blood = bloodyuan;
int fpblood = (rand() % 250 + 1) * level;
int c = fpblood;
\
int fpgong = (rand() % 100 + 1) * level;
int fpfang = (rand() % 80 + 1) * level;
cout << "机甲猫头鹰:哈哈,小伙子,你来了,你个菜鸡,没实力,没素质,这可是原始时代,我是可以重生的哦。你个小子小心点.\n";
cout << "你:哦,这是谁呀,这么嚣张。是那个机什么猫头鹰。哦,是机甲猫头鹰\n";
while (1) {
if (rand() % 10 == 1) {
cout << "机甲猫头鹰:恢复血量!\n";
fpblood += 1000;
}
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "他的攻击力为" << fpgong << endl;
cout << "他的防御力是" << fpfang << endl;
cout << "现在该你操作 你要用什么武器\n";
cout << "你的血量为" << blood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
if (vec[id].spj == 1) {
cout << "二向箔打击!机甲猫头鹰直接秒杀\n";
bloodyuan += 100, level += 100;
break;
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - fpfang);
}
if (fpblood <= 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5 + 1;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
cout << "机甲猫头鹰:我这次只是发挥失误,不然稳赢你\n";
cout << "你:呵呵,我都懒得理你\n";
cout << "机甲猫头鹰:!!!!!!!!!你个废物,没实力的家伙,居然敢不理本机甲猫头鹰.我要杀了你!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout << "你:你就慢慢念经吧,我先走了\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endddddd;
}
continue;
}
cout << "ok\n";
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - fpfang) << "点血\n";
fpblood -= max(0ll, vec[id].gong - fpfang);
if (fpblood <= 0) {
cout << "猫头鹰机甲死了\n";
cout << "你获得了" << c << "元\n";
int x = rand() % 5 + 1;
cout << "你升了" << x << "级\n";
cout << "你的血量提高了5\n";
cout << "机甲猫头鹰:我这次只是发挥失误,不然稳赢你\n";
cout << "你:呵呵,我都懒得理你\n";
cout << "机甲猫头鹰:!!!!!!!!!你个废物,没实力的家伙,居然敢不理本机甲猫头鹰.我要杀了你!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
cout << "你:你就慢慢念经吧,我先走了\n";
level += x;
money_zj += c;
bloodyuan += 5;
goto endddddd;
}
cout << "机甲猫头鹰对你造成了" << max(0ll, fpgong - vec[id].fang) << "点伤害\n";
blood -= max(0ll, fpgong - vec[id].fang);
if (blood <= 0) {
cout << "你死了\n";
cout << "降了10级\n";
level -= 10;
cout << "血量少10\n";
bloodyuan -= 10;
cout << "机甲猫头鹰:菜,就多练,过去是过去,现在是现在,别永远把过去当作现在。假设你总把过去当作现在,为什么你不把你刚出生时和现在比呢?哈哈,你个傻子也有今天\n";
goto endddddd;
}
}
} else if (op == 4) {
continue;
} else {
choujiang1();
}
endddddd:
;
}
bloodyuan += money_zj;
bloodyuan = max(bloodyuan, 1000000007);
bloodyuan = max(bloodyuan * 50, 1000000007);
cout << "机甲猫头鹰的失败,让他非常生气。\n";
cout << "于是你决定和机甲猫头鹰进行最终对决\n";
cout << "开始!\n";
bool win = 0;
blood = bloodyuan;
int fangg = 0;
int fpblood = 10000000;
while (!win) {
blood += 10;
cout << "机甲猫头鹰对你造成了10000点伤害!\n";
blood -= max(0, 10000 - fangg);
if (blood <= 0) {
break;
}
cout << "请选择武器\n";
cout << "你的血量为" << blood << endl;
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
if (vec[id].spj == 1) {
cout << "二向箔无效!\n";
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong * vec[id].level - 1000) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - 1000);
}
if (fpblood <= 0) {
win = 1;
break;
}
continue;
}
cout << "ok\n";
fangg += vec[id].fang;
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 1000) << "点血\n";
fpblood -= max(0ll, vec[id].gong - 1000);
if (fpblood <= 0) {
win = 1;
break;
}
if (rand() % 10 == 1) {
cout << "机甲猫头鹰突袭!扣除武器!\n";
if (vec.size()) {
vec.pop_back();
}
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰回血!\n";
fpblood += 114514;
}
if (rand() % 5 == 1) {
cout << "你回血了\n";
blood += 10000;
}
if (rand() % 20 == 1) {
cout << "机甲破损!机甲猫头鹰少了1000点血\n";
fpblood -= 1000;
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰末日!奖励宇宙黑暗森林广播器\n";
vec.push_back(wuqiku1.back());
}
if (rand() % 50 == 1) {
cout << "世界毁灭!机甲猫头鹰血量减少100000,你的血量减少10000\n";
blood -= 10000, fpblood -= 100000;
}
if (rand() % 15 == 1) {
cout << "前方高能预警!!!\n";
cout << "机甲猫头鹰大力来袭!\n";
blood -= 10000000;
}
if (rand() % 100 == 1) {
cout << "着火了!!!机甲猫头鹰的机甲爆炸了!机甲猫头鹰死了!\n";
fpblood = -1;
}
if (rand() % 20 == 1) {
cout << "机关枪扫射!!!机甲猫头鹰的血量减少10000\n";
fpblood -= 10000;
}
}
bloodyuan = max(bloodyuan * 100, 1000000007);
if (win) {
cout << "机甲猫头鹰的再次来袭!\n";
cout << "机甲猫头鹰的失败,让他非常生气。\n";
cout << "于是你决定和机甲猫头鹰进行最终对决\n";
cout << "开始!\n";
bool wins = 0;
blood = bloodyuan;
int fpblood = 10000000;
int fangg = 100;
int times = 0;
bool ne = 0;
while (!wins) {
times ++;
cout << "机甲猫头鹰对你造成了" << max(0, 1000000 - fangg) << "点伤害!\n";
blood -= max(0, 1000000 - fangg);
if (blood <= 0) {
break;
}
cout << "请选择武器\n";
cout << "你的血量为" << blood << endl;
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
fangg += vec[id].fang;
if (vec[id].spj == 1) {
cout << "二向箔无效!\n";
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 1000000) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - 1000000);
if (fpblood <= 0) {
win = 1;
break;
}
}
continue;
}
cout << "ok\n";
if (ne) {
cout << "机甲猫头鹰被你打坏了" << 0 << "点血\n";
} else {
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 1000000) << "点血\n";
fpblood -= max(0ll, vec[id].gong - 1000000);
}
if (fpblood <= 0) {
win = 1;
break;
}
if (rand() % 10 == 1) {
cout << "机甲猫头鹰机甲破损!机甲猫头鹰少了1000000点血\n";
fpblood -= 10000000;
}
if (rand() % 10 == 1) {
cout << "机甲猫头鹰突袭!扣除武器!\n";
if (vec.size()) {
vec.pop_back();
}
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰回血!\n";
fpblood += 1919810;
}
if (rand() % 5 == 1) {
cout << "你回血了\n";
blood += 10000;
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰末日!奖励宇宙黑暗森林广播器\n";
vec.push_back(wuqiku1.back());
}
if (rand() % 15 == 1) {
cout << "前方高能预警!!!\n";
cout << "机甲猫头鹰大力来袭!\n";
blood -= 1000000000;
}
if (rand() % 20 == 1) {
cout << "防御加强!你的防御力×5\n";
fangg *= 5;
}
if (rand() % 50 == 1) {
cout << "世界毁灭!机甲猫头鹰血量减少1000000,你的血量减少10000\n";
blood -= 10000, fpblood -= 1000000;
}
if (rand() % 10000 == 1) {
cout << "黑洞!!!游戏结束(你和机甲猫头鹰谁都赢了)\n";
return 0;
}
if (rand() % 20 == 1) {
cout << "机关枪扫射!!!机甲猫头鹰的血量减少10000\n";
fpblood -= 10000;
}
if (rand() % 10 == 1) {
cout << "机甲猫头鹰飞上天空!!!攻击无效!!!\n";
ne = 1;
}
if (ne && rand() % 3 == 1) {
cout << "机甲猫头鹰降落!!!";
if (rand() % 5 == 1) {
cout << "机甲破碎了!!!造成1000点伤害\n";
fpblood -= 1000;
} else {
cout << "成功降落!!!\n";
}
ne = 0;
}
blood += 100;
}
cout << "机甲猫头鹰的再次来袭!\n";
cout << "机甲猫头鹰的失败,让他非常生气。\n";
cout << "于是你决定和机甲猫头鹰进行最终对决\n";
cout << "开始!\n";
wins = 0;
blood = bloodyuan;
fpblood = 1000000000;
fangg = 100;
times = 0;
ne = 0;
bool have_smallowl = 0;
int small_blood;
int res = 0;
while (!wins) {
times ++;
cout << "机甲猫头鹰对你造成了" << max(0, 10000000 - fangg) << "点伤害!\n";
blood -= max(0, 10000000 - fangg);
if (blood <= 0) {
break;
}
if (fpblood <= 1000000){
cout << "机甲猫头鹰:我生气了,召唤小号机甲猫头鹰!!!!\n";
cout << "机甲猫头鹰:小号猫头鹰也有血量,血量为10000\n";
res ++ ;
if (res <= 3){
have_smallowl = 1;
small_blood = 10000;
}
}
if (!have_smallowl){
cout << "请选择武器\n";
cout << "你的血量为" << blood << endl;
cout << "机甲猫头鹰的血量为" << fpblood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
fangg += vec[id].fang;
if (vec[id].spj == 1) {
cout << "二向箔无效!\n";
}
if (vec[id].name != "太阳" && vec[id].name != "高级星际舰队" && vec[id].name != "宇宙黑暗森林广播器" && vec[id].name != "球状闪电" && vec[id].name != "反物质导弹"){
cout << "机甲猫头鹰被雷电攻击了!!!\n";
fpblood -= 10000;
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 1000000) << "点血\n";
fpblood -= max(0ll, vec[id].gong * vec[id].level - 1000000);
if (fpblood <= 0) {
win = 1;
break;
}
}
continue;
}
cout << "ok\n";
if (ne) {
cout << "机甲猫头鹰被你打坏了" << 0 << "点血\n";
} else {
cout << "机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 1000000) << "点血\n";
fpblood -= max(0ll, vec[id].gong - 1000000);
}
if (fpblood <= 0) {
win = 1;
break;
}
if (rand() % 5 == 1) {
cout << "机甲猫头鹰机甲破损!机甲猫头鹰少了1000000点血\n";
fpblood -= 100000000;
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰突袭!扣除武器!\n";
if (vec.size()) {
vec.pop_back();
}
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰回血!\n";
fpblood += 1919810;
}
if (rand() % 5 == 1) {
cout << "你回血了\n";
blood += 10000;
}
if (rand() % 20 == 1) {
cout << "机甲猫头鹰末日!奖励太阳!\n";
vec.push_back(wuqiku1.back());
}
if (rand() % 150 == 1) {
cout << "前方高能预警!!!\n";
cout << "机甲猫头鹰大力来袭!\n";
blood -= 1000000000;
}
if (rand() % 20 == 1) {
cout << "防御加强!你的防御力×5\n";
fangg *= 5;
}
if (rand() % 50 == 1) {
cout << "世界毁灭!机甲猫头鹰血量减少1000000,你的血量减少10000\n";
blood -= 10000, fpblood -= 1000000;
}
if (rand() % 10000 == 1) {
cout << "黑洞!!!游戏结束(你和机甲猫头鹰谁都赢了)\n";
return 0;
}
if (rand() % 20 == 1) {
cout << "机关枪扫射!!!机甲猫头鹰的血量减少10000\n";
fpblood -= 10000;
}
if (rand() % 10 == 1) {
cout << "机甲猫头鹰飞上天空!!!攻击无效!!!\n";
cout << "机甲猫头鹰使用了核弹!!!\n";
cout << "你被打坏了" << 114514 << "点血\n";
blood -= 114514;
ne = 1;
}
if (ne && rand() % 3 == 1) {
cout << "机甲猫头鹰降落!!!";
if (rand() % 5 == 1) {
cout << "机甲破碎了!!!造成1000点伤害\n";
fpblood -= 1000;
} else {
cout << "成功降落!!!\n";
}
ne = 0;
}
}
else{
cout << "请选择武器\n";
cout << "你的血量为" << blood << endl;
cout << "小号机甲猫头鹰的血量为" << small_blood << endl;
cout << "有这些武器\n";
for (int i = 0; i < vec.size(); i ++ ) {
cout << i + 1 << "." << vec[i].name << "(作用:" << vec[i].zuoyong << ")\n";
}
cout << "请选择第几个\n";
int id;
cin >> id;
id -- ;
fangg += vec[id].fang;
if (vec[id].spj == 1) {
cout << "二向箔无效!\n";
}
if (vec[id].spj == 2) {
cout << "ok\n";
int xxx = rand() % 10;
cout << "球状闪电已进入概率云模式,";
if (xxx < 2) {
cout << "攻击失败!\n";
} else {
cout << "攻击成功!小号机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 0) << "点血\n";
small_blood -= max(0ll, vec[id].gong * vec[id].level - 0);
if (small_blood <= 0) {
have_smallowl = 0;
break;
}
}
continue;
}
cout << "ok\n";
if (ne) {
cout << "小号机甲猫头鹰被你打坏了" << 0 << "点血\n";
} else {
cout << "小号机甲猫头鹰被你打坏了" << max(0ll, vec[id].gong - 1000000) << "点血\n";
small_blood -= max(0ll, vec[id].gong - 1000000);
}
if (small_blood <= 0) {
have_smallowl = 0;
}
if (rand() % 10 == 1) {
cout << "小号机甲猫头鹰机甲破损!机甲猫头鹰少了1000000点血\n";
small_blood -= 100000000;
}
if (rand() % 20 == 1) {
cout << "小号机甲猫头鹰突袭!扣除武器!\n";
if (vec.size()) {
vec.pop_back();
}
}
if (rand() % 20 == 1) {
cout << "小号机甲猫头鹰回血!\n";
small_blood += 1919810;
}
if (rand() % 5 == 1) {
cout << "你回血了\n";
blood += 10000;
}
if (rand() % 20 == 1) {
cout << "小号机甲猫头鹰末日!奖励宇宙黑暗森林广播器\n";
vec.push_back(wuqiku1.back());
}
if (rand() % 150 == 1) {
cout << "前方高能预警!!!\n";
cout << "小号机甲猫头鹰大力来袭!\n";
blood -= 1000000000;
}
if (rand() % 20 == 1) {
cout << "防御加强!你的防御力×5\n";
fangg *= 5;
}
if (rand() % 50 == 1) {
cout << "世界毁灭!小号机甲猫头鹰血量减少1000000,你的血量减少10000\n";
blood -= 10000, small_blood -= 1000000;
}
if (rand() % 10000 == 1) {
cout << "黑洞!!!游戏结束(你和机甲猫头鹰谁都赢了)\n";
return 0;
}
if (rand() % 20 == 1) {
cout << "机关枪扫射!!!小号机甲猫头鹰的血量减少10000\n";
small_blood -= 10000;
}
if (rand() % 10 == 1) {
cout << "小号机甲猫头鹰飞上天空!!!攻击无效!!!\n";
cout << "小号机甲猫头鹰使用了核弹!!!\n";
cout << "你被打坏了" << 114514 << "点血\n";
blood -= 114514;
ne = 1;
}
if (ne && rand() % 3 == 1) {
cout << "小号机甲猫头鹰降落!!!";
if (rand() % 5 == 1) {
cout << "小号机甲破碎了!!!造成1000点伤害\n";
small_blood -= 1000;
} else {
cout << "成功降落!!!\n";
}
ne = 0;
}
}
blood += 100;
}
if (wins){
for (int i = 0; i < 12; i ++ ) {
for (int j = 0; j < 26; j ++ ) {
cout << bq[i][j];
}
cout << endl;
}
cout << "机甲猫头鹰向你竖了白旗,游戏结束了。\n";
cout << "最终,你看清了机甲猫头鹰的真实面貌,原来他不是猫头鹰,而是恶魔所变\n";
}else {
cout << "你被机甲猫头鹰砍下头颅,并被烧死\n";
cout << "你输了,再见\n";
}
} else {
cout << "你被机甲猫头鹰砍下头颅,并被烧死\n";
cout << "你输了,再见\n";
}
return 0;
}
```
管理员密码:我的账号名