快速版:here
V1.2更新:
1:生命恢复削弱
2:更新技能3项
3:投毒和治疗药剂削弱
4:瘟疫削弱(太强了)
5:游戏平衡性调整X2
6:修BUG
7:初始生命增加上界and下界
8:潜行被识破V1.3更新:
1:潜行被识破的几率增加到33%
2:修改了在不需要的时候放出净化的BUG
3:平衡性调整
4:修改了背刺刺自己的BUG
5:修改了激光的BUG
6:增加了出手顺序,提高公平性※V1.4更新
1:增加“攻、防、智”的增益(未来会增加其他属性增益)
2:增加连续攻击
3:修改了在不需要的时候放出生命之轮的BUG
4:修复了伤害计算的BUG
5:修复了随机种子失效的BUG
6:修复了一段时间内伤害极低的BUG#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string name1,name2;
int hp1,hp2,gj1,gj2,fy1,fy2;
//编号请减一 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
string jin[31]={"会心一击","回复术","闪电拳","诅咒","治愈魔法","火球术","雷击术","重击","生命之轮","减速术","撞击","背刺","铁壁","吸血攻击","净化","伤害反弹盾","瘟疫","攻击","攻击","攻击","攻击","攻击","攻击","攻击","暴击","投毒","治疗药剂","攻击","攻击","10连击","连续攻击"};
double gj[31]={ 6, 3, 4, 5, 5, 4, 4.5, 3, 0, 1, 3.7, 8, 0, 2, 2, 0, 7, 1, 1, 1, 1, 1, 1, 1, 3.5, 1, 1, 1, 1, 0.55, 0.75};
int main()
{
cout <<"----------------------名字大作战V1.4版----------------------\n";
cout <<"P1的名字:";
cin >> name1;
cout <<"P2的名字:";
cin >> name2;
system("cls");
cout << name1 <<" VS "<< name2 << endl;
//
int num1=0,num2=0;
for(int i=0;i<=name1.size();i++)
num1=num1+int(name1[i]);
for(int i=0;i<=name2.size();i++)
num2=num2+int(name2[i]);
num1=abs(num1);
num2=abs(num2);
//
Sleep(200);
cout<<name1<<" "<<"HP";
hp1=150+num1%450;
cout<<hp1<<" "<<"攻"<<" ";
if(num1%60<40)
gj1=num1%60+40,cout<<num1%60+40;
else
gj1=num1%60,cout<<num1%60;
cout<<" "<<"防"<<" ";
if(num1%70<40)
fy1=num1%70+40,cout<<num1%70+40;
else
fy1=num1%70+40,cout<<num1%70;
cout<<" "<<"速"<<" ";
if(num1%80<40)
cout<<num1%80+40;
else
cout<<num1%80;
cout<<" "<<"敏"<<" ";
if(num1%90<40)
cout<<num1%90+40;
else
cout<<num1%90;
cout<<" "<<"魔"<<" ";
if(num1%45<30)
cout<<num1%35+30;
else
cout<<num1%45;
cout<<" "<<"抗"<<" ";
if(num1%65<30)
cout<<num1%65+40;
else
cout<<num1%65;
cout<<" "<<"智"<<" ";
cout<<num1%100<<endl;
cout<<name2<<" "<<"HP";
hp2=150+num2%450;
cout<<hp2<<" "<<"攻"<<" ";
if(num2%60<40)
gj2=num2%60+40,cout<<num2%60+40;
else
gj2=num2%60,cout<<num2%60;
cout<<" "<<"防"<<" ";
if(num2%70<40)
cout<<num2%70+40;
else
cout<<num2%70;
cout<<" "<<"速"<<" ";
if(num2%80<40)
cout<<num2%80+40;
else
cout<<num2%80;
cout<<" "<<"敏"<<" ";
if(num2%90<40)
cout<<num2%90+40;
else
cout<<num2%90;
cout<<" "<<"魔"<<" ";
if(num2%45<30)
cout<<num2%35+30;
else
cout<<num2%45;
cout<<" "<<"抗"<<" ";
if(num2%65<30)
cout<<num2%65+40;
else
cout<<num2%65;
cout<<" "<<"智"<<" ";
cout<<num2%100<<endl;
//
cout << endl;
srand(time(0));
int randd=rand()%2;
if(randd==1)
cout << name1;
else
cout << name2,swap(name1,name2),swap(gj1,gj2),swap(hp1,hp2),swap(num1,num2),swap(fy1,fy2),swap(num1,num2);
cout <<"先手\n";
Sleep(3000);
//
Sleep(1000);
cout << 3 << endl;
Sleep(1000);
cout << 2 << endl;
Sleep(1000);
cout << 1 << endl;
Sleep(1000);
cout <<"Go!!!\n";
Sleep(1000);
system("cls");
//
fy1/=10; fy2/=10;
gj1/=10; gj2/=10;
int tb1=0,tb2=0,ft1=0,ft2=0,du1=0,du2=0,ys1=0,ys2=0;
while(hp1>0 && hp2>0)
{
srand(time(0)+hp1);
int fs=rand()%31,jishu=5+rand()%10;
srand(time(0)+jishu+hp1+hp2);
if(num1%100>50 && rand()%20==0)
fs=18;
if(num1%100>50 && rand()%20==1)
fs=30;
if(fs==4 || fs==1)
{
int ran=rand()%2+1;
if(ran==1)
fs=1;
hp1+=jishu*gj[fs];
cout << name1 <<"使用"<< jin[fs] <<",回复"<< jishu*gj[fs] <<"点hp ";
cout << name1 <<"hp:"<< hp1 <<'\n';
}
else
if(fs==8)
{
if(hp1>hp2)
{
cout << name1 <<"使用激光,造成75固定伤害!";
hp2-=75;
cout << name1 <<"hp:"<< hp1 <<" ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
else
{
swap(hp1,hp2);
cout << name1 <<"使用生命之轮,"<< name1 <<"的生命和"<< name2 <<"的生命互换。 ";
cout << name1 <<"hp:"<< hp1 <<" ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
}
else
if(fs==12)
{
tb1=4;
cout << name1 <<"发动铁壁!\n";
}
else
if(fs==15)
{
ft1=2;
cout << name1 <<"发动伤害反弹盾!\n";
}
else
if(fs==14)
{
if(!du1)
{
fs=18;
cout << name1 <<"发动攻击! "<< name2 <<"hp-12。\n";
hp2-=12;
cout << name1 <<"hp:"<< hp1 <<'\n';
cout << name2 <<"hp:"<< hp2 <<'\n';
}
else
cout << name1 <<"发动净化! "<< name1 <<"被净化了。\n";
if(du1!=0)
du1=0;
}
else
if(fs==13)
{
cout << name1 <<"发动吸血攻击!\n";
hp2-=15;
hp1+=15;
cout << name1 <<"hp:"<< hp1 <<" ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
else
if(fs==16)
{
int r=rand()%2;
if(r)
{
if(tb2!=0)
{
cout << name1 <<"发动瘟疫,被铁壁阻挡。";
hp2-=15;
cout << name2 <<"hp-15\n";
}
else
{
int ran=rand()%3+3;
hp2*=(10-ran)*0.1;
cout << name1 <<"发动瘟疫,"<< name2 <<"的hp减少"<< ran <<"0%。 "<< name2 <<"hp:"<< hp2 << endl;
}
}
else
cout << name1 <<"发动会心一击 "<< name2 <<"hp-30\n",hp2-=30;
}
else
if(fs==29)
{
cout << name1 <<"使用10连击 "<< name2 <<"hp";
for(int i=1;i<=10;i++)
{
jishu=5+rand()%10;
hp2-=jishu*0.55;
cout <<'-'<< (int)(jishu*0.55);
}
cout << endl;
cout << name1 <<"hp:"<< hp1 <<" ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
else
{
if(jin[fs]=="背刺")
{
cout << name1 <<"潜行到"<< name2 <<"的背后\n";
int sss=rand()%3;
if(sss==1)
cout << name1 <<"的潜行被识破\n\n";
else
{
cout << name1 <<"发动"<< jin[fs] << endl;
cout << name2 <<"hp-"<< abs(jishu*gj[fs]+gj1-fy2) <<'\n';
hp2-=abs(jishu*gj[fs]+gj1-fy2);
}
}
else
{
if(fs==30)
{
do
{
srand(time(0)+jishu+hp1+hp2);
jishu=5+rand()%10;
cout << name1 <<"发动"<< jin[fs] << endl;
cout << name2 <<"hp-"<< abs(jishu*gj[fs]+gj1-fy2) <<'\n';
hp2-=abs(jishu*gj[fs]+gj1-fy2);
Sleep(125);
}
while(rand()%5>1);
cout << endl;
cout << name1 <<"hp:"<< hp1 <<" ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
else
{
cout << name1 <<"发动"<< jin[fs] << endl;
if(fs==25)
du2=3;
if(fs==26)
ys1=3;
if(tb2!=0)
{
hp2-=1;
cout << name2 <<"hp-1\n";
}
else
if(ft2!=0)
{
hp1-=abs(jishu*gj[fs]+gj1-fy2);
cout << name1 <<"hp-"<< abs(jishu*gj[fs]+gj1-fy2) <<'\n';
}
else
{
int randon=rand()%40;
if(!randon)
{
cout << name2 <<"防御, hp-"<< abs(jishu*gj[fs]*0.6+gj1-fy2) << endl;
hp2-=abs((int)(jishu*gj[fs]*0.6+gj1)-fy2);
}
else
if(randon==1)
cout << name2 <<"闪避, hp-0\n";
else
{
cout << name2 <<"hp-"<< abs(jishu*gj[fs]+gj1-fy2) <<'\n';
hp2-=abs(jishu*gj[fs]+gj1-fy2);
}
}
cout << name1 <<"hp:"<< hp1 <<" ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
}
}
cout <<"\n";
Sleep(1000);
if(ft2!=0)
ft2--;
if(tb2!=0)
tb2--;
if(du2!=0)
{
cout << name2 <<"毒发, hp-"<< 10+rand()%10 << endl;
hp2-=10+rand()%10;
du2--;
}
if(ys2!=0)
{
cout << name2 <<"药水发挥药效, hp+"<< 10+rand()%10 << endl;
hp2+=10+rand()%10;
ys2--;
}
if(hp1<=0 || hp2<=0)
break;
//
//
//
//
srand(time(0)+hp2);
fs=rand()%31,jishu=5+rand()%10;
srand(time(0)+jishu+hp1+hp2);
if(num2%100>50 && rand()%20==0)
fs=18;
if(num2%100>50 && rand()%20==1)
fs=30;
if(fs==4 || fs==1)
{
int ran=rand()%2+1;
if(ran==1)
fs=1;
hp2+=jishu*gj[fs];
cout << name2 <<"使用"<< jin[fs] <<",回复"<< jishu*gj[fs] <<"点hp ";
cout << name2 <<"hp:"<< hp2 <<'\n';
}
else
if(fs==8)
{
if(hp2>hp1)
{
cout << name2 <<"使用激光,造成75固定伤害!";
hp1-=75;
cout << name2 <<"hp:"<< hp2 <<" ";
cout << name1 <<"hp:"<< hp1 <<'\n';
}
else
{
swap(hp1,hp2);
cout << name2 <<"使用生命之轮,"<< name2 <<"的生命和"<< name1 <<"的生命互换。 ";
cout << name2 <<"hp:"<< hp2 <<" ";
cout << name1 <<"hp:"<< hp1 <<'\n';
}
}
else
if(fs==12)
{
tb2=4;
cout << name2 <<"发动铁壁!\n";
}
else
if(fs==15)
{
ft2=2;
cout << name2 <<"发动伤害反弹盾!\n";
}
else
if(fs==14)
{
if(!du2)
{
fs=18;
cout << name2 <<"发动攻击! "<< name1 <<"hp-12。\n";
hp1-=12;
cout << name2 <<"hp:"<< hp2 <<'\n';
cout << name1 <<"hp:"<< hp1 <<'\n';
}
else
cout << name2 <<"发动净化! "<< name2 <<"被净化了。\n";
if(du2!=0)
du2=0;
}
else
if(fs==13)
{
cout << name2 <<"发动吸血攻击!\n";
hp1-=15;
hp2+=15;
cout << name2 <<"hp:"<< hp2 <<" ";
cout << name1 <<"hp:"<< hp1 <<'\n';
}
else
if(fs==16)
{
int r=rand()%2;
if(r)
{
if(tb1!=0)
{
cout << name2 <<"发动瘟疫,被铁壁阻挡。 ";
hp1-=15;
cout << name1 <<"hp-15\n";
}
else
{
int ran=rand()%3+3;
hp1*=(10-ran)*0.1;
cout << name2 <<"发动瘟疫,"<< name1 <<"的hp减少"<< ran <<"0%。 "<< name1 <<"hp:"<< hp1 << endl;
}
}
else
cout << name2 <<"发动会心一击 "<< name1 <<"hp-30\n",hp1-=30;
}
else
if(fs==29)
{
cout << name2 <<"使用10连击 "<< name1 << "hp";
for(int i=1;i<=10;i++)
{
jishu=5+rand()%10;
hp1-=jishu*0.55;
cout <<'-'<< (int)(jishu*0.55);
}
cout << endl;
cout << name2 <<"hp:"<< hp2 <<" ";
cout << name1 <<"hp:"<< hp1 <<'\n';
}
else
{
if(jin[fs]=="背刺")
{
cout << name2 <<"潜行到"<< name1 <<"的背后\n";
int sss=rand()%3;
if(sss==1)
cout << name2 <<"的潜行被识破\n\n";
else
{
cout << name2 <<"发动"<< jin[fs] << endl;
cout << name1 <<"hp-"<< abs(jishu*gj[fs]+gj1-fy2) <<'\n';
hp1-=abs(jishu*gj[fs]+gj1-fy2);
}
}
else
if(fs==30)
{
do
{
srand(time(0)+jishu+hp1+hp2);
jishu=5+rand()%10;
cout << name2 <<"发动"<< jin[fs] << endl;
cout << name1 <<"hp-"<< abs(jishu*gj[fs]+gj2-fy1) <<'\n';
hp1-=abs(jishu*gj[fs]+gj2-fy1);
Sleep(125);
}
while(rand()%5>1);
cout << endl;
}
else
{
{
cout << name2 <<"发动"<< jin[fs] << endl;
if(fs==25)
du1=3;
if(fs==26)
ys2=3;
if(tb1!=0)
{
hp1-=1;
cout << name1 <<"hp-1\n";
}
else
if(ft1!=0)
{
hp2-=abs(jishu*gj[fs]+gj2-fy1);
cout << name2 <<"hp-"<< abs(jishu*gj[fs]+gj2-fy1) <<'\n';
}
else
{
int randon=rand()%40;
if(!randon)
{
cout << name1 <<"防御, hp-"<< abs(jishu*gj[fs]*0.6+gj2-fy1)<< endl;;
hp1-=(int)(jishu*gj[fs]*0.6+gj2);
}
else
if(randon==1)
cout << name1 <<"闪避, hp-0\n";
else
{
cout << name1 <<"hp-"<< abs(jishu*gj[fs]+gj2-fy1) <<'\n';
hp1-=abs(jishu*gj[fs]+gj2-fy1);
}
}
}
}
cout << name2 <<"hp:"<< hp2 <<" ";
cout << name1 <<"hp:"<< hp1 <<'\n';
}
cout <<"\n---------------------------------------\n\n";
Sleep(1000);
if(ft1!=0)
ft1--;
if(tb1!=0)
tb1--;
if(du1!=0)
{
cout << name1 <<"毒发, hp-"<< 10+rand()%10 << endl;
hp1-=10+rand()%10;
du1--;
}
if(ys1!=0)
{
cout << name1 <<"药水发挥药效, hp+"<< 10+rand()%10 << endl;
hp1+=10+rand()%10;
ys1--;
}
}
if(hp1>0)
cout << name1 <<"赢了。";
else
cout << name2 <<"赢了。";
system("pause");
return 0;
}