这是drs抄袭模仿名字竞技场做出来的,祝大家玩得开心。
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
struct player{
string name,ko,zhao;
int hsum = 0,id = 0,sbl = 0,sum = 0,zy = 0,tdly,hp = 300,hurt = 20,wdhh = 0,fang = 5,bdhh = 0,kocnt = 0,tmpfang = 5,hxl = 20,neili = 10,dhurt = 10,bdhurt = 0,duhh = 0;
bool bdg = 0,xuli = 0,dg = 0,bs = 0,zb = 0;
}a[1005];
int n,zycnt,cnt,sum,man[1005],people;
bool vis[1005],is;
void read(){
cout << "欢迎来到名字竞技场。\n";
Sleep(500);
cout << "请输入玩家数量(不能超过1000)(阵营从1开始编号):";
cin >> n;
people = n;
cout << "是否要挑战BOSS(是1否0):";
cin >> is;
for (int i = 1; i <= n; i++){
cout << "请输入玩家" << i << "的名字:";
cin >> a[i].name;
if (is) a[i].zy = 1;
else{
cout << "请输入玩家" << i << "的阵营:";
cin >> a[i].zy;
}
man[a[i].zy]++;
if (!vis[a[i].zy]){
cnt++;
zycnt++;
vis[a[i].zy] = 1;
}
}
if (is){
zycnt++;
a[++n].hp = 1000;
a[n].name = "BOSS";
a[n].hurt = 100;
a[n].sbl = 10;
a[n].fang = a[n].tmpfang = 25;
a[n].zy = 2;
man[a[n].zy]++;
cnt++;
}
system("cls");
return;
}
void print(){
sort(a + 1,a + n + 1,[](player x,player y){
if (x.hsum == y.hsum) return x.kocnt > y.kocnt;
return x.hsum > y.hsum;
});
int ans = 0,win = -1;
for (int i = 1; i <= n; i++) if (a[i].hp > 0){
win = a[i].zy;
ans = i;
break;
}
if (win == -1) cout << "无人获胜。\n";
else{
cout << "阵营" << win << "胜利。\n获胜名单:\n";
for (int i = 1; i <= n; i++) if (a[i].zy == win){
cout << "获胜名字:" << a[i].name << " 造成伤害:" << a[i].hsum << " 击杀人数:" << a[i].kocnt;
if (a[i].hp == 0) cout << " 致命一击:" << a[i].ko << " 致命招数:" << a[i].zhao;
cout << "。\n";
Sleep(1500);
}
}
cout << "获败名单:\n";
for (int i = 1; i <= n; i++) if (a[i].zy != win){
cout << "获败名字:" << a[i].name << " 获败阵营:" << a[i].zy << " 造成伤害:" << a[i].hsum << " 击杀人数:" << a[i].kocnt << " 致命一击:" << a[i].ko << " 致命招数:" << a[i].zhao << "。\n";
Sleep(1500);
}
if (is && win != 1){
while(MessageBox(NULL,"菜就多练,输不起就别玩,以前是以前,现在是现在,别把以前当现在,你还是跟以前一样菜","你失败了",MB_YESNO | MB_ICONQUESTION) == IDNO);
MessageBox(NULL,"你终于承认了","哈哈哈",MB_OK | MB_ICONEXCLAMATION);
}
system("pause");
return;
}
void BOSS(){
int player = n;
if (!a[player].wdhh && a[player].fang == -1){
cout << a[player].name << "无敌时间到。\n";
Sleep(1000);
a[player].fang = a[player].tmpfang;
}
if (a[player].wdhh > 0){
cout << a[player].name << "的无敌时间还剩下" << a[player].wdhh << "回合。\n";
Sleep(1000);
a[player].wdhh--;
}
if (a[player].duhh > 0){
int hurt = rand() % 10 + a[player].bdhurt - 5;
a[player].hp -= hurt;
a[player].hp = max(0,a[player].hp);
a[a[player].tdly].hsum += max(0,hurt - a[player].fang);
cout << a[player].name << "中毒了,受到" << hurt << "点毒伤,还剩下" << a[player].hp << "点血量,中毒时间还剩下" << a[player].duhh << "回合。\n";
a[player].duhh--;
if (a[player].hp == 0){
Sleep(1500);
cout << a[player].name << "被击倒了。\n";
a[player].ko = a[a[player].tdly].name;
a[a[player].tdly].kocnt++;
a[player].zhao = "毒";
man[a[player].zy]--;
people--;
if (!man[a[player].zy]){
Sleep(1500);
cout << "阵营" << a[player].zy << "团灭。\n";
cnt--;
}
return;
}
Sleep(1500);
}
else if (a[player].dg){
a[player].dg = 0;
cout << a[player].name << "解毒。\n";
Sleep(1000);
}
if (a[player].bdhh > 0){
cout << a[player].name << "被冰冻了,无法行动,冰冻回合还剩下" << a[player].bdhh << "回合\n";
a[player].bdhh--;
Sleep(1000);
return;
}
else if (a[player].bdg){
a[player].bdg = 0;
cout << a[player].name << "解冻。\n";
Sleep(1000);
}
int player2,ff = rand() % 100 + 1;
do{player2 = rand() % n + 1;}while(a[player].zy == a[player2].zy || a[player2].hp <= 0 || player == player2);
sb:if (ff <= 10){
int jxl = rand() % 21 + 40;
a[player].hp += jxl;
cout << a[player].name << "发动了金刚不坏,生命+" << jxl << "," << a[player].name << "还剩下" << a[player].hp << "点血量。\n";
Sleep(1500);
}
else if (ff <= 20){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了入木三分,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了入木三分,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
a[player].hsum += a[player2].hp - a[player2].hp / 3;
a[player2].hp /= 3;
a[player2].hp = max(a[player2].hp,0);
cout << a[player].name << "向" << a[player2].name << "发动了入木三分," << a[player2].name << "的血量只剩下原来的3分之1," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "入木三分";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
return;
}
else if (ff <= 30){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了滴水成冰,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了滴水成冰,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player2].bdhh += 3;
a[player2].bdg = 1;
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了滴水成冰,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量," << a[player2].name << "被冰冻了3回合。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "滴水成冰";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 40){
cout << a[player].name << "发动了火烧赤壁。\n";
Sleep(1000);
for (int i = 1; i <= n; i++){
if (a[i].hp == 0 || a[i].zy == a[player].zy) continue;
int player2 = i;
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
continue;
}
int hurt = (rand() % 21 + a[player].hurt - 10) / 2;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了攻击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "火烧赤壁";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
}
else if (ff <= 50){
a[player].fang = -1;
a[player].wdhh++;
cout << a[player].name << "发动了土生土长,任何攻击都无法对TA生效,持续1回合\n";
Sleep(1500);
}
else if (ff <= 60){
a[++n].name = "怪物";
a[n].zy = a[player].zy;
a[n].hp = 500;
man[a[player].zy]++;
cout << a[player].name << "发动了召唤,出现了一个怪物。\n";
swap(a[n],a[player]);
Sleep(1500);
}
else{
if (a[player].xuli){
ff = rand() % 70 + 1;
a[player].xuli = 0;
goto sb;
}
cout << a[player].name << "蓄力。\n";
a[player].xuli = 1;
Sleep(1000);
}
return;
}
void work(int player){
if (is && a[player].zy == 2 && a[player].name == "BOSS"){
BOSS();
return;
}
if (is && a[player].zy == 2 && a[player].name == "怪物" || a[player].bs){
if (a[player].duhh > 0){
int hurt = rand() % 10 + a[player].bdhurt - 5;
a[player].hp -= hurt;
a[player].hp = max(0,a[player].hp);
cout << a[player].name << "中毒了,受到" << hurt << "点毒伤,还剩下" << a[player].hp << "点血量,中毒时间还剩下" << a[player].duhh << "回合。\n";
a[player].duhh--;
if (a[player].hp == 0){
Sleep(1500);
cout << a[player].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].id == player){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player].ko = a[a[player].tdly].name;
a[a[player].tdly].kocnt++;
a[player].zhao = "毒";
man[a[player].zy]--;
people--;
if (!man[a[player].zy]){
Sleep(1500);
cout << "阵营" << a[player].zy << "团灭。\n";
cnt--;
}
return;
}
Sleep(1500);
}
else if (a[player].dg){
a[player].dg = 0;
cout << a[player].name << "解毒。\n";
Sleep(1000);
}
if (a[player].bdhh > 0){
cout << a[player].name << "被冰冻了,无法行动,冰冻回合还剩下" << a[player].bdhh << "回合\n";
a[player].bdhh--;
Sleep(1000);
return;
}
else if (a[player].bdg){
a[player].bdg = 0;
cout << a[player].name << "解冻。\n";
Sleep(1000);
}
int player2,ff = rand() % 100 + 1;
do{player2 = rand() % n + 1;}while(a[player].zy == a[player2].zy || a[player2].hp <= 0 || player == player2);
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "是无敌的。\n";
else{
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了攻击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "普攻";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
return;
}
if (a[player].duhh > 0){
int hurt = rand() % 10 + a[player].bdhurt - 5;
a[player].hp -= hurt;
a[player].hp = max(0,a[player].hp);
a[a[player].tdly].hsum += max(0,hurt - a[player].fang);
cout << a[player].name << "中毒了,受到" << hurt << "点毒伤,还剩下" << a[player].hp << "点血量,中毒时间还剩下" << a[player].duhh << "回合。\n";
a[player].duhh--;
if (a[player].hp == 0){
Sleep(1500);
cout << a[player].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id == player){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].ko = a[player].name;
man[a[player].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player].ko = a[a[player].tdly].name;
a[a[player].tdly].kocnt++;
a[player].zhao = "毒";
man[a[player].zy]--;
people--;
if (!man[a[player].zy]){
Sleep(1500);
cout << "阵营" << a[player].zy << "团灭。\n";
cnt--;
}
return;
}
Sleep(1500);
}
else if (a[player].dg){
a[player].dg = 0;
cout << a[player].name << "解毒。\n";
Sleep(1000);
}
if (!a[player].wdhh && a[player].fang == -1){
cout << a[player].name << "无敌时间到。\n";
Sleep(1000);
a[player].fang = a[player].tmpfang;
}
if (a[player].wdhh > 0){
cout << a[player].name << "的无敌时间还剩下" << a[player].wdhh << "回合。\n";
Sleep(1000);
a[player].wdhh--;
}
if (a[player].bdhh > 0){
cout << a[player].name << "被冰冻了,无法行动,冰冻回合还剩下" << a[player].bdhh << "回合\n";
a[player].bdhh--;
Sleep(1000);
return;
}
else if (a[player].bdg){
a[player].bdg = 0;
cout << a[player].name << "解冻。\n";
Sleep(1000);
}
int player2,ff = rand() % 100 + 1;
do{player2 = rand() % n + 1;}while(a[player].zy == a[player2].zy || a[player2].hp <= 0);
if (a[player].xuli){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了会心一击,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了会心一击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = (rand() % 21 + a[player].hurt - 10) * 3;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了会心一击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "会心一击";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
a[player].xuli = 0;
Sleep(1500);
return;
}
if (a[player].zb){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了自爆,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了自爆,但是" << a[player2].name << "闪避开了。\n";
goto yhy666;
}
int hurt = (rand() % 21 + a[player].hurt - 10) * 8;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了自爆,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "爆炸";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
yhy666:Sleep(1500);
cout << a[player].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].id == player){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player].hp = 0;
a[player].ko = a[player].name;
a[player].kocnt++;
a[player].zhao = "自爆";
man[a[player].zy]--;
people--;
if (!man[a[player].zy]){
Sleep(1500);
cout << "阵营" << a[player].zy << "团灭。\n";
cnt--;
}
Sleep(1500);
return;
}
if (!is && (a[player].hp <= 25 && (man[a[player].zy] > 1 || people == 2))){
a[player].zb = 1;
cout << a[player].name << "点燃了炸弹的引线,一回合后自爆!\n";
Sleep(1500);
return;
}
if (ff <= 50){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了攻击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "普攻";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 52){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了百分比伤害,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了百分比伤害,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int x = rand() % 100;
a[player].hsum += a[player2].hp - a[player2].hp * x / 100;
a[player2].hp = a[player2].hp * x / 100;
cout << a[player].name << "向" << a[player2].name << "发动了百分比伤害," << a[player2].name << "的血量只剩下原来的" << x << "%," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp <= 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "百分比伤害";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 55){
int zy = a[player2].zy;
cout << a[player].name << "发动了万箭齐发,攻击了阵营" << zy << "。\n";
Sleep(1000);
for (int i = 1; i <= n; i++){
if (a[i].hp == 0 || a[i].zy != zy) continue;
int player2 = i;
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了攻击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
continue;
}
int hurt = rand() % 21 + a[player].hurt - 10;
a[player].hsum += max(0,hurt - a[player2].fang);
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
cout << a[player].name << "向" << a[player2].name << "发动了攻击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "万箭齐发";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
}
else if (ff <= 57){
a[++n].name = a[player].name + "的帮手";
a[n].zy = a[player].zy;
a[n].bs = 1;
man[a[player].zy]++;
people++;
cout << a[player].name << "发动了召唤,出现了一个" << a[player].name << "的帮手。\n";
if (is) swap(a[n],a[n - 1]);
Sleep(1500);
}
else if (ff <= 60){
if (a[player2].fang == -1){
cout << a[player].name << "向" << a[player2].name << "发动了乘胜追击,但是" << a[player2].name << "是无敌的。\n";
Sleep(1500);
}
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了乘胜追击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int is = rand() % 10 + 1;
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了乘胜追击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "乘胜追击";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
return;
}
Sleep(1500);
do{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "连击,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
continue;
}
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "连击,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "乘胜追击";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
Sleep(1500);
return;
}
Sleep(1000);
is = rand() % 10 + 1;
}while (is >= 6);
}
}
else if (ff <= 62){
a[++n].name = a[player].name + "的分身";
a[n].zy = a[player].zy;
a[n].hp = 150;
a[n].id = player;
man[a[player].zy]++;
people++;
cout << a[player].name << "发动了分身,出现了一个新的" << a[player].name << "。\n";
if (is) swap(a[n],a[n - 1]);
Sleep(1500);
}
else if (ff <= 65){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了吸血,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了吸血,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hp += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了吸血,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量," << a[player].name << "吸了" << max(0,hurt - a[player2].fang) << "点血,还剩下" << a[player].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "吸血";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 69){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了火球,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了火球,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = (rand() % 21 + a[player].hurt - 10) * 2;
a[player].hsum += max(0,hurt - a[player2].fang);
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
cout << a[player].name << "向" << a[player2].name << "发动了火球,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "火球";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 72){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了冰冻术,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了冰冻术,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = (rand() % 21 + a[player].hurt - 10) / 2;
a[player].hsum += max(0,hurt - a[player2].fang);
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player2].bdhh += 2;
a[player2].bdg = 1;
cout << a[player].name << "向" << a[player2].name << "发动了冰冻术,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量," << a[player2].name << "被冰冻了2回合。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "冰冻术";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 75){
if (a[player2].fang == -1){
int neili = rand() % 11 + a[player].neili - 5;
a[player].hp -= neili;
cout << a[player].name << "向" << a[player2].name << "发动了灰飞烟灭,但是" << a[player2].name << "是无敌的," << a[player].name << "消耗了" << neili << "点内力,还剩下" << a[player].hp << "点血量。\n";
}
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
int neili = rand() % 11 + a[player].neili - 5;
a[player].hp -= neili;
cout << a[player].name << "向" << a[player2].name << "发动了灰飞烟灭,但是" << a[player2].name << "闪避开了," << a[player].name << "消耗了" << neili << "点内力,还剩下" << a[player].hp << "点血量。\n";
Sleep(1500);
return;
}
int hurt = (rand() % 21 + a[player].hurt - 10) * 3,neili = rand() % 11 + a[player].neili - 5;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player].hp -= neili;
a[player].hp = max(a[player].hp,0);
a[player].hsum += max(0,hurt - a[player2].fang) + neili;
cout << a[player].name << "向" << a[player2].name << "发动了灰飞烟灭,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量,但是" << a[player].name << "消耗了" << neili << "点内力," << a[player].name << "还剩下" << a[player].hp << "点血量。\n";
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "灰飞烟灭";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
if (a[player].hp == 0){
Sleep(1500);
cout << a[player].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].id == player){
flag = 1;
a[i].hp = 0;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player].ko = a[player].name;
a[player].kocnt++;
a[player].zhao = "灰飞烟灭的内力";
man[a[player].zy]--;
people--;
if (!man[a[player].zy]){
Sleep(1500);
cout << "阵营" << a[player].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(2000);
}
else if (ff <= 77){
a[player].xuli = 1;
cout << a[player].name << "蓄力......\n";
Sleep(1000);
}
else if (ff <= 79){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了投毒,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了投毒,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int hurt = rand() % 21 + a[player].hurt - 10;
a[player2].hp -= max(0,hurt - a[player2].fang);
a[player2].hp = max(a[player2].hp,0);
a[player2].tdly = player;
a[player2].duhh += 4;
a[player2].dg = 1;
a[player].hsum += max(0,hurt - a[player2].fang);
cout << a[player].name << "向" << a[player2].name << "发动了投毒,对" << a[player2].name << "造成了" << max(0,hurt - a[player2].fang) << "点伤害," << a[player2].name << "还剩下" << a[player2].hp << "点血量," << a[player2].name << "中毒了,持续4回合" << "。\n";
a[player2].bdhurt = a[player].dhurt;
if (a[player2].hp == 0){
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "投毒";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
}
Sleep(1500);
}
else if (ff <= 81){
a[player].fang = -1;
a[player].wdhh += 3;
cout << a[player].name << "发动了无懈可击,任何攻击都无法对TA生效,持续3回合\n";
Sleep(1500);
}
else if (ff <= 84){
int js = rand() % 11 + 5;
a[player].hurt += js;
cout << a[player].name << "发动了所向披靡,攻击+" << js << "。\n";
Sleep(1500);
}
else if (ff <= 87){
int jf = rand() % 5 + 3;
if (a[player].fang != -1) a[player].fang += jf;
else a[player].tmpfang += jf;
cout << a[player].name << "发动了坚不可摧,防御+" << jf << "。\n";
Sleep(1500);
}
else if (ff <= 90){
cout << a[player].name << "发动了妙手回春。\n";
Sleep(1000);
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].zy == a[player].zy){
int hx = rand() % 21 + a[player].hxl - 10;
a[i].hp += hx;
cout << a[i].name << "回了" << hx << "点血," << "还剩下" << a[i].hp << "点血量。\n";
Sleep(1500);
}
}
else if (ff <= 94){
int sb = rand() % 5 + 1;
a[player].sbl += sb;
cout << a[player].name << "发动了行如闪电,闪避率+" << sb << "%。\n";
Sleep(1500);
}
else if (ff <= 97){
int ds = rand() % 10 + 5;
a[player].dhurt += ds;
cout << a[player].name << "发动了心狠手毒,毒伤+" << ds << "。\n";
Sleep(1500);
}
else if (ff == 98){
if (a[player2].fang == -1) cout << a[player].name << "向" << a[player2].name << "发动了绝杀,但是" << a[player2].name << "是无敌的。\n";
else{
int sb = rand() % 100 + 1;
if (sb <= a[player2].sbl){
cout << a[player].name << "向" << a[player2].name << "发动了绝杀,但是" << a[player2].name << "闪避开了。\n";
Sleep(1500);
return;
}
int kn = rand() % 2 + 1;
cout << a[player].name << "向" << a[player2].name << "发动了绝杀,";
if (kn == 1){
cout << "无解!\n";
Sleep(1500);
cout << a[player2].name << "被击倒了。\n";
bool flag = 0;
for (int i = 1; i <= n; i++) if (a[i].hp && a[i].id ==player2){
flag = 1;
a[i].hp = 0;
a[player].kocnt++;
a[i].zhao = "主体死亡";
a[i].ko = a[player].name;
man[a[player2].zy]--;
people--;
}
if (flag){
Sleep(1500);
cout << "分身消失了。\n";
}
a[player].hsum += a[player2].hp;
a[player2].hp = 0;
a[player2].ko = a[player].name;
a[player].kocnt++;
a[player2].zhao = "绝杀";
man[a[player2].zy]--;
people--;
if (!man[a[player2].zy]){
Sleep(1500);
cout << "阵营" << a[player2].zy << "团灭。\n";
cnt--;
}
}
else{
a[player].hsum += a[player2].hp - 1;
a[player2].hp = 1;
cout << a[player2].name << "还有一线生机,血量仅剩下1!\n";
}
}
Sleep(1500);
}
else{
a[player].hurt *= 2;
if (a[player].fang != -1) a[player].fang *= 2;
else a[player].tmpfang *= 2;
a[player].tmpfang *= 2;
a[player].hp *= 2;
a[player].sbl *= 2;
a[player].hxl *= 2;
cout << a[player].name << "发动了八门全开,所有属性乘2。\n";
Sleep(1500);
}
return;
}
void play(){
srand(time(0));
int player,zy,cur = 0;
while (cnt > 1){
do{zy = rand() % zycnt + 1;}while (!man[zy]);
do{player = rand() % n + 1;}while (!a[player].hp || a[player].zy != zy);
work(player);
cur++;
}
system("pause");
system("cls");
return;
}
int main(){
read();
play();
print();
return 0;
}制作不易,求一键三连:点赞+收藏+宣传