小游戏(后续)
2025-08-06 17:32:47
发布于:浙江
if (b == 1) {
while (1) {
if (xing <= 0) {
while (duixing) {
cout << "对手回合";
if (abs(oi - ri) + abs(oj - rj) <= 5 && duixing >= 2 && dcd2 == 0) {
cout << "对手释放惊吓箱造成了" << diwugong + 35 << "点伤害";
duixing -= 1;
Sleep(1000);
sheng -= (diwugong + 35);
dcd2 += 4;
} else if (abs(oi - ri) + abs(oj - rj) <= 3 && duixing >= 1) {
cout << "对手普攻造成了" << diwugong << "点伤害";
duixing -= 1;
sheng -= diwugong;
Sleep(1000);
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
Sleep(1000);
Sleep(1000);
}
} else if (duixing <= 0) {
break;
} else {
if (rj < oi) {
cout << "对手2坐标+1" << endl;
rj++;
duixing -= 1;
}
if (rj > oi) {
rj--;
cout << "对手2坐标-1" << endl;
duixing -= 1;
}
if (ri < oj) {
cout << "对手1坐标+1" << endl;
duixing -= 1;
ri++;
}
if (ri > oj) {
cout << "对手1坐标-1" << endl;
duixing -= 1;
ri--;
}
if (ri == oj && ri == oi) {
cout << "对手普攻造成了" << diwugong << "点伤害";
duixing -= 1;
sheng -= diwugong;
Sleep(1000);
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
Sleep(1000);
Sleep(1000);
}
}
cout << "目前坐标" << rj << "," << ri;
Sleep(1000);
}
dcd1--;
dcdd--;
if (sheng <= 0) {
chao -= 20;
break;
cout << "你输了";
Sleep(1000);
}
}
xing += 6;
duixing = 7;
duixing -= jiandian;
}
system("cls");
if (sheng <= 0) {
break;
cout << "你输了";
}
cout << " 第" << l << "回合\n";
cout << "你的回合,0.普攻 ,1.引力炸弹,2.高能激光,3.头脑风暴\nw一坐标 s一坐标-1,d二坐标+1,a二坐标+1\n行动点剩余" << xing << endl << " 生命" << sheng << " 对手血量" << disheng << endl;
cout << " 当前冷却 ";
if (cdp < 0) {
cout << "0 ";
} else {
cout << cdp << " ";
}
if (cd1 < 0) {
cout << "0 ";
} else {
cout << cd1 << " ";
}
if (cd2 < 0) {
cout << "0 ";
} else {
cout << cd2 << " ";
}
if (cdd < 0) {
cout << "0 ";
} else {
cout << cdd << " ";
}
if (jingda == true) cout << "你的大招被禁用了" << endl;
cout << " 目前位置:" << "(" << oi << "," << oj << ")\n";
cout << " 对手目前位置:" << "(" << ri << "," << rj << ")\n";
if (chi == 1) {
cout << "(头脑风暴)你对对手造成了" << tongli << "点伤害\n";
disheng -= tongli;
chi--;
}
float linjia = 0;
char aa;
cin >> aa;
if (aa == 'w') {
oi++;
xing -= 1;
}
if (aa == 's') {
oi--;
xing -= 1;
}
if (aa == 'd') {
oj++;
xing -= 1;
}
if (aa == 'a') {
oj--;
xing -= 1;
}
if (aa == '2' && cd2 <= 0) {
int g = rand() % 20 + 1;
if (jingda == true) {
cd2 = 2;
} else {
cd2 = 4;
}
if (g <= fabao1) {
cout << "暴击!!,";
linjia = fabaos1;
}
xing -= 1;
if (abs(oi - ri) + abs(oj - rj) <= 5) {
cout << "你对对手造成了" << ((20 + fagong * 1.6) * (1 + shengda / 100 + wei / 100 ))*(linjia / 100 + 1) << "点伤害\n";
if (zhuanlan == true) {
cd2--;
}
Sleep(200);
disheng = disheng - ((20 + fagong * 1.6) * (1 + shengda / 100 + wei / 100 )) * (linjia + 1);
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << (20 + fagong * (1 + shengda / 100))*(luojin - 1) << "点伤害\n";
disheng = disheng - (20 + fagong * (1 + shengda / 100 + wei / 100)) * (luojin - 1);
}
if (zhuan2 == true) {
cout << "双重波波额外" << ((20 + fagong * 1.6) * (1 + shengda / 100 + wei / 100 ))*(linjia + 1) << "点伤害";
disheng = disheng - ((20 + fagong * 1.6) * (1 + shengda / 100 + wei / 100 )) * (linjia + 1);
Sleep(200);
if (zhuanlan == true) cd2--;
}
shengda = 0;
} else {
cout << "没打中\n";
Sleep(2300);
}
if (disheng <= 0) {
dichao -= 20;
cout << "你赢了";
break;
}
} else if (aa == '1' && cd1 <= 0) {
int g = rand() % 20 + 1;
if (g <= fabao1) {
cout << "暴击!!,";
linjia = fabaos1;
}
xing -= 1;
cout << "你对对手造成了" << 20 + fagong*(1 + shengda / 100 + wei / 100) * (0.6 + linjia / 100) << "点伤害\n";
Sleep(200);
disheng = disheng - (20 + fagong * (1 + shengda / 100 + wei / 100) * (0.6 + linjia));
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << 20 + fagong*(1 + shengda / 100 + wei / 100) * 0.6 * (luojin - 1) << "点伤害\n";
disheng = disheng - (20 + fagong * (1 + shengda / 100 + wei / 100)) * 0.6 * (luojin - 1);
}
if (jingda == true) {
cd1 = 1;
} else {
cd1 = 2;
}
if (disheng <= 0) {
cout << "你赢了";
dichao -= 20;
break;
}
shengda = 0;
} else if (aa == '3' && cdd <= 0 && jingda != true) {
int g = rand() % 20 + 1;
if (g <= fabao1) {
cout << "暴击!!,";
linjia = fabaos1;
}
xing -= 1;
cout << "你对对手造成了" << 30 + fagong*(1 + shengda / 100 + wei / 100) * 0.2 + wugong*(1 + shengda / 100 + wei / 100) * (0.3 + linjia / 100) << "点伤害,并持续1回合\n";
Sleep(200);
disheng = disheng - (30 + fagong * (1 + shengda / 100 + wei / 100) * 0.3 + wugong * (1 + shengda / 100 + wei / 100) * (0.3 + linjia / 100));
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << (disheng - 30 + fagong * (1 + shengda / 100) * 0.3 + wugong * (1 + shengda / 100) * 0.2 )* (luojin - 1) << "点伤害\n";
disheng = disheng - (30 + fagong * (1 + shengda / 100) * 0.3 + wugong * (1 + shengda / 100 + wei / 100) * 0.2 * (luojin - 1));
}
tongli = ( 30 + fagong * (1 + shengda / 100 + wei / 100) * 0.2 + wugong * (1 + shengda / 100 + wei / 100) * 0.3);
chi = 1;
if (jingda == true) {
cdd = 3;
} else {
cdd = 6;
}
if (disheng <= 0) {
cout << "你赢了";
chao -= 20;
break;
}
} else if (aa == '0' && cdp <= 0 && abs(oi - ri) + abs(oj - rj) <= 7) {
xing -= 1;
cout << "你对对手造成了" << (shengda / 100 + 1)*wugong*(xul / 100 + 1) + (pue * dishengmax / 100) << "点伤害\n";
disheng = disheng - ((shengda / 100 + 1) * wugong * (xul / 100 + 1) + (pue * dishengmax / 100));
if (xu == true) {
cdp = 1;
}
shengda = 0;
for (int i = 0; i < ci; i++) {
if (he > 0) {
cout << "合金狼牙棒:造成了" << he*disheng * 0.01 << "点伤害\n";
disheng -= he * disheng * 0.01;
}
if (quan > 0) {
cout << "巨人拳套:造成了" << shengmax*quan * 0.01 << "点伤害\n";
disheng -= shengmax * quan * 0.01;
}
}
wugong += pujia;
Sleep(300);
} else {
cdd++;
cd2++;
cd1++;
cdp++;
l--;
}
Sleep(500);
if (disheng <= 0) {
cout << "你赢了";
dichao -= 20;
break;
}
dcd1--;
dcdd--;
dcd2--;
cdd--;
cd2--;
l++;
cd1--;
cdp--;
difacd--;
leifa();
}
} else if (b == 2) {
while (1) {
if (xing <= 0) {
while (duixing) {
cout << "对手回合";
Sleep(1000);
if (abs(oi - ri) + abs(oj - rj) <= 5 && duixing >= 2 && dcd2 == 0) {
cout << "对手释放激光造成了" << difagong << "点伤害";
duixing -= 1;
Sleep(1000);
sheng -= difagong * 1.6;
dcd2 += 4;
} else if (abs(oi - ri) + abs(oj - rj) <= 5 && duixing >= 1 && dcd1 <= 0) {
cout << "对手引力炸弹造成了" << (20 + difagong) * 0.6 << "点伤害";
duixing -= 1;
sheng -= (20 + difagong * 0.6);
Sleep(1000);
dcd1++;
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
Sleep(2000);
}
} else if (abs(oi - ri) + abs(oj - rj) <= 3 && duixing >= 1) {
cout << "对手普攻造成了" << diwugong << "点伤害";
duixing -= 1;
sheng -= diwugong;
Sleep(1000);
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
Sleep(1000);
Sleep(1000);
}
} else if (duixing <= 0) {
break;
} else {
if (ri < oi) {
cout << "对手1坐标+1" << endl;
ri++;
duixing -= 1;
} else if (ri > oi) {
ri--;
cout << "对手1坐标-1" << endl;
duixing -= 1;
} else if (rj < oj) {
cout << "对手2坐标+1" << endl;
duixing -= 1;
rj++;
} else if (rj > oj) {
cout << "对手2 坐标-1" << endl;
duixing -= 1;
rj--;
}
cout << "目前坐标" << rj << "," << ri;
Sleep(400);
Sleep(2000);
}
dcd1--;
dcdd--;
dcd2--;
if (sheng <= 0) {
break;
cout << "你输了";
chao -= 20;
Sleep(1000);
}
}
xing += 6;
duixing = 6;
duixing -= jiandian;
}
system("cls");
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
}
system("cls");
cout << " 第" << l << "回合\n";
cout << "你的回合\n0.普攻,1.咸鱼飞刀,2.隐身,3.惊吓箱,w一坐标 s一坐标-1,d二坐标+1,a二坐标-1\n行动点剩余" << xing << endl << " 生命" << sheng << " 对手血量" << disheng;
if (jingda == true) {
cout << "你的大招被禁用了";
}
cout << " 目前位置:" << "(" << oi << "," << oj << ")\n";
cout << " 对手目前位置:" << "(" << ri << "," << rj << ")\n";
char aa;
cin >> aa;
float linjia = 0;
if (aa == 'w') {
oi++;
xing -= 1;
Sleep(500);
}
if (aa == 's') {
oi--;
xing -= 1;
Sleep(500);
}
if (aa == 'd') {
oj++;
xing -= 1;
Sleep(500);
}
if (aa == 'a') {
oj--;
xing -= 1;
Sleep(500);
} else if (aa == '0' && cdp <= 0 && abs(oi - ri) + abs(oj - rj) <= 4) {
int g = rand() % 20;
if (g <= wubao1) {
cout << "暴击!!,";
linjia = wubaos1;
}
cout << cdp << ' ' << abs(oi - ri) + abs(oj - rj);
xing -= 1;
cout << "你对对手造成了" << ((wugong) * (((xul + shengda + 1) + zengshang * 100) / 100) + (pue * dishengmax / 100))*(linjia / 100 + 1) << "点伤害\n";
disheng = disheng - ((wugong) * (((xul + shengda + 1) + zengshang * 100) / 100) + (pue * dishengmax / 100)) * (linjia / 100 + 1);
zengshang = 1;
if (ying == true && zhuan1 == true) {
cout << "(漂浮不定)你对对手造成了" << ((wugong) * (((xul + shengda + 1) + zengshang * 100) / 100) + (pue * dishengmax / 100))*(linjia / 100 + 1) << "点伤害\n";
disheng = disheng - ((wugong) * (((xul + shengda + 1) + zengshang * 100) / 100) + (pue * dishengmax / 100)) * (linjia / 100 + 1);
}
ying = false;
for (int i = 0; i < ci; i++) {
if (he > 0) {
cout << "合金狼牙棒:造成了" << he*disheng * 0.01 << "点伤害\n";
disheng -= he * disheng * 0.01;
}
if (quan > 0) {
cout << "巨人拳套:造成了" << shengmax*quan * 0.01;
disheng -= shengmax * quan * 0.01;
}
}
shengda = 0;
if (xu == true) {
cdp = 1;
}
Sleep(1000);
wugong += pujia;
} else if (aa == '1' && cd1 <= 0) {
int g = rand() % 20;
if (g <= wubao1) {
cout << "暴击!!,";
linjia = wubaos1;
}
xing -= 1;
if (jingda == true) {
cd1 = 2;
} else {
cd1 = 4;
}
if (abs(oi - rj) + abs(oj - ri) <= 7) {
cout << "你对对手造成了" << ((20 + wugong) * (1 + shengda / 100))*(linjia / 100 + 1) << "点伤害\n";
if (zhuanhei == true) {
cd1--;
}
Sleep(200);
disheng = disheng - ((20 + wugong) * (1 + shengda / 100)) * (linjia / 100 + 1);
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << (20 + wugong * (1 + shengda / 100))*(luojin - 1) << "点伤害\n";
disheng = disheng - (20 + wugong * (1 + shengda / 100)) * (luojin - 1);
}
Sleep(1000);
}
ying = false;
} else if (aa == '2' && cd2 <= 0) {
cout << "你开启了隐身";
zengshang = 1.5;
Sleep(1000);
ying = true;
if (jingda == true) {
cd2 = 4;
} else {
cd2 = 8;
}
} else if (aa == '3' && cdd <= 0) {
int g = rand() % 20;
if (g <= wubao1) {
cout << "暴击!!,";
linjia = wubaos1;
}
if (abs(oi - ri) + abs(oj - rj) <= 4) {
cout << "你对对手造成了" << (40 + wugong * 0.8) << "点伤害并加上一点行动点\n";
xingg += 1;
Sleep(200);
disheng = disheng - (40 + wugong * 0.8);
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << (40 + wugong * 0.8)*(luojin - 1) << "点伤害\n";
disheng = disheng - (40 + wugong * 0.8) * (luojin - 1);
}
Sleep(1000);
} else {
cout << "没打中";
}
if (jingda == true) {
cdd = 4;
} else {
cdd = 8;
}
ying = false;
} else {
cdd++;
cd2++;
cd1++;
cdp++;
l--;
}
if (disheng <= 0) {
cout << "你赢了";
Sleep(1000);
dichao -= 20;
break;
}
cdd--;
cd2--;
cd1--;
cdp--;
l++;
difacd--;
leifa();
}
} else if (b == 3) {
while (1) {
if (xing <= 0) {
while (duixing) {
cout << "对手回合\n\n";
if (abs(oi - rj) + abs(oj - ri) <= 5 && dcd2 == 0) {
cout << "对手释放惊吓箱造成了" << diwugong + 35 << "点伤害";
duixing -= 1;
Sleep(1000);
sheng -= (diwugong + 35);
dcd2 += 4;
} else if (abs(oi - rj) + abs(oj - ri) <= 3) {
cout << "对手普攻造成了" << diwugong << "点伤害";
duixing -= 1;
sheng -= diwugong;
Sleep(1000);
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
Sleep(1000);
}
} else {
if (rj < oi) {
cout << "对手2坐标+1" << endl;
rj++;
duixing -= 1;
}
if (rj > oi) {
rj--;
cout << "对手2坐标-1" << endl;
duixing -= 1;
}
if (ri < oj) {
cout << "对手1坐标+1" << endl;
duixing -= 1;
ri++;
}
if (ri > oj) {
cout << "对手1坐标-1" << endl;
duixing -= 1;
ri--;
}
if (ri == oj && ri == oi) {
cout << "对手普攻造成了" << diwugong << "点伤害";
duixing -= 1;
sheng -= diwugong;
Sleep(1000);
if (sheng <= 0) {
cout << "你输了";
chao -= 20;
break;
Sleep(1000);
Sleep(1000);
}
}
cout << "目前坐标" << rj << "," << ri;
Sleep(1000);
}
dcd1--;
dcdd--;
if (sheng <= 0) {
chao -= 20;
break;
cout << "你输了";
Sleep(1000);
}
}
xing += 6;
duixing = 7;
duixing -= jiandian;
}
system("cls");
if (sheng <= 0) {
break;
cout << "你输了";
}
cout << " 第" << l << "回合\n";
cout << "你的回合,0.普攻 ,1.闪耀冲刺,2.能量光波,3.真理脉冲\nw一坐标 s一坐标-1,d二坐标+1,a二坐标-1\n行动点剩余" << xing << endl << " 生命" << sheng << " 对手血量" << disheng << endl;
if (jingda == true) cout << "你的大招被禁用了" << endl;
cout << " 目前位置:" << "(" << oi << "," << oj << ")\n";
cout << " 对手目前位置:" << "(" << ri << "," << rj << ")\n";
float linjia = 0;
char aa;
cin >> aa;
if (aa == 'w') {
oi++;
xing -= 1;
}
if (aa == 's') {
oi--;
xing -= 1;
}
if (aa == 'd') {
oj++;
xing -= 1;
}
if (aa == 'a') {
oj--;
xing -= 1;
}
if (aa == '2' && cd2 <= 0) {
cout << oi << ' ' << oj << "\n" << ri << rj;
xing -= 1;
int g = rand() % 20 + 1;
if (jingda == true) {
cd2 = 3;
} else {
cd2 = 6;
}
if (g <= wubao1) {
cout << "暴击!!,";
linjia = wubaos1;
}
if (abs(oj - rj) + abs(oj - rj) <= 6) {
cout << "你对对手造成了" << ((20 + wugong * 1.2) * (1 + shengda / 100 + wei / 100 ))*(linjia / 100 + 1) << "点伤害\n";
cd1 -= ji;
cd2 -= ji;
cdd -= ji;
Sleep(200);
disheng = disheng - ((20 + wugong * 1.0) * (1 + shengda / 100 + wei / 100 )) * (linjia / 100 + 1);
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << ((20 + wugong * 1.0) * (1 + shengda / 100 + wei / 100 ))*(linjia / 100 + 1)*(luojin - 1) << "点伤害\n";
disheng = disheng - (20 + fagong * (1 + shengda / 100 + wei / 100)) * (luojin - 1);
}
if (zhuan3 == true) {
cout << "复刻射击额外" << ((20 + wugong * 1.0) * (1 + shengda / 100 + wei / 100 ))*(linjia / 100 + 1) << "点伤害";
disheng = disheng - ((20 + wugong * 1.0) * (1 + shengda / 100 + wei / 100 )) * (linjia / 100 + 1);
Sleep(200);
cd1 -= ji;
cd2 -= ji;
cdd -= ji;
}
shengda = 0;
} else {
cout << "没打中\n";
Sleep(2300);
}
if (disheng <= 0) {
dichao -= 20;
cout << "你赢了";
break;
}
} else if (aa == '1' && cd1 <= 0) {
cout << "朝哪个方向移动 w一坐标+2 s一坐标-2,d二坐标+2,a二坐标-2";
cd2 = 0;
char aaa;
cin >> aaa;
if (aaa == 'w') {
oi += 2;
}
if (aaa == 's') {
oi -= 2;
}
if (aaa == 'd') {
oj += 2;
}
if (aaa == 'a') {
oj -= 2;
}
if (jingda == true) {
cd1 = 3;
} else {
cd1 = 6;
}
} else if (aa == '3' && cdd <= 0 && jingda != true) {
int g = rand() % 20 + 1;
if (g <= wubao1) {
cout << "暴击!!,";
linjia = wubaos1;
}
xing -= 1;
cout << "你对对手造成了" << (20 + wugong * (1 + shengda / 100 + wei / 100) * da / 100)*(1 + linjia / 100) << "点伤害,并持续1回合\n";
Sleep(200);
disheng = disheng - (20 + wugong * (1 + shengda / 100 + wei / 100) * da / 100) * (1 + linjia / 100);
if (disheng <= dishengmax / 2) {
cout << "(落井下石)你对对手造成了" << 20 + wugong*(1 + shengda / 100 + wei / 100) * da / 100 * (luojin - 1) << "点伤害\n";
disheng = disheng - (20 + wugong * (1 + shengda / 100 + wei / 100) * da / 100 * (luojin - 1));
}
if (jingda == true) {
cdd = 3;
} else {
cdd = 6;
}
if (disheng <= 0) {
cout << "你赢了";
dichao -= 20;
break;
}
}
全部评论 7
怎么报错了
21小时前 来自 四川
0还有
20小时前 来自 浙江
0你重复制一下
20小时前 来自 浙江
0我那时候在更新
20小时前 来自 浙江
0
蛋仔加好友吗?
名:你12点黄2025-06-15 来自 浙江
0跟我玩别抢我劝学
2025-06-16 来自 浙江
0我叫广水全智蛋
2025-06-16 来自 浙江
0ok
2025-06-22 来自 浙江
0
6,现在c++都能玩超燃了
2025-06-15 来自 浙江
0不完全体
2025-06-16 来自 浙江
0
OKOK
2025-05-28 来自 浙江
0暴击目前只做了小蓝
2025-06-03 来自 浙江
0好的好的
2025-06-03 来自 浙江
0
2025-05-28 来自 浙江
0顶
2025-05-28 来自 浙江
0顶
2025-05-28 来自 浙江
0
有帮助,赞一个