第一部分
#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<time.h>
#define Nor if(B[b].x<5) B[b].x=5;
#define Out1 Bx1-Bvx1<=6||Bx1-Bvx1>=28||By1-Bvy1<=7||By1-Bvy1>=27
#define Out2 Bx2-Bvx2<=6||Bx2-Bvx2>=28||By2-Bvy2<=7||By2-Bvy2>=27
#define Chang1 {Bwhat1=0;Bvx1=Bvy1=0;memset(Bgo1,0,sizeof(Bgo1));}
#define Chang2 {Bwhat2=0;Bvx2=Bvy2=0;memset(Bgo2,0,sizeof(Bgo2));}
#define Chang3 {Bwhat3=0;Bvx3=Bvy3=0;memset(Bgo3,0,sizeof(Bgo3));}
using namespace std;
int ti(float a) {
return ((int)(a*10+5))/10;
}
void Setpos(float x,float y) {
COORD pos;
pos.X=ti(y*4)/2;
pos.Y=ti(x);
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void Color(int a) {
if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED);
if(a==9) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_GREEN|BACKGROUND_BLUE);
if(a==10) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_BLUE);
if(a==11) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_BLUE);
if(a==12) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
if(a==13) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY);
if(a==14) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN|FOREGROUND_BLUE);
}
int Blomax,Ren,Exp,Expmax,Lv,Lvl,Ice,Drug,ar1,ar2,Tar1,Tar2,bl,br,Win,T,Tb,Sy,Up,Upt,Down,u1,u2,Kill,Killb,L,Ll[4],Li,D,Gd[10],Biao,Fire,Fir,Water,Thun,Wind,Magne,I[20][2],ib,Dis,Disb,Dis1,Disb1,Boss,Bblo,Bblomax,Bwhat1,Bwhat2,Bwhat3,Bgo1[10],Bgo2[10],Bgo3[10],Bbr,Bbl,Bl[4];
float X,Y,Vx,Vy,Ding,Blo,Hui,Bx1,By1,Bx2,By2,Bx3,By3,Bvx1,Bvy1,Bvx2,Bvy2,Bvx3,Bvy3,Bway[1001][2];
struct bullet {
float x,y,vx,vy;
int what;
int a,t,How;
int life;
bool kill;
} B[100001];
void Map(int a,int b);
void Pan(int a,float x,float y,int b) {
float Nox[4],Noy[4];
Nox[0]=X,Noy[0]=Y;
if(Down==1&&X==22) Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=X-1,Noy[2]=Y-0.5;
else if(Down==2) Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=-10,Noy[2]=-10;
else if(Down==1||X<18) Nox[1]=X-1,Noy[1]=Y-0.5,Nox[2]=-10,Noy[2]=-10;
else Nox[1]=X+1,Noy[1]=Y-0.5,Nox[2]=X-1,Noy[2]=Y-0.5;
for(int i=0; i<3; i++) {
if(a==-1) {
if(abs(x-Nox[i])+abs(y-Noy[i])<1.5) {
if(B[b].what==-10)Exp+=2;
if(B[b].what==-11)Exp+=1;
B[b].life=0;
if(B[b].life==0&&b==bl) bl++;
Map(3,b);
break;
}
}
if(a==-2) {
if(abs(x-Nox[i])+abs(y-Noy[i])<2.5) {
if(B[b].what==-2)Exp+=5,Biao+=5;
if(B[b].what==-3)Fire=300,Ice=0,Fir=3;
if(B[b].what==-4)Water=200;
if(B[b].what==-5) {
Wind=70;
Ding=28.25;
Ice=0;
if(Y<Ding-1)Vy=5;
else Vy=0;
if(Up>=1) Vx=-5;
if(Down==2) Vx=5;
}
if(B[b].what==-6) {
Thun=200;
system("color 1F");
Sleep(20);
system("color 6F");
Sleep(10);
system("color 0F");
}
if(B[b].what==-7)Magne=300;
if(B[b].what==-8)Ice=0,Drug=0,Blo=fmin((float)Blomax,Blo+20);
if(B[b].what==-9)Exp=fmin((float)Expmax,Exp+20);
B[b].life=0;
if(B[b].life==0&&b==bl) bl++;
Map(3,b);
break;
}
}
}
if(Wind==0&&Thun==0&&(B[b].kill!=0||Killb>=15||Ren==1&&Killb>0)) return;
for(int i=0; i<3; i++) {
if((Wind>=1||Thun>=1)&&abs(x-Nox[i])+abs(y-Noy[i])<2.5) {
if(B[b].what<98)Exp+=2;
B[b].life=0;
Map(3,b);
break;
}
if(a==1) {
if(abs(x-Nox[i])<0.5&&abs(y-Noy[i])<1) {
if(B[b].what>=99)Blo-=10;
if(B[b].what==14)Blo-=15,Ice=100,B[b].life=0;
else if(B[b].what==15)Blo-=20,Ice=0,B[b].life=0;
else if(B[b].what==17)Blo-=5,Drug=100,B[b].life=0;
else if(B[b].what>=13&&B[b].what<=17)Blo-=10,B[b].life=0;
else Blo-=15;
B[b].kill=1,Killb=20;
Kill=1;
Map(3,b);
break;
}
}
if (a==2||a==6||a==8||a==9||a==10||a==11||a==12) {
if(abs(x-Nox[i])+abs(y-Noy[i])<1.5) {
if(a==2)Blo-=20;
else if(a==8)Blo-=10;
else Blo-=15;
B[b].kill=1,Killb=20;
Kill=1;
if(a!=2) {
B[b].life=0;
if(B[b].life==0&&b==bl) bl++;
Map(3,b);
break;
}
}
}
if(a==4) {
if((Wind>=1||Thun>=1)&&abs(x-Nox[i])<1.5&&Noy[i]-y<=0&&Noy[i]-y>=-8) {
if(B[b].what<98)Exp+=2;
B[b].life=0;
Map(3,b);
break;
}
if(abs(x-Nox[i])<1&&Noy[i]-y<=0&&Noy[i]-y>=-8) {
Blo-=25,B[b].kill=1,Killb=20;
Kill=1;
Vy=-1;
Y-=0.5;
break;
}
}
}
}
void Map(int a,int b) {
Color(0);
if(a==-1) {
if(Boss==1||Boss==6) {
if(Bwhat1==5) {
if(ti(Bx1)==20)Setpos(Bx1,By1),cout<<"==";
else Setpos(Bx1,By1),cout<<" ";
} else {
Setpos(Bx1-1,By1-0.5),cout<<" ";
Setpos(Bx1,By1-1),cout<<" ";
Setpos(Bx1+1,By1-0.5),cout<<" ";
if(abs(ti(Bx1)-20)<=1)Setpos(20,By1-1),cout<<"======";
}
}
if(Boss==2||Boss==6) {
Setpos(Bx2-1,By2-1);
cout<<" ";
Setpos(Bx2,By2-1);
cout<<" ";
Setpos(Bx2+1,By2-1),cout<<" ";
Color(0);
if(abs(ti(Bx2)-20)<=1)Setpos(20,By2-1),cout<<"======";
}
if(Boss==3||Boss==6) {
Setpos(Bx3-1,By3-0.5);
cout<<" ";
Setpos(Bx3,By3);
cout<<" ";
Setpos(Bx3+1,By3-1),cout<<" ";
Color(0);
if(abs(ti(Bx3)-20)<=1)Setpos(20,By3-1),cout<<"=======";
}
if(X<0)return;
if(X>=17&&X<=19) {
Setpos(X-1,Y);
cout<<" ";
Setpos(X,Y-1);
cout<<" ";
Setpos(X+1,Y-1),cout<<" ";
} else if(X<=23&&X>=21) {
Setpos(X+1,Y);
cout<<" ";
Setpos(X,Y-1);
cout<<" ";
Setpos(X-1,Y-1),cout<<" ";
} else if(X>23) {
Setpos(X,Y-1);
cout<<" ";
Setpos(X-1,Y-0.5),cout<<" ";
} else if(X<17&&Upt!=0) {
Setpos(X,Y-1);
cout<<" ";
Setpos(X+1,Y-1.5),cout<<" ";
} else if(X<17) {
Setpos(X,Y-1);
cout<<" ";
Setpos(X+1,Y-0.5),cout<<" ";
}
if(Thun>0) {
Setpos(X-2,Y-1),cout<<" ";
Setpos(X+2,Y-1),cout<<" ";
Setpos(X,Y+2),cout<<" ";
Setpos(X,Y-2.5),cout<<" ";
Setpos(X-1,Y+1),cout<<" ";
Setpos(X+1,Y+1),cout<<" ";
Setpos(X-1,Y-2),cout<<" ";
Setpos(X+1,Y-2),cout<<" ";
Setpos(20,Y-2.5),cout<<"============";
}
if(Wind!=0) {
Setpos(X+1,Y-5);
cout<<" ";
Setpos(X,Y-5);
cout<<" ";
Setpos(X-1,Y-5);
cout<<" ";
Setpos(20,Y-5),cout<<"========";
}
if(Water!=0) {
Setpos(X,Y-4);
cout<<" ";
Setpos(X+2,Y-3.5);
cout<<" ";
Setpos(X-2,Y-3.5);
cout<<" ";
Setpos(X+1,Y-3.5);
cout<<" ";
Setpos(X-1,Y-3.5);
cout<<" ";
Setpos(20,Y-5),cout<<"========";
}
if(Fire!=0) {
Setpos(X,Y+1),cout<<" ";
Setpos(X+1,Y),cout<<" ";
Setpos(X-1,Y-1),cout<<" ";
Setpos(20,Y-1);
cout<<"======";
}
}
if(a==0) {
if(Boss==1||Boss==6) {
if(Bwhat1==5)Color(5),Setpos(Bx1,By1),cout<<"█",Color(0);
else if(Bwhat1==4&&Bgo1[1]>6&&Bgo1[1]<11)Color(4),Setpos(Bgo1[5]-1,Bgo1[6]),cout<<"︻",Setpos(Bgo1[5],Bgo1[6]-1),cout<<"【",Setpos(Bgo1[5],Bgo1[6]+1),cout<<"】",Setpos(Bgo1[5]+1,Bgo1[6]),cout<<"︼",Color(0);
else {
Setpos(Bx1-1,By1-0.5),Color(0),cout<<"●●";
Setpos(Bx1,By1-1);
if(Bwhat1==2&&Bgo1[1]<=5)Color(1);
else if(Bwhat1==3&&Bgo1[1]<=5)Color(5);
else if(Bwhat1==6&&Bgo1[1]<=5)Color(8);
else Color(4);
if(Bwhat1==4) Setpos(Bx1,By1-0.5),cout<<"██(";
else cout<<")██(";
Setpos(Bx1+1,By1-0.5),cout<<"……";
Color(0);
}
}
if(Boss==2||Boss==6) {
Setpos(Bx2-1,By2-1);
Color(0),cout<<"\\ ";
Color(0);
cout<<"●";
Setpos(Bx2,By2-1);
Color(3);
cout<<"◥";
Color(5),cout<<"JJJ";
Color(0),cout<<">";
Color(3);
Setpos(Bx2+1,By2-1),cout<<"◢█◣";
Color(0);
}
if(Boss==3||Boss==6) {
Setpos(Bx3-1,By3-0.5);
if(Bwhat3==3||Bwhat3==9) Color(1);
else if(Bwhat3==4||Bwhat3==10) Color(4);
else if(Bwhat3==5||Bwhat3==11) Color(5);
if(Bwhat3==11)cout<<' ';
else if(Bwhat3==6) Color(3);
else Color(2);
cout<<"●-";
Setpos(Bx3,By3);
if(Bwhat3==11)cout<<"/";
else cout<<"┃";
Color(0);
Setpos(Bx3+1,By3-1),cout<<"●●●";
}
if(X<0)return;
if(Ren==2) Color(12);
if(Ren==3) Color(1);
if(Ren==4) Color(3);
if(Ren==5) Color(4);
if(Ren==6) Color(2);
if(Drug!=0&&T%5!=0) Color(11);
if(Drug!=0&&T%5==0) Color(11);
if(Ice!=0) Color(6);
if(b==1) Color(8);
if(Li!=0) Color(5);
if(Ren==1&&Killb>0&&T%4<2) Color(13);
if(Wind>0&&T%4<=1) Color(1);
if(Wind>0&&T%4>=2) Color(0);
if(Thun>0&&T%4<=1) Color(1);
if(Thun>0&&T%4>=2) Color(6);
if(X>=17&&X<=19) {
Setpos(X-1,Y);
cout<<"●";
Setpos(X,Y-1);
cout<<"━/";
if(T%10<3) Setpos(X+1,Y-1),cout<<"┛╲";
else if(T%10<6) Setpos(X+1,Y-1),cout<<"┦ ";
else Setpos(X+1,Y-1),cout<<"╯>";
if(Wind>0&&T%3==0) Setpos(X+1,Y-1),cout<<"┛╲";
else if(Wind>0&&T%3==1) Setpos(X+1,Y-1),cout<<"┦ ";
else if(Wind>0&&T%3==2)Setpos(X+1,Y-1),cout<<"╯>";
} else if(X<=23&&X>=21) {
Setpos(X+1,Y);
cout<<"●";
Setpos(X,Y-1);
cout<<"━\\";
if(T%10<3) Setpos(X-1,Y-1),cout<<"┓╱";
else if(T%10<6) Setpos(X-1,Y-1),cout<<"┪ ";
else Setpos(X-1,Y-1),cout<<"╮>";
if(Wind>0&&T%3==0) Setpos(X-1,Y-1),cout<<"┓╱";
else if(Wind>0&&T%3==1) Setpos(X-1,Y-1),cout<<"┪ ";
else if(Wind>0&&T%3==2)Setpos(X-1,Y-1),cout<<"╮>";
} else if(X>23) {
Setpos(X,Y-1);
cout<<"━ ●";
Setpos(X-1,Y-0.5),cout<<"│>";
} else if(X<17&&Upt!=0) {
Setpos(X,Y-1);
cout<<"━ ●";
Setpos(X+1,Y-1.5),cout<<"╱ >";
} else if(X<17) {
Setpos(X,Y-1);
cout<<"━ ●";
Setpos(X+1,Y-0.5),cout<<"│>";
}
if(Thun>0) {
Setpos(X-2,Y-1),cout<<"▄▄";
Setpos(X+2,Y-1),cout<<"▄▄";
Setpos(X,Y+2),cout<<"▌";
Setpos(X,Y-2.5),cout<<"▌";
Setpos(X-1,Y+1),cout<<"█";
Setpos(X+1,Y+1),cout<<"█";
Setpos(X-1,Y-2),cout<<"█";
Setpos(X+1,Y-2),cout<<"█";
}
if(Magne>0&&T%7<2)Setpos(X,Y),Color(5),cout<<"★";
if(Wind>1) {
if(T%6<2)Color(1);
else Color(0);
if(T%8<=1) {
Setpos(X+1,Y-5);
cout<<"---- --";
Setpos(X,Y-5);
cout<<"- --- -";
Setpos(X-1,Y-5);
cout<<"--- - --";
} else if(T%8<=3) {
Setpos(X+1,Y-5);
cout<<"------ ";
Setpos(X,Y-5);
cout<<" -- ---";
Setpos(X-1,Y-5);
cout<<"----- - ";
} else if(T%8<=5) {
Setpos(X+1,Y-5);
cout<<" ------";
Setpos(X,Y-5);
cout<<"-- -- -";
Setpos(X-1,Y-5);
cout<<"- ----- ";
} else if(T%8<=7) {
Setpos(X+1,Y-5);
cout<<"-- ----";
Setpos(X,Y-5);
cout<<" --- -- ";
Setpos(X-1,Y-5);
cout<<"- - ----";
}
}
if(Water!=0) {
Color(1);
if(T%20<5) {
Setpos(X+2,Y-3);
cout<<"■";
Setpos(X+1,Y-3.5);
cout<<"■";
Setpos(X-1,Y-2.5);
cout<<"■";
Setpos(X-2,Y-3);
cout<<"■";
} else if(T%20<10||T%20>=15) {
Setpos(X+2,Y-3);
cout<<"■";
Setpos(X,Y-4);
cout<<"■■";
Setpos(X-2,Y-3);
cout<<"■";
} else if(T%20<15) {
Setpos(X+2,Y-3.5);
cout<<"■";
Setpos(X+1,Y-3);
cout<<"■";
Setpos(X-1,Y-3.5);
cout<<"■";
Setpos(X-2,Y-3);
cout<<"■";
}
}
if(Fire!=0) {
if(T%6<3)Color(4);
else Color(5);
if(Fir>=1)Setpos(X,Y+1),cout<<"●";
if(Fir>=2)Setpos(X+1,Y),cout<<"●";
if(Fir>=3)Setpos(X-1,Y-1),cout<<"●";
}
}
if(a==1||a==3) {
if(B[b].what==1) {
Nor;
Setpos(B[b].x,B[b].y-1);
if(ti(B[b].x)==20)cout<<"======";
else cout<<" ";
if(B[b].life!=0) {
B[b].y-=B[b].vy;
Setpos(B[b].x,B[b].y);
if(B[b].How<=1) Color(13);
else Color(4);
cout<<"●";
if(a==1) Pan(1,B[b].x,B[b].y,b);
}
}
if(B[b].what==2) {
Nor;
Setpos(B[b].x-1,B[b].y-1);
if(ti(B[b].x-1)==20)cout<<"======";
else cout<<" ";
Setpos(B[b].x,B[b].y-1);
if(ti(B[b].x)==20)cout<<"======";
else cout<<" ";
Setpos(B[b].x+1,B[b].y-1);
if(ti(B[b].x+1)==20)cout<<"======";
else cout<<" ";
if(B[b].life!=0) {
B[b].y-=B[b].vy;
Setpos(B[b].x,B[b].y);
Color(5);
if(B[b].How==0) {
Setpos(B[b].x-1,B[b].y),cout<<"↑";
Setpos(B[b].x,B[b].y-1),cout<<"←┼ →";
Setpos(B[b].x+1,B[b].y),cout<<"↓";
} else if(B[b].How==1) {
Setpos(B[b].x-1,B[b].y-1),cout<<"↖ ↗";
Setpos(B[b].x,B[b].y),cout<<"╳";
Setpos(B[b].x+1,B[b].y-1),cout<<"↙ ↘";
}
if(a==1) Pan(2,B[b].x,B[b].y,b);
}
}
if(B[b].what==3||B[b].what==5) {
Nor;
Setpos(B[b].x,B[b].y);
if(ti(B[b].x)==20)cout<<"==";
else cout<<" ";
if(B[b].life!=0) {
B[b].y-=B[b].vy;
B[b].x-=B[b].vx;
Setpos(B[b].x,B[b].y);
if(B[b].How==1) Color(5);
else Color(4);
cout<<"◎";
}
}
if(B[b].what==4) {
Nor;
Setpos(B[b].x,fmax((float)0,B[b].y-8));
if(ti(B[b].x)==20) {
for(int i=max(0,(int)B[b].y-8); i<=B[b].y; i++)cout<<"==";
} else {
for(int i=max(0,(int)B[b].y-8); i<=B[b].y; i++)cout<<" ";
}
if(B[b].life!=0) {
B[b].y-=B[b].vy;
Setpos(B[b].x,fmax((float)0,B[b].y-8));
Color(6);
for(int i=max(0,(int)B[b].y-8); i<=B[b].y; i++)cout<<"═";
if(a==1) Pan(4,B[b].x,B[b].y,b);
}
}
if(B[b].what==6||B[b].what==8||B[b].what==9) {
Nor;
Setpos(B[b].x-1,B[b].y);
if(ti(B[b].x)-1==20)cout<<"==";
else cout<<" ";
Setpos(B[b].x+1,B[b].y);
if(ti(B[b].x)+1==20)cout<<"==";
else cout<<" ";
Setpos(B[b].x,B[b].y-1);
if(ti(B[b].x)==20)cout<<"======";
else cout<<" ";
if(B[b].life!=0) {
B[b].y-=B[b].vy;
B[b].x-=B[b].vx;
Setpos(B[b].x,B[b].y-1);
if(B[b].what==6) {
if(B[b].How<=1) Color(1);
else Color(6);
}
if(B[b].what==9) {
if(B[b].How<=1) Color(4);
else Color(8);
}
if(B[b].what==8)Color(5);
Setpos(B[b].x-1,B[b].y);
cout<<"︹";
Setpos(B[b].x+1,B[b].y);
cout<<"︺";
Setpos(B[b].x,B[b].y-1);
if(B[b].How%2==1) cout<<"〔●〕";
else cout<<"﹝○﹞";
if(a==1) Pan(6,B[b].x,B[b].y,b);
}
}
if(B[b].what==7) {
Nor;
Setpos(B[b].x,B[b].y);
if(B[b].How<0) for(int i=19; i>=20+B[b].How; i--) {
Setpos(i,B[b].y);
cout<<" ";
}
if(B[b].How>0) for(int i=21; i<=20+B[b].How; i++) {
Setpos(i,B[b].y);
cout<<" ";
}
if(B[b].life!=0) {
B[b].y-=B[b].vy;
if(B[b].How<0) for(int i=19; i>=20+B[b].How; i--) {
Setpos(i,B[b].y);
cout<<"║";
if(a==1) Pan(7,i,B[b].y,b);
}
if(B[b].How>0) for(int i=21; i<=20+B[b].How; i++) {
Setpos(i,B[b].y);
cout<<"║";
if(a==1) Pan(7,i,B[b].y,b);
}
}
}
if(B[b].what==10||B[b].what==11||B[b].what==12) {
Nor;
Setpos(B[b].x,B[b].y);
if(ti(B[b].x)==20)cout<<"==";
else cout<<" ";
if(B[b].life!=0) {
B[b].x-=B[b].vx;
B[b].y-=B[b].vy;
if(B[b].How==1) {
B[b].vy-=0.2;
} else B[b].vx-=0.35;
if(B[b].x>=25) B[b].x=25,B[b].vx*=-0.8;
if(B[b].what==11&&B[b].y<=1) B[b].y=1,B[b].vy*=-1;
if(B[b].what==12&&B[b].y<=1) B[b].y=1,B[b].vx=0,B[b].vy=-0.5,B[b].How=1;
Setpos(B[b].x,B[b].y);
if(B[b].what==11)Color(1);
else if(B[b].what==12)Color(5);
else Color(0);
if(B[b].t%4<2)cout<<"▃";
else cout<<"▍";
if(a==1) Pan(B[b].what,B[b].x,B[b].y,b);
}
}
if(B[b].what>=13&&B[b].what<=17) {
Nor;
Setpos(B[b].x,B[b].y);
if(ti(B[b].x)==20)cout<<"====";
else cout<<" ";
if(B[b].life!=0) {
B[b].x-=B[b].vx;
B[b].y-=B[b].vy;
Setpos(B[b].x,B[b].y);
if(B[b].what==14) Color(1);
else if(B[b].what==15) Color(4);
else if(B[b].what==16) Color(5);
else if(B[b].what==17) Color(3);
else Color(2);
cout<<"●";
if(B[b].what==14)cout<<"*";
if(B[b].what==15)cout<<"";
if(B[b].what==16)cout<<"<";
if(B[b].what==17)cout<<"X";
}
if(a==1) Pan(1,B[b].x,B[b].y,b);
}
if(B[b].what==98&&B[b].life!=0) {
B[b].y-=B[b].vy;
Setpos(B[b].x,B[b].y);
if(ti(B[b].x==20))cout<<"==";
else cout<<" ";
if(B[b].y<=3)B[b].life=0;
}
if(B[b].what>=99) {
if(B[b].y<=3)B[b].life=0;
if(B[b].life!=0) {
B[b].y-=B[b].vy;
Setpos(B[b].x,B[b].y);
Color(5);
if(B[b].what==99)cout<<"█";
if(B[b].what>=100&&B[b].what<200) {
if(B[b].what%5==0)cout<<"我";
if(B[b].what%5==1)cout<<"是";
if(B[b].what%5==2)cout<<"最";
if(B[b].what%5==3)cout<<"强";
if(B[b].what%5==4)cout<<"的";
}
if(B[b].what>=200&&B[b].what<300) {
if(B[b].what%6==0)cout<<"神";
if(B[b].what%6==1)cout<<"级";
if(B[b].what%6==2)cout<<"怪";
if(B[b].what%6==3)cout<<"物";
if(B[b].what%6==4)cout<<"之";
if(B[b].what%6==5)cout<<"光";
}
if(B[b].what>=300&&B[b].what<400) {
if(B[b].what%8==0)cout<<"颤";
if(B[b].what%8==1)cout<<"抖";
if(B[b].what%8==2)cout<<"吧";
if(B[b].what%8==3)cout<<"无";
if(B[b].what%8==4)cout<<"能";
if(B[b].what%8==5)cout<<"的";
if(B[b].what%8==6)cout<<"人";
if(B[b].what%8==7)cout<<"类";
}
if(B[b].what>=400&&B[b].what<500) {
if(B[b].what%8==0)cout<<"还";
if(B[b].what%8==1)cout<<"不";
if(B[b].what%8==2)cout<<"快";
if(B[b].what%8==3)cout<<"跪";
if(B[b].what%8==4)cout<<"倒";
if(B[b].what%8==5)cout<<"在";
if(B[b].what%8==6)cout<<"朕";
if(B[b].what%8==7)cout<<"前";
}
if(B[b].what>=500&&B[b].what<600) {
if(B[b].what%8==0)cout<<"看";
if(B[b].what%8==1)cout<<"懂";
if(B[b].what%8==2)cout<<"这";
if(B[b].what%8==3)cout<<"句";
if(B[b].what%8==4)cout<<"话";
if(B[b].what%8==5)cout<<"的";
if(B[b].what%8==6)cout<<"是";
if(B[b].what%8==7)cout<<"猪";
}
if(a==1) Pan(1,B[b].x,B[b].y,b);
}
}
if(B[b].what==-1) {
Nor;
Setpos(B[b].x,B[b].y);
if(ti(B[b].x)==20)cout<<"==";
else cout<<" ";
if(Boss==0) B[b].life=0;
else if(((Boss==1&&abs(B[b].x-Bx1)+abs(B[b].y-By1)<1.5)||(Boss==2&&abs(B[b].x-Bx2)+abs(B[b].y-By2)<1.5)||(Boss==3&&abs(B[b].x-Bx3)+abs(B[b].y-By3)<1.5)||(B[b].t==10))&&B[b].life==1) Bblo-=8+Lv*2,B[b].life=0;
if(B[b].life!=0) {
if(Boss==1)B[b].x=B[b].x+(Bx1-B[b].x)/(10-B[b].t)*1.0,B[b].y=B[b].y+(By1-B[b].y)/(10-B[b].t)*1.0;
if(Boss==2)B[b].x=B[b].x+(Bx2-B[b].x)/(10-B[b].t)*1.0,B[b].y=B[b].y+(By2-B[b].y)/(10-B[b].t)*1.0;
if(Boss==3)B[b].x=B[b].x+(Bx3-B[b].x)/(10-B[b].t)*1.0,B[b].y=B[b].y+(By3-B[b].y)/(10-B[b].t)*1.0;
Setpos(B[b].x,B[b].y);
Color(7);
if(B[b].t%2==0) cout<<"+";
else cout<<"×";
}
}
if(B[b].what<=-2&&B[b].what>=-9) {
Nor;
Setpos(B[b].x-1,B[b].y);
if(ti(B[b].x)-1==20)cout<<"==";
else cout<<" ";
Setpos(B[b].x+1,B[b].y);
if(ti(B[b].x)+1==20)cout<<"==";
else cout<<" ";
Setpos(B[b].x,B[b].y-1);
if(ti(B[b].x)==20)cout<<"======";
else cout<<" ";
if(B[b].life!=0) {
B[b].y-=B[b].vy;
B[b].x-=B[b].vx;
if(B[b].what<=-3&&B[b].what>=-7) {
if(B[b].x<=7)B[b].x=7;
if(B[b].x>=28)B[b].x=28;
else if(B[b].x>=B[b].a+1&&B[b].How==1)B[b].How=0;
else if(B[b].x<=B[b].a-1&&B[b].How==0)B[b].How=1;
if(B[b].How==1&&B[b].vx>=-1)B[b].vx-=0.2;
if(B[b].How==0&&B[b].vx<=1)B[b].vx+=0.2;
}
if(B[b].what==-2) Color(3);
if(B[b].what==-3) Color(4);
if(B[b].what==-4) Color(1);
if(B[b].what==-5) Color(0);
if(B[b].what==-6) Color(6);
if(B[b].what==-7) Color(5);
if(B[b].what==-8) Color(2);
if(B[b].what==-9) Color(14);
if(T%7<=1&&B[b].what==-5)Color(1);
else if(T%7<=1)Color(0);
Setpos(B[b].x-1,B[b].y);
cout<<"︹";
Setpos(B[b].x+1,B[b].y);
cout<<"︺";
Setpos(B[b].x,B[b].y-1);
if(B[b].what==-2) cout<<"﹝镖﹞";
if(B[b].what==-3) cout<<"﹝火﹞";
if(B[b].what==-4) cout<<"﹝水﹞";
if(B[b].what==-5) cout<<"﹝风﹞";
if(B[b].what==-6) cout<<"﹝雷﹞";
if(B[b].what==-7) cout<<"﹝磁﹞";
if(B[b].what==-8) cout<<"﹝血﹞";
if(B[b].what==-9) cout<<"﹝忍﹞";
if(a==1) Pan(-2,B[b].x,B[b].y,b);
}
}
if(B[b].what==-11||B[b].what==-12) {
Nor;
Setpos(B[b].x,B[b].y);
if(ti(B[b].x)==20)cout<<"==";
else cout<<" ";
if(B[b].life!=0) {
if(Magne>0)B[b].How++,B[b].x=B[b].x+(X-B[b].x)/(10-B[b].How)*1.0,B[b].y=B[b].y+(Y-B[b].y)/(10-B[b].How)*1.0;
B[b].y-=B[b].vy;
Setpos(B[b].x,B[b].y);
if(B[b].what==-10) Color(5);
if(B[b].what==-11) Color(7);
if(T%7<=1)Color(0);
cout<<"◆";
if(a==1) Pan(-1,B[b].x,B[b].y,b);
}
}
if(B[b].what==-13) {
Nor;
Setpos(B[b].x,B[b].y-0.5);
if(ti(B[b].x)==20)cout<<"===";
else cout<<" ";
if(B[b].life!=0) {
if(B[b].a==13880086) {
if(Boss==0) B[b].life=0;
else if(((Boss==1&&abs(B[b].x-Bx1)+abs(B[b].y-By1)<1.5)||(Boss==2&&abs(B[b].x-Bx2)+abs(B[b].y-By2)<1.5)||(Boss==3&&abs(B[b].x-Bx3)+abs(B[b].y-By3)<1.5)||(B[b].t==5))&&B[b].life==1) Bblo-=8+Lv*2,B[b].life=0;
if(B[b].life!=0) {
if(Boss==1)B[b].x=B[b].x+(Bx1-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(By1-B[b].y)/(5-B[b].t)*1.0;
if(Boss==2)B[b].x=B[b].x+(Bx2-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(By2-B[b].y)/(5-B[b].t)*1.0;
if(Boss==3)B[b].x=B[b].x+(Bx3-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(By3-B[b].y)/(5-B[b].t)*1.0;
}
} else {
if(B[B[b].a].life==0) B[b].life=0;
else if((abs(B[b].x-B[B[b].a].x)+abs(B[b].y-B[B[b].a].y)<1.5||(B[b].t==5))&&B[b].life==1) Exp+=2,B[B[b].a].life=B[b].life=0;
if(B[b].life!=0) {
B[b].x=B[b].x+(B[B[b].a].x-B[b].x)/(5-B[b].t)*1.0,B[b].y=B[b].y+(B[B[b].a].y-B[b].y)/(5-B[b].t)*1.0;
}
}
Setpos(B[b].x,B[b].y-0.5);
if(T%6<3)Color(5);
else Color(4);
cout<<"●";
}
}
}
if(br<bl) {
br=-1,bl=0;
memset(B,0,sizeof(B));
}
Color(0);
}
void Move() {
if(X<3) X=3;
if(Y<1) Y=1,Vy=0;
if(Y>29) Y=29,Vy=0;
if(Ice!=0) {
X-=Vx/2.0;
Y+=Vy/2.0;
Vy=fmax(Vy-0.025,(float)0);
if(T%6==0&&Up==0&&Y<Ding) Y+=0.25;
if(T%6==3&&Up==0&&Y>=Ding) Y-=0.25;
if(Up==0&&Y<=Ding-1.25) Vy=0.25;
if(Up==0&&Y>=Ding+1.25&&Wind==0) Vy=-0.25;
if(Up==0&&Down==0&&Vx>0&&X<=18) Up=0,Down=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";
else if(Down==2&&X<=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";
else if(Up==0&&Down==1&&Vx<0&&X>=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";
else if(Up>0&&Down==0&&X>18) Up=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";
else if(Down==2) Vx+=0.175;
else if(Up>0&&Upt==0) Vx-=0.175;
else if(Up>0&&Upt>0) {
Vx=fmax(Vx-0.125,(float)0);
if(Upt==1&&T%2==0)Map(-1,0);
if(T%2==0)Upt--;
}
} else {
X-=Vx;
Y+=Vy;
Vy=fmax(Vy-0.05,(float)0);
if(Wind==0) {
if(T%6==0&&Up==0&&Y<Ding) Y+=0.5;
if(T%6==3&&Up==0&&Y>=Ding) Y-=0.5;
} else {
if(T%2==0&&Up==0&&Y<Ding) Y+=0.5;
if(T%2==1&&Up==0&&Y>=Ding) Y-=0.5;
}
if(Up==0&&Y<=Ding-1.25) Vy=0.5;
if(Up==0&&Y>=Ding+1.25&&Wind==0) Vy=-0.5;
if(Up==0&&Down==0&&Vx>0&&X<=18) Up=0,Down=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";
else if(Down==2&&X<=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";
else if(Up==0&&Down==1&&Vx<0&&X>=22) Up=0,Down=1,Vx=0,Vy=0,X=22,Setpos(20,Y-2.5),cout<<"==========";
else if(Up>0&&Down==0&&X>18) Up=0,Vx=0,Vy=0,X=18,Setpos(20,Y-2.5),cout<<"==========";
else if(Down==2) Vx+=0.35;
else if(Up>0&&Upt==0) Vx-=0.35;
else if(Up>0&&Upt>0) {
Vx=fmax(Vx-0.25,(float)0);
if(Upt==1)Map(-1,0);
Upt--;
}
}
for(int i=bl; i<=br; i++) {
if(B[i].what<98)if(B[i].x-B[i].vx<=5||B[i].x-B[i].vx>=30||B[i].y-B[i].vy<=0||B[i].y-B[i].vy>=30) {
B[i].life=0;
Map(1,i);
}
for(int j=0; j<20; j++)if(B[i].what>0&&B[i].life!=0&&abs(B[i].x-I[j][0])<2&&B[i].y-I[j][1]<=2) {
Setpos(I[j][0],I[j][1]);
if(I[j][0]==20) cout<<"===";
else cout<<" ";
I[j][0]=I[j][1]=-1;
B[i].life=0;
Exp+=2;
}
if(B[i].t>=100)B[i].life=0;
if(B[i].life==0&&i==bl) bl++;
Map(1,i);
if(B[i].life==0) continue;
else {
B[i].t++;
if(B[i].what==1) {
if(B[i].y<=25&&B[i].How==0) B[i].vy=0,B[i].How=1;
if(B[i].t==30) B[i].y+=1.5,B[i].How=2;
if(B[i].t==35) B[i].vy=1.5,B[i].How=3;
}
if(B[i].what==2) {
if(B[i].t%3==0) B[i].How=!B[i].How;
}
if(B[i].what==3||B[i].what==5) {
if(B[i].what==3&&B[i].y<=20) B[i].vy=0;
if(B[i].what==5&&B[i].y<=21) B[i].vy=0;
if(B[i].t>30&&B[i].t%2==0) B[i].How=!B[i].How;
if(B[i].what==5&&B[i].t<=30&&B[i].x<X) B[i].vx=-0.2;
else if(B[i].what==5&&B[i].t<=70&&B[i].x>X) B[i].vx=0.2;
else B[i].vx=0;
if(B[i].t==45) {
B[i].life=0;
br++;
B[br].what=4;
B[br].x=B[i].x;
B[br].y=32;
B[br].vy=3;
B[br].life=1;
}
}
if(B[i].what==6||B[i].what==8||B[i].what==9) {
if(B[i].vx<0.25&&B[i].vy<0.25&&B[i].t>=50) {
B[i].life=0;
if(B[i].life==0&&i==bl) bl++;
Map(1,i);
break;
}
if(B[i].t%5==0) B[i].How=rand()%4;
if(B[i].what==9) {
if(B[i].t==7) {
X9:
float xx=(rand()%41)/40.0,yy=(rand()%41)/40.0;
if(xx<=0.5&&yy<=0.5) goto X9;
for(int j=1; j<=4; j++) {
br++,B[br].what=9;
B[br].t=11;
B[br].x=B[i].x,B[br].y=B[i].y,B[br].vx=xx,B[br].vy=yy;
if(j%2==0)swap(B[br].vx,B[br].vy),B[br].vy*=-1;
if(j<=2)B[br].vx*=-1,B[br].vy*=-1;
B[br].life=1;
}
B[i].life=0;
}
}
if(B[i].what==8) {
if(B[i].x>X&&B[i].vx<1.2) B[i].vx+=fmax((float)0,0.2-B[i].t/25);
if(B[i].x<X&&B[i].vx>-1.2) B[i].vx-=fmax((float)0,0.2-B[i].t/25);
if(B[i].y>Y&&B[i].vy<1.2) B[i].vy+=fmax((float)0,0.2-B[i].t/25);
if(B[i].y<Y&&B[i].vy>-1.2) B[i].vy-=fmax((float)0,0.2-B[i].t/25);
}
}
if(B[i].what>=13&&B[i].what<=15&&B[i].How!=0) {
if(B[i].x==B[i].How)B[i].vx=0,B[i].How=0;
}
if(B[i].what==16) {
if(B[i].x<X&&B[i].vx>=-1) B[i].vx-=0.2;
else if(B[i].x>X&&B[i].vx<=1) B[i].vx+=0.2;
}
}
if(B[i].life==1&&B[i].a==0&&B[i].what>0) {
if(B[i].y>Y&&abs(B[i].x-X)<=3&&((B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y))<Dis) Dis=(B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y),Disb=i;
else if(((B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y))<Dis1) Dis1=(B[i].x-X)*(B[i].x-X)+(B[i].y-Y)*(B[i].y-Y),Disb1=i;
}
}
}
void Guai(int R,int r) {
if(R==-1) {
br++;
B[br].what=-1;
B[br].x=X+rand()%3-1;
B[br].y=Y+rand()%3-1;
B[br].life=1;
}
if(R<=-2&&R>=-11) {
br++;
B[br].what=R;
B[br].x=B[br].a=r;
B[br].y=29;
if(R<=-3&&R>=-7)B[br].vx=-1;
B[br].vy=1;
B[br].life=1;
}
if(R==0) {
br++;
B[br].what=1;
B[br].x=r;
B[br].y=29;
B[br].vy=1;
B[br].life=1;
}
if(R==1) {
br++;
B[br].what=2;
B[br].x=r;
B[br].y=29;
B[br].vy=1;
B[br].life=1;
}
if(R==2||R==3) {
br++;
B[br].what=2*R-1;
B[br].x=r;
B[br].y=29;
B[br].vy=1;
B[br].life=1;
}
if(R==4) {
br++;
B[br].what=6;
if(r<5)r=5;
if(r>30)r=30;
B[br].x=r;
if(r==11||r==25) B[br].y=29-(rand()%20);
else B[br].y=29;
X4:
B[br].vx=(rand()%21-10)/30.0;
B[br].vy=(rand()%25)/30.0;
if(B[br].vx<=0.8&&B[br].vy<=0.8)goto X4;
int rx=rand()%50;
if(rx==0) B[br].vx=0;
B[br].life=1;
}
if(R==5) {
br++;
B[br].How=r;
B[br].what=7;
if(B[br].How<0) B[br].x=19;
if(B[br].How>0) B[br].x=21;
B[br].y=29;
B[br].vy=1;
B[br].life=1;
}
}
void CpGuai(int R,float x,float y,float xx,float yy) {
if(R==4) {
br++;
B[br].what=6;
B[br].x=x;
B[br].y=y;
B[br].vx=xx;
B[br].vy=yy;
B[br].life=1;
}
if(R==6||R==7||R==8) {
br++;
B[br].what=4+R;
B[br].x=x;
B[br].y=y;
B[br].vx=xx;
B[br].vy=yy;
B[br].life=1;
}
}
void MesGuai(int a,int rr) {
int R=rand()%rr,r=-10086;
if(R==0) {
if(a==1) r=(5+rand()%8)*2;
if(a<=3&&a!=1) r=10+rand()%16;
if(a==4) r=rand()%75-20;
if(a==5) r=2+rand()%4;
if(r!=-10086) Guai(a,r);
}
}
void NorGuai(int a,int b) {
if(a==1) {
if(b==1||b==41) Guai(0,15),Guai(0,17),Guai(0,19);
if(b==21||b==61) Guai(0,21),Guai(0,23),Guai(0,25);
if(b==81) Guai(0,11),Guai(0,13),Guai(0,15),Guai(0,17),Guai(0,19);
if(b==101||b==141) Guai(0,17),Guai(0,19),Guai(0,21),Guai(0,23),Guai(0,25);
if(b==121) Guai(0,15),Guai(0,17),Guai(0,19),Guai(0,21),Guai(0,23);
if(b>=160&&b<=260&&b%10==0) Guai(0,b/10-1);
if(b>=270&&b<=370&&b%10==0) Guai(0,52-b/10);
if(b>=460&&b<=560&&b%10==0) Guai(0,b/10-37),Guai(0,b/10-36),Guai(0,b/10-35);
if(b>=570&&b<=670&&b%10==0) Guai(0,78-b/10),Guai(0,77-b/10),Guai(0,76-b/10);
if(b>=760&&b<=960&&b%10==0) Guai(0,b/10-66),Guai(0,b/10-65),Guai(0,103-b/10),Guai(0,104-b/10);
if(b>=1000&&b<=1300) MesGuai(0,30-b/50);
}
if(a==2) {
if(b<=200&&b%30==1) {
int r=rand()%4;
if(r==1) r=0;
for(int i=0; i<4; i++) if(i!=r) Guai(1,i*4+9);
}
if(b>200&&b<=220&&b%5==1) Guai(1,18);
if(b>220&&b<=300&&b%7==1) Guai(1,b/5-26);
if(b>350&&b<=370&&b%5==1) Guai(1,22);
if(b>370&&b<=450&&b%7==1) Guai(1,96-b/5);
if(b==461||b==501||b==541) Guai(1,13),Guai(1,17),Guai(1,21);
if(b==481||b==521||b==561) Guai(1,17),Guai(1,21),Guai(1,25);
if(b>=561&&b<=861&&b%20==1) Guai(1,b/40+5);
if(b>=561&&b<=861&&b%20==11) Guai(1,35-b/40);
if(b>=801&&b<=961&&b%15==1) Guai(1,20);
if(b>=1000&&b<=1300) MesGuai(1,30-b/50);
}