- 游戏
- 2022-04-16 17:56:25 @
爱好NBA者请进
1. 常规模式和季后赛
2. 王朝模式
3. 创建队伍,队内赛
4. cheat code:vvssopt
/* NBA Seasoner 2022 v1.4.8
by PongFly*/
#include<bits/stdc++.h>
#include<windows.h>
#include<algorithm>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
void cn_language();
void cn_initer();
void cn_start();
void cn_createteam();
void cn_n_team();
void cn_playoff();
void cheat_playoff();
void cheat(); //cheat code:vvssopt
struct teams {
string name;
double abi;
int bigscore=0,smallscore=0;
int gaimao=0,lanban=0,qiangduan=0;
int losenum=0;
int finals=0;
};
struct n_teams {
string name;
double abi;
int bigscore=0,smallscore=0;
int gaimao=0,lanban=0,qiangduan=0;
int losenum=0;
};
int g_type=0;
teams t[26];
n_teams nt[120];
int ntnum=0;
void cheat_playoff(int s_p[]) {
for(int i=1; i<=44; i++) {
cout<<i<<"轮季后赛\n";
int t1=random(0,8);
int t2=random(0,8);
cout<<"主场 "<<t[s_p[t1]].name;
cout<<" 客场 "<<t[s_p[t2]].name<<endl;
cout<<"比赛结果:\n";
int s1=int(t[s_p[t1]].abi+random(5,random(7,20)));
int s2=int(t[s_p[t2]].abi+random(5,random(7,20)));
cout<<t[s_p[t1]].name<<"队 "<<s1<<"分\n";
cout<<t[s_p[t2]].name<<"队 "<<s2<<"分\n";
if(s1>s2) {
t[s_p[t1]].bigscore++;
t[s_p[t2]].losenum++;
t[s_p[t1]].smallscore+=s1;
t[s_p[t2]].smallscore+=s2;
t[s_p[t1]].gaimao+=random(12,20);
t[s_p[t2]].gaimao+=random(10,18);
t[s_p[t1]].lanban+=random(30,50);
t[s_p[t2]].lanban+=random(25,40);
t[s_p[t1]].qiangduan+=random(10,25);
t[s_p[t2]].qiangduan+=random(8,18);
}
if(s1==s2) {
t[s_p[t1]].bigscore++;
t[s_p[t2]].bigscore++;
t[s_p[t1]].smallscore+=s1;
t[s_p[t2]].smallscore+=s2;
t[s_p[t1]].gaimao+=random(12,20);
t[s_p[t2]].gaimao+=random(12,20);
t[s_p[t1]].lanban+=random(30,50);
t[s_p[t2]].lanban+=random(30,50);
t[s_p[t1]].qiangduan+=random(10,25);
t[s_p[t2]].qiangduan+=random(10,25);
}
if(s1<s2) {
t[s_p[t2]].bigscore++;
t[s_p[t1]].losenum++;
t[s_p[t1]].smallscore+=s1;
t[s_p[t2]].smallscore+=s2;
t[s_p[t2]].gaimao+=random(12,20);
t[s_p[t1]].gaimao+=random(10,18);
t[s_p[t2]].lanban+=random(30,50);
t[s_p[t1]].lanban+=random(25,40);
t[s_p[t2]].qiangduan+=random(10,25);
t[s_p[t1]].qiangduan+=random(8,18);
}
}
}
void cheat(int r_num,int seasontime) {
int t1,t2;
int r_score1,r_score2;
for(int i=1; i<=seasontime; i++) {
cout<<"NBA "<<r_num<<"轮常规赛:\n";
r_num++;
t1=random(0,25);
t2=random(0,25);
cout<<"主场 "<<t[t1].name<<"队 ";
cout<<"客场 "<<t[t2].name<<"队\n";
r_score1=int(t[t1].abi+t[t1].abi/random(2,6));
r_score2=int(t[t2].abi+t[t2].abi/random(2,6));
t[t1].smallscore+=r_score1;
t[t2].smallscore+=r_score2;
cout<<t[t1].name<<"队 "<<r_score1<<"分\n";
if(r_score1>r_score2) {
t[t1].bigscore++;
t[t2].losenum++;
t[t1].gaimao+=random(5,20);
t[t2].gaimao+=random(5,15);
t[t1].lanban+=random(11,20);
t[t2].lanban+=random(11,15);
t[t1].qiangduan+=random(5,12);
t[t2].qiangduan+=random(5,8);
}
if(r_score2>r_score1) {
t[t2].bigscore++;
t[t1].losenum++;
t[t2].gaimao+=random(5,20);
t[t1].gaimao+=random(5,15);
t[t2].lanban+=random(11,20);
t[t1].lanban+=random(11,15);
t[t2].qiangduan+=random(5,12);
t[t1].qiangduan+=random(5,8);
}
if(r_score2==r_score1) {
t[t1].bigscore++;
t[t2].bigscore++;
t[t2].gaimao+=random(5,20);
t[t1].gaimao+=random(5,20);
t[t2].lanban+=random(11,20);
t[t1].lanban+=random(11,20);
t[t2].qiangduan+=random(5,12);
t[t1].qiangduan+=random(5,12);
}
}
}
void cn_start() {
int type;
system("cls");
cout<<"##>>----------------------NBA Seasoner 2022";
cout<<"----------------------<<##\n";
cout<<"by PongFly\n";
Sleep(400);
cout<<"'a' NBA season creater\n";
Sleep(500);
cout<<"have 26 team and can create 120 new team!\n";
Sleep(400);
cout<<"You can have nice try with NBA Seasoner!\n";
system("pause");
cout<<"欢迎来到NBA Seasoner 2022!\n";
cout<<"你想要干什么?:\n";
cout<<"1.开始新赛季(常规赛) 2.离开 3.创建队伍 4.自定义队伍比赛(有自己的队伍)\n";
cout<<"5.季后赛 6.王朝模式Dynasty Mode\n";
cin>>type;
if(type==2) return;
if(type==3) cn_createteam();
if(type==1) cn_language();
if(type==4) cn_n_team();
if(type==5) cn_playoff();
if(type==6) {
int r;
cout<<"打几个赛季?\n";
cin>>r;
for(int i=1; i<=r; i++) {
cn_language();
cn_playoff();
}
}
}
void cn_createteam() {
int num;
cout<<"请问你要创建多少队伍?(<=120)";
cin>>num;
for(int i=0; i<num; i++) {
cout<<"输入队名:";
cin>>nt[i].name;
cout<<"输入队伍能力:";
cin>>nt[i].abi;
cout<<"创建成功!\n";
ntnum++;
}
cn_start();
}
void cn_playoff() {
int s_p[9];
srand(time(0));
cout<<"这里是季后赛的现场\n";
cout<<"在开始前,请先输入进入季后赛球队的编号,一共需要9个。\n";
cout<<"请按照编号顺序输入编号,例如:1 5 8\n";
cout<<"下面是能力球队和编号\n";
for(int i=0; i<26; i++) {
if(t[i].abi>=80) {
cout<<i<<" "<<t[i].name<<"队\n";
Sleep(300);
}
}
cout<<"请输入9个队伍编号,能力过低已被自动淘汰:\n";
for(int i=0; i<9; i++) cin>>s_p[i];
cout<<"共45场比赛。\n";
string round;
int tty=0;
cout<<"输入cheat代号即可跳过季后赛进入总决赛:";
cin>>round; //cheat code:vvssopt
if(round=="vvssopt") tty=1;
for(int i=1; i<=44; i++) {
if(tty==1) {
cheat_playoff(s_p);
break;
}
cout<<i<<"轮季后赛\n";
int t1=random(0,8);
int t2=random(0,8);
Sleep(400);
cout<<"比赛开始!";
system("pause");
cout<<"主场 "<<t[s_p[t1]].name;
Sleep(400);
cout<<" 客场 "<<t[s_p[t2]].name<<endl;
system("pause");
cout<<"比赛结果:\n";
int s1=int(t[s_p[t1]].abi+random(5,random(7,20)));
int s2=int(t[s_p[t2]].abi+random(5,random(7,20)));
cout<<t[s_p[t1]].name<<"队 "<<s1<<"分\n";
Sleep(500);
cout<<t[s_p[t2]].name<<"队 "<<s2<<"分\n";
if(s1>s2) {
t[s_p[t1]].bigscore++;
t[s_p[t2]].losenum++;
t[s_p[t1]].smallscore+=s1;
t[s_p[t2]].smallscore+=s2;
t[s_p[t1]].gaimao+=random(12,20);
t[s_p[t2]].gaimao+=random(10,18);
t[s_p[t1]].lanban+=random(30,50);
t[s_p[t2]].lanban+=random(25,40);
t[s_p[t1]].qiangduan+=random(10,25);
t[s_p[t2]].qiangduan+=random(8,18);
}
if(s1==s2) {
t[s_p[t1]].bigscore++;
t[s_p[t2]].bigscore++;
t[s_p[t1]].smallscore+=s1;
t[s_p[t2]].smallscore+=s2;
t[s_p[t1]].gaimao+=random(12,20);
t[s_p[t2]].gaimao+=random(12,20);
t[s_p[t1]].lanban+=random(30,50);
t[s_p[t2]].lanban+=random(30,50);
t[s_p[t1]].qiangduan+=random(10,25);
t[s_p[t2]].qiangduan+=random(10,25);
}
if(s1<s2) {
t[s_p[t2]].bigscore++;
t[s_p[t1]].losenum++;
t[s_p[t1]].smallscore+=s1;
t[s_p[t2]].smallscore+=s2;
t[s_p[t2]].gaimao+=random(12,20);
t[s_p[t1]].gaimao+=random(10,18);
t[s_p[t2]].lanban+=random(30,50);
t[s_p[t1]].lanban+=random(25,40);
t[s_p[t2]].qiangduan+=random(10,25);
t[s_p[t1]].qiangduan+=random(8,18);
}
system("pause");
}
cout<<"----------playoffs end----------\n";
cout<<"THE NBA FINAL";
int maxn=0,maxn2=0;
for(int i=0; i<9; i++) {
t[s_p[i]].finals+=t[s_p[i]].bigscore-=t[s_p[i]].losenum;
}
for(int i=1; i<9; i++) {
if(t[s_p[i]].finals>t[s_p[maxn]].finals) {
maxn=i;
}
}
for(int i=1; i<9; i++) {
if(t[s_p[i]].finals>t[s_p[maxn2]].finals && t[s_p[i]].finals<t[s_p[maxn]].finals) {
maxn2=i;
}
}
system("pause");
cout<<"序幕即将拉响 我们一起期待最终的冠军 ";
for(int i=10; i>=1; i--) {
cout<<i;
cout<<endl;
Sleep(900);
}
cout<<"决赛的角逐开始了!\n";
Sleep(1000);
cout<<"主场 季后赛排名第1 "<<t[s_p[maxn]].name;
Sleep(3000);
cout<<" 客场 季后赛排名第2 "<<t[s_p[maxn2]].name;
cout<<"比赛开始!!!\n";
system("pause");
Sleep(1000);
int sc1=t[s_p[maxn]].abi+random(random(8,12),random(25,35));
int sc2=t[s_p[maxn2]].abi+random(random(8,12),random(25,35));
cout<<"最终结果:\n";
cout<<t[s_p[maxn]].name<<"队 "<<sc1<<"分\n";
Sleep(1000);
cout<<t[s_p[maxn2]].name<<"队 "<<sc2<<"分\n";
if(sc1>sc2) {
cout<<t[s_p[maxn]].name<<"队获得了NBA总冠军!\n";
t[s_p[maxn]].bigscore++;
t[s_p[maxn2]].losenum++;
t[s_p[maxn]].smallscore+=sc1;
t[s_p[maxn2]].smallscore+=sc2;
t[s_p[maxn]].gaimao+=random(12,20);
t[s_p[maxn2]].gaimao+=random(10,18);
t[s_p[maxn]].lanban+=random(30,50);
t[s_p[maxn2]].lanban+=random(25,40);
t[s_p[maxn]].qiangduan+=random(10,25);
t[s_p[maxn2]].qiangduan+=random(8,18);
}
if(sc1<sc2) {
cout<<t[s_p[maxn2]].name<<"队获得了NBA总冠军!\n";
t[s_p[maxn2]].bigscore++;
t[s_p[maxn]].losenum++;
t[s_p[maxn2]].smallscore+=sc2;
t[s_p[maxn]].smallscore+=sc1;
t[s_p[maxn2]].gaimao+=random(12,20);
t[s_p[maxn]].gaimao+=random(10,18);
t[s_p[maxn2]].lanban+=random(30,50);
t[s_p[maxn]].lanban+=random(25,40);
t[s_p[maxn2]].qiangduan+=random(10,25);
t[s_p[maxn]].qiangduan+=random(8,18);
}
if(sc1==sc2) {
cout<<"平局!\n;";
t[s_p[maxn2]].bigscore++;
t[s_p[maxn]].bigscore++;
t[s_p[maxn2]].smallscore+=sc2;
t[s_p[maxn]].smallscore+=sc1;
t[s_p[maxn2]].gaimao+=random(12,20);
t[s_p[maxn]].gaimao+=random(12,20);
t[s_p[maxn2]].lanban+=random(30,50);
t[s_p[maxn]].lanban+=random(30,50);
t[s_p[maxn2]].qiangduan+=random(10,25);
t[s_p[maxn]].qiangduan+=random(10,25);
}
system("pause");
for(int i=0; i<9; i++) {
cout<<"No. "<<i+1;
cout<<t[s_p[i]].name<<"队\n";
cout<<t[s_p[i]].bigscore<<"-"<<t[s_p[i]].losenum;
cout<<"总得分 "<<t[s_p[i]].smallscore;
cout<<" 盖帽 "<<t[s_p[i]].gaimao;
cout<<" 篮板 "<<t[s_p[i]].lanban;
cout<<" 抢断 "<<t[s_p[i]].qiangduan;
cout<<" rank "<<t[s_p[i]].abi;
system("pause");
}
cout<<"你的NBA赛季结束了,\n";
Sleep(500);
cout<<"这是一段美好的回忆,也是精彩的。\n";
Sleep(800);
cout<<"NBA Seasoner 2023 see you\n";
cout<<"GAME OVER";
}
void cn_language() {
srand(time(0));
Sleep(100);
int seasontime,rank_num;
cout<<"设置赛季赛事数量:";
cin>>seasontime;
cout<<"新的赛季开始了!\n";
int r_num=1;
int t1,t2;
string ro;
int tty=0;
cout<<"输入cheat代号即可跳过季后赛进入总决赛:";
cin>>ro; //cheat code:vvssopt
if(ro=="vvssopt") tty=1;
for(int i=1; i<=seasontime; i++) {
if(tty==1) {
cheat(1,seasontime);
break;
}
int r_score1,r_score2;
system("pause");
cout<<"NBA "<<r_num<<"轮常规赛:\n";
r_num++;
t1=random(0,25);
t2=random(0,25);
Sleep(400);
cout<<"主场 "<<t[t1].name<<"队 ";
Sleep(400);
cout<<"客场 "<<t[t2].name<<"队\n";
Sleep(500);
cout<<"比赛开始!";
Sleep(600);
system("pause");
cout<<"比赛结果:\n";
Sleep(300);
r_score1=int(t[t1].abi+t[t1].abi/random(2,6));
r_score2=int(t[t2].abi+t[t2].abi/random(2,6));
t[t1].smallscore+=r_score1;
t[t2].smallscore+=r_score2;
cout<<t[t1].name<<"队 "<<r_score1<<"分\n";
Sleep(300);
cout<<t[t2].name<<"队 "<<r_score2<<"分\n";
if(r_score1>r_score2) {
t[t1].bigscore++;
t[t2].losenum++;
t[t1].gaimao+=random(5,20);
t[t2].gaimao+=random(5,15);
t[t1].lanban+=random(11,20);
t[t2].lanban+=random(11,15);
t[t1].qiangduan+=random(5,12);
t[t2].qiangduan+=random(5,8);
}
if(r_score2>r_score1) {
t[t2].bigscore++;
t[t1].losenum++;
t[t2].gaimao+=random(5,20);
t[t1].gaimao+=random(5,15);
t[t2].lanban+=random(11,20);
t[t1].lanban+=random(11,15);
t[t2].qiangduan+=random(5,12);
t[t1].qiangduan+=random(5,8);
}
if(r_score2==r_score1) {
t[t1].bigscore++;
t[t2].bigscore++;
t[t2].gaimao+=random(5,20);
t[t1].gaimao+=random(5,20);
t[t2].lanban+=random(11,20);
t[t1].lanban+=random(11,20);
t[t2].qiangduan+=random(5,12);
t[t1].qiangduan+=random(5,12);
}
}
cout<<"经过"<<r_num-1<<"场比赛后,赛季最终结果:";
system("pause");
for(int i=0; i<26; i++) {
cout<<"No."<<i+1<<"\n";
cout<<t[i].name<<"队,"<<endl;
Sleep(200);
cout<<t[i].bigscore<<"-"<<t[i].losenum<<endl;
Sleep(200);
cout<<"总得分 "<<t[i].smallscore<<" ";
Sleep(200);
cout<<"抢断 "<<t[i].qiangduan<<" ";
Sleep(200);
cout<<"盖帽 "<<t[i].gaimao<<" ";
Sleep(200);
cout<<"篮板 "<<t[i].lanban<<" \n";
system("pause");
}
cout<<"你的NBA赛季结束了,\n";
Sleep(500);
cout<<"这是一段美好的回忆,也是精彩的。\n";
Sleep(800);
cout<<"NBA Seasoner 2023 see you\n";
cout<<"GAME OVER";
}
void cn_n_team() {
srand(time(0));
Sleep(600);
int seasontime,r_num=1;
cout<<"输入赛事数量:";
cin>>seasontime;
cout<<"新的赛季开始了!\n";
for(int i=1; i<=seasontime; i++) {
system("pause");
cout<<"第"<<r_num<<"场比赛\n";
Sleep(400);
r_num++;
int nt1=random(0,ntnum-1);
int nt2=random(0,ntnum-1);
cout<<"主场 "<<nt[nt1].name<<"队 ";
Sleep(300);
cout<<"客场 "<<nt[nt2].name<<"队\n";
cout<<"比赛开始!\n";
system("pause");
cout<<"比赛结果:\n";
int s1=nt[nt1].abi+random(5,20);
int s2=nt[nt2].abi+random(5,20);
cout<<nt[nt1].name<<"队 "<<s1<<"分\n";
Sleep(400);
cout<<nt[nt2].name<<"队 "<<s2<<"分\n";
if(s1>s2) {
nt[nt1].bigscore++;
nt[nt2].losenum++;
nt[nt1].gaimao+=random(7,20);
nt[nt2].gaimao+=random(5,15);
nt[nt1].lanban+=random(10,50);
nt[nt2].lanban+=random(8,43);
nt[nt1].qiangduan+=random(10,15);
nt[nt2].qiangduan+=random(7,13);
nt[nt1].smallscore+=s1;
nt[nt2].smallscore+=s2;
}
if(s1<s2) {
nt[nt2].bigscore++;
nt[nt1].losenum++;
nt[nt2].gaimao+=random(7,20);
nt[nt1].gaimao+=random(5,15);
nt[nt2].lanban+=random(10,50);
nt[nt1].lanban+=random(8,43);
nt[nt2].qiangduan+=random(10,15);
nt[nt1].qiangduan+=random(7,13);
nt[nt2].smallscore+=s2;
nt[nt1].smallscore+=s1;
}
if(s1==s2) {
nt[nt1].bigscore++;
nt[nt2].bigscore++;
nt[nt1].gaimao+=random(7,20);
nt[nt2].gaimao+=random(7,20);
nt[nt1].lanban+=random(10,50);
nt[nt2].lanban+=random(10,50);
nt[nt1].qiangduan+=random(10,15);
nt[nt2].qiangduan+=random(10,15);
nt[nt1].smallscore+=s1;
nt[nt2].smallscore+=s2;
}
}
cout<<"经过"<<r_num-1<<"场比赛后,赛季最终结果:";
system("pause");
for(int i=0; i<ntnum; i++) {
cout<<"No."<<i+1<<"\n";
cout<<nt[i].name<<"队,"<<endl;
Sleep(200);
cout<<nt[i].bigscore<<"-"<<nt[i].losenum<<endl;
Sleep(200);
cout<<"总得分 "<<nt[i].smallscore<<" ";
Sleep(200);
cout<<"抢断 "<<nt[i].qiangduan<<" ";
Sleep(200);
cout<<"盖帽 "<<nt[i].gaimao<<" ";
Sleep(200);
cout<<"篮板 "<<nt[i].lanban<<" \n";
system("pause");
}
cout<<"你的NBA赛季结束了,\n";
Sleep(500);
cout<<"这是一段美好的回忆,也是精彩的。\n";
Sleep(800);
cout<<"NBA Seasoner 2023 see you\n";
cout<<"GAME OVER";
}
void cn_initer() {
t[0].name="老鹰",t[0].abi=80;
t[1].name="公牛",t[1].abi=94;
t[2].name="黄蜂",t[2].abi=77;
t[3].name="篮网",t[3].abi=88;
t[4].name="骑士",t[4].abi=84;
t[5].name="热火",t[5].abi=89;
t[6].name="尼克斯",t[6].abi=86;
t[7].name="魔术",t[7].abi=80;
t[8].name="76人",t[8].abi=77;
t[9].name="步行者",t[9].abi=80;
t[10].name="奇才",t[10].abi=80;
t[11].name="雄鹿",t[11].abi=89;
t[12].name="独行侠",t[12].abi=83;
t[13].name="掘金",t[13].abi=76;
t[14].name="勇士",t[14].abi=95;
t[15].name="火箭",t[15].abi=87;
t[16].name="快船",t[16].abi=85;
t[17].name="灰熊",t[17].abi=85;
t[18].name="雷霆",t[18].abi=89;
t[19].name="湖人",t[19].abi=97;
t[20].name="鹈鹕",t[20].abi=81;
t[21].name="开拓者",t[21].abi=84;
t[22].name="太阳",t[22].abi=90;
t[23].name="马刺",t[23].abi=89;
t[24].name="爵士",t[24].abi=69;
t[25].name="国王",t[25].abi=79;
}
int main() {
// system("color 08");
// system("color ?");
// Sleep(100000);
cn_initer();
cn_start();
return 0;
}
1 条评论
-
PongFly_PF LV 4 @ 2022-04-16 17:58:50
附加CBA Seasoner
区别只有队伍#include<bits/stdc++.h> #include<windows.h> #include<algorithm> #define random(a,b) (rand()%(b-a+1)+a) using namespace std; void cn_language(); void cn_initer(); void cn_start(); void cn_createteam(); void cn_n_team(); void cn_playoff(); void cheat_playoff(); void cheat(); //cheat code:vvssopt struct teams { string name; double abi; int bigscore=0,smallscore=0; int gaimao=0,lanban=0,qiangduan=0; int losenum=0; int finals=0; }; struct n_teams { string name; double abi; int bigscore=0,smallscore=0; int gaimao=0,lanban=0,qiangduan=0; int losenum=0; }; int g_type=0; teams t[26]; n_teams nt[120]; int ntnum=0; void cheat_playoff(int s_p[]) { for(int i=1; i<=44; i++) { cout<<i<<"轮季后赛\n"; int t1=random(0,8); int t2=random(0,8); cout<<"主场 "<<t[s_p[t1]].name; cout<<" 客场 "<<t[s_p[t2]].name<<endl; cout<<"比赛结果:\n"; int s1=int(t[s_p[t1]].abi+random(5,random(7,20))); int s2=int(t[s_p[t2]].abi+random(5,random(7,20))); cout<<t[s_p[t1]].name<<"队 "<<s1<<"分\n"; cout<<t[s_p[t2]].name<<"队 "<<s2<<"分\n"; if(s1>s2) { t[s_p[t1]].bigscore++; t[s_p[t2]].losenum++; t[s_p[t1]].smallscore+=s1; t[s_p[t2]].smallscore+=s2; t[s_p[t1]].gaimao+=random(12,20); t[s_p[t2]].gaimao+=random(10,18); t[s_p[t1]].lanban+=random(30,50); t[s_p[t2]].lanban+=random(25,40); t[s_p[t1]].qiangduan+=random(10,25); t[s_p[t2]].qiangduan+=random(8,18); } if(s1==s2) { t[s_p[t1]].bigscore++; t[s_p[t2]].bigscore++; t[s_p[t1]].smallscore+=s1; t[s_p[t2]].smallscore+=s2; t[s_p[t1]].gaimao+=random(12,20); t[s_p[t2]].gaimao+=random(12,20); t[s_p[t1]].lanban+=random(30,50); t[s_p[t2]].lanban+=random(30,50); t[s_p[t1]].qiangduan+=random(10,25); t[s_p[t2]].qiangduan+=random(10,25); } if(s1<s2) { t[s_p[t2]].bigscore++; t[s_p[t1]].losenum++; t[s_p[t1]].smallscore+=s1; t[s_p[t2]].smallscore+=s2; t[s_p[t2]].gaimao+=random(12,20); t[s_p[t1]].gaimao+=random(10,18); t[s_p[t2]].lanban+=random(30,50); t[s_p[t1]].lanban+=random(25,40); t[s_p[t2]].qiangduan+=random(10,25); t[s_p[t1]].qiangduan+=random(8,18); } } } void cheat(int r_num,int seasontime) { int t1,t2; int r_score1,r_score2; for(int i=1; i<=seasontime; i++) { cout<<"CBA "<<r_num<<"轮常规赛:\n"; r_num++; t1=random(0,25); t2=random(0,25); cout<<"主场 "<<t[t1].name<<"队 "; cout<<"客场 "<<t[t2].name<<"队\n"; r_score1=int(t[t1].abi+t[t1].abi/random(2,6)); r_score2=int(t[t2].abi+t[t2].abi/random(2,6)); t[t1].smallscore+=r_score1; t[t2].smallscore+=r_score2; cout<<t[t1].name<<"队 "<<r_score1<<"分\n"; if(r_score1>r_score2) { t[t1].bigscore++; t[t2].losenum++; t[t1].gaimao+=random(5,20); t[t2].gaimao+=random(5,15); t[t1].lanban+=random(11,20); t[t2].lanban+=random(11,15); t[t1].qiangduan+=random(5,12); t[t2].qiangduan+=random(5,8); } if(r_score2>r_score1) { t[t2].bigscore++; t[t1].losenum++; t[t2].gaimao+=random(5,20); t[t1].gaimao+=random(5,15); t[t2].lanban+=random(11,20); t[t1].lanban+=random(11,15); t[t2].qiangduan+=random(5,12); t[t1].qiangduan+=random(5,8); } if(r_score2==r_score1) { t[t1].bigscore++; t[t2].bigscore++; t[t2].gaimao+=random(5,20); t[t1].gaimao+=random(5,20); t[t2].lanban+=random(11,20); t[t1].lanban+=random(11,20); t[t2].qiangduan+=random(5,12); t[t1].qiangduan+=random(5,12); } } } void cn_start() { int type; system("cls"); cout<<"##>>----------------------CBA Seasoner 2022"; cout<<"----------------------<<##\n"; cout<<"by PongFly\n"; Sleep(400); cout<<"'a' CBA season creater\n"; Sleep(500); cout<<"have 26 team and can create 120 new team!\n"; Sleep(400); cout<<"You can have nice try with CBA Seasoner!\n"; system("pause"); cout<<"欢迎来到CBA Seasoner 2022!\n"; cout<<"你想要干什么?:\n"; cout<<"1.开始新赛季(常规赛) 2.离开 3.创建队伍 4.自定义队伍比赛(有自己的队伍)\n"; cout<<"5.季后赛 6.王朝模式Dynasty Mode\n"; cin>>type; if(type==2) return; if(type==3) cn_createteam(); if(type==1) cn_language(); if(type==4) cn_n_team(); if(type==5) cn_playoff(); if(type==6) { int r; cout<<"打几个赛季?\n"; cin>>r; for(int i=1; i<=r; i++) { cn_language(); cn_playoff(); } } } void cn_createteam() { int num; cout<<"请问你要创建多少队伍?(<=120)"; cin>>num; for(int i=0; i<num; i++) { cout<<"输入队名:"; cin>>nt[i].name; cout<<"输入队伍能力:"; cin>>nt[i].abi; cout<<"创建成功!\n"; ntnum++; } cn_start(); } void cn_playoff() { int s_p[9]; srand(time(0)); cout<<"这里是季后赛的现场\n"; cout<<"在开始前,请先输入进入季后赛球队的编号,一共需要9个。\n"; cout<<"请按照编号顺序输入编号,例如:1 5 8\n"; cout<<"下面是能力球队和编号\n"; for(int i=0; i<26; i++) { if(t[i].abi>=random(77,88)) { cout<<i<<" "<<t[i].name<<"队\n"; Sleep(300); } } cout<<"请输入9个队伍编号,能力过低已被自动淘汰:\n"; for(int i=0; i<9; i++) cin>>s_p[i]; cout<<"共45场比赛。\n"; string round; int tty=0; cout<<"输入cheat代号即可跳过季后赛进入总决赛:"; cin>>round; //cheat code:vvssopt if(round=="vvssopt") tty=1; for(int i=1; i<=44; i++) { if(tty==1) { cheat_playoff(s_p); break; } cout<<i<<"轮季后赛\n"; int t1=random(0,8); int t2=random(0,8); Sleep(400); cout<<"比赛开始!"; system("pause"); cout<<"主场 "<<t[s_p[t1]].name; Sleep(400); cout<<" 客场 "<<t[s_p[t2]].name<<endl; system("pause"); cout<<"比赛结果:\n"; int s1=int(t[s_p[t1]].abi+random(5,random(7,20))); int s2=int(t[s_p[t2]].abi+random(5,random(7,20))); cout<<t[s_p[t1]].name<<"队 "<<s1<<"分\n"; Sleep(500); cout<<t[s_p[t2]].name<<"队 "<<s2<<"分\n"; if(s1>s2) { t[s_p[t1]].bigscore++; t[s_p[t2]].losenum++; t[s_p[t1]].smallscore+=s1; t[s_p[t2]].smallscore+=s2; t[s_p[t1]].gaimao+=random(12,20); t[s_p[t2]].gaimao+=random(10,18); t[s_p[t1]].lanban+=random(30,50); t[s_p[t2]].lanban+=random(25,40); t[s_p[t1]].qiangduan+=random(10,25); t[s_p[t2]].qiangduan+=random(8,18); } if(s1==s2) { t[s_p[t1]].bigscore++; t[s_p[t2]].bigscore++; t[s_p[t1]].smallscore+=s1; t[s_p[t2]].smallscore+=s2; t[s_p[t1]].gaimao+=random(12,20); t[s_p[t2]].gaimao+=random(12,20); t[s_p[t1]].lanban+=random(30,50); t[s_p[t2]].lanban+=random(30,50); t[s_p[t1]].qiangduan+=random(10,25); t[s_p[t2]].qiangduan+=random(10,25); } if(s1<s2) { t[s_p[t2]].bigscore++; t[s_p[t1]].losenum++; t[s_p[t1]].smallscore+=s1; t[s_p[t2]].smallscore+=s2; t[s_p[t2]].gaimao+=random(12,20); t[s_p[t1]].gaimao+=random(10,18); t[s_p[t2]].lanban+=random(30,50); t[s_p[t1]].lanban+=random(25,40); t[s_p[t2]].qiangduan+=random(10,25); t[s_p[t1]].qiangduan+=random(8,18); } system("pause"); } cout<<"----------playoffs end----------\n"; cout<<"THE CBA FINAL"; int maxn=0,maxn2=0; for(int i=0; i<9; i++) { t[s_p[i]].finals+=t[s_p[i]].bigscore-=t[s_p[i]].losenum; } for(int i=1; i<9; i++) { if(t[s_p[i]].finals>t[s_p[maxn]].finals) { maxn=i; } } for(int i=1; i<9; i++) { if(t[s_p[i]].finals>t[s_p[maxn2]].finals && t[s_p[i]].finals<t[s_p[maxn]].finals) { maxn2=i; } } system("pause"); cout<<"序幕即将拉响 我们一起期待最终的冠军 "; for(int i=10; i>=1; i--) { cout<<i; cout<<endl; Sleep(900); } cout<<"决赛的角逐开始了!\n"; Sleep(1000); cout<<"主场 季后赛排名第1 "<<t[s_p[maxn]].name; Sleep(3000); cout<<" 客场 季后赛排名第2 "<<t[s_p[maxn2]].name; cout<<"比赛开始!!!\n"; system("pause"); Sleep(1000); int sc1=t[s_p[maxn]].abi+random(random(8,12),random(25,35)); int sc2=t[s_p[maxn2]].abi+random(random(8,12),random(25,35)); cout<<"最终结果:\n"; cout<<t[s_p[maxn]].name<<"队 "<<sc1<<"分\n"; Sleep(1000); cout<<t[s_p[maxn2]].name<<"队 "<<sc2<<"分\n"; if(sc1>sc2) { cout<<t[s_p[maxn]].name<<"队获得了CBA总冠军!\n"; t[s_p[maxn]].bigscore++; t[s_p[maxn2]].losenum++; t[s_p[maxn]].smallscore+=sc1; t[s_p[maxn2]].smallscore+=sc2; t[s_p[maxn]].gaimao+=random(12,20); t[s_p[maxn2]].gaimao+=random(10,18); t[s_p[maxn]].lanban+=random(30,50); t[s_p[maxn2]].lanban+=random(25,40); t[s_p[maxn]].qiangduan+=random(10,25); t[s_p[maxn2]].qiangduan+=random(8,18); } if(sc1<sc2) { cout<<t[s_p[maxn2]].name<<"队获得了CBA总冠军!\n"; t[s_p[maxn2]].bigscore++; t[s_p[maxn]].losenum++; t[s_p[maxn2]].smallscore+=sc2; t[s_p[maxn]].smallscore+=sc1; t[s_p[maxn2]].gaimao+=random(12,20); t[s_p[maxn]].gaimao+=random(10,18); t[s_p[maxn2]].lanban+=random(30,50); t[s_p[maxn]].lanban+=random(25,40); t[s_p[maxn2]].qiangduan+=random(10,25); t[s_p[maxn]].qiangduan+=random(8,18); } if(sc1==sc2) { cout<<"平局!\n;"; t[s_p[maxn2]].bigscore++; t[s_p[maxn]].bigscore++; t[s_p[maxn2]].smallscore+=sc2; t[s_p[maxn]].smallscore+=sc1; t[s_p[maxn2]].gaimao+=random(12,20); t[s_p[maxn]].gaimao+=random(12,20); t[s_p[maxn2]].lanban+=random(30,50); t[s_p[maxn]].lanban+=random(30,50); t[s_p[maxn2]].qiangduan+=random(10,25); t[s_p[maxn]].qiangduan+=random(10,25); } system("pause"); for(int i=0; i<9; i++) { cout<<"No. "<<i+1; cout<<t[s_p[i]].name<<"队\n"; cout<<t[s_p[i]].bigscore<<"-"<<t[s_p[i]].losenum; cout<<"总得分 "<<t[s_p[i]].smallscore; cout<<" 盖帽 "<<t[s_p[i]].gaimao; cout<<" 篮板 "<<t[s_p[i]].lanban; cout<<" 抢断 "<<t[s_p[i]].qiangduan; cout<<" rank "<<t[s_p[i]].abi; system("pause"); } cout<<"你的CBA赛季结束了,\n"; Sleep(500); cout<<"这是一段美好的回忆,也是精彩的。\n"; Sleep(800); cout<<"CBA Seasoner 2023 see you\n"; cout<<"GAME OVER"; } void cn_language() { srand(time(0)); Sleep(100); int seasontime,rank_num; cout<<"设置赛季赛事数量:"; cin>>seasontime; cout<<"新的赛季开始了!\n"; int r_num=1; int t1,t2; string ro; int tty=0; cout<<"输入cheat代号即可跳过季后赛进入总决赛:"; cin>>ro; //cheat code:vvssopt if(ro=="vvssopt") tty=1; for(int i=1; i<=seasontime; i++) { if(tty==1) { cheat(1,seasontime); break; } int r_score1,r_score2; system("pause"); cout<<"CBA "<<r_num<<"轮常规赛:\n"; r_num++; t1=random(0,25); t2=random(0,25); Sleep(400); cout<<"主场 "<<t[t1].name<<"队 "; Sleep(400); cout<<"客场 "<<t[t2].name<<"队\n"; Sleep(500); cout<<"比赛开始!"; Sleep(600); system("pause"); cout<<"比赛结果:\n"; Sleep(300); r_score1=int(t[t1].abi+t[t1].abi/random(2,6)); r_score2=int(t[t2].abi+t[t2].abi/random(2,6)); t[t1].smallscore+=r_score1; t[t2].smallscore+=r_score2; cout<<t[t1].name<<"队 "<<r_score1<<"分\n"; Sleep(300); cout<<t[t2].name<<"队 "<<r_score2<<"分\n"; if(r_score1>r_score2) { t[t1].bigscore++; t[t2].losenum++; t[t1].gaimao+=random(5,20); t[t2].gaimao+=random(5,15); t[t1].lanban+=random(11,20); t[t2].lanban+=random(11,15); t[t1].qiangduan+=random(5,12); t[t2].qiangduan+=random(5,8); } if(r_score2>r_score1) { t[t2].bigscore++; t[t1].losenum++; t[t2].gaimao+=random(5,20); t[t1].gaimao+=random(5,15); t[t2].lanban+=random(11,20); t[t1].lanban+=random(11,15); t[t2].qiangduan+=random(5,12); t[t1].qiangduan+=random(5,8); } if(r_score2==r_score1) { t[t1].bigscore++; t[t2].bigscore++; t[t2].gaimao+=random(5,20); t[t1].gaimao+=random(5,20); t[t2].lanban+=random(11,20); t[t1].lanban+=random(11,20); t[t2].qiangduan+=random(5,12); t[t1].qiangduan+=random(5,12); } } cout<<"经过"<<r_num-1<<"场比赛后,赛季最终结果:"; system("pause"); for(int i=0; i<26; i++) { cout<<"No."<<i+1<<"\n"; cout<<t[i].name<<"队,"<<endl; Sleep(200); cout<<t[i].bigscore<<"-"<<t[i].losenum<<endl; Sleep(200); cout<<"总得分 "<<t[i].smallscore<<" "; Sleep(200); cout<<"抢断 "<<t[i].qiangduan<<" "; Sleep(200); cout<<"盖帽 "<<t[i].gaimao<<" "; Sleep(200); cout<<"篮板 "<<t[i].lanban<<" \n"; system("pause"); } cout<<"你的CBA赛季结束了,\n"; Sleep(500); cout<<"这是一段美好的回忆,也是精彩的。\n"; Sleep(800); cout<<"CBA Seasoner 2023 see you\n"; cout<<"GAME OVER"; } void cn_n_team() { srand(time(0)); Sleep(600); int seasontime,r_num=1; cout<<"输入赛事数量:"; cin>>seasontime; cout<<"新的赛季开始了!\n"; for(int i=1; i<=seasontime; i++) { system("pause"); cout<<"第"<<r_num<<"场比赛\n"; Sleep(400); r_num++; int nt1=random(0,ntnum-1); int nt2=random(0,ntnum-1); cout<<"主场 "<<nt[nt1].name<<"队 "; Sleep(300); cout<<"客场 "<<nt[nt2].name<<"队\n"; cout<<"比赛开始!\n"; system("pause"); cout<<"比赛结果:\n"; int s1=nt[nt1].abi+random(5,20); int s2=nt[nt2].abi+random(5,20); cout<<nt[nt1].name<<"队 "<<s1<<"分\n"; Sleep(400); cout<<nt[nt2].name<<"队 "<<s2<<"分\n"; if(s1>s2) { nt[nt1].bigscore++; nt[nt2].losenum++; nt[nt1].gaimao+=random(7,20); nt[nt2].gaimao+=random(5,15); nt[nt1].lanban+=random(10,50); nt[nt2].lanban+=random(8,43); nt[nt1].qiangduan+=random(10,15); nt[nt2].qiangduan+=random(7,13); nt[nt1].smallscore+=s1; nt[nt2].smallscore+=s2; } if(s1<s2) { nt[nt2].bigscore++; nt[nt1].losenum++; nt[nt2].gaimao+=random(7,20); nt[nt1].gaimao+=random(5,15); nt[nt2].lanban+=random(10,50); nt[nt1].lanban+=random(8,43); nt[nt2].qiangduan+=random(10,15); nt[nt1].qiangduan+=random(7,13); nt[nt2].smallscore+=s2; nt[nt1].smallscore+=s1; } if(s1==s2) { nt[nt1].bigscore++; nt[nt2].bigscore++; nt[nt1].gaimao+=random(7,20); nt[nt2].gaimao+=random(7,20); nt[nt1].lanban+=random(10,50); nt[nt2].lanban+=random(10,50); nt[nt1].qiangduan+=random(10,15); nt[nt2].qiangduan+=random(10,15); nt[nt1].smallscore+=s1; nt[nt2].smallscore+=s2; } } cout<<"经过"<<r_num-1<<"场比赛后,赛季最终结果:"; system("pause"); for(int i=0; i<ntnum; i++) { cout<<"No."<<i+1<<"\n"; cout<<nt[i].name<<"队,"<<endl; Sleep(200); cout<<nt[i].bigscore<<"-"<<nt[i].losenum<<endl; Sleep(200); cout<<"总得分 "<<nt[i].smallscore<<" "; Sleep(200); cout<<"抢断 "<<nt[i].qiangduan<<" "; Sleep(200); cout<<"盖帽 "<<nt[i].gaimao<<" "; Sleep(200); cout<<"篮板 "<<nt[i].lanban<<" \n"; system("pause"); } cout<<"你的CBA赛季结束了,\n"; Sleep(500); cout<<"这是一段美好的回忆,也是精彩的。\n"; Sleep(800); cout<<"NBA Seasoner 2023 see you\n"; cout<<"GAME OVER"; } void cn_initer() { t[0].name="上海久事",t[0].abi=91; t[1].name="九台农商银行",t[1].abi=90; t[2].name="北京首钢",t[2].abi=94; t[3].name="北京控股",t[3].abi=90; t[4].name="北区全明星",t[4].abi=99; t[5].name="南京同曦宙光",t[5].abi=88; t[6].name="南区全明星",t[6].abi=99; t[7].name="四川金荣实业",t[7].abi=85; t[8].name="天津先行者",t[8].abi=89; t[9].name="宁波甬兴证券",t[9].abi=85; t[10].name="山东高速",t[10].abi=85; t[11].name="山西汾酒股份",t[11].abi=89; t[12].name="广东东莞大益",t[12].abi=94; t[13].name="新疆伊力王酒",t[13].abi=84; t[14].name="时代中国广州",t[14].abi=93; t[15].name="浙江广厦控股",t[15].abi=90; t[16].name="浙江稠州金租",t[16].abi=86; t[17].name="深圳马可波罗",t[17].abi=91; t[18].name="福建浔兴股份",t[18].abi=84; t[19].name="苏州肯帝亚",t[19].abi=82; t[20].name="辽宁本钢",t[20].abi=89; t[21].name="青岛每日优鲜",t[21].abi=84; t[22].name="湖南勇胜",t[22].abi=89; t[23].name="CBA全明星",t[23].abi=99; t[24].name="武汉非遗",t[24].abi=79; t[25].name="承德",t[25].abi=79; } int main() { // system("color 08"); // system("color ?"); // Sleep(100000); cn_initer(); cn_start(); return 0; }
- 1