move
//作者:https://www.luogu.com.cn/user/126871
//转自:https://www.luogu.com.cn/blog/yzh-Error404/move-v10-post
//使用鼠标点击进入游戏
#include<bits/stdc++.h>
#include<windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
#define jp(x) ((GetAsyncKeyState(x)&0x8000)?1:0)
#define CLS color(112),system("cls");
using namespace std;
int clearma[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
int ma[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,1,9,9,9,9,9,1,1,1,1,1,1,1,1,8,8,8,8,8,8,8,8,8,1}};
int ma1[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,0,0,0,0,0,0,0,0,6,0,0,0,5,0,0,0,6,0,0,0,5,0,0,0,0},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,5,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,5,0,0,0},
{0,0,1,0,0,0,6,0,0,0,0,1,0,0,0,0,0,6,0,0,0,0,1,0,0,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma2[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,6,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0},
{0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0},
{0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0},
{0,1,5,1,5,1,5,1,5,5,5,5,5,5,5,5,1,5,1,5,1,5,1,5,1,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma3[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,6,1,1,1,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,5,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,5},
{0,0,0,0,0,0,5,0,6,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,5,5},
{0,0,0,5,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,5,0,0,0,5,5,5},
{0,5,0,1,1,1,1,2,0,0,0,0,0,0,0,5,0,5,0,1,0,0,5,5,5,5},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma4[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0},
{0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0},
{0,0,7,7,7,7,0,7,7,7,0,7,7,7,7,0,7,7,7,0,7,7,7,7,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
{0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma5[105][105]={{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,0},
{0,0,0,5,0,0,0,5,0,5,0,0,0,5,0,1,0,1,0,1,0,0,0,0,0,0},
{0,0,0,1,5,0,5,1,0,1,5,0,5,1,0,5,5,5,5,5,5,5,5,5,5,5},
{7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,7,0,1,0,7,0,1,0,7,0,1,0,7,0,1,0,7,0,1,0,7,0,2},
{0,0,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5},
{0,0,0,1,0,7,0,1,0,7,0,1,0,7,0,1,0,7,0,1,0,7,0,1,0,7},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma6[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,1,1,1,1,1,0,0,0,0,0,7,1,5,0,0,0,5,1,5,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,7,1,0,5,0,5,0,0,0,5,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,5,1,0,0,1,0,0,0,0,0,1,5,0},
{0,0,0,1,1,1,1,1,0,0,0,0,0,7,1,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,0,0,0,0,0,7,1,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,1,5,5,5,5,5,5,1,2,0,5,5,5,0,5,5,5,0,0},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma7[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,5,0,0,0,5,0,0,0,0,0,0,7,1,1,1,1,1,0,0,0,0,0,0},
{0,0,1,1,1,0,1,1,1,7,0,5,0,0,7,0,0,1,0,0,5,0,0,0,0,0},
{0,0,0,0,0,0,0,5,0,7,0,5,0,0,7,0,0,1,7,1,1,1,0,0,0,0},
{0,7,1,1,1,0,1,1,1,7,1,1,1,0,7,0,0,1,7,0,1,0,0,0,0,0},
{0,7,0,0,0,0,0,0,0,0,0,1,0,0,7,0,0,1,7,0,0,0,1,1,1,0},
{0,0,0,1,0,7,1,1,1,0,0,1,0,1,1,1,0,1,0,0,1,0,0,1,0,0},
{0,0,0,1,5,7,5,1,5,5,5,1,5,5,1,5,5,1,5,5,1,5,5,1,5,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma8[105][105]={{0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,7,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,7,0,0,7,0,0,0,0},
{0,7,0,7,5,0,0,5,0,7,0,5,0,0,0,0,7,0,5,5,0,5,7,0,0,0},
{0,7,0,0,7,0,0,7,0,0,0,7,0,7,0,0,5,0,0,7,0,0,0,7,0,0},
{0,7,0,0,0,7,0,0,0,0,0,0,0,5,7,0,0,0,0,0,0,0,0,0,0,0},
{0,7,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0},
{0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma9[105][105]={{0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,2},
{0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,5},
{0,0,0,0,5,1,5,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,7,5},
{0,1,1,0,0,1,0,0,1,0,5,1,5,0,1,0,5,1,5,0,1,0,0,5,7,5},
{0,7,1,0,0,1,0,5,1,5,0,1,0,5,1,5,0,1,0,0,1,0,0,5,7,5},
{0,7,1,5,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,5,7,5},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,7,5},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma10[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{9,9,9,9,9,9,9,9,5,9,9,9,9,5,9,9,9,9,9,5,9,9,9,9,9,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,5,0,0,0,0,5,0,0,1},
{0,0,0,0,0,5,0,0,5,0,0,0,0,0,0,5,0,0,0,0,5,0,0,0,5,1},
{0,1,8,8,8,8,8,5,8,8,5,8,8,5,8,8,8,8,8,5,8,8,8,8,8,8},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
int ma11[105][105]={{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5},
{0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,5,9,0,0,0,0,0,0,6,5,7},
{0,0,0,0,0,0,0,0,0,0,0,0,1,5,0,0,0,0,0,0,0,0,0,5,5,7},
{0,0,0,0,0,0,0,0,0,1,5,0,1,0,0,0,0,0,5,0,0,0,0,0,5,7},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,7},
{0,0,1,5,5,5,5,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,7},
{0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7},
{1,1,1,5,1,1,1,5,1,1,1,5,1,1,1,1,5,1,1,5,1,1,1,1,1,1}};
//8冰,9细雪
int rec[105];
int turn=0;//0左,2右
bool jumphigher=false;
int manum=1;
int blood=3,maxblood=3;
int nowx=7,nowy=0;
int tim;
struct Button
{
int x,y,color;
const char *name;
int len;
};
inline void GetPos(POINT &pt)
{
HWND hwnd=GetForegroundWindow();
GetCursorPos(&pt);
ScreenToClient(hwnd,&pt);
pt.y=pt.y/16;
pt.x=pt.x/8;
}
inline void color(int a)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
}
inline void gto(int x,int y)
{
COORD pos;
pos.X=y;
pos.Y=x;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
inline Button NewButton(int x,int y,int color,const char *name)
{
Button t;
t.x=x;
t.y=y;
t.name=name;
t.color=color;
t.len=strlen(name);
gto(x,y),cout<<name;
return t;
}
inline bool Preserve(Button A)
{
gto(A.x,A.y),color(A.color);
POINT pt;
GetPos(pt);
if(pt.y==A.x&&(pt.x>=A.y&&pt.x<=A.y+A.len))
{
if(KEY_DOWN(MOUSE_MOVED))return 1;
}
return 0;
}
inline void dis_mouse()
{
ShowCursor(false);
HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cci;
GetConsoleCursorInfo(hOut,&cci);
cci.bVisible=false;
SetConsoleCursorInfo(hOut,&cci);
}
inline void print(int x,int y,string c)
{
y*=2;
HANDLE hOut;COORD pos;
hOut=GetStdHandle(STD_OUTPUT_HANDLE);
pos.X=y;pos.Y=x;
SetConsoleCursorPosition(hOut,pos);
cout<<c;
}
inline void printmap()
{
system("cls");
for(register int i=0;i<=8;i++)
{
for(register int j=0;j<=25;j++)
{
if(ma[i][j]==0)print(i,j," ");
if(ma[i][j]==1)print(i,j,"■");
if(ma[i][j]==2)print(i,j,"Ω");
if(ma[i][j]==4)print(i,j,"Ψ");
if(ma[i][j]==5)print(i,j,"Λ");
if(ma[i][j]==6)print(i,j,"Θ");
if(ma[i][j]==7)print(i,j,"▓");
if(ma[i][j]==8)color(3),print(i,j,"■"),color(7);
if(ma[i][j]==9)color(8),print(i,j,"■"),color(7);
}
puts("");
}
print(nowx,nowy,"○");
print(9,0,"");
printf("level:%d\n",manum);
printf("blood:");
for(register int i=1;i<=blood;i++)
printf("■");
for(register int i=blood;i<maxblood;i++)
printf("□");
if(manum==9)print(9,21,"by lyxsky");
if(manum==12)print(9,19,"by 无名の蒟蒻");
color(7);
}
inline int changemap()
{
print(4,11,"win!");
Sleep(1024);
if(manum==12)
{
system("cls");
print(0,0,"move v2.2.1");
print(4,0,">开始游戏");
print(6,0,">游戏规则");
print(8,0,">退出游戏");
print(10,0,">查看记录");
return 10;
}
if(manum==11)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma11[i][j];
nowx=7,nowy=0;
manum=12;
printmap();
tim=clock();
return 0;
}
if(manum==10)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma10[i][j];
nowx=7,nowy=0;
manum=11;
printmap();
tim=clock();
return 0;
}
if(manum==9)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma9[i][j];
nowx=7,nowy=0;
manum=10;
printmap();
tim=clock();
return 0;
}
if(manum==8)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma8[i][j];
nowx=7,nowy=0;
manum=9;
printmap();
tim=clock();
return 0;
}
if(manum==7)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma7[i][j];
nowx=7,nowy=0;
manum=8;
printmap();
tim=clock();
return 0;
}
if(manum==6)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma6[i][j];
nowx=7,nowy=0;
manum=7;
printmap();
tim=clock();
return 0;
}
if(manum==5)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma5[i][j];
nowx=7,nowy=0;
manum=6;
printmap();
tim=clock();
return 0;
}
if(manum==4)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma4[i][j];
nowx=7,nowy=0;
manum=5;
printmap();
tim=clock();
return 0;
}
if(manum==3)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma3[i][j];
nowx=7,nowy=0;
manum=4;
printmap();
tim=clock();
return 0;
}
if(manum==2)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma2[i][j];
nowx=7,nowy=0;
manum=3;
printmap();
tim=clock();
return 0;
}
if(manum==1)
{
rec[manum]=min(int(clock()-tim),rec[manum]);
for(register int i=0;i<=8;i++)
for(register int j=0;j<=25;j++)
ma[i][j]=ma1[i][j];
nowx=7,nowy=0;
manum=2;
printmap();
tim=clock();
return 0;
}
}
int main()
{
srand(time(NULL));
dis_mouse();
system("title move v2.3");
system("mode con cols=53 lines=13");
print(0,0,"move v2.2.1");
Button start=NewButton(4,0,7,">开始游戏");
Button rule=NewButton(6,0,7,">游戏规则");
Button goout=NewButton(8,0,7,">退出游戏");
Button red=NewButton(10,0,7,">查看记录");
while(1)
{
system("title move v2.2.1");
if(Preserve(rule))
{
system("cls");
Sleep(100);
print(0,0,"游戏规则");
print(2,0,"AWSD移动");
print(3,0,"Ψ为跳跃加强");
print(4,0,"Λ为刺 ");
print(5,0,"Θ为血包 ");
print(6,0,"Ω为终点 ");
print(7,0,"▓为藤蔓 ");
color(3),print(8,0,"■"),color(7);
print(8,1,"为冰块");
color(8),print(9,0,"■"),color(7);
print(9,1,"为细雪");
print(10,0,"按Q返回起点");
print(11,0,"按Shift蹲下");
Button back=NewButton(12,0,7,"返回");
while(1)
{
if(Preserve(back))
{
system("cls");
print(0,0,"move v2.2.1");
print(4,0,">开始游戏");
print(6,0,">游戏规则");
print(8,0,">退出游戏");
print(10,0,">查看记录");
break;
}
}
Sleep(100);
}
if(Preserve(goout))
{
system("cls");
system("title bye~");
return 0;
}
if(Preserve(start))
{
memset(rec,0x7f,sizeof(rec));
color(7);
printmap();
tim=clock();
while(1)
{
if(blood==0)
{
// ma[nowx][nowy]=0;
nowx=7,nowy=0;
print(nowx,nowy,"○");
blood=3;
printmap();
}
if(jp(16))turn=3;
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,print(nowx,nowy," "),printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
if(jp('Q'))
{
print(nowx,nowy," ");
nowx=7;
nowy=0;
printmap();
print(nowx,nowy,"○");
}
if(ma[nowx+1][nowy]==5&&ma[nowx][nowy]!=7)//下面有刺
{
blood--;
print(nowx,nowy," ");
int a=rand()%2;
if(a==0)
{
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5)nowy++;
print(nowx,nowy,"○");
}
else
{
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5)nowy--;
print(nowx,nowy,"○");
}
printmap();
}
if(ma[nowx+1][nowy]!=1&&ma[nowx][nowy]!=7&&ma[nowx+1][nowy]!=5&&ma[nowx+1][nowy]!=8&&ma[nowx+1][nowy]!=9)//控制下落
{
print(nowx,nowy," ");
print(nowx+1,nowy,"○");
nowx++;
Sleep(50);
}
if(ma[nowx+1][nowy]==8)
{
if(turn==0)
{
print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
}
if(turn==1)
{
print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
}
Sleep(64);
}
if(jp('A'))//向左走
{
turn=0;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(50);
if(ma[nowx+1][nowy]==9)Sleep(132);
}
if(jp('D'))//向右走
{
turn=1;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(50);
if(ma[nowx+1][nowy]==9)Sleep(132);
}
if(jp('S')&&ma[nowx][nowy]==7&&ma[nowx+1][nowy]!=1&&ma[nowx+1][nowy]!=8&&ma[nowx+1][nowy]!=9)//向下走(只在藤蔓上有效
{
if(ma[nowx][nowy+1]==5)
{
blood--;
continue;
}
print(nowx,nowy,"▓");
nowx++;
print(nowx,nowy,"○");
Sleep(60);
}
if(jp('W'))//跳跃
{
// system("cls");
if(ma[nowx-1][nowy]==7)
{
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowx--;
print(nowx,nowy,"○");
Sleep(60);
continue;
}
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowx--;
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,print(nowx,nowy," "),printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
if(nowx<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowx++;
print(nowx,nowy,"○");
// printmap();
Sleep(10);
if(jp('A'))//向左走
{
turn=0;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(40);
}
if(jp('D'))//向右走
{
turn=1;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(40);
}
// system("cls");
if(ma[nowx-1][nowy]==7)
{
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowx--;
print(nowx,nowy,"○");
Sleep(60);
continue;
}
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowx--;
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,print(nowx,nowy," "),printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
if(nowx<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowx++;
print(nowx,nowy,"○");
// printmap();
if(jumphigher)Sleep(50);
else Sleep(90);
if(jp('A'))//向左走
{
turn=0;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(40);
}
if(jp('D'))//向右走
{
turn=1;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(40);
}
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,print(nowx,nowy," "),printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
if(jumphigher)
{
//system("cls");
if(ma[nowx-1][nowy]==7)
{
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowx--;
print(nowx,nowy,"○");
Sleep(60);
continue;
}
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
print(nowx,nowy," ");
nowx--;
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,print(nowx,nowy," "),printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
if(nowx<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowx++;
print(nowx,nowy,"○");
//printmap();
Sleep(90);
if(jp('A'))//向左走
{
turn=0;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(40);
}
if(jp('D'))//向右走
{
turn=1;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(40);
}
if(ma[nowx+1][nowy]==5&&ma[nowx][nowy]!=7)//下面有刺
{
blood--;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
int a=rand()%2;
if(a==0)
{
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(50);
}
else
{
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(50);
}
printmap();
}
if(blood==0)
{
ma[nowx][nowy]=0;
nowx=7,nowy=0;
ma[nowx][nowy]=3;
blood=3;
printmap();
}
if(ma[nowx+1][nowy]!=1&&ma[nowx][nowy]!=7&&ma[nowx+1][nowy]!=5&&ma[nowx+1][nowy]!=8&&ma[nowx+1][nowy]!=9)//控制下落
{
print(nowx,nowy," ");
nowx++;
print(nowx,nowy,"○");
Sleep(50);
}
//system("cls");
//printmap();
Sleep(10);
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
}
if(jp('A'))//向左走
{
turn=0;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(40);
}
if(jp('D'))//向右走
{
turn=1;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(40);
}
if(ma[nowx+1][nowy]==5&&ma[nowx][nowy]!=7)//下面有刺
{
blood--;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
int a=rand()%2;
if(a==0)
{
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(50);
}
else
{
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(50);
}
printmap();
}
if(blood==0)
{
ma[nowx][nowy]=0;
nowx=7,nowy=0;
ma[nowx][nowy]=3;
blood=3;
printmap();
}
if(ma[nowx+1][nowy]!=1&&ma[nowx][nowy]!=7&&ma[nowx+1][nowy]!=5&&ma[nowx+1][nowy]!=8&&ma[nowx+1][nowy]!=9)//控制下落
{
print(nowx,nowy," ");
nowx++;
print(nowx,nowy,"○");
Sleep(50);
}
Sleep(10);
// system("cls");
// printmap();
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
if(jp('A'))//向左走
{
turn=0;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(40);
}
if(jp('D'))//向右走
{
turn=1;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(40);
}
if(ma[nowx+1][nowy]==5&&ma[nowx][nowy]!=7)//下面有刺
{
blood--;
if(ma[nowx][nowy]==7)print(nowx,nowy,"▓");
else print(nowx,nowy," ");
int a=rand()%2;
if(a==0)
{
nowy--;
if(nowy<0||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy++;
print(nowx,nowy,"○");
Sleep(50);
}
else
{
nowy++;
if(nowy>25||ma[nowx][nowy]==1||ma[nowx][nowy]==5||ma[nowx][nowy]==8||ma[nowx][nowy]==9)nowy--;
print(nowx,nowy,"○");
Sleep(50);
}
printmap();
}
if(blood==0)
{
ma[nowx][nowy]=0;
nowx=7,nowy=0;
ma[nowx][nowy]=3;
blood=3;
printmap();
}
if(ma[nowx+1][nowy]!=1&&ma[nowx][nowy]!=7&&ma[nowx+1][nowy]!=5&&ma[nowx+1][nowy]!=8&&ma[nowx+1][nowy]!=9)//控制下落
{
print(nowx,nowy," ");
nowx++;
print(nowx,nowy,"○");
Sleep(50);
}
Sleep(10);
// system("cls");
// printmap();
if(ma[nowx][nowy]==4)jumphigher=true;
if(ma[nowx][nowy]==6)blood=min(blood+1,maxblood),ma[nowx][nowy]=0,printmap();
if(ma[nowx][nowy]==2)if(changemap())break;;
}
// system("cls");
}
}
if(Preserve(red))
{
system("cls");
for(register int i=1;i<=11;i++)
printf("%d关 %ds\n",i,rec[i]/1024);
Button back=NewButton(11,0,7,"返回");
while(1)
{
if(Preserve(back))
{
system("cls");
print(0,0,"move v2.2.1");
print(4,0,">开始游戏");
print(6,0,">游戏规则");
print(8,0,">退出游戏");
print(10,0,">查看记录");
break;
}
}
}
}
return 0;
}
小游戏 · 9 蒟蒻的魔塔游戏
原作者系xutongwei
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <string>
#include <cstring>
using namespace std;
const int gk = 10;
void color(int a){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
}
int nn[gk] = {0,7,7,12}, mm[gk] = {0,11,20,18}, xx[gk] = {0,5,1,10}, yy[gk] = {0,1,1,7}, gongg[gk] = {0,1,3,5}, xuee[gk] = {0,20,20,6}, fangg[gk] = {0,0,0,0}, guai1 = 2, guai2 = 9, yao1 = 21, yao2 = 23, bao1 = 31, bao2 = 32, key1 = 41, key2 = 41, men1 = 51, men2 = 51, n, m, gong, xue, fang, x, y, key[10];
int b[10][10] = {
{0},
{0},
{0,2,10},
{0,1,30},
{0,3,14},
{0,5,16},
{0,1,6},
{0,6,20},
{0,5,70},
{0,10000,6}
};
int c[10] = {0,2,5,10};
bool d[gk][20] = {
{0},
{0,1,1,0,0},
{0,1,1,1,0},
{0,0,0,1,1,1,1,1,1}
};
int a[100][100];
int a1[gk][100][100] = {
{0},
{
{1,1,1,1,1,1,1,1,1,1,1},
{1,21,41,23,1,0,0,-2,1,22,1},
{1,2,1,1,1,2,1,1,1,23,1},
{1,0,0,1,0,0,0,2,51,2,1},
{1,1,2,1,3,1,1,2,2,2,1},
{1,-1,21,0,0,0,0,0,31,2,1},
{1,1,1,1,1,1,1,1,1,1,1}
},
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,-1,0,0,0,0,0,0,2,0,0,0,41,0,4,0,0,0,21,1},
{1,0,1,1,1,1,1,4,1,1,1,1,3,1,1,1,1,1,0,1},
{1,0,4,0,0,0,0,0,0,3,0,0,0,0,0,0,0,2,51,1},
{1,0,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,2,1},
{1,0,0,4,21,0,0,0,0,3,0,32,0,22,4,4,51,0,-2,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
},
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,41,1,0,0,1,1,1,-2,1,0,0,1,23,1,23,41,1},
{1,0,1,0,23,0,1,1,0,1,0,0,1,22,1,32,0,1},
{1,0,1,1,1,6,1,0,8,0,1,1,21,0,1,1,7,1},
{1,23,1,23,1,0,1,1,0,1,1,1,1,4,1,1,51,1},
{1,0,1,22,1,0,0,7,0,51,0,0,6,0,0,0,0,1},
{1,5,0,0,6,0,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1},
{1,0,1,21,1,0,6,0,0,0,6,0,0,6,0,0,1,1},
{1,51,1,1,1,51,1,0,0,41,1,9,1,0,1,1,1,1},
{1,5,0,1,23,0,1,0,0,0,1,21,1,0,51,0,23,1},
{1,41,23,1,22,22,1,-1,0,0,1,0,31,51,1,0,21,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
}
};
void mem(int r){
memset(key, 0, sizeof(key));
n = nn[r];
m = mm[r];
x = xx[r];
y = yy[r];
gong = gongg[r];
xue = xuee[r];
fang = fangg[r];
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
a[i][j] = a1[r][i][j];
}
}
}
void output(){
color(7);
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(a[i][j] == -1){
color(15);
cout << "●";
color(7);
}else if(a[i][j] == 0){
cout << " ";
}else if(a[i][j] == -2){
color(15);
cout << "★";
color(7);
}else if(a[i][j] == 2 || a[i][j] == 6){
color(12);
cout << "○";
color(7);
}else if(a[i][j] == 3 || a[i][j] == 5){
color(11);
cout << "○";
color(7);
}else if(a[i][j] == 4){
color(10);
cout << "○";
color(7);
}else if(a[i][j] == 7){
color(13);
cout << "○";
color(7);
}else if(a[i][j] == 9){
color(13);
cout << "▽";
color(7);
}else if(a[i][j] == 8){
color(14);
cout << "▽";
color(7);
}else if(a[i][j] == 21){
color(12);
cout << "◎";
color(7);
}else if(a[i][j] == 22){
color(11);
cout << "◎";
color(7);
}else if(a[i][j] == 23){
color(10);
cout << "◎";
color(7);
}else if(a[i][j] == 31){
color(13);
cout << "▲";
color(7);
}else if(a[i][j] == 32){
color(14);
cout << "▲";
color(7);
}else if(a[i][j] == 41){
color(14);
cout << "♂";
color(7);
}else if(a[i][j] == 51){
color(14);
cout << "▓";
color(7);
}else{
cout << "■";
}
}
cout << endl;
}
color(15);
}
bool fangqi(){
system("cls");
cout << "您确定放弃本次游戏吗?(Y or N)" << endl;
p1:char m5 = getch();
if(m5 == 'y' || m5 == 'Y' || m5 == '1'){
cout << "您放弃了本次游戏" << endl;
return true;
}else if(m5 == 'N' || m5 == 'n' || m5 == '0'){
return false;
}else{
goto p1;
}
}
bool kaimen(int r){
system("cls");
cout << "您确定开启此门吗?(Y or N)" << endl;
if(r == 1) {
cout << "需要消耗一个";
color(14);
cout << "钥匙" << endl;
color(15);
}
p3:char m6 = getch();
if(m6 == 'y' || m6 == 'Y' || m6 == '1'){
if(key[r] >= 1) {
cout << "您开启了这个门" << endl;
key[r]--;
Sleep(500);
return true;
}else{
cout << "您没有足够的钥匙" << endl;
Sleep(500);
return false;
}
}else if(m6 == 'N' || m6 == 'n' || m6 == '0'){
return false;
}else{
goto p3;
}
}
int daguai(int r){
int g1 = b[r][1];
int x1 = b[r][2];
int g2 = gong;
int x2 = 0;
while(true){
x1 -= g2;
if(x1 <= 0){
return x2;
}
x2 += g1 - fang;
}
}
void guaiwushuxing(int r){
system("cls");
for(int i = guai1; i <= guai2; i++){
if(d[r][i - guai1 + 1]){
if(i == 2){
color(12);
cout << "○";
color(15);
}else if(i == 3){
color(11);
cout << "○";
color(15);
}else if(i == 4){
color(10);
cout << "○";
color(15);
}
Sleep(100);
cout << " 血量:" << b[i][2] << " 攻击:" << b[i][1] << " 需要" << daguai(i) << "点血量" << endl;
}
}
Sleep(1000);
system("pause") ;
}
bool guai(int r){
system("cls");
Sleep(100);
cout << "该怪物攻击力为:" << b[r][1] << endl;
Sleep(100);
cout << "该怪物血量为:" << b[r][2] << endl;
Sleep(100);
int m3 = daguai(r);
cout << "你将耗费掉" << m3 << "点血量" << endl;
Sleep(100);
cout << "是否攻击此怪物?(Y or N)" << endl;
p2:char m2 = getch();
if(m2 == 'y' || m2 == 'Y' || m2 == '1'){
if(xue > m3){
xue -= m3;
return true;
}else{
cout << "你打不过此怪物" << endl;
Sleep(500);
return false;
}
}else if(m2 == 'N' || m2 == 'n' || m2 == '0'){
return false;
}else{
goto p2;
}
}
void play(int r){
mem(r);
while(true){
system("cls");
cout << "血量:" << xue << " 攻击:" << gong << " 防御:" << fang << endl;
color(14);
cout << "钥匙:" << key[1];
cout << endl;
color(15);
cout << "1:查看怪物属性 2:查看规则 0:放弃本次游戏" << endl;
output();
char m1 = getch();
if(m1 == '1'){
guaiwushuxing(r);
}else if(m1 == '0'){
if(fangqi()){
break;
}
}else if(m1 == '2'){
system("cls");
color(15);
Sleep(100);
cout << "图例:" << endl;
Sleep(100);
cout << "●:你自己" << endl;
Sleep(100);
cout << "★:终点" << endl;
Sleep(100);
cout << "■:墙" << endl;
Sleep(100);
cout << "(空):路" << endl;
Sleep(100);
cout << "○:普通怪物" << endl;
Sleep(100);
cout << "▽:boss级怪物" << endl;
Sleep(100);
cout << "◎:药水" << endl;
Sleep(100);
cout << "▲:宝石" << endl;
Sleep(100);
cout << "♂:钥匙" << endl;
Sleep(100);
cout << "▓:大门" << endl << endl;
Sleep(500);
cout << "按键:" << endl;
Sleep(100);
cout << "w:上 s:下 a:左 d:右" << endl;
Sleep(500);
system("pause");
}else if(m1 == 'w'){
x--;
if(a[x][y] == 1){
x++;
}else if(a[x][y] == 0){
a[x][y] = -1;
a[x + 1][y] = 0;
}else if(a[x][y] == -2){
a[x][y] = -1;
a[x + 1][y] = 0;
system("cls");
output();
cout << "恭喜您,第" << r << "关游戏挑战成功!" << endl;
break;
}else if(a[x][y] >= guai1 && a[x][y] <= guai2){
if(guai(a[x][y])){
a[x][y] = -1;
a[x + 1][y] = 0;
}else{
x++;
}
}else if(a[x][y] >= yao1 && a[x][y] <= yao2){
xue += c[a[x][y] - yao1 + 1];
cout << " 生命值 + " << c[a[x][y] - yao1 + 1] << endl;
Sleep(500);
a[x][y] = -1;
a[x + 1][y] = 0;
}else if(a[x][y] >= bao1 && a[x][y] <= bao2){
if(a[x][y] == bao1){
gong += 1;
cout << " 攻击力 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x + 1][y] = 0;
}else if(a[x][y] == bao1 + 1){
fang += 1;
cout << " 防御值 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x + 1][y] = 0;
}
}else if(a[x][y] >= key1 && a[x][y] <= key2){
key[a[x][y] - key1 + 1] += 1;
cout << " 钥匙 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x + 1][y] = 0;
}else if(a[x][y] >= men1 && a[x][y] <= men2){
if(kaimen(a[x][y] - men1 + 1)){
a[x][y] = -1;
a[x + 1][y] = 0;
}else{
x++;
}
}else{
x++;
}
}else if(m1 == 's'){
x++;
if(a[x][y] == 1){
x--;
}else if(a[x][y] == 0){
a[x][y] = -1;
a[x - 1][y] = 0;
}else if(a[x][y] == -2){
a[x][y] = -1;
a[x - 1][y] = 0;
system("cls");
output();
cout << "恭喜您,第" << r << "关游戏挑战成功!" << endl;
break;
}else if(a[x][y] >= guai1 && a[x][y] <= guai2){
if(guai(a[x][y])){
a[x][y] = -1;
a[x - 1][y] = 0;
}else{
x--;
}
}else if(a[x][y] >= yao1 && a[x][y] <= yao2){
xue += c[a[x][y] - yao1 + 1];
cout << " 生命值 + " << c[a[x][y] - yao1 + 1] << endl;
Sleep(500);
a[x][y] = -1;
a[x - 1][y] = 0;
}else if(a[x][y] >= bao1 && a[x][y] <= bao2){
if(a[x][y] == bao1){
gong += 1;
cout << " 攻击力 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x - 1][y] = 0;
}else if(a[x][y] == bao1 + 1){
fang += 1;
cout << " 防御值 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x - 1][y] = 0;
}
}else if(a[x][y] >= key1 && a[x][y] <= key2){
key[a[x][y] - key1 + 1] += 1;
cout << " 钥匙 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x - 1][y] = 0;
}else if(a[x][y] >= men1 && a[x][y] <= men2){
if(kaimen(a[x][y] - men1 + 1)){
a[x][y] = -1;
a[x - 1][y] = 0;
}else{
x--;
}
}else{
x--;
}
}else if(m1 == 'a'){
y--;
if(a[x][y] == 1){
y++;
}else if(a[x][y] == 0){
a[x][y] = -1;
a[x][y + 1] = 0;
}else if(a[x][y] == -2){
a[x][y] = -1;
a[x][y + 1] = 0;
system("cls");
output();
cout << "恭喜您,第" << r << "关游戏挑战成功!" << endl;
break;
}else if(a[x][y] >= guai1 && a[x][y] <= guai2){
if(guai(a[x][y])){
a[x][y] = -1;
a[x][y + 1] = 0;
}else{
y++;
}
}else if(a[x][y] >= yao1 && a[x][y] <= yao2){
xue += c[a[x][y] - yao1 + 1];
cout << " 生命值 + " << c[a[x][y] - yao1 + 1] << endl;
Sleep(500);
a[x][y] = -1;
a[x][y + 1] = 0;
}else if(a[x][y] >= bao1 && a[x][y] <= bao2){
if(a[x][y] == bao1){
gong += 1;
cout << " 攻击力 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x][y + 1] = 0;
}else if(a[x][y] == bao1 + 1){
fang += 1;
cout << " 防御值 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x][y + 1] = 0;
}
}else if(a[x][y] >= key1 && a[x][y] <= key2){
key[a[x][y] - key1 + 1] += 1;
cout << " 钥匙 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x][y + 1] = 0;
}else if(a[x][y] >= men1 && a[x][y] <= men2){
if(kaimen(a[x][y] - men1 + 1)){
a[x][y] = -1;
a[x][y + 1] = 0;
}else{
y++;
}
}else{
y++;
}
}else if(m1 == 'd'){
y++;
if(a[x][y] == 1){
y--;
}else if(a[x][y] == 0){
a[x][y] = -1;
a[x][y - 1] = 0;
}else if(a[x][y] == -2){
a[x][y] = -1;
a[x][y - 1] = 0;
system("cls");
output();
cout << "恭喜您,第" << r << "关游戏挑战成功!" << endl;
break;
}else if(a[x][y] >= guai1 && a[x][y] <= guai2){
if(guai(a[x][y])){
a[x][y] = -1;
a[x][y - 1] = 0;
}else{
y--;
}
}else if(a[x][y] >= yao1 && a[x][y] <= yao2){
xue += c[a[x][y] - yao1 + 1];
cout << " 生命值 + " << c[a[x][y] - yao1 + 1] << endl;
Sleep(500);
a[x][y] = -1;
a[x][y - 1] = 0;
}else if(a[x][y] >= bao1 && a[x][y] <= bao2){
if(a[x][y] == bao1){
gong += 1;
cout << " 攻击力 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x][y - 1] = 0;
}else if(a[x][y] == bao1 + 1){
fang += 1;
cout << " 防御值 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x][y - 1] = 0;
}
}else if(a[x][y] >= key1 && a[x][y] <= key2){
key[a[x][y] - key1 + 1] += 1;
cout << " 钥匙 + 1" << endl;
Sleep(500);
a[x][y] = -1;
a[x][y - 1] = 0;
}else if(a[x][y] >= men1 && a[x][y] <= men2){
if(kaimen(a[x][y] - men1 + 1)){
a[x][y] = -1;
a[x][y - 1] = 0;
}else{
y--;
}
}else{
y--;
}
}else{
continue;
}
}
}
int main( ){
system("mode con cols=50 lines=20");
while(true){
system("cls");
color(15);
cout << "请选择想要挑战的关卡数(1~3):" << endl;
string m4;
cin >> m4;
if((m4.size() == 1 && '1' <= m4[0] && m4[0] <= '3')){
play((int)(m4[0] - '0'));
Sleep(500);
cout << "还想再来一局吗?(Y or N)" << endl;
p3:char m5 = getch();
if(m5 == 'y' || m5 == 'Y' || m5 == '1') {
continue;
}else if(m5 == 'N' || m5 == 'n' || m5 == '0'){
cout << "游戏结束!" << endl;
break;
}else{
goto p3;
}
}else{
continue;
}
}
system("pause") ;
return 0;
}
鬼屋逃生
//转自:https://www.luogu.com.cn/blog/user71443/gui-wu-tao-sheng-you-hu
#include <iostream>
#include <ctime>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <set>
#include <windows.h>
#include <conio.h>
using namespace std;
int main()
{
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
srand(time(NULL));
char MAP[100][100]={{"###############################"},{"#@....#....@#*........@#@*...##"}, {"#.......*...#@.........#..##.##"},{"#*....#.....#..........#..##.##"},{"####.######.####...#########.##"},{"#@....#......................##"},{"#..##.#......................##"},{"#..##.#...#####################"},{"#.........#....*@.#.......@..##"},{"#..y@.#...#.......#..........%#"},{"#######...#.......#..........%#"},{"#@.*......######.####.##########"},{"#.....#......................##"},{"###############################"}};
int i,j,x=9,y=3,ax=4,ay=18,c=0;
char yt='.',ayt='.';
cout<<"欢迎来到鬼屋逃生游戏,用wasd操作,y是你的位置,#是墙,@是柜子,可以躲柜子里不受怪物攻击,a是怪物,速度是你2倍,每当你拿起一个钥匙,怪物自动传送你身旁,会杀死你的呕!!!*就是钥匙,%是大门,需攒齐六个钥匙才能逃脱!!!"<<endl;
system("pause");
bool flag=true;
while(flag)
{
bool flag1=true;;
if(MAP[x+1][y]=='a'||MAP[x-1][y]=='a'||MAP[x][y+1]=='a'||MAP[x][y-1]=='a'||MAP[x+1][y+1]=='a'||MAP[x-1][y-1]=='a'||MAP[x-1][y+1]=='a'||MAP[x+1][y-1]=='a')
{
if(MAP[x][y]!='@')
{
cout<<"你死了!!!"<<endl;
system("pause");
return 0;
}
}
if(MAP[x+1][y]=='%'||MAP[x-1][y]=='%'||MAP[x][y+1]=='%'||MAP[x][y-1]=='%'||MAP[x+1][y+1]=='%'||MAP[x-1][y-1]=='%'||MAP[x-1][y+1]=='%'||MAP[x+1][y-1]=='%')
{
if(c==6)
{
cout<<"游戏成功,逃脱成功!!!"<<endl;
system("pause");
return 0;
}
else
{
cout<<"钥匙不够!!!"<<endl;
system("pause");
}
}
for(i=0; i<=14; i++)
{
for(j=0; j<=31; j++)
{
cout<<MAP[i][j];
}
cout<<endl;
}
char t=getch();
if(t=='w'&&MAP[x-1][y]!='#'&&MAP[x-1][y]!='a'&&MAP[x-1][y]!='&')
{
MAP[x][y]=yt;
x--;
yt=MAP[x][y];
if(yt=='@')
MAP[x][y]='@';
else
MAP[x][y]='y';
if(yt=='*')
{
flag1=false;
yt='.';
c++;
MAP[ax][ay]=ayt;
ay=y+2;
ax=x;
MAP[x][y+2]='a';
}
}
if(t=='a'&&MAP[x][y-1]!='#'&&MAP[x][y-1]!='a'&&MAP[x][y-1]!='&')
{
MAP[x][y]=yt;
y--;
yt=MAP[x][y];
if(yt=='@')
MAP[x][y]='@';
else
MAP[x][y]='y';
if(yt=='*')
{
flag1=false;
yt='.';
MAP[ax][ay]=ayt;
c++;
ay=y+2;
ax=x;
MAP[x][y+2]='a';
}
}
if(t=='s'&&MAP[x+1][y]!='#'&&MAP[x+1][y]!='a'&&MAP[x+1][y]!='&')
{
MAP[x][y]=yt;
x++;
yt=MAP[x][y];
if(yt=='@')
MAP[x][y]='@';
else
MAP[x][y]='y';
if(yt=='*')
{
flag1=false;
yt='.';
c++;
MAP[ax][ay]=ayt;
ay=y+2;
ax=x;
MAP[x][y+2]='a';
}
if(yt=='&')
{
if(c==7)
{
cout<<"游戏成功!!!逃脱鬼屋!!!"<<endl;
return 0;
}
else
{
cout<<"钥匙不够!!!"<<endl;
x--;
yt=MAP[x][y];
MAP[x][y]='y';
MAP[x-1][y]='&';
}
}
}
if(t=='d'&&MAP[x][y+1]!='#'&&MAP[x][y+1]!='a'&&MAP[x][y+1]!='&')
{
MAP[x][y]=yt;
y++;
yt=MAP[x][y];
if(yt=='@')
MAP[x][y]='@';
else
MAP[x][y]='y';
if(yt=='*')
{
flag1=false;
yt='.';
c++;
MAP[ax][ay]=ayt;
ay=y+2;
ax=x;
MAP[x][y+2]='a';
}
}
if(flag1)
{
int ar=rand()%4;
if(ar==0&&MAP[ax-1][ay]!='#'&&MAP[ax-1][ay]!='@'&&MAP[ax-1][ay]!='&'&MAP[ax-1][ay]!='y')
{
MAP[ax][ay]=ayt;
ax--;
ayt=MAP[ax][ay];
MAP[ax][ay]='a';
}
else if(ar==1&&MAP[ax][ay-1]!='#'&&MAP[ax][ay-1]!='@'&&MAP[ax][ay-1]!='&'&&MAP[ax][ay-1]!='y')
{
MAP[ax][ay]=ayt;
ay--;
ayt=MAP[ax][ay];
MAP[ax][ay]='a';
}
else if(ar==2&&MAP[ax+1][ay]!='#'&&MAP[ax+1][ay]!='@'&&MAP[ax+1][ay]!='&'&&MAP[ax+1][ay]!='y')
{
MAP[ax][ay]=ayt;
ax++;
ayt=MAP[ax][ay];
MAP[ax][ay]='a';
}
else if(ar==3&&MAP[ax][ay+1]!='#'&&MAP[ax][ay+1]!='@'&&MAP[ax][ay+1]!='&'&&MAP[ax][ay+1]!='y')
{
MAP[ax][ay]=ayt;
ay++;
ayt=MAP[ax][ay];
MAP[ax][ay]='a';
}
}
system("cls");
}
system("pause");
return 0;
}
哈利波特
//转自:https://www.luogu.com.cn/team/32221#main
//笔者的提示:作者咕咕咕了,只编写了前12个地图
#include <iostream>
#include <string>
#include <windows.h>
#include <conio.h>
#include <fstream>
#include <ctime>
#include <time.h>
#include <stdio.h>
using namespace std;
int D_Of_C, OK, ane, xy, D_Of_C1, OK1, ane1, xy1, nowM, MoralValue;
int ict = 0, nowlevel = 0;
int bag[44] = { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0};
//0抽奖券 1经验石R 2经验石SR 3经验石SSR 4经验石SSS 5经验石X
//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龙神经 32夜骐的尾羽
//33桦木 34紫衫木 35冬青木 36山楂木柳条 37橡木 38械木 39山毛榉木 40栗木 41樱桃木 42桃花心木
//43速度药水
string Material1name[9] = { "猫狸子胡须","媚娃头发","马形水怪的鬃毛","龙心腱","雷鸟尾羽","凤凰羽毛","独角兽尾毛","龙神经","夜骐的尾羽" };
string Material2name[10] = { "桦木","紫衫木","冬青木","山楂木柳条","橡木","械木","山毛榉木","栗木","樱桃木","桃花心木" };
int health = 1000, maxhealth = 1000, money=0, attack = 250, defense = 10, experience = 0, camp, level = 1, amm = 0, f = 0, speed = 0;
string Nwand = "空手";
int LE1 = 1, LE2 = 1, Sl[13];
bool dead = false;
string wandname[100] = { "柳条魔杖","胡桃魔杖","鹅耳枥木魔杖","柳条魔杖","花心木魔杖","冬青木魔杖","紫杉木魔杖","老魔杖" };
int wandpower[100] = { 200,500,1100,1300,2400,5000,9000,20000 }, wand[100], wandi = 8, wandnamei = 8, wandpoweri = 8;
string name, password;
int choose()
{
system("cls");
cout << "请选择您的阵营。" << endl;
cout << "0, 哈利.HarryPotter" << endl;
cout << "1, 伏地魔 LordVoldemort" << endl;
cin >> camp;
if (camp != 0 && camp != 1) {
cout << "输入错误。";
Sleep(250);
choose();
}
else {
if (MessageBox(0, TEXT("你确定?"), TEXT("请选择"), MB_OKCANCEL | MB_ICONINFORMATION) == IDOK) return 0;
choose();
}
return 0;
}
int login()
{
string DN, DPW;
bool isn = false;
cout << "请输入账号和密码" << endl;
cout << "账号:";
cin >> name;
cout << "密码:";
cin >> password;
ifstream fin("data2.txt");
while(fin >> DN) {
if (DN == name) {
fin >> DPW;
if (DPW != password) {
cout << "密码错误!" << endl; isn = true;
system("cls"); login();
}
else {
fin >> money >> attack >> defense >> health >> level >> experience >> LE1 >> LE2 >> camp >> maxhealth;
fin >> D_Of_C >> OK >> ane >> xy >> D_Of_C1 >> OK1 >> ane1 >> xy1 >> nowM;
fin >> bag[0] >> bag[1] >> bag[2] >> bag[3] >> bag[4] >> bag[5] >> bag[6] >> bag[7];
fin >> bag[8] >> bag[9] >> bag[10] >> bag[11] >> bag[12] >> bag[13] >> bag[14] >> bag[15];
fin >> bag[16] >> bag[17] >> bag[18] >> bag[19] >> bag[20] >> bag[21] >> bag[22] >> bag[23];
fin >> bag[24] >> bag[25] >> bag[26] >> bag[27] >> bag[28] >> bag[29] >> bag[30] >> bag[31];
fin >> bag[32] >> bag[33] >> bag[34] >> bag[35] >> bag[36] >> bag[37] >> bag[38] >> bag[39];
fin >> bag[40] >> bag[41] >> bag[42] >> bag[43];
fin >> Sl[0] >> Sl[1] >> Sl[2] >> Sl[3] >> Sl[4] >> Sl[5] >> Sl[6] >> Sl[7] >> Sl[8] >> Sl[9] >> Sl[10] >> Sl[11] >> Sl[12];
for (int i = 0; i < 100; i++) {
fin >> wandname[i];
fin >> wandpower[i];
fin >> wand[i];
}
fin >> Nwand >> amm >> f >> wandi >> wandnamei >> wandpoweri >> ict >> speed >> nowlevel;
isn = true;
}
}
}
if (!isn) {
cout << "无此用户!" << endl;
login();
}
cout << "登入成功!" << endl;
Sleep(1000);
return 0;
}
int save()
{
ofstream outfile("data2.txt", ios::binary | ios::app | ios::in | ios::out);
outfile << name << " " << password << " " << money << " " << attack << " " << defense << " " << health << " " << level << " " << experience << " " << LE1 << " " << LE2 << " " << camp << " " << maxhealth << " ";
outfile << D_Of_C << " " << OK << " " << ane << " " << xy << " " << D_Of_C1 << " " << OK1 << " " << ane1 << " " << xy1 << " " << nowM << " ";
outfile << bag[0] << " " << bag[1] << " " << bag[2] << " " << bag[3] << " " << bag[4] << " " << bag[5] << " " << bag[6] << " " << bag[7] << " ";
outfile << bag[8] << " " << bag[9] << " " << bag[10] << " " << bag[11] << " " << bag[12] << " " << bag[13] << " " << bag[14] << " " << bag[15] << " ";
outfile << bag[16] << " " << bag[17] << " " << bag[18] << " " << bag[19] << " " << bag[20] << " " << bag[21] << " " << bag[22] << " " << bag[23] << " ";
outfile << bag[24] << " " << bag[25] << " " << bag[26] << " " << bag[27] << " " << bag[28] << " " << bag[29] << " " << bag[30] << " " << bag[31] << " ";
outfile << bag[32] << " " << bag[33] << " " << bag[34] << " " << bag[35] << " " << bag[36] << " " << bag[37] << " " << bag[38] << " " << bag[39] << " ";
outfile << bag[40] << " " << bag[41] << " " << bag[42] << " " << bag[43] << " ";
outfile << Sl[0] << " " << Sl[1] << " " << Sl[2] << " " << Sl[3] << " " << Sl[4] << " " << Sl[5] << " " << Sl[6] << " " << Sl[7] << " " << Sl[8] << " " << Sl[9] << " " << Sl[10] << " " << Sl[11] << " " << Sl[12] << " ";
for (int i = 0; i < 100; i++) {
outfile << wandname[i] << " ";
outfile << wandpower[i] << " ";
outfile << wand[i] << " ";
}
outfile << Nwand << " " << amm << " " << f << " " << wandi << " " << wandnamei << " " << wandpoweri << " " << ict << " " << speed << " " << nowlevel << endl;
outfile.close();
return 0;
}
int Reg()
{
string DN, DPW;
cout << "请输入账号和密码 " << endl;
cout << "账号:";
cin >> name;
cout << endl << "密码:";
cin >> password;
ifstream fin("data2.txt");
while(fin >> DN) {
if (DN == name) {
cout << "用户名已被使用=====请重新起名";
Reg();
}
}
choose();
return 0;
}
int monsterfight(string Hname, int hisH, int hisA, int hisD, int hisS, int hisSP)
{
int mhealth = 10000, mdefense = 1000, mattack = 10000, mspeed = 500;
int hfaint = 0;
int mfaint = 0;
dead = false;
int ha = hisA;
while (1) {
if (hfaint > 0) hfaint -= 1;
if (mfaint > 0) {
if (rand() % 3 == 0)
{
mfaint = 0;
cout << "石怪使用技能咒立停,停止了魔咒!" << endl;
}
else mfaint -= 1;
}
if (mfaint <= 0) {
if (rand() % 3) {
cout << "石怪使用技能快快复苏 生命增加200" << endl;
mhealth += 200;
}
if (rand() % 3) {
cout << "石怪使用技能铁甲护身 生命增加100 防御增加50" << endl;
mhealth += 100;
mdefense += 50;
}
if (rand() % 3) {
cout << "石怪使用技能神锋无影 攻击增加200 对方扣血200滴" << endl;
hisH -= 200;
mattack += 200;
}
Sleep(1000);
int ran = rand() % 40 - 20;
if (rand() % 10000 > hisSP) {
if (attack + ran > hisD) {
cout << "石怪发起进攻 " << Hname << "扣血" << mattack - hisD + ran << "滴 剩余" << hisH - (mattack - hisD + ran) << "滴" << endl;
hisH -= mattack - hisD + ran;
}
else cout << "石怪发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
else {
if (rand() % 2) cout << "石怪一脚踹了过去,但没有踢中" << endl;
else {
cout << "石怪一脚踹了过去,但只擦着了腰" << endl;
if ((mattack / 3) + ran > hisD) {
cout << Hname << "扣血" << (mattack / 3) + ran - hisD << "滴 剩余" << hisH - ((mattack / 3) + ran - hisD) << "滴" << endl;
hisH -= (mattack / 3) + ran - hisD;
}
else cout << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
}
}
Sleep(1000);
if (hisH <= 0) {
if (hisS == 20 && rand() % 3 == 0) {
cout << "对方发动技能:恢复如初 满血复活" << endl;
hisH = ha; Sleep(1000);
}
else {
cout << "对方死亡" << endl;
return 0;
}
}
if (hfaint <= 0) {
if (hisS != 0) {
if (rand() % 3 == 0) {
if (hisS == 14) {
cout << "对方发动技能:快快复苏 生命加200" << endl;
hisH += 200;
}
if (hisS == 15) {
cout << "对方发动技能:盔甲护身 生命加50 防御增加50" << endl;
hisH += 50;
hisD += 50;
}
if (hisS == 17) {
cout << "对方发动技能神锋无影 攻击增加200 扣血200滴" << endl;
health -= 200;
hisA += 200;
}
}
Sleep(1000);
}
int ran = rand() % 40 - 20;
if (rand() % 10000 > mspeed) {
if (hisA + ran > defense) {
cout << Hname << "发起进攻 " << "石怪扣血" << hisA - defense + ran << "滴 剩余" << mhealth - (hisA - defense + ran) << "滴" << endl;
mhealth -= hisA - defense + ran;
}
else cout << Hname << "发起进攻 " << "石怪扣血0滴 剩余" << mhealth << "滴" << endl;
}
else {
if (rand() % 2) cout << Hname << "一脚踹了过来,但没有踢中" << endl;
else {
cout << "对方一脚踹了过来,但只擦着了石怪的腰" << endl;
if ((hisA / 3) + ran > hisD) {
cout << "石怪扣血" << (hisA / 3) + ran - defense << "滴 剩余" << mhealth - ((hisA / 3) + ran - defense) << "滴" << endl;
mhealth -= ((hisA / 3) + ran - defense);
}
else cout << "石怪扣血0滴 剩余" << mhealth << "滴" << endl;
}
}
Sleep(1000);
if (mhealth <= 0) {
cout << "石怪死亡" << endl;
return hisH;
}
}
}
return 0;
}
int fight1(string Hname, int hisH, int hisA, int hisD, int hisS, int hisSP)
{
int hfaint = 0, hhurt = 0, hbeat = 0;
int mfaint = 0, mhurt = 0;
dead = false;
int ha = hisA;
int his = hisA + hisD + hisH;
while (1) {
if (hfaint > 0) {
if (rand() % 3 == 0) {
cout << "对方使用技能:咒立停!停止了魔咒" << endl;
hfaint = 1;
}
hfaint -= 1;
}
if (hbeat == 1) {
if (rand() % 10 == 0) {
cout << "对方一躲,躲过了你的石头" << endl;
hbeat = 0;
}
else {
cout << "对方躲闪不急,石头正好撞在他的鼻子上 扣血50滴" << endl;
hisH -= 50;
}
}
if (mfaint > 0) {
if (Sl[6]) mfaint = 0;
else mfaint -= 1;
}
if (mhurt > 0) {
if (Sl[6]) mhurt = 0;
else mhurt -= 1;
cout << "你的心像被一把刀刺穿了一样 扣血200滴" << endl;
health -= 200;
}
if (mfaint <= 0) {
if (rand() % 3 && Sl[0]) {
cout << "你使用技能快快复苏 生命增加200" << endl;
health += 200;
}
if (rand() % 3 && Sl[1]) {
cout << "你使用技能铁甲护身 生命增加100 防御增加50" << endl;
health += 100; defense += 50;
}
if (rand() % 3 && Sl[2]) {
cout << "你使用技能昏昏倒地 " << Hname << "一回合之内不能攻击" << endl;
hfaint += 1;
}
if (rand() % 3 && Sl[3]) {
cout << "你使用技能神锋无影 攻击增加200 扣血200滴" << endl;
hisH -= 200; attack += 200;
}
if (rand() % 3 && Sl[5]) {
if (rand() % 10) {
cout << "你使用技能统统石化 " << Hname << "二回合之内不能攻击" << endl;
hfaint += 2;
}
else {
cout << "你使用技能统统石化 " << Hname << "十回合之内不能攻击" << endl;
hfaint += 10;
}
}
if (rand() % 4 == 0 && Sl[7])
{
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
hisH = monsterfight(Hname, hisH, hisA, hisD, hisS, hisSP);
if (hisH < 1) return 0;
if (Sl[0]) {
cout << "在对方和石怪的战斗中,你已经恢复了2000生命" << endl;
if (maxhealth < health + 2000) health = maxhealth;
else health += 2000;
}
}
if (rand() % 4 == 0 && Sl[8]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
}
if (rand() % 3 && Sl[9]) {
cout << "你使用技能万弹齐发!变出几十块石头" << endl;
hbeat = 1;
}
if (rand() % 3 && Sl[10]) {
cout << "你使用技能钻心咒!对方将疼痛5回合" << endl;
hhurt += 5;
}
if (rand() % 3 && Sl[11]) {
cout << "魂魄出窍!你使用夺魂咒,企图让" << Hname << "自己攻击自己!" << endl;
Sleep((rand() % 1000) + 1000);
cout << Hname << "被你控制了,开始攻击自己" << endl;
Sleep(700);
int ran = rand() % 40 - 20;
if (hisA + ran > hisD) {
cout << "对方发起进攻 自己扣血" << hisH - hisD + ran << "滴 剩余" << hisH - (hisA - hisD + ran) << "滴" << endl;
hisH -= hisA - hisD + ran;
}
else cout << "对方发起进攻 自己扣血0滴 剩余" << hisH << "滴" << endl;
}
if (rand() % 2 && Sl[12]) {
cout << "你使用技能阿瓦达索命 " << Hname << "扣血" << hisH - hisH / 4 << "滴" << endl;
hisH /= 4;
}
Sleep(1000);
int ran = rand() % 40 - 20;
if (rand() % 10000 > hisSP) {
if (attack + ran > hisD) {
cout << "你发起进攻 " << Hname << "扣血" << attack - hisD + ran << "滴 剩余" << hisH - (attack - hisD + ran) << "滴" << endl;
hisH -= attack - hisD + ran;
}
else cout << "你发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
else {
if (rand() % 2) cout << "你一脚踹了过去,但没有踢中" << endl;
else {
cout << "你一脚踹了过去,但只擦着了腰" << endl;
if ((attack / 3) + ran > hisD) {
cout << Hname << "扣血" << (attack / 3) + ran - hisD << "滴 剩余" << hisH - ((attack / 3) + ran - hisD) << "滴" << endl;
hisH -= (attack / 3) + ran - hisD;
}
else cout << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
}
}
Sleep(700);
if (hhurt > 0) {
hhurt -= 1;
cout << "对方因中了你的钻心咒,正捂着心大叫呢 扣血200滴" << endl;
hisH -= 200;
}
if (hisH <= 0) {
if (hisS == 20 && rand() % 3 == 0) {
cout << "对方发动技能:恢复如初 满血复活" << endl;
hisH = ha;
Sleep(1000);
}
else {
cout << "对方死亡\n获得" << (his / 30) << "经验" << endl;
experience += (his / 30);
if (ane == 3) D_Of_C++;
if (ane1 == 3) D_Of_C1++;
return 0;
}
}
if (hfaint <= 0) {
if (rand() % 3 == 0) {
if (hisS == 14) {
cout << "对方发动技能:快快复苏 生命加200" << endl;
hisH += 200;
}
if (hisS == 15) {
cout << "对方发动技能:盔甲护身 生命加50 防御增加50" << endl;
hisH += 50; hisD += 50;
}
if (hisS == 17) {
cout << "对方发动技能神锋无影 攻击增加200 扣血200滴" << endl;
health -= 200; hisA += 200;
}
Sleep(1000);
}
int ran = rand() % 40 - 20;
if (rand() % 10000 > speed) {
if (hisA + ran > defense) {
cout << Hname << "发起进攻 " << "你扣血" << hisA - defense + ran << "滴 剩余" << health - (hisA - defense + ran) << "滴" << endl;
health -= hisA - defense + ran;
}
else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
}
else {
if (rand() % 2) cout << Hname << "一脚踹了过来,但没有踢中" << endl;
else {
cout << "对方一脚踹了过来,但只擦着了你的腰" << endl;
if ((hisA / 3) + ran > hisD) {
cout << "你扣血" << (hisA / 3) + ran - defense << "滴 剩余" << health - ((hisA / 3) + ran - defense) << "滴" << endl;
health -= ((hisA / 3) + ran - defense);
}
else cout << "你扣血0滴 剩余" << health << "滴" << endl;
}
}
Sleep(700);
if (health <= 0) {
if (Sl[6] && rand() % 2) {
cout << "你发动技能:恢复如初 满血复活" << endl;
health = maxhealth;
Sleep(1000);
}
else {
cout << "你死亡";
health = 20;
dead = true;
return 0;
}
}
}
}
return 0;
}
int fight2(string Hname, int hisH, int hisA, int hisD, int hisS, int hisSP)
{
int hfaint = 0, hhurt = 0, hbeat = 0;
int mfaint = 0, mhurt = 0;
dead = false;
int ha = hisA;
int his = hisA + hisD + hisH;
while (1) {
if (hfaint > 0) {
if (rand() % 3 == 0) {
cout << "对方使用技能:咒立停!停止了魔咒";
hfaint = 1;
}
hfaint -= 1;
}
if (hbeat == 1) {
if (rand() % 10 == 0) {
cout << "对方一躲,躲过了你的石头" << endl;
hbeat = 0;
}
else {
cout << "对方躲闪不急,石头正好撞在他的鼻子上 扣血50滴" << endl;
hisH -= 50;
}
}
if (mfaint > 0) {
if (Sl[6]) mfaint = 0;
else mfaint -= 1;
}
if (mhurt > 0) {
if (Sl[6]) mhurt = 0;
else mhurt -= 1;
cout << "你的心像被一把刀刺穿了一样 扣血200滴" << endl;
health -= 200;
}
if (mfaint <= 0) {
if (rand() % 3 && Sl[0]) {
cout << "你使用技能快快复苏 生命增加200" << endl;
health += 200;
}
if (rand() % 3 && Sl[1]) {
cout << "你使用技能铁甲护身 生命增加100 防御增加50" << endl;
health += 100;
defense += 50;
}
if (rand() % 3 && Sl[2]) {
cout << "你使用技能昏昏倒地 " << Hname << "一回合之内不能攻击" << endl;
hfaint += 1;
}
if (rand() % 3 && Sl[3]) {
cout << "你使用技能神锋无影 攻击增加200 扣血200滴" << endl;
hisH -= 200;
attack += 200;
}
if (rand() % 3 && Sl[5]) {
if (rand() % 10) {
cout << "你使用技能统统石化 " << Hname << "二回合之内不能攻击" << endl;
hfaint += 2;
}
else {
cout << "你使用技能统统石化 " << Hname << "十回合之内不能攻击" << endl;
hfaint += 10;
}
}
if (rand() % 4 == 0 && Sl[7]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
hisH = monsterfight(Hname, hisH, hisA, hisD, hisS, hisSP);
if (hisH < 1) return 0;
if (Sl[0]) {
cout << "在对方和石怪的战斗中,你已经恢复了2000生命" << endl;
if (maxhealth < health + 2000) health = maxhealth;
else health += 2000;
}
Sleep(1000);
}
if (rand() % 4 == 0 && Sl[8]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
}
if (rand() % 3 && Sl[9]) {
cout << "你使用技能万弹齐发!变出几十块石头" << endl;
hbeat = 1;
}
if (rand() % 3 && Sl[10]) {
cout << "你使用技能钻心咒!对方将疼痛5回合" << endl;
hhurt += 5;
}
if (rand() % 3 && Sl[11]) {
cout << "魂魄出窍!你使用夺魂咒,企图让" << Hname << "自己攻击自己!" << endl;
Sleep((rand() % 1000) + 1000);
cout << Hname << "被你控制了,开始攻击自己" << endl;
Sleep(700);
int ran = rand() % 40 - 20;
if (hisA + ran > hisD) {
cout << "对方发起进攻 自己扣血" << hisH - hisD + ran << "滴 剩余" << hisH - (hisA - hisD + ran) << "滴" << endl;
hisH -= hisA - hisD + ran;
}
else cout << "对方发起进攻 自己扣血0滴 剩余" << hisH << "滴" << endl;
}
if (rand() % 2 && Sl[12]) {
cout << "你使用技能阿瓦达索命 " << Hname << "扣血" << hisH - hisH / 4 << "滴" << endl;
hisH /= 4;
}
Sleep(1000);
int ran = rand() % 40 - 20;
if (rand() % 10000 > hisSP) {
if (attack + ran > hisD) {
cout << "你发起进攻 " << Hname << "扣血" << attack - hisD + ran << "滴 剩余" << hisH - (attack - hisD + ran) << "滴" << endl;
hisH -= attack - hisD + ran;
}
else cout << "你发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
else {
if (rand() % 2) cout << "你一脚踹了过去,但没有踢中" << endl;
else {
cout << "你一脚踹了过去,但只擦着了腰" << endl;
if ((attack / 3) + ran > hisD) {
cout << Hname << "扣血" << (attack / 3) + ran - hisD << "滴 剩余" << hisH - ((attack / 3) + ran - hisD) << "滴" << endl;
hisH -= (attack / 3) + ran - hisD;
}
else cout << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
}
}
Sleep(700);
if (hhurt > 0) {
hhurt -= 1;
cout << "对方因中了你的钻心咒,正捂着心大叫呢 扣血200滴" << endl;
hisH -= 200;
}
if (hisH <= 0) {
if (hisS == 20 && rand() % 3 == 0) {
cout << "对方发动技能:恢复如初 满血复活" << endl;
hisH = ha;
Sleep(1000);
}
else {
cout << "对方死亡\n获得" << (his / 200) << "金币" << endl;
money += (his / 200);
if (ane == 3) D_Of_C++;
if (ane1 == 3) D_Of_C1++;
return 0;
}
}
if (hfaint <= 0) {
if (rand() % 3 == 0) {
if (hisS == 14) {
cout << "对方发动技能:快快复苏 生命加200" << endl;
hisH += 200;
}
if (hisS == 15) {
cout << "对方发动技能:盔甲护身 生命加50 防御增加50" << endl;
hisH += 50; hisD += 50;
}
if (hisS == 17) {
cout << "对方发动技能神锋无影 攻击增加200 扣血200滴" << endl;
health -= 200; hisA += 200;
}
Sleep(1000);
}
int ran = rand() % 40 - 20;
if (rand() % 10000 > speed) {
if (hisA + ran > defense) {
cout << Hname << "发起进攻 " << "你扣血" << hisA - defense + ran << "滴 剩余" << health - (hisA - defense + ran) << "滴" << endl;
health -= hisA - defense + ran;
}
else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
}
else {
if (rand() % 2) cout << Hname << "一脚踹了过来,但没有踢中" << endl;
else {
cout << "对方一脚踹了过来,但只擦着了你的腰" << endl;
if ((hisA / 3) + ran > hisD) {
cout << "你扣血" << (hisA / 3) + ran - defense << "滴 剩余" << health - ((hisA / 3) + ran - defense) << "滴" << endl;
health -= ((hisA / 3) + ran - defense);
}
else cout << "你扣血0滴 剩余" << health << "滴" << endl;
}
}
Sleep(700);
if (health <= 0) {
if (Sl[6] && rand() % 2) {
cout << "你发动技能:恢复如初 满血复活" << endl;
health = maxhealth;
Sleep(1000);
}
else {
cout << "你死亡";
health = 20;
dead = true;
return 0;
}
}
}
}
return 0;
}
int fight(string Hname, int hisH, int hisA, int hisD, int hisS, int hisSP)
{
int hfaint = 0, hhurt = 0, hbeat = 0;
int mfaint = 0, mhurt = 0;
dead = false;
int ha = hisA;
int his = hisA + hisD + hisH;
while (1)
{
if (hfaint > 0) {
if (rand() % 3 == 0) {
cout << "对方使用技能:咒立停!停止了魔咒" << endl;
hfaint = 0;
}
else hfaint -= 1;
}
if (hbeat == 1) {
if (rand() % 10 == 0) {
cout << "对方一躲,躲过了你的石头" << endl;
hbeat = 0;
}
else {
cout << "对方躲闪不急,石头正好撞在他的鼻子上 扣血50滴" << endl;
hisH -= 50;
}
}
if (mfaint > 0) {
if (Sl[6]) mfaint = 0;
else mfaint -= 1;
}
if (mhurt > 0) {
if (Sl[6]) mhurt = 0;
else mhurt -= 1;
cout << "你的心像被一把刀刺穿了一样 扣血200滴" << endl;
health -= 200;
}
if (mfaint <= 0) {
if (rand() % 3 && Sl[0]) {
cout << "你使用技能快快复苏 生命增加200" << endl;
health += 200;
}
if (rand() % 3 && Sl[1]) {
cout << "你使用技能铁甲护身 生命增加100 防御增加50" << endl;
health += 100;
defense += 50;
}
if (rand() % 3 && Sl[2]) {
cout << "你使用技能昏昏倒地 " << Hname << "一回合之内不能攻击" << endl;
hfaint += 1;
}
if (rand() % 3 && Sl[3]) {
cout << "你使用技能神锋无影 攻击增加200 扣血200滴" << endl;
hisH -= 200; attack += 200;
}
if (rand() % 3 && Sl[5]) {
if (rand() % 10) {
cout << "你使用技能统统石化 " << Hname << "二回合之内不能攻击" << endl;
hfaint += 2;
}
else {
cout << "你使用技能统统石化 " << Hname << "十回合之内不能攻击" << endl;
hfaint += 10;
}
}
if (rand() % 4 == 0 && Sl[7]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
hisH = monsterfight(Hname, hisH, hisA, hisD, hisS, hisSP);
if (hisH < 1) return 0;
if (Sl[0]) {
cout << "在对方和石怪的战斗中,你已经恢复了2000生命" << endl;
if (maxhealth < health + 2000) health = maxhealth;
else health += 2000;
}
}
if (rand() % 4 == 0 && Sl[8]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
}
if (rand() % 3 && Sl[9]) {
cout << "你使用技能万弹齐发!变出几十块石头" << endl;
hbeat = 1;
}
if (rand() % 3 && Sl[10]) {
cout << "你使用技能钻心咒!对方将疼痛5回合" << endl;
hhurt += 5;
}
if (rand() % 3 && Sl[11]) {
cout << "魂魄出窍!你使用夺魂咒,企图让" << Hname << "自己攻击自己!" << endl;
Sleep((rand() % 1000) + 1000);
cout << Hname << "被你控制了,开始攻击自己" << endl;
Sleep(700);
int ran = rand() % 40 - 20;
if (hisA + ran > hisD) {
cout << "对方发起进攻 自己扣血" << hisH- hisD + ran << "滴 剩余" << hisH - (hisA - hisD + ran) << "滴" << endl;
hisH -= hisA - hisD + ran;
}
else cout << "对方发起进攻 自己扣血0滴 剩余" << hisH << "滴" << endl;
}
if (rand() % 2 && Sl[12]) {
cout << "你使用技能阿瓦达索命 " << Hname << "扣血" << hisH - hisH / 4 << "滴" << endl;
hisH /= 4;
}
Sleep(1000);
int ran = rand() % 40 - 20;
if (rand() % 10000 > hisSP) {
if (attack + ran > hisD) {
cout << "你发起进攻 " << Hname << "扣血" << attack - hisD + ran << "滴 剩余" << hisH - (attack - hisD + ran) << "滴" << endl;
hisH -= attack - hisD + ran;
}
else cout << "你发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
else {
if (rand() % 2) cout << "你一脚踹了过去,但没有踢中" << endl;
else {
cout << "你一脚踹了过去,但只擦着了腰" << endl;
if ((attack / 3) + ran > hisD) {
cout << Hname << "扣血" << (attack / 3) + ran - hisD << "滴 剩余" << hisH - ((attack / 3) + ran - hisD) << "滴" << endl;
hisH -= (attack / 3) + ran - hisD;
}
else cout << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
}
}
Sleep(700);
if (hhurt > 0) {
hhurt -= 1;
cout << "对方因中了你的钻心咒,正捂着心大叫呢 扣血200滴" << endl;
hisH -= 200;
}
if (hisH <= 0) {
if (hisS == 20 && rand() % 3 == 0) {
cout << "对方发动技能:恢复如初 满血复活" << endl;
hisH = ha;
Sleep(1000);
}
else {
cout << "对方死亡\n获得" << his / 30 << "元" << endl;
money += his / 30;
experience += (his / 30) * 10;
if (ane == 3) D_Of_C++;
if (ane1 == 3) D_Of_C1++;
return 0;
}
}
if (hfaint <= 0) {
if (rand() % 3 == 0) {
if (hisS == 14) {
cout << "对方发动技能:快快复苏 生命加200" << endl;
hisH += 200;
}
if (hisS == 15) {
cout << "对方发动技能:盔甲护身 生命加50 防御增加50" << endl;
hisH += 50;
hisD += 50;
}
if (hisS == 17)
{
cout << "对方发动技能神锋无影 攻击增加200 扣血200滴" << endl;
health -= 200;
hisA += 200;
}
Sleep(1000);
}
int ran = rand() % 40 - 20;
if (rand() % 10000 > speed) {
if (hisA + ran > defense) {
cout << Hname << "发起进攻 " << "你扣血" << hisA - defense + ran << "滴 剩余" << health - (hisA - defense + ran) << "滴" << endl;
health -= hisA - defense + ran;
}
else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
}
else {
if (rand() % 2) cout << Hname << "一脚踹了过来,但没有踢中" << endl;
else {
cout << "对方一脚踹了过来,但只擦着了你的腰" << endl;
if ((hisA / 3) + ran > hisD) {
cout <<"你扣血" << (hisA / 3) + ran - defense << "滴 剩余" << health - ((hisA / 3) + ran - defense) << "滴" << endl;
health -= ((hisA / 3) + ran - defense);
}
else cout << "你扣血0滴 剩余" << health << "滴" << endl;
}
}
Sleep(700);
if (health <= 0) {
if (Sl[6] && rand() % 2) {
cout << "你发动技能:恢复如初 满血复活" << endl;
health = maxhealth;
Sleep(1000);
}
else {
cout << "你死亡" << endl;
health = 20;
dead = true;
return 0;
}
}
}
}
return 0;
}
int street()
{
switch (rand() % 6)
{
case 0:
if (camp) {
int f;
cout << "你遇到了一个路人" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("路人", 500, 110, 0, 14, 1000);
if (!dead && rand() % 2) {
if (rand() % 4 == 0) {
cout << "获得一瓶经验药水" << endl;
bag[22] += 1;
}
else if (rand() % 4 == 1) {
cout << "获得一瓶攻击药水" << endl;
bag[21] += 1;
}
else if (rand() % 4 == 2) {
cout << "获得一瓶生命药水" << endl;
bag[19] += 1;
}
else {
cout << "获得一瓶防御药水" << endl;
bag[20] += 1;
}
}
}
}
else {
int f;
cout << "你遇到了一个小混混" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("小混混", 500, 110, 0, 15, 1000);
if (!dead && rand() % 2) {
if (rand() % 4 == 0) {
cout << "获得一瓶经验药水" << endl;
bag[22] += 1;
}
else if (rand() % 4 == 1) {
cout << "获得一瓶攻击药水" << endl;
bag[21] += 1;
}
else if (rand() % 4 == 2) {
cout << "获得一瓶生命药水" << endl;
bag[19] += 1;
}
else {
cout << "获得一瓶防御药水" << endl;
bag[20] += 1;
}
}
}
}
break;
case 1:
if (camp) {
int f;
cout << "你遇到了一个警察" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("警察", 2000, 500, 15, 15, 1000);
if (!dead && rand() % 3 != 0) {
if (rand() % 5 == 0) {
cout << "获得两瓶经验药水" << endl;
bag[22] += 2;
}
else if (rand() % 5 == 1) {
cout << "获得两瓶攻击药水" << endl;
bag[21] += 2;
}
else if (rand() % 5 == 2) {
cout << "获得两瓶生命药水" << endl;
bag[19] += 2;
}
else if (rand() % 5 == 3) {
cout << "获得一瓶全幅药水" << endl;
bag[23] += 1;
}
else {
cout << "获得两瓶防御药水" << endl;
bag[20] += 2;
}
}
}
}
else {
int f;
cout << "你遇到了一个小食死徒" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("食死徒", 2000, 500, 15, 15, 1000);
if (!dead && rand() % 3 != 0) {
if (rand() % 5 == 0) {
cout << "获得两瓶经验药水" << endl;
bag[22] += 2;
}
else if (rand() % 5 == 1) {
cout << "获得两瓶攻击药水" << endl;
bag[21] += 2;
}
else if (rand() % 5 == 2) {
cout << "获得两瓶生命药水" << endl;
bag[19] += 2;
}
else if (rand() % 5 == 3) {
cout << "获得一瓶全幅药水" << endl;
bag[23] += 1;
}
else {
cout << "获得两瓶防御药水" << endl;
bag[20] += 2;
}
}
}
}
break;
case 2:
if (camp) {
int f;
cout << "你遇到了一个凤凰社成员" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("凤凰社成员", 5000, 700, 50, 16, 1500);
if (!dead && rand() % 4 != 0) {
if (rand() % 5 == 0) {
cout << "获得三瓶经验药水" << endl;
bag[22] += 3;
}
else if (rand() % 5 == 1) {
cout << "获得三瓶攻击药水" << endl;
bag[21] += 3;
}
else if (rand() % 5 == 2) {
cout << "获得三瓶生命药水" << endl;
bag[19] += 3;
}
else if (rand() % 5 == 3) {
cout << "获得两瓶全幅药水" << endl;
bag[23] += 2;
}
else {
cout << "获得三瓶防御药水" << endl;
bag[20] += 3;
}
}
}
}
else {
int f;
cout << "你遇到了一个真食死徒" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("食死徒", 5000, 700, 50, 15, 1500);
if (!dead && rand() % 4 != 0) {
if (rand() % 5 == 0) {
cout << "获得三瓶经验药水" << endl;
bag[22] += 3;
}
else if (rand() % 5 == 1) {
cout << "获得三瓶攻击药水" << endl;
bag[21] += 3;
}
else if (rand() % 5 == 2) {
cout << "获得三瓶生命药水" << endl;
bag[19] += 3;
}
else if (rand() % 5 == 3) {
cout << "获得两瓶全幅药水" << endl;
bag[23] += 2;
}
else {
cout << "获得三瓶防御药水" << endl;
bag[20] += 3;
}
}
}
}
break;
case 3:
if (camp) {
int f;
cout << "你遇到了一个傲罗·穆迪" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("穆迪", 10000, 1200, 250, 17, 2000);
if (!dead) {
if (rand() % 3) {
if (rand() % 2) {
cout << "获得技能书神锋无影" << endl;
bag[9]++;
}
else {
cout << "获得技能书快快复苏" << endl;
bag[6]++;
}
}
if (rand() % 4) {
if (rand() % 5 == 0) {
cout << "获得四瓶经验药水" << endl;
bag[22] += 4;
}
else if (rand() % 5 == 1) {
cout << "获得四瓶攻击药水" << endl;
bag[21] += 4;
}
else if (rand() % 5 == 2) {
cout << "获得四瓶生命药水" << endl;
bag[19] += 4;
}
else if (rand() % 5 == 3) {
cout << "获得三瓶全幅药水" << endl;
bag[23] += 3;
}
else {
cout << "获得四瓶防御药水" << endl;
bag[20] += 4;
}
}
}
}
}
else {
int f;
cout << "你遇到了卢修斯·马尔福" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("马尔福", 10000, 1200, 250, 17, 2000);
if (!dead) {
if (rand() % 3) {
if (rand() % 2) {
cout << "获得技能书神锋无影" << endl;
bag[9]++;
}
else {
cout << "获得技能书快快复苏" << endl;
bag[6]++;
}
}
if (rand() % 4) {
if (rand() % 5 == 0) {
cout << "获得四瓶经验药水" << endl;
bag[22] += 4;
}
else if (rand() % 5 == 1) {
cout << "获得四瓶攻击药水" << endl;
bag[21] += 4;
}
else if (rand() % 5 == 2) {
cout << "获得四瓶生命药水" << endl;
bag[19] += 4;
}
else if (rand() % 5 == 3) {
cout << "获得三瓶全幅药水" << endl;
bag[23] += 3;
}
else {
cout << "获得四瓶防御药水" << endl;
bag[20] += 4;
}
}
}
}
}
if (!dead)
if (ane1 == 2) D_Of_C1++;
break;
case 4:
if (camp) {
int f;
cout << "你遇到了卢平" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("卢平", 100000, 12000, 2500, 17, 4000);
if (!dead) {
if (rand() % 3) {
if (rand() % 2) {
cout << "获得技能书恢复如初" << endl;
bag[12]++;
}
else {
cout << "获得技能书阿瓦达索命" << endl;
bag[18]++;
}
}
if (rand() % 5) {
if (rand() % 5 == 0) {
cout << "获得四瓶经验药水" << endl;
bag[22] += 4;
}
else if (rand() % 5 == 1) {
cout << "获得四瓶攻击药水" << endl;
bag[21] += 4;
}
else if (rand() % 5 == 2) {
cout << "获得四瓶生命药水" << endl;
bag[19] += 4;
}
else if (rand() % 5 == 3) {
cout << "获得三瓶全幅药水" << endl;
bag[23] += 3;
}
else {
cout << "获得四瓶防御药水" << endl;
bag[20] += 4;
}
}
}
}
}
else {
int f;
cout << "你遇到了食死徒·卡卡洛夫" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("卡卡洛夫", 100000, 12000, 2500, 170, 4000);
if (!dead) {
if (rand() % 3) {
if (rand() % 2) {
cout << "获得技能书恢复如初" << endl;
bag[12]++;
}
else {
cout << "获得技能书阿瓦达索命" << endl;
bag[18]++;
}
}
if (rand() % 5) {
if (rand() % 5 == 0) {
cout << "获得四瓶经验药水" << endl;
bag[22] += 4;
}
else if (rand() % 5 == 1) {
cout << "获得四瓶攻击药水" << endl;
bag[21] += 4;
}
else if (rand() % 5 == 2) {
cout << "获得四瓶生命药水" << endl;
bag[19] += 4;
}
else if (rand() % 5 == 3) {
cout << "获得三瓶全幅药水" << endl;
bag[23] += 3;
}
else {
cout << "获得四瓶防御药水" << endl;
bag[20] += 4;
}
}
}
}
}
break;
case 5:
if (camp) {
int f;
cout << "你遇到了邓布利多" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("邓布利多", 300000, 36000, 7500, 20, 5000);
if (!dead) {
if (rand() % 3) {
if (rand() % 2) {
cout << "获得技能书恢复如初" << endl;
bag[12]++;
}
else {
cout << "获得技能书阿瓦达索命" << endl;
bag[18]++;
}
}
if (rand() % 5) {
if (rand() % 5 == 0) {
cout << "获得四瓶经验药水" << endl;
bag[22] += 4;
}
else if (rand() % 5 == 1) {
cout << "获得四瓶攻击药水" << endl;
bag[21] += 4;
}
else if (rand() % 5 == 2) {
cout << "获得四瓶生命药水" << endl;
bag[19] += 4;
}
else if (rand() % 5 == 3) {
cout << "获得三瓶全幅药水" << endl;
bag[23] += 3;
}
else {
cout << "获得四瓶防御药水" << endl;
bag[20] += 4;
}
}
}
}
}
else {
int f;
cout << "你遇到了纳尼吉" << endl;
cout << "1进攻/2逃跑" << endl;
cin >> f;
if (f == 1) {
fight("纳尼吉", 300000, 36000, 7500, 20, 5000);
if (!dead) {
if (rand() % 3) {
if (rand() % 2) {
cout << "获得技能书恢复如初" << endl;
bag[12]++;
}
else {
cout << "获得技能书阿瓦达索命" << endl;
bag[18]++;
}
}
if (rand() % 5) {
if (rand() % 5 == 0) {
cout << "获得四瓶经验药水" << endl;
bag[22] += 4;
}
else if (rand() % 5 == 1) {
cout << "获得四瓶攻击药水" << endl;
bag[21] += 4;
}
else if (rand() % 5 == 2) {
cout << "获得四瓶生命药水" << endl;
bag[19] += 4;
}
else if (rand() % 5 == 3) {
cout << "获得三瓶全幅药水" << endl;
bag[23] += 3;
}
else {
cout << "获得四瓶防御药水" << endl;
bag[20] += 4;
}
}
}
}
}
if (!dead)
if (ane1 == 0) D_Of_C1++;
break;
}
Sleep(1000);
return 0;
}
int buy(int p, int m)
{
if (money < m) {
cout << "没钱,打出去!" << endl;
if (camp) {
cout << "1抢劫 2逃离" << endl;
int a;
cin >> a;
if (a == 1) {
fight("员工", 1000, 100, 10, 0, 1000);
if (dead) return 0;
cout << "另外一个员工冲了过来" << endl;
fight("员工", 1000, 100, 10, 14, 1000);
if (dead) return 0;
cout << "另外一个员工冲了过来" << endl;
fight("员工", 1000, 100, 10, 14, 2000);
if (dead) return 0;
cout << "员工头冲了过来" << endl;
fight("员工头", 5000, 5000, 10, 14, 2000);
if (dead) return 0;
cout << "店主冲了过来" << endl;
fight("店主", 10000, 1000, 100, 15, 4000);
if (dead) return 0;
cout << "获得100元" << endl;
money += 100;
if (rand() % 10 < 3) {
Sleep(3000);
cout << "你翻了半天,终于找到了你要卖的东西" << endl;
bag[p]++;
}
else {
Sleep(3000);
cout << "你翻了半天,还是没找到你要卖的东西" << endl;
cout << "你要不要到大街上消消气(杀人)" << endl;
cout << "1要! 2不必了" << endl;
int q;
cin >> q;
if (q == 1) street();
}
}
}
}
else {
cout << "购买成功" << endl;
bag[p]++;
money -= m;
if (ane == 1) D_Of_C++;
if (ane1 == 1) D_Of_C1 += m;
}
Sleep(1000);
return 0;
}
int buywand(int p, int m)
{
if (money < m) cout << "没钱,打出去!" << endl;
else {
cout << "购买成功" << endl;
wand[p - 6]++;
money -= m;
if (ane == 1) D_Of_C++;
if (ane1 == 1) D_Of_C1 += m;
}
Sleep(1000);
return 0;
}
int make(int w1, int w2, int c1, int c2)
{
if (w1 < 24 || w2 < 33) {
cout << "根本就没有这种材料,你眼瞎啊!" << endl;
Sleep(1000);
return 0;
}
if (c1 == 0||c2 == 0) {
cout << "你想拿0个材料来造魔杖!没门!" << endl;
Sleep(1000);
return 0;
}
if (bag[w1] < c1) {
if (bag[w2] < c2) cout << "你木材和杖芯都不够";
else cout << "杖芯不够";
}
else if (bag[w2] < c2) cout << "木材不够";
else {
cout << "制作成功" << endl;
string wn;
wn = Material1name[w1 - 24] + Material2name[w2 - 33] + "魔杖";
bag[w1] -= c1;
bag[w2] -= c2;
wand[wandi++]++;
wandpower[wandpoweri++] = c1 * 20 * (w1 - 4) + c1 * 10 * (w2 - 13);
wandname[wandnamei++] = wn;
}
Sleep(1000);
return 0;
}
int levelup()
{
if (experience >= level * 100) {
experience -= level * 100;
level++;
maxhealth += 100; health += 100; attack += 10; defense += 5; speed += 10;
if (rand() % 2 && level > 4) bag[0] += 1;
cout << "你升了1级" << endl;
levelup();
if (ane1 == 4) D_Of_C1++;
}
return 0;
}
int Hos()
{
int a;
if (health < maxhealth) {
cout << "剩余生命:(" << health << "/" << maxhealth << ")" << endl;
cout << "需要" << ((maxhealth) - health) / 16 << "元 是否恢复. 等级小于等于10免费恢复" << endl;
cout << "1,是 2,否" << endl;
cin >> a;
if (a == 1) {
if (level > 10) {
if (money >= ((maxhealth) - health) / 16) {
money -= ((maxhealth) - health) / 16;
cout << "恢复成功\n剩余:" << money << "元";
if (ane == 2) D_Of_C++;
if (ane1 == 1) D_Of_C1 += ((maxhealth) - health) / 16;
health = maxhealth;
}
else cout << "钱不足" << endl;
}
else {
health = maxhealth;
cout << "恢复成功" << endl;
if (ane == 2) D_Of_C++;
}
}
else if (a == 2) return 0;
else {
cout << "请别乱输";
Hos();
}
}
else {
cout << "生命已满";
Sleep(1000);
}
return 0;
}
int w()
{
int aaaa = 1;
while (aaaa) {
for (int i = 0; i < wandi; i++) {
if (wandname[i] == Nwand) cout << "o";
else cout << " ";
cout << i + 1 << "," << wandname[i] << " " << wand[i] << "个" << " 力量:" << wandpower[i] << endl;
}
cout << "1,装备魔杖 2,卸下现有魔杖 0,退出" << endl;
cin >> aaaa;
if (aaaa == 1) {
cout << "请输入魔杖编号" << endl;
int bbbb;
cin >> bbbb;
if (wand[bbbb - 1]) {
if (Nwand != "空手") {
cout << "已装备魔杖";
Sleep(1000);
}
else {
cout << "装备成功";
Nwand = wandname[bbbb - 1];
attack += wandpower[bbbb - 1];
}
}
else {
cout << "您还未拥有此魔杖";
}
Sleep(1000);
}
else if (aaaa == 2) {
for (int ia = 0; ia < wandi - 1; ia++) {
if (Nwand == wandname[ia]) {
cout << "成功卸下";
attack -= wandpower[ia];
break;
}
}
Nwand = "空手";
Sleep(1000);
}
else if (aaaa == 0) break;
else cout << "请别乱输";
levelup();
system("cls");
cout << "魔法人士:" << name << endl;
cout << "势力:";
if (camp) cout << "伏地魔" << endl;
else cout << "哈利波特" << endl;
cout << "生命:" << health << "/" << maxhealth << endl;
cout << "攻击:" << attack << endl;
cout << "防御:" << defense << endl;
cout << "速度:" << speed << endl;
cout << "等级:" << level << endl;
cout << "经验:" << experience << "/" << level * 100 << endl;
cout << "金币:" << money << endl;
cout << "1,魔法部(攻击即可占领) 2,大街(杀人/阻止食死徒) 3,";
if (camp) cout << "霍格沃茨(哈利波特不在) ";
else cout << "伏地魔总部(伏地魔不在) ";
cout << "4,霍格沃茨(最后战场) 5,奥利凡德魔杖商店 6,抽奖 7,经验石店 8,背包 9,工厂 10,材料店 11,任务 12,终极任务 13,副本 14,保存 ";
if (camp) cout << "15, 医疗兵(伏地魔的)";
else cout << "15, 庞弗雷女士 ";
cout << "16,改变参数(测试专用 需要密码) 17,设置 18,登出" << endl;
cout << "8" << endl;
cout << "1,查看魔杖 2,查看药水 3,查看经验石 4,学习技能" << endl;
cout << "1" << endl;
}
return 0;
}
int e()
{
int bbbb = 1;
while (bbbb) {
cout << "1,经验石R " << bag[1] << "个" << endl;
cout << "2,经验石SR " << bag[2] << "个" << endl;
cout << "3,经验石SSR " << bag[3] << "个" << endl;
cout << "4,经验石SSS " << bag[4] << "个" << endl;
cout << "5,经验石X " << bag[5] << "个" << endl;
cout << "0,退出 6,一键使用";
int aaaa;
cin >> bbbb;
switch (bbbb)
{
case 1:
cout << "几个?";
cin >> aaaa;
if (bag[1] >= aaaa) {
cout << "服用成功";
experience += aaaa * 100;
bag[1] -= aaaa;
Sleep(1000);
break;
}
break;
case 2:
cout << "几个?";
cin >> aaaa;
if (bag[2] >= aaaa) {
cout << "服用成功";
experience += aaaa * 250;
bag[2] -= aaaa;
Sleep(1000);
break;
}
break;
case 3:
cout << "几个?";
cin >> aaaa;
if (bag[3] >= aaaa) {
cout << "服用成功";
experience += aaaa * 500;
bag[3] -= aaaa;
Sleep(1000);
break;
}
break;
case 4:
cout << "几个?";
cin >> aaaa;
if (bag[4] >= aaaa) {
cout << "服用成功";
experience += aaaa * 1200;
bag[4] -= aaaa;
Sleep(1000);
break;
}
break;
case 5:
cout << "几个?";
cin >> aaaa;
if (bag[5] >= aaaa) {
cout << "服用成功";
experience += aaaa * 2500;
bag[5] -= aaaa;
Sleep(1000);
break;
}
break;
case 0:
break;
case 6:
cout << "服用成功";
experience += bag[1] * 100;
experience += bag[2] * 250;
experience += bag[3] * 500;
experience += bag[4] * 1200;
experience += bag[5] * 2500;
bag[1] = bag[2] = bag[3] = bag[4] = bag[5] = 0;
break;
default:
cout << "请别乱输";
Sleep(1000);
break;
}
levelup();
system("cls");
cout << "魔法人士:" << name << endl;
cout << "势力:";
if (camp) cout << "伏地魔" << endl;
else cout << "哈利波特" << endl;
cout << "生命:" << health << "/" << maxhealth << endl;
cout << "攻击:" << attack << endl;
cout << "防御:" << defense << endl;
cout << "速度:" << speed << endl;
cout << "等级:" << level << endl;
cout << "经验:" << experience << "/" << level * 100 << endl;
cout << "金币:" << money << endl;
cout << "1,魔法部(攻击即可占领) 2,大街(杀人/阻止食死徒) 3,";
if (camp) cout << "霍格沃茨(哈利波特不在) ";
else cout << "伏地魔总部(伏地魔不在) ";
cout << "4,霍格沃茨(最后战场) 5,奥利凡德魔杖商店 6,抽奖 7,经验石店 8,背包 9,工厂 10,材料店 11,任务 12,终极任务 13,副本 14,保存 ";
if (camp) cout << "15, 医疗兵(伏地魔的)";
else cout << "15, 庞弗雷女士 ";
cout << "16,改变参数(测试专用 需要密码) 17,设置 18,登出" << endl;
cout << "8" << endl;
cout << "1,查看魔杖 2,查看药水 3,查看经验石 4,学习技能" << endl;
cout << "3" << endl;
}
return 0;
}
int p()
{
int bbbb = 1;
while (bbbb) {
cout << "1,生命药水 " << bag[19] << "个" << endl;
cout << "2,防御药水 " << bag[20] << "个" << endl;
cout << "3,攻击药水 " << bag[21] << "个" << endl;
cout << "4,经验药水 " << bag[22] << "个" << endl;
cout << "5,速度药水 " << bag[23] << "个" << endl;
cout << "6,全幅药水 " << bag[23] << "个" << endl;
cout << "0,退出 7,一键使用";
cin >> bbbb;
int aaaa;
switch (bbbb)
{
case 1:
cout << "几个?";
cin >> aaaa;
if (bag[19] >= aaaa) {
cout << "服用成功";
health += aaaa * 50;
maxhealth += aaaa * 50;
bag[19] -= aaaa;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 2:
cout << "几个?";
cin >> aaaa;
if (bag[20] >= aaaa) {
cout << "服用成功";
defense += aaaa * 10;
bag[20] -= aaaa;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 3:
cout << "几个?";
cin >> aaaa;
if (bag[21] >= aaaa) {
cout << "服用成功";
attack += aaaa * 25;
bag[21] -= aaaa;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 4:
cout << "几个?";
cin >> aaaa;
if (bag[22] >= aaaa) {
cout << "服用成功";
experience += aaaa * 200;
bag[22] -= aaaa;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 5:
cout << "几个?";
cin >> aaaa;
if (bag[43] >= aaaa) {
cout << "服用成功";
speed += aaaa;
bag[43] -= aaaa;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 6:
cout << "几个?";
cin >> aaaa;
if (bag[23] >= aaaa) {
cout << "服用成功";
health += aaaa * 50;
maxhealth += aaaa * 50;
defense += aaaa * 10;
attack += aaaa * 25;
experience += aaaa * 200;
speed += aaaa;
bag[23] -= aaaa;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 7:
cout << "服用成功";
health += bag[19] * 50;
maxhealth += bag[19] * 50;
defense += bag[20] * 10;
attack += bag[21] * 25;
experience += bag[22] * 200;
speed += bag[43];
health += bag[23] * 50;
maxhealth += bag[23] * 50;
defense += bag[23] * 10;
attack += bag[23] * 25;
experience += bag[23] * 200;
speed += bag[23];
bag[19] = 0;
bag[20] = 0;
bag[21] = 0;
bag[22] = 0;
bag[23] = 0;
bag[43] = 0;
break;
case 0:
break;
default:
cout << "请别乱输";
Sleep(1000);
break;
}
levelup();
system("cls");
cout << "魔法人士:" << name << endl;
cout << "势力:";
if (camp) cout << "伏地魔" << endl;
else cout << "哈利波特" << endl;
cout << "生命:" << health << "/" << maxhealth << endl;
cout << "攻击:" << attack << endl;
cout << "防御:" << defense << endl;
cout << "速度:" << speed << endl;
cout << "等级:" << level << endl;
cout << "经验:" << experience << "/" << level * 100 << endl;
cout << "金币:" << money << endl;
cout << "1,魔法部(攻击即可占领) 2,大街(杀人/阻止食死徒) 3,";
if (camp) cout << "霍格沃茨(哈利波特不在) ";
else cout << "伏地魔总部(伏地魔不在) ";
cout << "4,霍格沃茨(最后战场) 5,奥利凡德魔杖商店 6,抽奖 7,经验石店 8,背包 9,工厂 10,材料店 11,任务 12,终极任务 13,副本 14,保存 ";
if (camp) cout << "15, 医疗兵(伏地魔的)";
else cout << "15, 庞弗雷女士 ";
cout << "16,改变参数(测试专用 需要密码) 17,设置 18,登出" << endl;
cout << "8" << endl;
cout << "1,查看魔杖 2,查看药水 3,查看经验石 4,学习技能" << endl;
cout << "2" << endl;
}
return 0;
}
int s()
{
int bbbb = 1;
while (bbbb) {
cout << "1,快快复苏 " << bag[6] << "个" << endl;
cout << "2,盔甲护身 " << bag[7] << "个" << endl;
cout << "3,昏昏倒地 " << bag[8] << "个" << endl;
cout << "4,神锋无影 " << bag[9] << "个" << endl;
cout << "5,咒立停 " << bag[10] << "个" << endl;
cout << "6,统统石化 " << bag[11] << "个" << endl;
cout << "7,恢复如初 " << bag[12] << "个" << endl;
cout << "8,召唤咒 " << bag[13] << "个" << endl;
cout << "9,一忘皆空 " << bag[14] << "个" << endl;
cout << "10,万箭齐发 " << bag[15] << "个" << endl;
cout << "11,钻心剜骨 " << bag[16] << "个" << endl;
cout << "12,魂魄出窍 " << bag[17] << "个" << endl;
cout << "13,阿瓦达索命 " << bag[18] << "个" << endl;
cout << "0,退出";
cin >> bbbb;
switch (bbbb)
{
case 1:
if (bag[6] >= 1) {
cout << "学习成功" << endl;
cout << "能够恢复200滴血" << endl;
bag[6] -= 1;
Sl[0] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 2:
if (bag[7] >= 1) {
cout << "学习成功" << endl;
cout << "能恢复100滴血并加50防御" << endl;
bag[7] -= 1;
Sl[1] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 3:
if (bag[8] >= 1) {
cout << "学习成功" << endl;
cout << "能使对方暂停一回合" << endl;
bag[8] -= 1;
Sl[2] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 4:
if (bag[9] >= 1) {
cout << "学习成功" << endl;
cout << "攻击加250并扣对方500滴血" << endl;
bag[9] -= 1;
Sl[3] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 5:
if (bag[10] >= 1) {
cout << "学习成功" << endl;
cout << "能使对方对你施加的状态没用" << endl;
bag[10] -= 1;
Sl[4] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 6:
if (bag[11] >= 1) {
cout << "学习成功" << endl;
cout << "%10概率能事对方冻结10回合" << endl;
cout << "%90概率能事对方冻结2回合" << endl;
bag[11] -= 1;
Sl[5] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 7:
if (bag[12] >= 1) {
cout << "学习成功" << endl;
cout << "%50概率能起死回生" << endl;
bag[12] -= 1;
Sl[6] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 8:
if (bag[13] >= 1) {
cout << "学习成功" << endl;
cout << "能召唤生物进攻" << endl;
bag[13] -= 1;
Sl[7] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 9:
if (bag[14] >= 1) {
cout << "学习成功" << endl;
cout << "%90能使对方无技能" << endl;
cout << "%10能使对方防御变为0" << endl;
bag[14] -= 1;
Sl[8] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 10:
if (bag[15] >= 1) {
cout << "学习成功" << endl;
cout << "对方一直减10滴血直到对方躲过(%10躲过)" << endl;
bag[15] -= 1;
Sl[9] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 11:
if (bag[16] >= 1) {
cout << "学习成功" << endl;
cout << "对方扣血5回合,每回合扣200滴" << endl;
bag[16] -= 1;
Sl[10] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 12:
if (bag[17] >= 1) {
cout << "学习成功" << endl;
cout << "让对方自己攻击自己(当然不攻击你)" << endl;
bag[17] -= 1;
Sl[11] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 13:
if (bag[18] >= 1) {
cout << "学习成功" << endl;
cout << "让对方直接扣3/4的血" << endl;
bag[18] -= 1;
Sl[12] = 1;
Sleep(1000);
break;
}
else cout << "物品不足" << endl;
break;
case 0:
break;
default:
cout << "请别乱输";
Sleep(1000);
break;
}
system("cls");
cout << "魔法人士:" << name << endl;
cout << "势力:";
if (camp) cout << "伏地魔" << endl;
else cout << "哈利波特" << endl;
cout << "生命:" << health << "/" << maxhealth << endl;
cout << "攻击:" << attack << endl;
cout << "防御:" << defense << endl;
cout << "速度:" << speed << endl;
cout << "等级:" << level << endl;
cout << "经验:" << experience << "/" << level * 100 << endl;
cout << "金币:" << money << endl;
cout << "1,魔法部(攻击即可占领) 2,大街(杀人/阻止食死徒) 3,";
if (camp) cout << "霍格沃茨(哈利波特不在) ";
else cout << "伏地魔总部(伏地魔不在) ";
cout << "4,霍格沃茨(最后战场) 5,奥利凡德魔杖商店 6,抽奖 7,经验石店 8,背包 9,工厂 10,材料店 11,任务 12,终极任务 13,副本 14,保存 ";
if (camp) cout << "15, 医疗兵(伏地魔的)";
else cout << "15, 庞弗雷女士 ";
cout << "16,改变参数(测试专用 需要密码) 17,设置 18,登出" << endl;
cout << "8" << endl;
cout << "1,查看魔杖 2,查看药水 3,查看经验石 4,学习技能" << endl;
cout << "4" << endl;
}
return 0;
}
int LD()
{
cout << "剩余抽奖券:" << bag[0] << "张" << endl;
cout << "1,抽奖 2,退出" << endl;
int a;
cin >> a;
if (a == 1) {
cout << "抽几次?";
int num;
cin >> num;
if (bag[0] >= num) {
bag[0] -= num;
int num1 = 0, num2 = 0, num3 = 0, num4 = 0, num5 = 0;
int num6 = 0, num7 = 0, num8 = 0, num9 = 0, num10 = 0;
int num11 = 0;
for (int i = 0; i < num; i++)
{
switch (rand() % 20)
{
case 0:
case 1:
num1++;
bag[1]++;
break;
case 2:
case 3:
num2++;
bag[2]++;
break;
case 4:
case 5:
num3++;
bag[3]++;
break;
case 6:
case 7:
num4++;
bag[4]++;
break;
case 8:
num5++;
bag[5]++;
break;
case 9:
case 10:
num6++;
bag[19]++;
break;
case 11:
case 12:
num7++;
bag[20]++;
break;
case 13:
case 14:
num8++;
bag[21]++;
break;
case 15:
case 16:
num9++;
bag[22]++;
break;
case 17:
num10++;
bag[23]++;
break;
case 18:
num11 += 50;
money += 50;
break;
case 19:
num11 += 100;
money += 100;
break;
}
}
cout << "你获得了经验石R " << num1 << "个" << endl;
cout << "经验石SR " << num2 << "个" << endl;
cout << "经验石SSR " << num3 << "个" << endl;
cout << "经验石SSS " << num4 << "个" << endl;
cout << "经验石X " << num5 << "个" << endl;
cout << "生命药水 " << num6 << "个" << endl;
cout << "防御药水 " << num7 << "个" << endl;
cout << "攻击药水 " << num8 << "个" << endl;
cout << "经验药水 " << num9 << "个" << endl;
cout << "全幅药水 " << num10 << "个" << endl;
cout << "金币 " << num11 << "个" << endl;
}
else cout << "您的抽奖券不足" << endl;
}
else if (a == 2) return 0;
else {
cout << "请别乱输。";
system("cls");
LD();
}
_getch();
return 0;
}
int dig()
{
cout << "进入挖矿状态";
Sleep(1000);
system("cls");
int x = 0;
while (1) {
system("cls");
cout << "挖";Sleep(200);
cout << "矿";Sleep(200);
cout << "中";Sleep(200);
cout << ".";Sleep(100);
cout << ".";Sleep(100);
cout << "." << endl;
x++;Sleep(500);
int ad = rand() % 3;
if (ad == 2) {
ad = rand() % 100;
if (ad < 6) {
switch (rand() % 3)
{
case 0:
cout << "你挖到了技能书铁甲咒!!!" << endl;
bag[7]++;
break;
case 1:
cout << "你挖到了技能书咒立停!!!" << endl;
bag[10]++;
break;
case 2:
cout << "你挖到了技能书石化咒!!!" << endl;
bag[11]++;
break;
}
Sleep(500);
}
else if (ad >= 6 && ad < 20) {
switch (rand() % 20)
{
case 0:
cout << "你挖到了夜琪的尾羽!!!" << endl;
bag[32]++;
break;
case 1:
case 2:
cout << "你挖到了独角兽尾毛!" << endl;
bag[30]++;
break;
case 3:
case 4:
cout << "你挖到了龙神经!" << endl;
bag[31]++;
break;
case 5:
case 6:
cout << "你挖到了凤凰羽毛!" << endl;
bag[29]++;
break;
case 7:
case 8:
cout << "你挖到了龙心腱" << endl;
bag[27]++;
break;
case 9:
case 10:
cout << "你挖到了雷鸟尾羽" << endl;
bag[28]++;
break;
case 11:
case 12:
case 13:
cout << "你挖到了马形水怪的鬃毛" << endl;
bag[26]++;
break;
case 14:
case 15:
case 16:
cout << "你挖到了猫狸子胡须" << endl;
bag[24]++;
break;
case 17:
case 18:
case 19:
cout << "你挖到了媚娃头发" << endl;
bag[25]++;
break;
}
Sleep(500);
}
else if (ad >= 20 && ad < 50) {
switch (rand() % 10)
{
case 0:
cout << "你挖到了桦木" << endl;
bag[33]++;
break;
case 1:
cout << "你挖到了紫衫木" << endl;
bag[34]++;
break;
case 2:
cout << "你挖到了冬青木" << endl;
bag[35]++;
break;
case 3:
cout << "你挖到了山楂木柳条" << endl;
bag[36]++;
break;
case 4:
cout << "你挖到了橡木" << endl;
bag[37]++;
break;
case 5:
cout << "你挖到了械木" << endl;
bag[38]++;
break;
case 6:
cout << "你挖到了山毛榉木" << endl;
bag[39]++;
break;
case 7:
cout << "你挖到了栗木" << endl;
bag[40]++;
break;
case 8:
cout << "你挖到了樱桃木" << endl;
bag[41]++;
break;
case 9:
cout << "你挖到了桃花心木" << endl;
bag[42]++;
break;
}
Sleep(500);
}
else if (ad >= 50 && ad <= 100) {
int as = rand() % 20 + 30;
cout << "你挖到了" << as << "金币" << endl;
money += as;
Sleep(500);
}
}
else if (ad == 1) {
ad = rand() % 3;
if (ad == 0) {
cout << "你遇到了大老鼠" << endl;
fight("大老鼠", 5000, 500, 50, 20, 1000);
if (dead)
{
cout << "你死了" << endl;
return 0;
}
}
if (ad == 1) {
cout<<"你遇到了食死徒" << endl;
fight("食死徒", 10000, 1000, 100, 17, 1000);
if (dead)
{
cout << "你死了" << endl;
return 0;
}
}
if (ad == 2) {
cout << "你遇到了坏矿工" << endl;
fight("矿工", 5000, 2000, 200, 17, 1000);
if (dead)
{
cout << "你死了" << endl;
return 0;
}
}
cout << "是否继续挖矿?" << endl;
cout << "1,是 2,否" << endl;
int ans;
cin >> ans;
if (ans == 2) return 0;
}
}
return 0;
}
int clearance()
{
system("cls");
cout << "你在出口处发现了一张纸条,上面写着:";
if (camp) {
cout << "伏地魔,我知道你在找我...我就告诉你吧,我在霍格沃茨等你!" << endl;
cout << " ————哈利·波特" << endl;
}
else {
cout << "哈利·波特, 你看到这张纸条的时候, 你们的校已经掌握在我手中, 要么你前来送死,要么我就会把你的同们统统杀死!!!"<<endl;
cout << " ——伏地魔" << endl;
}
_getch();
f = 1;
return 0;
}
int maze()
{
bool is[101][101];
for (int i = 0; i < 100; i++)
for (int j = 0; j < 100; j++)
is[i][j] = false;
int x = 8, y = 1;
string a[100] = {
"##################################################",
"# 1 # 2 2 3# # 1 #89#1#1# 1 1 #12 #3 #1#",
"#2#1#5 # #1# # ## # ##91 6 #9#7#11## # # 11#",
"# ## ## # # # #### # ##### # ####5## # # #####",
"#2########### # 4 # ## #####4 5##1# #189o",
"# 1 1# #2# ## # ## 5# ######### # #7#8#",
"#1# #1 2# # # #9 # ### # ##2## # ## 5#167#",
"# 1## ## # # ### #4## ## 6 # 3 ### #####5##",
"I 2 #### #### # 1 6 #1# ## 5###6## # #11134##",
"I 1 # 7 # # # # 227# # # # #2 #2#21#5#",
"##1 #1 #1# ## 5 # # #3#### # 1#5# # 1 111#6 #",
"# 2##3##1# ### ## ### # ## #### # #1####### #",
"# ##3 ##1###7# ##### ## # ###3 4## 9 # #",
"#23 # 3 # ##9 ##6 6## ### 9## ##1 # #3 #",
"# # # # # ## # ## ##7 ## # 9 ###9#11##2## ##",
"### # ####### # 2 # #3 # # # 1## 1 1## ##1 #3 #",
"#5 #2 ## # #### # #5# # ### #8###1 #1# #1# #",
"# # # # # # 4 5 # # # 7 # # # #### 8 #9#",
"# 2 # #42 # ## # 11#2#3 9 # ##9 # #999#",
"##################################################",
};
while (1) {
is[x - 1][y - 1] = true;
is[x - 1][y] = true;
is[x - 1][y + 1] = true;
is[x][y - 1] = true;
is[x][y] = true;
is[x][y + 1] = true;
is[x + 1][y - 1] = true;
is[x + 1][y] = true;
is[x + 1][y + 1] = true;
system("cls");
cout << "生命:" << health << "/" << maxhealth << endl;
for (int i = 0; i < 20; i++) {
for (int j = 0; j < 50; j++) {
if (is[i][j]) cout << a[i][j];
else cout << "0";
}
cout << endl;
}
int ch;
ch = _getch();
if (ch == 'a') {
if (a[x][y - 1] == ' ')
{
a[x][y - 1] = '@';
a[x][y] = ' ';
y -= 1;
}
else if ('0' <= a[x][y - 1] && a[x][y - 1] <= '9')
{
cout << "你遇到了" << (int)(a[x][y - 1] - '0') << "级怪物,迎战吧!";
fight("怪物", 10000 * (a[x][y - 1] - '0'), 2500 * (a[x][y - 1] - '0'), 100 * (a[x][y - 1] - '0'), 20, 500 * (a[x][y - 1] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x][y - 1] = '@';
a[x][y] = ' ';
y -= 1;
a[x][y] = ' ';
}
else if (a[x][y - 1] == 'I')
{
cout << "你是否要退出这个奇怪的世界,如果退出,你现在闯下的江湖都会重置" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x][y - 1] == 'o')
{
cout << "你通关了" << endl;
_getch();
clearance();
}
}
if (ch == 'd') {
if (a[x][y + 1] == ' ')
{
a[x][y + 1] = '@';
a[x][y] = ' ';
y += 1;
}
else if ('0' <= a[x][y + 1] && a[x][y + 1] <= '9')
{
cout << "你遇到了" << (int)(a[x][y + 1] - '0') << "级怪物,迎战吧!";
fight("怪物", 10000 * (a[x][y + 1] - '0'), 2500 * (a[x][y + 1] - '0'), 100 * (a[x][y + 1] - '0'), 20, 500 * (a[x][y + 1] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x][y + 1] = '@';
a[x][y] = ' ';
y += 1;
a[x][y] = ' ';
}
else if (a[x][y + 1] == 'I')
{
cout << "你是否要退出这个奇怪的世界,如果退出,你现在闯下的江湖都会重置" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x][y + 1] == 'o')
{
cout << "你通关了" << endl;
_getch();
clearance();
}
}
if (ch == 'w') {
if (a[x - 1][y] == ' ')
{
a[x - 1][y] = '@';
a[x][y] = ' ';
x -= 1;
}
else if ('0' <= a[x - 1][y] && a[x - 1][y] <= '9')
{
cout << "你遇到了" << (int)(a[x - 1][y] - '0') << "级怪物,迎战吧!";
fight("怪物", 10000 * (a[x - 1][y] - '0'), 2500 * (a[x - 1][y] - '0'), 100 * (a[x - 1][y] - '0'), 20, 500 * (a[x - 1][y] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x - 1][y] = '@';
a[x][y] = ' ';
x -= 1;
a[x][y] = ' ';
}
else if (a[x - 1][y] == 'I')
{
cout << "你是否要退出这个奇怪的世界,如果退出,你现在闯下的江湖都会重置" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x - 1][y] == 'o')
{
cout << "你通关了" << endl;
_getch();
clearance();
}
}
if (ch == 's') {
if (a[x + 1][y] == ' ')
{
a[x + 1][y] = '@';
a[x][y] = ' ';
x += 1;
}
else if ('0' <= a[x + 1][y] && a[x + 1][y] <= '9')
{
cout << "你遇到了" << (int)(a[x + 1][y] - '0') << "级怪物,迎战吧!";
fight("怪物", 10000 * (a[x + 1][y] - '0'), 2500 * (a[x + 1][y] - '0'), 100 * (a[x + 1][y] - '0'), 20, 500 * (a[x + 1][y] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x + 1][y] = '@';
a[x][y] = ' ';
x += 1;
a[x][y] = ' ';
}
else if (a[x + 1][y] == 'I')
{
cout << "你是否要退出这个奇怪的世界,如果退出,你现在闯下的江湖都会重置" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x + 1][y] == 'o')
{
cout << "你通关了" << endl;
_getch();
clearance();
}
}
}
return 0;
}
int DriveOut()
{
switch (rand() % 3)
{
case 1:
cout << "店主:没钱还敢卖!!!打出去!!!" << endl;
break;
case 2:
cout << "店主:什么!没钱!!!" << endl;
break;
case 3:
cout << "你:可不可以降一降价?" << endl;
cout << "店主:不行!哪有那么简单!" << endl;
break;
}
Sleep(1000);
return 0;
}
int poisonshop()
{
system("cls");
cout << "店主:这位客人,您要卖什么?" << endl;
cout << "1,购买 |小生命药水+200| 100元" << endl;
cout << "2,购买 ||大生命药水+500|| 200元" << endl;
cout << "3,购买 |小防御药水 +20| 100元" << endl;
cout << "4,购买 ||大防御药水 +50|| 200元" << endl;
cout << "5,购买 |小攻击药水+100| 100元" << endl;
cout << "6,购买 ||大攻击药水+250|| 200元" << endl;
cout << "7,购买 |小全幅药水| 500元" << endl;
cout << "8,购买 ||中全幅药水|| 1000元" << endl;
cout << "9,购买 |||大全幅药水||| 2000元" << endl;
cout << "10,购买 *|||||极·全幅药水|||||* 10000元" << endl;
cout << "你掏了掏自己的钱包,发现有" << money << "元" << endl;
int which;
cin >> which;
switch (which)
{
case 1:
if (money < 100) DriveOut();
else {
money -= 100;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
health += 200;
maxhealth += 200;
}
break;
case 2:
if (money < 200) DriveOut();
else {
money -= 200;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
health += 500;
maxhealth += 500;
}
break;
case 3:
if (money < 100) DriveOut();
else {
money -= 100;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
defense += 20;
}
break;
case 4:
if (money < 200) DriveOut();
else {
money -= 200;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
defense += 50;
}
break;
case 5:
if (money < 100) DriveOut();
else {
money -= 100;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
attack += 100;
}
break;
case 6:
if (money < 200) DriveOut();
else {
money -= 200;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
attack += 250;
}
break;
case 7:
if (money < 500) DriveOut();
else {
money -= 500;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
health += 50;
defense += 5;
attack += 25;
experience += 1000;
}
break;
case 8:
if (money < 1000) DriveOut();
else {
money -= 1000;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
health += 150;
defense += 15;
attack += 75;
experience += 3000;
}
break;
case 9:
if (money < 2000) DriveOut();
else {
money -= 2000;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
health += 450;
defense += 45;
attack += 225;
experience += 9000;
}
break;
case 10:
if (money < 10000) DriveOut();
else {
money -= 10000;
cout << "店主:一路走好!" << endl;
cout << "你拿起药水就喝了下去。" << endl;
health += 2500;
defense += 250;
attack += 1250;
experience += 50000;
}
break;
default:
break;
}
Sleep(1000);
return 0;
}
int bookshop()
{
system("cls");
cout << "店主:这里是巫师们卖书的地方,您要卖什么?" << endl;
cout << "1,购买 ||||恢复如初技能书|||| 40000元 现货大量供应" << endl;
cout << "2,购买 ||遗忘咒技能书|| 10000元 已经售完" << endl;
cout << "3,购买 |||钻心咒技能书||| 15000元 现货大量供应" << endl;
cout << "4,购买 |||召唤咒技能书||| 20000元 现货大量供应" << endl;
cout << "5,购买 *|||||咒立停技能书|||||* 25000元 现货大量供应" << endl;
cout << "6,购买 ||||夺魂咒技能书|||| 20000元 现货大量供应" << endl;
cout << "7,购买 ||万弹齐发技能书|| 15000元 现货大量供应" << endl;
cout << "你掏了掏自己的钱包,发现有" << money << "元" << endl;
int which;
cin >> which;
switch (which)
{
case 1:
if (money < 40000) DriveOut();
else {
money -= 40000;
cout << "店主:一路走好!" << endl;
bag[12]++;
}
break;
case 2:
cout << "店主:对不起,本书已经售完" << endl;
break;
case 3:
if (money < 20000) DriveOut();
else {
money -= 20000;
cout << "店主:一路走好!" << endl;
bag[16]++;
}
break;
case 4:
if (money < 20000) DriveOut();
else {
money -= 20000;
cout << "店主:一路走好!" << endl;
bag[13]++;
}
break;
case 5:
if (money < 25000) DriveOut();
else {
money -= 25000;
cout << "店主:一路走好!" << endl;
bag[10]++;
}
break;
case 6:
if (money < 20000) DriveOut();
else {
money -= 20000;
cout << "店主:一路走好!" << endl;
bag[17]++;
}
break;
case 7:
if (money < 15000) DriveOut();
else {
money -= 15000;
cout << "店主:一路走好!" << endl;
bag[15]++;
}
break;
default:
break;
}
return 0;
}
int NoticeBoard(int l, int x, int y)
{
if (l == 10 && x == 6 && y == 1) {
system("cls");
cout << "跟着'*'走" << endl;
cout << " ——作者" << endl;
_getch();
}
if (l == 10 && x == 8 && y == 12) {
system("cls");
cout << "走吧,谁叫你不听命令呢..." << endl;
cout << " ——作者" << endl;
_getch();
}
if (l == 12 && x == 3 && y == 1) {
system("cls");
cout << "杀出重围!" << endl;
cout << " ——作者" << endl;
_getch();
}
if (l == 12 && x < 4 && y == 20) {
system("cls");
cout << "恭喜通过一半!往下走继续..." << endl;
cout << " ——作者" << endl;
_getch();
}
if (l == 12 && x > 4 && y == 20) {
system("cls");
cout << "恭喜通过一半!往上走继续..." << endl;
cout << " ——作者" << endl;
_getch();
}
if (l == 12 && x == 10) {
system("cls");
cout << "拿走全部奖励吧!" << endl;
cout << " ——作者" << endl;
_getch();
}
else {
system("cls");
cout << "回去吧,你来错地方了..." << endl;
_getch();
}
return 0;
}
int checkpoint(int l)
{
bool is[101][101];
for (int i = 0; i < 100; i++)
for (int j = 0; j < 100; j++)
is[i][j] = false;
int x = 1, y = 1;
string a[100];
if (l == 1) {
a[0] = "######";
a[1] = "I o";
a[2] = "######";
}
else if (l == 2) {
a[0] = "#######";
a[1] = "I 1#";
a[2] = "#### ##";
a[3] = "##1 ##";
a[4] = "#### ##";
a[5] = "#P o";
a[6] = "#######";
}
else if (l == 3) {
a[0] = "#########";
a[1] = "I # 1#S#";
a[2] = "# ## ##1#";
a[3] = "# 2 #";
a[4] = "#### ## #";
a[5] = "#P1 #o #";
a[6] = "#########";
}
else if (l == 4) {
a[0] = "#######o#######";
a[1] = "I #P3 #";
a[2] = "# ##### #";
a[3] = "# 1P #";
a[4] = "# ##### #";
a[5] = "#S # 2#";
a[6] = "######### #####";
a[7] = "#P121 2 1 11P#";
a[8] = "###############";
}
else if (l == 5) {
a[0] = "###############";
a[1] = "I 3 #P3 #";
a[2] = "# 3 # ##### #";
a[3] = "# 2 # 1 #";
a[4] = "# 2 # # ##### #";
a[5] = "# 1 # #P# 2#";
a[6] = "#####2S## ###o#";
a[7] = "#P1 1 # 1 1P#";
a[8] = "###############";
}
else if (l == 6) {
a[0] = "###############";
a[1] = "# 11 2 6PP#";
a[2] = "#2# #P#########";
a[3] = "#2##### #S# o";
a[4] = "I #2# ###";
a[5] = "# ##### 11 ###";
a[6] = "# #P##### #####";
a[7] = "#1112 4P#";
a[8] = "###############";
x = 4;
}
else if (l == 7) {
a[0] = "###############";
a[1] = "#3 4# P# # B#";
a[2] = "#1# #9## 1# 3#";
a[3] = "#1#6# 9# # ###";
a[4] = "I #7 94 # # o";
a[5] = "# #1 3 ## P# #";
a[6] = "# ########### #";
a[7] = "# 1 P #";
a[8] = "###############";
x = 4;
}
else if (l == 8) {
a[0] = "#################";
a[1] = "#PPPPPPPPPPPPPPP#";
a[2] = "#P#############P#";
a[3] = "#PPPP 9999999 PP#";
if (rand() % 100 < 7) a[4] = "#################";
else a[4] = "######### #######";
a[5] = "#2 2#2 2#9##2 P#";
a[6] = "# # # # # #22# #";
a[7] = "# # # # # # #22##";
a[8] = "I # # # # # # # o";
a[9] = "##22# # # # # # #";
a[10] = "# #22# #3# # # #";
a[11] = "#P 2##2 5 2#2 2#";
a[12] = "#################";
x = 8;
}
else if (l == 9) {
a[0] = "#################";
a[1] = "I 9###9 I";
a[2] = "# # # #";
a[3] = "# ##P9P## #";
a[4] = "# 9# 9o9 #9 #";
a[5] = "# ##P9P## #";
a[6] = "# # # #";
a[7] = "I 9###9 I";
a[8] = "#################";
if (rand() % 2) x = 7;
if (rand() % 2) y = 15;
}
else if (l == 10) {
a[0] = "#############################";
a[1] = "#00*****009***P0000000000000#";
a[2] = "#0*9000*00*000*0**P000000000#";
a[3] = "#0*000**00*0#0*0900*****00**o";
a[4] = "#0*00**00*90#0******000****0#";
a[5] = "#0*00*00**00#0000000***00000#";
a[6] = "#T*00*90*00##################";
a[7] = "I**000***00#================I";
a[8] = "############T################";
x = 7;
y = 1;
}
else if (l == 11) {
a[0] = "#############################";
a[1] = "# 33344555#P #";
a[2] = "#22222P 33344566#P ##";
a[3] = "#11 2 33344567#7 8 8 8 8 9######################";
a[4] = "I 1 2 33344567 999999999999999 PPPPo#";
a[5] = "#11 2 33344567#7 8 8 8 8 9######################";
a[6] = "#22222P 33344566#P ##";
a[7] = "# 33344555#P #";
a[8] = "#############################";
x = 4;
y = 1;
}
else if (l == 12) {
a[0] = "###################################################";
a[1] = "#999999999999999999.T.999999999P999999999999999999#";
a[2] = "#9999999999.99.99.99T.999999999P999999999999999999#";
a[3] = "#T9...99.99999999999T.999999999P9999999999999999..#";
a[4] = "I...9.9.9999.999.99...999999999P9999999999999999.X#";
a[5] = "#T9...99999999.99999T.999999999P9999999999999999..#";
a[6] = "#9999999.99.999.99.9T.999999999P999999999999999999#";
a[7] = "#99999.9999999999999T.999999999P999999999999999999#";
a[8] = "###################################################";
a[9] = "#oPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP #";
a[10] = "#################################################T#";
x = 4;
y = 1;
}
else {
a[0] = "#############################";
a[1] = "#T T#";
a[2] = "# #";
a[3] = "# #";
a[4] = "# #";
a[5] = "# #";
a[6] = "# #";
a[7] = "I T#";
a[8] = "#############################";
x = 7;
y = 1;
for (int i = 0; i < 100; i++)
for (int j = 0; j < 100; j++) is[i][j] = true;
}
a[x][y] = '@';
while (1) {
is[x - 1][y - 1] = true;
is[x - 1][y] = true;
is[x - 1][y + 1] = true;
is[x][y - 1] = true;
is[x][y] = true;
is[x][y + 1] = true;
is[x + 1][y - 1] = true;
is[x + 1][y] = true;
is[x + 1][y + 1] = true;
system("cls");
cout << "生命:" << health << "/" << maxhealth << endl;
cout << "攻击:" << attack << endl;
cout << "防御:" << defense << endl;
for (int i = 0; i < 25; i++) {
for (int j = 0; j < 50; j++) {
if (is[i][j]) cout << a[i][j];
else cout << "0";
}
cout << endl;
}
int ch;
ch = _getch();
if (ch == 'a') {
if ('0' < a[x][y - 1] && a[x][y - 1] <= '9')
{
cout << "你遇到了" << (int)(a[x][y - 1] - '0') << "级怪物,迎战吧!";
fight("怪物", 1000 * (a[x][y - 1] - '0'), 250 * (a[x][y - 1] - '0'), 10 * (a[x][y - 1] - '0'), 12, 50 * (a[x][y - 1] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x][y - 1] = '@';
a[x][y] = ' ';
y--;
a[x][y] = ' ';
}
else if (a[x][y - 1] == 'I')
{
cout << "你是否要退出?" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x][y - 1] == 'o')
{
cout << "你通关了" << endl;
if (nowlevel + 1 == l)
{
nowlevel++;
}
_getch();
return 0;
}
else if (a[x][y - 1] == 'P')
{
int m1 = rand() % 50;
int m2 = rand() % 2;
int m3 = rand() % 2;
int m4 = rand() % 2;
int m5 = rand() % 2;
int m6 = rand() % 2;
cout << "你获得了:" << endl;
cout << m1 << "元" << endl;
cout << m2 << "瓶生命药水" << endl;
cout << m3 << "瓶防御药水" << endl;
cout << m4 << "瓶攻击药水" << endl;
cout << m5 << "瓶经验药水" << endl;
cout << m6 << "瓶全幅药水" << endl;
money += m1;
bag[19] += m2;
bag[20] += m3;
bag[21] += m4;
bag[22] += m5;
bag[23] += m6;
_getch();
a[x][y - 1] = '@';
a[x][y] = ' ';
y--;
}
else if (a[x][y - 1] == 'S')
{
poisonshop();
}
else if (a[x][y - 1] == 'B')
{
bookshop();
}
else if (a[x][y - 1] == 'T')
{
NoticeBoard(l, x, y - 1);
}
else if (a[x][y - 1] == '0' && l == 10)
{
a[x][y] = '0';
x = 7;
y = 12;
a[x][y] = '@';
}
else if (a[x][y - 1] == 'X' && l == 12)
{
a[x][y] = ' ';
x = 9;
y = 49;
a[x][y] = '@';
}
else if (a[x][y - 1] != '#')
{
a[x][y - 1] = '@';
a[x][y] = ' ';
y -= 1;
}
if (l == 9 && x == 4 && y == 12)
{
a[x][y - 2] = '@';
a[x][y] = ' ';
y -= 2;
}
}
if (ch == 'd') {
if ('0' < a[x][y + 1] && a[x][y + 1] <= '9')
{
cout << "你遇到了" << (int)(a[x][y + 1] - '0') << "级怪物,迎战吧!";
fight("怪物", 1000 * (a[x][y + 1] - '0'), 250 * (a[x][y + 1] - '0'), 10 * (a[x][y + 1] - '0'), 12, 50 * (a[x][y + 1] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x][y + 1] = '@';
a[x][y] = ' ';
y++;
a[x][y] = ' ';
}
else if (a[x][y + 1] == 'I')
{
cout << "你是否要退出?" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x][y + 1] == 'o')
{
cout << "你通关了" << endl;
if (nowlevel + 1 == l)
{
nowlevel++;
}
_getch();
return 0;
}
else if (a[x][y + 1] == 'P')
{
int m1 = rand() % 50;
int m2 = rand() % 2;
int m3 = rand() % 2;
int m4 = rand() % 2;
int m5 = rand() % 2;
int m6 = rand() % 2;
cout << "你获得了:" << endl;
cout << m1 << "元" << endl;
cout << m2 << "瓶生命药水" << endl;
cout << m3 << "瓶防御药水" << endl;
cout << m4 << "瓶攻击药水" << endl;
cout << m5 << "瓶经验药水" << endl;
cout << m6 << "瓶全幅药水" << endl;
money += m1;
bag[19] += m2;
bag[20] += m3;
bag[21] += m4;
bag[22] += m5;
bag[23] += m6;
_getch();
a[x][y + 1] = '@';
a[x][y] = ' ';
y++;
}
else if (a[x][y + 1] == 'S')
{
poisonshop();
}
else if (a[x][y + 1] == 'B')
{
bookshop();
}
else if (a[x][y + 1] == 'T')
{
NoticeBoard(l, x, y + 1);
}
else if (a[x][y + 1] == '0' && l == 10)
{
a[x][y] = '0';
x = 7;
y = 12;
a[x][y] = '@';
}
else if (a[x][y + 1] == 'X' && l == 12)
{
a[x][y] = ' ';
x = 9;
y = 49;
a[x][y] = '@';
}
else if (a[x][y + 1] != '#')
{
a[x][y + 1] = '@';
a[x][y] = ' ';
y++;
}
if (l == 9 && x == 4 && y == 4)
{
a[x][y + 2] = '@';
a[x][y] = ' ';
y += 2;
}
}
if (ch == 'w') {
if ('0' < a[x - 1][y] && a[x - 1][y] <= '9')
{
cout << "你遇到了" << (int)(a[x - 1][y] - '0') << "级怪物,迎战吧!";
fight("怪物", 1000 * (a[x - 1][y] - '0'), 250 * (a[x - 1][y] - '0'), 10 * (a[x - 1][y] - '0'), 12, 50 * (a[x - 1][y] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x - 1][y] = '@';
a[x][y] = ' ';
x--;
a[x][y] = ' ';
}
else if (a[x - 1][y] == 'I')
{
cout << "你是否要退出?" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x - 1][y] == 'o')
{
cout << "你通关了" << endl;
if (nowlevel + 1 == l)
{
nowlevel++;
}
_getch();
return 0;
}
else if (a[x - 1][y] == 'P')
{
int m1 = rand() % 50;
int m2 = rand() % 2;
int m3 = rand() % 2;
int m4 = rand() % 2;
int m5 = rand() % 2;
int m6 = rand() % 2;
cout << "你获得了:" << endl;
cout << m1 << "元" << endl;
cout << m2 << "瓶生命药水" << endl;
cout << m3 << "瓶防御药水" << endl;
cout << m4 << "瓶攻击药水" << endl;
cout << m5 << "瓶经验药水" << endl;
cout << m6 << "瓶全幅药水" << endl;
money += m1;
bag[19] += m2;
bag[20] += m3;
bag[21] += m4;
bag[22] += m5;
bag[23] += m6;
_getch();
a[x - 1][y] = '@';
a[x][y] = ' ';
x--;
}
else if (a[x - 1][y] == 'S')
{
poisonshop();
}
else if (a[x - 1][y] == 'B')
{
bookshop();
}
else if (a[x - 1][y] == 'T')
{
NoticeBoard(l, x - 1, y);
}
else if (a[x - 1][y] == '0' && l == 10)
{
a[x][y] = '0';
x = 7;
y = 12;
a[x][y] = '@';
}
else if (a[x - 1][y] == 'X' && l == 12)
{
a[x][y] = ' ';
x = 9;
y = 49;
a[x][y] = '@';
}
else if (a[x - 1][y] != '#')
{
a[x - 1][y] = '@';
a[x][y] = ' ';
x -= 1;
}
}
if (ch == 's') {
if (a[x + 1][y] == ' ')
{
a[x + 1][y] = '@';
a[x][y] = ' ';
x += 1;
}
else if ('0' < a[x + 1][y] && a[x + 1][y] <= '9')
{
cout << "你遇到了" << (int)(a[x + 1][y] - '0') << "级怪物,迎战吧!";
fight("怪物", 1000 * (a[x + 1][y] - '0'), 250 * (a[x + 1][y] - '0'), 10 * (a[x + 1][y] - '0'), 12, 50 * (a[x + 1][y] - '0'));
if (dead)
{
Sleep(1000);
return 0;
}
a[x + 1][y] = '@';
a[x][y] = ' ';
x++;
a[x][y] = ' ';
}
else if (a[x + 1][y] == 'I')
{
cout << "你是否要退出?" << endl;
cout << "1确定 2取消" << endl;
int num;
cin >> num;
if (num == 1)
{
break;
}
}
else if (a[x + 1][y] == 'o')
{
cout << "你通关了" << endl;
if (nowlevel + 1 == l)
{
nowlevel++;
}
_getch();
return 0;
}
else if (a[x + 1][y] == 'P')
{
int m1 = rand() % 50;
int m2 = rand() % 2;
int m3 = rand() % 2;
int m4 = rand() % 2;
int m5 = rand() % 2;
int m6 = rand() % 2;
cout << "你获得了:" << endl;
cout << m1 << "元" << endl;
cout << m2 << "瓶生命药水" << endl;
cout << m3 << "瓶防御药水" << endl;
cout << m4 << "瓶攻击药水" << endl;
cout << m5 << "瓶经验药水" << endl;
cout << m6 << "瓶全幅药水" << endl;
money += m1;
bag[19] += m2;
bag[20] += m3;
bag[21] += m4;
bag[22] += m5;
bag[23] += m6;
_getch();
a[x + 1][y] = '@';
a[x][y] = ' ';
x++;
}
else if (a[x + 1][y] == 'S')
{
poisonshop();
}
else if (a[x + 1][y] == 'B')
{
bookshop();
}
else if (a[x + 1][y] == 'T')
{
NoticeBoard(l, x + 1, y);
}
else if (a[x + 1][y] == '0' && l == 10)
{
a[x][y] = '0';
x = 7;
y = 12;
a[x][y] = '@';
}
else if (a[x + 1][y] == 'X' && l == 12)
{
a[x][y] = ' ';
x = 9;
y = 49;
a[x][y] = '@';
}
else if (a[x + 1][y] != '#')
{
a[x + 1][y] = '@';
a[x][y] = ' ';
x++;
}
}
}
return 0;
}
int MM()
{
if (amm == 0) {
int lie = 0;
cout << "....建议45级打,飘升80级...." << endl;
cout << "攻击即可获得:" << endl;
cout << "抽奖券*100 技能书昏昏倒地或技能书铁甲咒 全幅药水*50";
cout << " 金币*2000 经验石X*50" << endl;
cout << " 1攻击 2变强后再来" << endl;
int a;
cin >> a;
if (a == 1) {
cout << "你来到了魔法部大门" << endl;
Sleep(1000);
cout << "魔法部大门看守:你来这干嘛!" << endl;
Sleep(1000);
cout << "1抢劫! 2办事的。" << endl;
cin >> a;
if (a == 1) cout << "魔法部大门看守:拦下他!" << endl;
else {
if (camp) cout << "魔法部大门看守:不可能,你是伏地魔的人!" << endl;
else {
cout << "魔法部大门看守仔细一看。" << endl;
Sleep(1000);
cout << "魔法部大门看守:他是哈利波特的人,抓了他问哈利波特下落!" << endl;
}
}
Sleep(1000);
fight("大门看守", 2000, 200, 20, 0, 1000);
if (dead) return 0;
fight("大门看守", 2000, 200, 20, 0, 1000);
if (dead) return 0;
cout << "增加100滴血" << endl;
health += 100;
Sleep(1000);
cout << "你踢开了大门" << endl;
Sleep(1000);
cout << "里面的几个雕像活了" << endl;
Sleep(1000);
fight("雕像", 10000, 200, 20, 0, 500);
if (dead) return 0;
fight("雕像", 10000, 200, 20, 0, 500);
if (dead) return 0;
fight("雕像", 10000, 200, 20, 0, 500);
if (dead) return 0;
cout << "增加500滴血" << endl;
health += 500;
cout << "你杀死了雕像后, 正准备往楼上走" << endl;
Sleep(1000);
cout << "突然一群员工跑了过来" << endl;
Sleep(1000);
cout << "员工:这是你干你的吗" << endl;
Sleep(1000);
cout << "1,撒谎 其他,是!" << endl;
cin >> a;
if (a == 1) {
cout << "员工:是谁干的?" << endl;
Sleep(1000);
cout << "你随便指了一个员工" << endl;
Sleep(1000);
cout << "他!" << endl;
Sleep(1000);
cout << "那群员工匆匆跑了过去" << endl;
Sleep(1000);
cout << "你赶快跑上楼梯" << endl;
Sleep(1000);
lie = 1;
}
else {
cout << "员工:干掉他!" << endl;
Sleep(1000);
fight("员工", 3000, 200, 100, 14, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 14, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 14, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 15, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 17, 1000);
if (dead) return 0;
if (rand() % 3 == 0) {
cout << "你获得了技能书铁甲咒" << endl;
bag[7]++;
Sleep(1000);
}
cout << "你赶快跑上楼梯" << endl;
health += 500;
}
Sleep(1000);
cout << "你遇到了副部长" << endl;
Sleep(1000);
fight("副部长", 10000, 1000, 100, 20, 3000);
health += 5000;
if (dead) return 0;
if (lie) {
cout << "上次的员工跑了过来" << endl;
Sleep(1000);
cout << "员工:你,你骗了我们!" << endl;
Sleep(1000);
fight("员工", 3000, 200, 100, 14, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 14, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 14, 1000);
if (dead) return 0;
fight("员工", 3000, 200, 100, 15, 1500);
if (dead) return 0;
fight("员工", 3000, 200, 100, 17, 2000);
if (dead) return 0;
if (rand() % 3 == 0){
cout << "你获得了技能书铁甲咒" << endl;
bag[7]++;
Sleep(1000);
}
health += 500;
}
cout << "你遇到了部长";
fight("部长", 15000, 1500, 150, 20, 4000);
if (dead) return 0;
cout << "你获得:" << endl;
cout << "抽奖券*100 技能书昏昏倒地或技能书铁甲咒 全幅药水*50";
cout << " 金币*2000 经验石X*50" << endl;
bag[0] += 100; bag[8]++; bag[23] += 50; money += 2000; bag[5] += 50; amm = 1;
Sleep(3000);
}
else if (a == 2) return 0;
else {
cout << "请勿乱输";
Sleep(1000);
}
}
else {
cout << "你已占领魔法部 可以进入以下地方" << endl;
cout << "0,退出 1,泡温泉 2,矿洞" << endl;
int b;
cin >> b;
switch (b)
{
case 0:
break;
case 1:
time_t c_start, t_start, c_end, t_end;
c_start = clock();
t_start = time(NULL);
cout << "正在泡温泉 按下任意键停止" << endl;
_getch();
c_end = clock();
t_end = time(NULL);
cout << "你获得" << (int)difftime(c_end, c_start) / 100 << "元" << endl;
cout << "你获得" << (int)difftime(c_end, c_start) / 10 << "经验" << endl;
experience += (int)difftime(c_end, c_start) / 10;
money += (int)difftime(c_end, c_start) / 100;
_getch();
break;
case 2:
cout << "你走进矿洞" << endl;
Sleep(1000);
ict++;
if (ict == 5) cout << "你不小心靠在墙上,触发了机关" << endl;
else if (ict > 5) cout << "你找到原来触发机关的地方,按下那块岩石,密道又出现了" << endl;
cout << "0,退出 1,挖矿";
if (ict > 4) cout << " 2,暗道";
cout << endl;
int c;
cin >> c;
if (c == 1) dig();
else if (c == 2 && ict > 4) {
cout << "你走进暗道" << endl;
_getch();
cout << "你发现了一个完全不同的世界,里面充满了怪物" << endl;
_getch();
cout << "每去一个地方都有可能遇到他们" << endl;
_getch();
cout << "但你有一种直觉,穿过这个森林,就能找到某些东西" << endl;
_getch();
MessageBox(0, TEXT("建议 生命>60000 攻击>20000 防御>2000 速度>1000 时来打"), TEXT("重要提示"), MB_OK);
if (MessageBox(0, TEXT("用 wasd 移动,o出口,I入口,@你"), TEXT("重要提示"), MB_OKCANCEL | MB_ICONINFORMATION) != IDOK){
MessageBox(0, TEXT("下次再来吧!"), TEXT("重要提示"), MB_OK);
return 0;
};
cout << "开始吧!" << endl;
maze();
}
else cout << "请勿乱输" << endl;
Sleep(1000);
break;
}
}
return 0;
}
int finalfight(string Hname)
{
int hisH = 1000000000, hisA = 1000000, hisD = 500000, hisSP = 5000;
int hfaint = 0, hhurt = 0, hbeat = 0;
int mfaint = 0, mhurt = 0;
dead = false;
int ha = hisA;
int his = hisA + hisD + hisH;
while (1)
{
if (hfaint > 0) {
if (rand() % 3 == 0) {
cout << "对方使用技能:咒立停!停止了魔咒" << endl;
hfaint = 1;
}
hfaint -= 1;
}
if (hbeat == 1) {
if (rand() % 10 == 0) {
cout << "对方一躲,躲过了你的石头" << endl;
hbeat = 0;
}
else {
cout << "对方躲闪不急,石头正好撞在他的鼻子上 扣血50滴" << endl;
hisH -= 50;
}
}
if (mfaint > 0) {
if (Sl[6]) mfaint = 0;
else mfaint -= 1;
}
if (mhurt > 0) {
if (Sl[6]) mhurt = 0;
else {
mhurt -= 1;
cout << "你的心像被一把刀刺穿了一样 扣血200滴" << endl;
health -= 200;
}
}
if (mfaint <= 0) {
if (rand() % 3 && Sl[0]) {
cout << "你使用技能快快复苏 生命增加200" << endl;
health += 200;
}
if (rand() % 3 && Sl[1]) {
cout << "你使用技能铁甲护身 生命增加100 防御增加50" << endl;
health += 100;
defense += 50;
}
if (rand() % 3 && Sl[2]) {
cout << "你使用技能昏昏倒地 " << Hname << "一回合之内不能攻击" << endl;
hfaint += 1;
}
if (rand() % 3 && Sl[3]) {
cout << "你使用技能神锋无影 攻击增加200 对方扣血200滴" << endl;
hisH -= 200;
attack += 200;
}
if (rand() % 3 && Sl[5]) {
if (rand() % 10) {
cout << "你使用技能统统石化 " << Hname << "二回合之内不能攻击" << endl;
hfaint += 2;
}
else {
cout << "你使用技能统统石化 " << Hname << "十回合之内不能攻击" << endl;
hfaint += 10;
}
}
if (rand() % 4 == 0 && Sl[7]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
hisH = monsterfight(Hname, hisH, hisA, hisD, 23, hisSP);
if (hisH < 1)
{
cout << "对方死亡" << endl; Sleep(1000);
cout << "全部人都来庆祝你" << endl; Sleep(1000);
cout << "突然," << Hname << "的魔杖一转,指向了你。" << endl; Sleep(1000);
cout << "里面发出一束红色的光柱" << endl; Sleep(1000);
cout << "你连忙拿魔杖一挡" << endl; Sleep(1000);
cout << "那光柱击中你的魔杖,爆炸了" << endl; Sleep(1000);
cout << "你的魔杖断了" << endl; Sleep(1000);
cout << "你被炸出20多米" << endl; Sleep(1000);
cout << "未完待续..." << endl; Sleep(10000);
return 0;
}
if (Sl[0]) {
cout << "在对方和石怪的战斗中,你已经恢复了2000生命" << endl;
if (maxhealth < health + 2000) health = maxhealth;
else health += 2000;
}
}
if (rand() % 4 == 0 && Sl[8]) {
cout << "你使用技能召唤咒!召唤出石怪跟" << Hname << "战斗" << endl;
}
if (rand() % 3 && Sl[9]) {
cout << "你使用技能万弹齐发!变出几十块石头" << endl;
hbeat = 1;
}
if (rand() % 3 && Sl[10]) {
cout << "你使用技能钻心咒!对方将疼痛5回合" << endl;
hhurt += 5;
}
if (rand() % 3 && Sl[11]) {
cout << "魂魄出窍!你使用夺魂咒,企图让" << Hname << "自己攻击自己!" << endl;
Sleep((rand() % 2000) + 1000);
cout << Hname << "被你控制了,开始攻击自己" << endl;
Sleep(700);
int ran = rand() % 40 - 20;
if (hisA + ran > hisD) {
cout << "对方发起进攻 自己扣血" << hisH - hisD + ran << "滴 剩余" << hisH - (hisA - hisD + ran) << "滴" << endl;
hisH -= hisA - hisD + ran;
}
else cout << "对方发起进攻 自己扣血0滴 剩余" << hisH << "滴" << endl;
}
if (rand() % 2 && Sl[12]) {
cout << "你使用技能阿瓦达索命 " << Hname << "扣血" << hisH - hisH / 4 << "滴" << endl;
hisH /= 4;
}
Sleep(1000);
int ran = rand() % 40 - 20;
if (rand() % 10000 > hisSP) {
if (attack + ran > hisD) {
cout << "你发起进攻 " << Hname << "扣血" << attack - hisD + ran << "滴 剩余" << hisH - (attack - hisD + ran) << "滴" << endl;
hisH -= attack - hisD + ran;
}
else cout << "你发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
else
{
if (rand() % 2) cout << "你一脚踹了过去,但没有踢中" << endl;
else {
cout << "你一脚踹了过去,但只擦着了腰" << endl;
if ((attack / 3) + ran > hisD) {
cout << Hname << "扣血" << (attack / 3) + ran - hisD << "滴 剩余" << hisH - ((attack / 3) + ran - hisD) << "滴" << endl;
hisH -= (attack / 3) + ran - hisD;
}
else cout << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
}
}
Sleep(700);
if (hhurt > 0) {
hhurt -= 1;
cout << "对方因中了你的钻心咒,正捂着心大叫呢 扣血200滴" << endl;
hisH -= 200;
}
if (hisH <= 0) {
if (rand() % 3 == 0) {
cout << "对方发动技能:恢复如初 满血复活" << endl;
hisH = ha;
Sleep(1000);
}
else {
cout << "对方死亡"<< endl; Sleep(1000);
cout << "全部人都来庆祝你" << endl; Sleep(1000);
cout << "突然," << Hname << "的魔杖一转,指向了你。" << endl; Sleep(1000);
cout << "里面发出一束红色的光柱" << endl; Sleep(1000);
cout << "你连忙拿魔杖一挡" << endl; Sleep(1000);
cout << "那光柱击中你的魔杖,爆炸了" << endl; Sleep(1000);
cout << "你的魔杖断了" << endl; Sleep(1000);
cout << "你被炸出20多米" << endl; Sleep(1000);
cout << "未完待续..." << endl; Sleep(10000);
return 0;
}
}
if (rand() % 3 == 0) {
cout << "对方发动技能:快快复苏 生命加200" << endl;
hisH += 200;
}
if (rand() % 3 == 0) {
cout << "对方发动技能:盔甲护身 生命加50 防御增加50" << endl;
hisH += 50;
hisD += 50;
}
if (rand() % 3 == 0) {
cout << "对方使用技能神锋无影 攻击增加200 扣血200滴" << endl;
health -= 200;
hisA += 200;
}
if (rand() % 3 == 0) {
cout << "对方使用技能昏昏倒地 " << name << "一回合之内不能攻击" << endl;
mfaint += 1;
}
if (rand() % 3 == 0)
{
if (rand() % 10) {
cout << "对方使用技能统统石化 " << name << "二回合之内不能攻击" << endl;
mfaint += 2;
}
else {
cout << "对方使用技能统统石化 " << name << "十回合之内不能攻击" << endl;
mfaint += 10;
}
}
if (rand() % 3 == 0) {
cout << "对方使用技能阿瓦达索命 " << name << "扣血" << health - health / 4 << "滴" << endl;
health /= 4;
}
Sleep(1000);
if (hfaint <= 0) {
int ran = rand() % 40 - 20;
if (rand() % 10000 > speed) {
if (hisA + ran > defense) {
cout << Hname << "发起进攻 " << "你扣血" << hisA - defense + ran << "滴 剩余" << health - (hisA - defense + ran) << "滴" << endl;
health -= hisA - defense + ran;
}
else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
}
else {
if (rand() % 2) cout << Hname << "一脚踹了过来,但没有踢中" << endl;
else {
if ((hisA / 3) + ran > hisD) {
cout << Hname << "发起进攻 你扣血" << (hisA / 3) + ran - defense << "滴 剩余" << health - ((hisA / 3) + ran - defense) << "滴" << endl;
health -= ((hisA / 3) + ran - defense);
}
else cout << Hname << "发起进攻 " << "你扣血0滴 剩余" << health << "滴" << endl;
}
}
Sleep(1000);
if (health <= 0) {
if (Sl[6] && rand() % 2) {
cout << "你发动技能:恢复如初 满血复活" << endl;
health = maxhealth;
Sleep(1000);
}
else {
cout << "你死亡";
health = 20;
dead = true;
return 0;
}
}
}
}
return 0;
}
int main()
{
int isbreak;
isbreak = false;
if (MessageBox(0, TEXT("除输入名字外,请不要输入任何字符,否则将导致游戏崩溃!"), TEXT("重要提示"), MB_OKCANCEL | MB_ICONINFORMATION) != IDOK)
{
MessageBox(0, TEXT("既然你不同意,那就别玩了"), TEXT("重要提示"), MB_OK);
return 0;
};
srand((unsigned)time(NULL));
cout << " 1.2.9 \n";
cout << " MagicWorld--HarryPotter \n";
cout << " \n";
cout << " / > \n";
cout << " / > / \n";
cout << " < _____ > / \n";
cout << " |-O--O-| / \n";
cout << " / == - . / \n";
cout << " / . [ ] \n";
cout << " / /` ___/ \n";
cout << " \n";
cout << " by evan\n";
cout << "输入‘start’开始游戏 \n";
string start;
cin >> start;
for (int i = 8; i < 100; i++) wandname[i] = "1";
if (start == "start") {
int i;
system("cls");
for (i = 0; i < 20; i++) {
cout << "loading..." << endl << "--------------------------" << endl << " ";
for (int j = 0; j <= i % 5; j++) cout << "+==+";
cout << " " << endl << "--------------------------" << endl;
switch (rand() % 4)
{
case 0:
cout << "打怪是升级和提升战力的好方法。" << endl;
break;
case 1:
cout << "开始游戏时记得选择阵营。" << endl;
break;
case 2:
cout << "退出时要保存。" << endl;
break;
case 3:
cout << "新手开始游戏时会有3瓶经验药水1张抽奖券。" << endl;
break;
}
Sleep(250);
system("cls");
}
while (1)
{
isbreak = false;
cout << "1,登录 2,注册";
int a;
cin >> a;
if (a == 1) login();
else Reg();
while (1) {
if (isbreak)
{
break;
}
system("cls");
cout << "魔法人士:" << name << endl;
cout << "势力:";
if (camp) cout << "伏地魔" << endl;
else cout << "哈利波特" << endl;
cout << "生命:" << health << "/" << maxhealth << endl;
cout << "攻击:" << attack << endl;
cout << "防御:" << defense << endl;
cout << "速度:" << speed << endl;
cout << "等级:" << level << endl;
cout << "经验:" << experience << "/" << level * 100 << endl;
cout << "金币:" << money << endl;
cout << "1,魔法部(攻击即可占领) 2,大街(杀人/阻止食死徒) 3,";
if (camp) cout << "霍格沃茨(哈利波特不在) ";
else cout << "伏地魔总部(伏地魔不在) ";
cout << "4,霍格沃茨(最后战场) 5,奥利凡德魔杖商店 6,抽奖 7,经验石店 8,背包 9,工厂 10,材料店 11,任务 12,终极任务 13,副本 14,保存 ";
if (camp) cout << "15, 医疗兵(伏地魔的)";
else cout << "15, 庞弗雷女士 ";
cout << "16,改变参数(测试专用 需要密码) 17,设置 18,登出" << endl;
cin >> a;
switch (a)
{
case 1:
MM();
break;
case 2:
street();
break;
case 3:
for (int i = 1; i < 100; i++) {
cout << "|";
for (int j = 0; j < 10 && i < 100; j++, i++) {
if (nowlevel + 1 < i) cout << " " << i << " |";
else cout << ":" << i << ":|";
}
cout << endl;
}
int num;
cin >> num;
if (nowlevel + 1 < num) cout << "你未解锁这关" << endl;
else checkpoint(num);
Sleep(1000);
break;
case 4:
if (camp) {
if (f) finalfight("哈利·波特");
else cout << "你需要先寻找哈利波特的下落" << endl;
}
else {
if (f) finalfight("伏地魔");
else cout << "你需要先寻找伏地魔的下落" << endl;
}
Sleep(1000);
break;
case 5:
cout << "1 柳条独角兽尾毛魔杖 100元" << endl;
cout << "2 胡桃木龙神经魔杖 200元" << endl;
cout << "3 鹅耳枥木魔杖 550元" << endl;
cout << "4 柳条魔杖 1200元" << endl;
cout << "5 花心木魔杖 3650元" << endl;
cout << "6 冬青木凤凰羽毛魔杖 5780元" << endl;
cout << "7 紫杉木凤凰羽毛魔杖 7120元" << endl;
cout << "8 老魔杖 50000元" << endl;
cout << "0 退出 0元" << endl;
int b;
cin >> b;
switch (b)
{
case 1:
buywand(6, 100);
system("cls");
break;
case 2:
buywand(7, 200);
system("cls");
break;
case 3:
buywand(8, 550);
system("cls");
break;
case 4:
buywand(9, 1200);
system("cls");
break;
case 5:
buywand(10, 3650);
system("cls");
break;
case 6:
buywand(11, 5780);
system("cls");
break;
case 7:
buywand(12, 7120);
system("cls");
break;
case 8:
buywand(13, 50000);
system("cls");
break;
default:
break;
}
break;
case 6:
LD();
break;
case 7:
cout << "1 经验石R 100元 100经验" << endl;
cout << "2 经验石SR 200元 250经验" << endl;
cout << "3 经验石SSR 400元 500经验" << endl;
cout << "4 经验石SSS 1000元 1200经验" << endl;
cout << "5 经验石X 2000元 2500经验" << endl;
cout << "0 退出 0元 0经验" << endl;
int c;
cin >> c;
switch (c)
{
case 1:
buy(1, 100);
system("cls");
break;
case 2:
buy(2, 200);
system("cls");
break;
case 3:
buy(3, 550);
system("cls");
break;
case 4:
buy(4, 1200);
system("cls");
break;
case 5:
buy(5, 3650);
system("cls");
break;
default:
break;
}
break;
case 8:
cout << "1,查看魔杖 2,查看药水 3,查看经验石 4,学习技能" << endl;
cin >> b;
if (b == 1) w();
else if (b == 2) p();
else if (b == 3) e();
else if (b == 4) s();
else {
cout << "请勿乱输" << endl;
Sleep(1000);
}
break;
case 9:
int material1, material2, mn1, mn2;
cout << "1,制作 2,查看材料";
cin >> material1;
if (material1 == 1) {
cout << "你要用什么杖芯?" << endl;
for (int ij = 0; ij < 9; ij++) cout << ij + 1 << "," << Material1name[ij] << " " << bag[ij + 24] << "个" << endl;
cin >> material1;
cout << "几个?" << endl;
cin >> mn1;
cout << "你要用什么木材?" << endl;
for (int ij = 0; ij < 10; ij++) cout << ij + 1 << "," << Material2name[ij] << " " << bag[ij + 33] << "个" << endl;
cin >> material2;
cout << "几个?" << endl;
cin >> mn2;
make(material1 + 23, material2 + 32, mn1, mn2);
break;
}
else if (material1 == 2) {
cout << "杖芯:" << endl;
for (int ij = 0; ij < 9; ij++) cout << ij + 1 << "," << Material1name[ij] << " " << bag[ij + 24] << "个" << endl;
cout << "木材:" << endl;
for (int ij = 0; ij < 10; ij++) cout << ij + 1 << "," << Material2name[ij] << " " << bag[ij + 33] << "个" << endl;
_getch();
}
else cout << "请勿乱输";
break;
case 10:
break;
case 11:
if (xy == 1) {
if (ane == 0) cout << "再闯 1 关副本";
else if (ane == 1) cout << "买两件商品";
else if (ane == 2) cout << "回血一次";
else if (ane == 3) cout << "杀死10个人";
cout << "(" << D_Of_C << "/" << OK << ")" << endl;
if (D_Of_C >= OK) {
cout << "任务完成!!"; maxhealth += 200; health += 200; defense += 20; xy = 0; bag[43]++;
}
Sleep(1000);
}
else {
ane = rand() % 4;
D_Of_C = 0;
xy = 1;
if (ane == 0) {
cout << "再闯 1 关副本"; OK = 1;
}
else if (ane == 1) {
cout << "买两件商品"; OK = 2;
}
else if (ane == 2) {
cout << "回血一次"; OK = 1;
}
else if (ane == 3) {
cout << "杀死10个人"; OK = 10;
}
Sleep(1000);
}
break;
case 12:
if (xy1 == 1) {
if (ane1 == 0) {
if (camp) cout << "杀死1个邓布利多";
else cout << "杀死1个纳尼吉";
}
else if (ane1 == 1) cout << "消耗5000元";
else if (ane1 == 2) {
if (camp) cout << "杀死5个穆迪";
else cout << "杀死5个卢修斯·马尔福";
}
else if (ane1 == 3) cout << "杀死100个生物";
else if (ane1 == 4) cout << "再升10级";
cout << "(" << D_Of_C1 << "/" << OK1 << ")" << endl;
if (D_Of_C1 >= OK1) {
cout << "任务完成!!" << endl;
xy1 = 0;
cout << "增加500元 攻击力+10 防御力+10 生命+500" << endl;
money += 500; attack += 200; health += 1000; maxhealth += 1000; defense += 150; bag[43] += 5;
}
Sleep(1000);
}
else {
ane1 = rand() % 5;
D_Of_C1 = 0;
xy1 = 1;
if (ane1 == 0) {
if (camp) cout << "杀死1个邓布利多";
else cout << "杀死1个纳尼吉";
OK1 = 1;
}
else if (ane1 == 1) {
cout << "消耗5000元"; OK1 = 5000;
}
else if (ane1 == 2) {
if (camp) cout << "杀死5个穆迪";
else cout << "杀死5个卢修斯·马尔福";
OK1 = 5;
}
else if (ane1 == 3) {
cout << "杀死100个生物"; OK1 = 100;
}
else if (ane1 == 4) {
cout << "再升10级"; OK1 = 10;
}
Sleep(1000);
}
break;
case 13:
cout << "1 金钱副本" << LE1 << "级 2 经验副本" << LE2 << "级" << endl;
int y;
cin >> y;
if (y == 1) {
for (int i = 0; i < LE1 % 5; i++) {
if (rand() % 3 == 0) fight2("木人桩", 1500, 100, 10, 0, 1000);
else if (rand() % 3 == 1) fight2("沙包", 3000, 50, 20, 0, 1000);
else fight2("木板", 1000, 100, 10, 0, 1000);
if (dead) break;
}
for (int i = 0; i < (LE1 / 5) % 25; i++) {
if (dead) break;
if (rand() % 3 == 0) fight2("石人桩(这有吗)", 3000, 200, 20, 0, 2000);
else if (rand() % 3 == 1) fight2("石包(这有吗)", 6000, 100, 60, 0, 2000);
else fight2("石板", 3000, 300, 30, 0, 2000);
}
for (int i = 0; i < (LE1 / 25) % 125; i++) {
if (dead) break;
if (rand() % 3 == 0) fight2("铁人桩(这有吗)", 6000, 400, 40, 0, 4000);
else if (rand() % 3 == 1) fight2("铁包(这有吗)", 12000, 200, 120, 0, 4000);
else fight2("铁板", 6000, 400, 40, 0, 4000);
}
for (int i = 0; i < (LE1 / 125) % 625; i++) {
if (dead) break;
if (rand() % 3 == 0) fight2("金人桩(这有吗)", 12000, 800, 80, 0, 6500);
else if (rand() % 3 == 1) fight2("金包(这有吗)", 24000, 400, 240, 0, 6500);
else fight2("金板", 12000, 800, 80, 0, 6500);
}
if (!dead) {
LE1++;
if (ane == 0) D_Of_C++;
}
}
if (y == 2) {
for (int i = 0; i < LE2 % 5; i++) {
if (rand() % 3 == 0) fight1("木人桩", 1500, 100, 10, 0, 1000);
else if (rand() % 3 == 1) fight1("沙包", 3000, 50, 20, 0, 1000);
else fight1("木板", 1000, 100, 10, 0, 1000);
if (dead) break;
}
for (int i = 0; i < (LE2 / 5) % 25; i++) {
if (dead) break;
if (rand() % 3 == 0) fight1("石人桩(这有吗)", 3000, 200, 20, 0, 1000);
else if (rand() % 3 == 1) fight1("石包(这有吗)", 6000, 100, 60, 0, 1000);
else fight1("石板", 3000, 300, 30, 0, 1000);
}
for (int i = 0; i < (LE2 / 25) % 125; i++) {
if (dead) break;
if (rand() % 3 == 0) fight1("铁人桩(这有吗)", 6000, 400, 40, 0, 4000);
else if (rand() % 3 == 1) fight1("铁包(这有吗)", 12000, 200, 120, 0, 4000);
else fight1("铁板", 6000, 400, 40, 0, 4000);
}
for (int i = 0; i < (LE2 / 125) % 625; i++) {
if (dead) break;
if (rand() % 3 == 0) fight1("金人桩(这有吗)", 12000, 800, 80, 0, 6500);
else if (rand() % 3 == 1) fight1("金包(这有吗)", 24000, 400, 240, 0, 6500);
else fight1("金板", 12000, 800, 80, 0, 6500);
}
if (!dead) {
LE2++;
if (ane == 0) D_Of_C++;
}
}
break;
case 14:
save();
cout << "保存成功!";
Sleep(1000);
break;
case 15:
Hos();
Sleep(1000);
break;
case 16:
int pw;
cout << "密码:";
cin >> pw;
if (pw == 1212) {
cout << "0~42,改变背包 43,金币 44,等级 45,经验 46,生命 47,防御 48,攻击 49,最大生命 50,进入魔法部权力(0没有 0<有) 51,速度" << endl;
int num1, num2;
cout << "几号:";
cin >> num1;
cout << "改变成:";
cin >> num2;
if (num1 <= 42) bag[num1] = num2;
else {
switch (num1)
{
case 43:
money = num2;
break;
case 44:
level = num2;
break;
case 45:
experience = num2;
break;
case 46:
health = num2;
break;
case 47:
defense = num2;
break;
case 48:
attack = num2;
break;
case 49:
maxhealth = num2;
break;
case 50:
amm = num2;
break;
case 51:
speed = num2;
break;
default:
break;
}
}
levelup();
cout << "改变成功";
}
else cout << "密码错误" << endl;
Sleep(1000);
break;
case 17:
cout << "1,关卡攻略 2,关卡功能" << endl;
int xd;
cin >> xd;
if (xd == 1) system("start https://paste.ubuntu.com/p/2YQBCmYvSb/");
if (xd == 2) {
cout << "我们先介绍一下图标" << endl;
cout << "╔═══╗ ╔═══╗ ╔═══╗ ╔═══╗" << endl;
cout << "║ @ ║ ║ I ║ ║ o ║ ║ # ║" << endl;
cout << "╚═══╝ ╚═══╝ ╚═══╝ ╚═══╝" << endl;
cout << "你自己 出口 入口 墙" << endl;
cout << "╔═══╗ ╔═══╗ ╔═══╗ ╔═══╗" << endl;
cout << "║ 1 ║ ║ 2 ║ ║ 3 ║ ║ 4 ║" << endl;
cout << "╚═══╝ ╚═══╝ ╚═══╝ ╚═══╝" << endl;
cout << "1级怪 2级怪 3级怪 4级怪" << endl;
cout << "命1000 命2000 命3000 命4000" << endl;
cout << "攻250 攻500 攻750 攻1000" << endl;
cout << "防10 防20 防30 防40" << endl;
cout << "速50 速100 速150 速200" << endl;
cout << "╔═══╗ ╔═══╗ ╔═══╗ ╔═══╗" << endl;
cout << "║ 5 ║ ║ 6 ║ ║ 7 ║ ║ 8 ║" << endl;
cout << "╚═══╝ ╚═══╝ ╚═══╝ ╚═══╝" << endl;
cout << "5级怪 6级怪 7级怪 8级怪" << endl;
cout << "命5000 命6000 命7000 命8000" << endl;
cout << "攻1250 攻1500 攻1750 攻2000" << endl;
cout << "防50 防60 防70 防80" << endl;
cout << "速250 速300 速350 速400" << endl;
cout << "╔═══╗ ╔═══╗ ╔═══╗ ╔═══╗" << endl;
cout << "║ 9 ║ ║ S ║ ║ B ║ ║ T ║" << endl;
cout << "╚═══╝ ╚═══╝ ╚═══╝ ╚═══╝" << endl;
cout << "9级怪 药水商店 书店 告示牌" << endl;
cout << "命9000" << endl;
cout << "攻2250" << endl;
cout << "防90" << endl;
cout << "速450" << endl;
cout << "╔═══╗" << endl;
cout << "║ X ║" << endl;
cout << "╚═══╝" << endl;
cout << "传送机" << endl;
cout << "输入图标了解详细,0退出" << endl;
string st;
cin >> st;
if (st == "@") system("start https://paste.ubuntu.com/p/cdJPnhXddT/");
else if (st == "I" || st == "i") system("start https://paste.ubuntu.com/p/h5npMzvDBX/");
else if (st == "o" || st == "O") system("start https://paste.ubuntu.com/p/By6Fdyq9wq/");
else if (st == "#") system("start https://paste.ubuntu.com/p/DswXYhVGFn/");
else if (st <= "9" && st >= "1") system("start https://paste.ubuntu.com/p/4vZDjY7fX4/");
else if (st == "S" || st == "s") system("start https://paste.ubuntu.com/p/SvSTDGrcD3/");
else if (st == "B" || st == "b") system("start https://paste.ubuntu.com/p/MMqwYn63N9/");
else if (st == "T" || st == "t") system("start https://paste.ubuntu.com/p/mXgfbyhGGJ/");
else if (st == "X" || st == "x") system("start https://paste.ubuntu.com/p/M6svDYryGt/");
else if (st == "0");
else cout << "请勿乱输" << endl;
Sleep(1000);
}
break;
case 18:
isbreak = true;
}
levelup();
}
}
}
}
草原战争(双人)
//感觉解释不全,很难玩
#include <bits/stdc++.h> //WEWILLFINDYOUANDHANTYOU
#include <windows.h> //GETYOUANDKILLYOUEATYOU!
#include <conio.h>
using namespace std;
int t,g[15][15],h;
int xf=1,yf=1,hf=10,ff=1,gf=1;
int xs=12,ys=12,hs=10,fs=0,gs=1;
int xt,yt,xln,yln,fx[]={-1,1,0,0},fy[]={0,0,-1,1};
int dp[15][15][15][15],cd;
bool bt,bl,bn,bs;
string st="▓",f[4]={"↑","↓","←","→"},s;
string gz=" <( 操作方法 )>\n1.A 用w a s d移动, 按x键攻击.\n2.B 用u h j k移动, 按n键攻击.\n";
void col(int c1,int c2,string c){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c1*16+c2);
cout<<c;
} void HideCursor(){
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
} int makeg(int k){
if(k<=600) return 0;//荒原
if(k<=690) return 1;//草地
if(k<=780) return 2;//沼泽
if(k<=870) return 3;//冰川
if(k<=980) return 4;//废墟
if(k<=986) return 5;//小炮
if(k<=988) return 6;//大炮
if(k<=991) return 7;//穿透枪
if(k<=992) return 8;// 弹炮
if(k<=997) return 9;//火矢
if(k<=999) return 10;//脉冲枪
if(k<=1000) return 11;//手榴弹
} void make(){
int i=14,j;
col(cd,7,"");
while(i--) cout<<st;
cout<<endl;
for(i=1;i<=12;i++){
col(cd,7,st);
for(j=1;j<=12;j++){
if(i==xf&&j==yf) col(10,2,f[ff]);
else if(i==xs&&j==ys) col(12,4,f[fs]);
else if(g[i][j]==4) col(cd,7,st);
else if(g[i][j]==3) col(cd,11,st);
else if(g[i][j]==2) col(cd,13,st);
else if(g[i][j]==1) col(cd,10,st);
else if(g[i][j]==11) col(cd,2,"⊕");
else if(g[i][j]==10) col(cd,7,"◎");
else if(g[i][j]==9) col(cd,13,"Δ");
else if(g[i][j]==8) col(cd,12,"¤");
else if(g[i][j]==7) col(cd,11,"≈");
else if(g[i][j]==6) col(cd,14,"≡");
else if(g[i][j]==5) col(cd,10,"=");
else col(cd,7," ");
} col(cd,7,st);
cout<<endl;
} i=14;
col(cd,7,"");
while(i--) cout<<st;
cout<<endl<<endl;
col(10,0,"");
if(gf==1) cout<<" ";
if(gf==5) cout<<"=";
if(gf==6) cout<<"≡";
if(gf==7) cout<<"≈";
if(gf==8) cout<<"¤";
if(gf==9) cout<<"Δ";
if(gf==10) cout<<"◎";
if(gf==11) cout<<"⊕";
col(cd,10," ph : ");
printf("%-4d",hf);
col(12,0,"");
if(gs==1) cout<<" ";
if(gs==5) cout<<"=";
if(gs==6) cout<<"≡";
if(gs==7) cout<<"≈";
if(gs==8) cout<<"¤";
if(gs==9) cout<<"Δ";
if(gs==10) cout<<"◎";
if(gs==11) cout<<"⊕";
col(cd,12," ph : ");
printf("%-4d",hs);
} bool dfs(int x,int y,int xl,int yl){
if(x==xl&&y==yl) return dp[x][y][xl][yl]=1;
if(dp[x][y][xl][yl]!=-1) return dp[x][y][xl][yl];
int te=g[x][y];
bool btool=0;
g[x][y]=-1;
for(int i=0;i<4;i++){
xln=x+fx[i]; yln=y+fy[i];
if(xln>0&&xln<13&&yln>0&&yln<13&&(g[xln][yln]==0||g[xln][yln]>4)){
if(dfs(xln,yln,xl,yl)) btool=1;
}
} g[x][y]=te;
return dp[x][y][xl][yl]=btool;
} int main(){
system("title skgame");
srand((unsigned)time(0));
HideCursor();
cd=0;
system("cls");
for(int i=1;i<=12;i++)
for(int j=1;j<=12;j++)
for(int k=1;k<=12;k++)
for(int l=1;l<=12;l++)
dp[i][j][k][l]=-1;
for(int i=1;i<=12;i++)
for(int j=1;j<=12;j++)
g[i][j]=makeg(rand()%1000+1);
g[1][1]=g[12][12]=0;
col(cd,7,"");
for(int i=0;i<gz.length();i++){
cout<<gz[i];
Sleep(30);
}
string que="3.武器:\n(1).小炮";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,10,"=");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(2).大炮";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,14,"≡");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(3).穿透枪";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,11,"≈");
Sleep(30);
cout<<endl;
col(cd,7,"");
que="(4).弹炮";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,12,"¤");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(5).火栓";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,13,"Δ");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(6).脉冲枪";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,7,"◎");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(7).手榴弹";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,2,"⊕");
col(cd,7,"");
cout<<endl;
Sleep(30);
cout<<"4.周围:"<<endl;
que="(1).墙";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,7,"▓");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(2).草";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,10,"▓");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(3).沼泽地";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,13,"▓");
col(cd,7,"");
cout<<endl;
Sleep(30);
que="(4).湖";
for(int i=0;i<que.length();i++){
cout<<que[i];
Sleep(30);
}
col(cd,11,"▓");
col(cd,7,"");
Sleep(30);
cout<<endl;
cout<<"按s键开始游戏\n按0键结束游戏"<<endl;
t=getch();
while(t!='s') t=getch();
system("cls");
make();
col(cd,12,"\n Game will start on 3 s\b\b");
for(int i=3;i>=1;i--){
Sleep(1000);
cout<<"\b"<<i;
} cout<<"开始!"<<endl;
system("cls");
make();
t=getch();
while(t!='0'){
bl=1;
if(t=='w'&&xf>1&&(g[xf-1][yf]==0||g[xf-1][yf]==1)&&!((xf-1==xs)&&(yf==ys))){
xf--; ff=0;
} else if(t=='w'&&xf>1&&g[xf-1][yf]==2&&!((xf-1==xs)&&(yf==ys))){
xf--; hf--; ff=0;
if(hf<=0) break;
} else if(t=='w'&&xf>1&&g[xf-1][yf]>4&&!((xf-1==xs)&&(yf==ys))){
xf--; ff=0;
gf=g[xf][yf];
g[xf][yf]=0;
} else if(t=='s'&&xf<12&&(g[xf+1][yf]==0||g[xf+1][yf]==1)&&!((xf+1==xs)&&(yf==ys))){
xf++; ff=1;
} else if(t=='s'&&xf<12&&g[xf+1][yf]==2&&!((xf+1==xs)&&(yf==ys))){
xf++; hf--; ff=1;
if(hf<=0) break;
} else if(t=='s'&&xf<12&&g[xf+1][yf]>4&&!((xf+1==xs)&&(yf==ys))){
xf++; ff=1;
gf=g[xf][yf];
g[xf][yf]=0;
} else if(t=='a'&&yf>1&&(g[xf][yf-1]==0||g[xf][yf-1]==1)&&!((xf==xs)&&(yf-1==ys))){
yf--; ff=2;
} else if(t=='a'&&yf>1&&g[xf][yf-1]==2&&!((xf==xs)&&(yf-1==ys))){
yf--; hf--; ff=2;
if(hf<=0) break;
} else if(t=='a'&&yf>1&&g[xf][yf-1]>4&&!((xf==xs)&&(yf-1==ys))){
yf--; ff=2;
gf=g[xf][yf];
g[xf][yf]=0;
} else if(t=='d'&&yf<12&&(g[xf][yf+1]==0||g[xf][yf+1]==1)&&!((xf==xs)&&(yf+1==ys))){
yf++; ff=3;
} else if(t=='d'&yf<12&&g[xf][yf+1]==2&&!((xf==xs)&&(yf+1==ys))){
yf++; hf--; ff=3;
if(hf<=0) break;
} else if(t=='d'&&yf<12&&g[xf][yf+1]>4&&!((xf==xs)&&(yf+1==ys))){
yf++; ff=3;
gf=g[xf][yf];
g[xf][yf]=0;
} else if(t=='x'){
xt=yt=bt=bn=bs=0; h=1;
if(gf==8){
if(dfs(xf,yf,xs,ys)) bt=1;
} if(gf==10){
if(sqrt(pow(xf-xs,2)+pow(yf-ys,2))<4){
bt=1; h=2;
}
} if(gf==11){
if(ff==0) xt=-1;
if(ff==1) xt=1;
if(ff==2) yt=-1;
if(ff==3) yt=1;
int xn,yn;
for(xn=xf+xt,yn=yf+yt;xn<=12&&xn>=1&&yn<=12&&yn>=1;xn+=xt,yn+=yt){
if(g[xn][yn]==0||g[xn][yn]>4) break;
} if(xn<=12&&xn>=1&&yn<=12&&yn>=1){
if(sqrt(pow(xn-xs,2)+pow(yn-ys,2))<3){
bt=1;
h=2;
}
}
} else{
if(gf==9) bs=1;
if(gf==7) bn=1;
if(gf==6) h=3;
if(gf==5) h=2;
if(ff==0) xt=-1;
if(ff==1) xt=1;
if(ff==2) yt=-1;
if(ff==3) yt=1;
for(int xn=xf,yn=yf;xn<=12&&xn>=1&&yn<=12&&yn>=1;xn+=xt,yn+=yt){
if(xn==xs&&yn==ys){
bt=1;
break;
} if((g[xn][yn]==1||g[xn][yn]==4)&&bn==0) break;
}
} if(bt==1){
hs-=h;
if(hf<10) hf+=bs;
} if(hs<=0) break;
} else if(t=='u'&&xs>1&&(g[xs-1][ys]==0||g[xs-1][ys]==1)&&!((xs-1==xf)&&(ys==yf))){
xs--; fs=0;
} else if(t=='u'&&xs>1&&g[xs-1][ys]==2&&!((xs-1==xf)&&(ys==yf))){
xs--; hs--; fs=0;
if(hs<=0) break;
} else if(t=='u'&&xs>1&&g[xs-1][ys]>4&&!((xs-1==xf)&&(ys==yf))){
xs--; fs=0;
gs=g[xs][ys];
g[xs][ys]=0;
} else if(t=='j'&&xs<12&&(g[xs+1][ys]==0||g[xs+1][ys]==1)&&!((xs+1==xf)&&(ys==yf))){
xs++; fs=1;
} else if(t=='j'&&xs<12&&g[xs+1][ys]==2&&!((xs+1==xf)&&(ys==yf))){
xs++; hs--; fs=1;
if(hs<=0) break;
} else if(t=='j'&&xs<12&&g[xs+1][ys]>4&&!((xs+1==xf)&&(ys==yf))){
xs++; fs=1;
gs=g[xs][ys];
g[xs][ys]=0;
} else if(t=='h'&&ys>1&&(g[xs][ys-1]==0||g[xs][ys-1]==1)&&!((xs==xf)&&(ys-1==yf))){
ys--; fs=2;
} else if(t=='h'&&ys>1&&g[xs][ys-1]==2&&!((xs==xf)&&(ys-1==yf))){
ys--; hs--; fs=2;
if(hs<=0) break;
} else if(t=='h'&&ys>1&&g[xs][ys-1]>4&&!((xs==xf)&&(ys-1==yf))){
ys--; fs=2;
gs=g[xs][ys];
g[xs][ys]=0;
} else if(t=='k'&&ys<12&&(g[xs][ys+1]==0||g[xs][ys+1]==1)&&!((xs==xf)&&(ys+1==yf))){
ys++; fs=3;
} else if(t=='k'&ys<12&&g[xs][ys+1]==2&&!((xs==xf)&&(ys+1==yf))){
ys++; hs--; fs=3;
if(hs<=0) break;
} else if(t=='k'&&ys<12&&g[xs][ys+1]>4&&!((xs==xf)&&(ys+1==yf))){
ys++; fs=3;
gs=g[xs][ys];
g[xs][ys]=0;
} else if(t=='n'){
xt=yt=bt=bn=bs=0; h=1;
if(gs==8){
if(dfs(xf,yf,xs,ys)) bt=1;
} if(gs==10){
if(sqrt(pow(xf-xs,2)+pow(yf-ys,2))<4){
bt=1; h=2;
}
} if(gs==11){
if(fs==0) xt=-1;
if(fs==1) xt=1;
if(fs==2) yt=-1;
if(fs==3) yt=1;
int xn,yn;
for(xn=xs+xt,yn=ys+yt;xn<=12&&xn>=1&&yn<=12&&yn>=1;xn+=xt,yn+=yt){
if(g[xn][yn]==0||g[xn][yn]>4) break;
} if(xn<=12&&xn>=1&&yn<=12&&yn>=1){
if(sqrt(pow(xn-xf,2)+pow(yn-yf,2))<3){
bt=1;
h=2;
}
}
} else{
if(gs==9) bs=1;
if(gs==7) bn=1;
if(gs==6) h=3;
if(gs==5) h=2;
if(fs==0) xt=-1;
if(fs==1) xt=1;
if(fs==2) yt=-1;
if(fs==3) yt=1;
for(int xn=xs,yn=ys;xn<=12&&xn>=1&&yn<=12&&yn>=1;xn+=xt,yn+=yt){
if(xn==xf&&yn==yf){
bt=1;
break;
} if((g[xn][yn]==1||g[xn][yn]==4)&&bn==0) break;
}
} if(bt==1){
hf-=h;
if(hs<10) hs+=bs;
} if(hf<=0) break;
} else bl=0;
if(bl==1){
system("cls");
make();
} t=getch();
} system("cls");
if(hf<=0){
col(cd,7,"\n ");
col(12,0," ");
col(cd,12," wins!");
} else if(hs<=0){
col(cd,7,"\n ");
col(10,0," ");
col(cd,10," wins!");
} else col(cd,7,"\n end!\n\n");
Sleep(1000);
col(cd,7,"");
return 0;
}
草原战争(单人)
//因为打不出作者名字两侧的字符,所以找不到作者的链接
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
//制作者:Wendigo,版权所有,盗版必究
struct point{
int x,y,g;
//x轴y轴东西
void make(int xl,int yl,int gl){
x=xl; y=yl; g=gl;
}
}ts;
int cd;
string lv;
//lv和cd控制输出颜色与电脑匹配
int siz=4,xue=10;
point w;
int g[1100][1100],s;
int L[1100][1100];
bool doit[1100][1100];
string pf;
int sinc[15]={0,3,2,1,0,
0,1,2,100,200,300,200,0,500,1000};
int Ls[15]={1,3,2,1,INT_MAX,
INT_MAX,1,2,1,2,3,1,1,1,1};
int last=1;
//控制地图、大小siz与自己位置和金币s
//pf是皮肤字符串,两个英文字母或一个中文字
//L数组值表示方块剩余血量
vector<point> vs;
//野兽
string notice[]={
"按w a s d 键移动 ",
"按f 键来选择攻击方向",
"按h 键选获取物品方向",
"小心野兽! ",
"科学家: 草原资源守恒",
"按e 键打造方块 "
};
//提示
int t,sec;
int fx[5][2]={{0,0},
{-1,0},{0,-1},{1,0},{0,1}};
//动作输入匹配
void col(int c1,int c2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c1*16+c2);
} //颜色,c1为背景,c2为前景
void HideCursor(){
CONSOLE_CURSOR_INFO cursor_info={1,0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
} //隐藏光标
void Help(){
printf("输入你的电脑等级(高级or低级)\n");
cin>>lv;
if(lv=="高级") cd=15;
else if(lv=="低级") cd=0;
while(lv!="高级"&&lv!="低级"){
cin>>lv;
if(lv=="高级") cd=15;
else if(lv=="低级") cd=0;
} system("cls");
} void Start(){
printf("请设计你的皮肤\n");
printf("(两个英文字母或一个中文字)\n");
cin>>pf;
while(pf.size()!=2){
printf("长度不符");
col(cd,12);
printf("X\n");
col(cd,7);
cin>>pf;
} printf("符合!");
col(cd,10);
printf("J\n");
col(cd,7);
Sleep(500);
system("cls");
printf("加载中......\n");
w.x=w.y=501;
} int RAND(int xl,int yl){
int ran=(int)rand()%10000+1;
if(ran<=7000){
g[xl][yl]=0;
L[xl][yl]=Ls[0];
} //空地
else if(ran<=7400){
g[xl][yl]=1;
L[xl][yl]=Ls[1];
} else if(ran<=7700){
g[xl][yl]=2;
L[xl][yl]=Ls[2];
} else if(ran<=8000){
g[xl][yl]=3;
L[xl][yl]=Ls[3];
} //石头
else if(ran<=8500){
g[xl][yl]=4;
L[xl][yl]=Ls[4];
} else if(ran<=9000){
g[xl][yl]=5;
L[xl][yl]=Ls[5];
} //水
else if(ran<=9490){
g[xl][yl]=6;
L[xl][yl]=Ls[6];
} //灌木
else if(ran<=9980){
g[xl][yl]=7;
L[xl][yl]=Ls[7];
} //丛林
else if(ran<=9985){
g[xl][yl]=8;
L[xl][yl]=Ls[8];
} //野猪
else if(ran<=9988){
g[xl][yl]=9;
L[xl][yl]=Ls[9];
} //狼
else if(ran<=9990){
g[xl][yl]=10;
L[xl][yl]=Ls[10];
} //老虎
else if(ran<=9995){
g[xl][yl]=11;
L[xl][yl]=Ls[11];
} //茶
else if(ran<=9997){
g[xl][yl]=12;
L[xl][yl]=Ls[12];
}//扩野镜
else if(ran<=9999){
g[xl][yl]=13;
L[xl][yl]=Ls[13];
} //绿宝石
else if(ran<=10000){
g[xl][yl]=14;
L[xl][yl]=Ls[14];
} //红宝石
} //随机生成地图
int keymap(int key){
if(key=='W'||key=='w')
return 1;
if(key=='A'||key=='a')
return 2;
if(key=='S'||key=='s')
return 3;
if(key=='D'||key=='d')
return 4;
if(key=='F'||key=='f')
return 5;
if(key=='H'||key=='h')
return 6;
if(key=='E'||key=='e')
return 7;
return 0;
} //按键匹配
void dfs(int &xn,int &yn,int xl,int yl,int dist){
if(dist==0){
if(abs(xl-w.x)+abs(
yl-w.y)<abs(xn-w.x)
+abs(yn-w.y)){
xn=xl; yn=yl;
} return;
} for(int i=1;i<=4;i++){
int xne=xl+fx[i][0];
int yne=yl+fx[i][1];
if(xne<1&&xne>1001
&&yne<1&&yne>1001)
continue;
if(!g[xne][yne])
dfs(xn,yn,xne,yne,dist-1);
}
} //野兽追人
void ken(){
system("cls");
col(cd,10);
printf(" <(草原战争)>\n\n");
for(int i=w.x-siz;i<=w.x+siz;i++){
for(int j=w.y-siz;j<=w.y+siz;j++){
if(i==w.x&&j==w.y){
col(13,cd);
cout<<pf;
continue;
} if(i<0||i>1002||j<0||j>1002){
printf(" ");
continue;
} if(i==0||j==0||i==1002||j==1002){
col(cd,7);
printf("▓");
continue;
} if(g[i][j]==0){
col(cd,7);
printf(" ");
} else if(g[i][j]==1){
col(cd,8);
printf("▓");
} else if(g[i][j]==2){
col(cd,7);
printf("▓");
} else if(g[i][j]==3){
col(cd,4);
printf("▓");
} else if(g[i][j]==4){
col(11,cd);
printf(" ");
} else if(g[i][j]==5){
col(9,cd);
printf(" ");
} else if(g[i][j]==6){
col(cd,10);
printf("▓");
} else if(g[i][j]==7){
col(cd,2);
printf("▓");
} else if(g[i][j]==8){
col(cd,6);
printf("C:");
// ts.make(i,j,1);
// vs.push_back(ts);
// if(doit[i][j]){
// doit[i][j]=0;
// col(cd,7);
// printf(" ");
// } if(abs(w.x-i)+abs(w.y-j)<=1)
// xue--;
// int xt=i,yt=j;
// dfs(xt,yt,i,j,1);
// g[xt][yt]=g[i][j];
// g[i][j]=0;
// L[i][j]=0;
// doit[xt][yt]=1;
} else if(g[i][j]==9){
col(cd,6);
printf("<A");
} else if(g[i][j]==10){
col(6,cd);
printf("王");
} else if(g[i][j]==11){
col(cd,14);
printf("%&");
} else if(g[i][j]==12){
col(cd,7);
printf("◎");
} else if(g[i][j]==13){
col(cd,2);
printf("<>");
} else if(g[i][j]==14){
col(cd,12);
printf("<>");
}
} printf("\n");
} printf("\n");
int xr=(int)rand()%5;
for(int i=1;i<=10;i++){
if(xue>=i) col(10,cd);
else col(12,cd);
cout<<notice[xr].substr(i*2-2,2);
} col(14,cd);
printf("%d",s);
col(cd,7);
printf("\n");
}//画出视野
int main(){
srand((unsigned)time(NULL));
col(15,7);
HideCursor();
Help();
Start();
for(int i=1;i<=1001;i++)
for(int j=1;j<=1001;j++)
RAND(i,j);
ken();
col(cd,7);
bool lf;
// 记录步骤是否浪费
while(t=getch()){
lf=0;
int km=keymap(t);
if(!km) continue;
if(km<=4){
point nw;
nw.make(w.x+fx[km][0],
w.y+fx[km][1],0);
if(g[nw.x][nw.y]!=0
&&g[nw.x][nw.y]!=6){
continue;
} w=nw;
} else if(km==5){
sec=getch();
int secm=keymap(sec);
if(!secm||secm>4) continue;
point gj=w;
for(;g[gj.x][gj.y]==0||
g[gj.x][gj.y]==4||
g[gj.x][gj.y]==5;gj.x
+=fx[secm][0],gj.y+=fx[secm][1]){
if(gj.x<1||gj.x>1001
||gj.y<1||gj.y>1001){
lf=1; break;
}
} if(lf) continue;
L[gj.x][gj.y]--;
if(L[gj.x][gj.y]<=0){
int temp=g[gj.x][gj.y];
L[gj.x][gj.y]=0;
s+=sinc[temp];
if(temp!=8&&temp!=9&&
temp!=10&&temp!=12)
last=g[gj.x][gj.y];
g[gj.x][gj.y]=0;
}
} else if(km==6){
sec=getch();
int secm=keymap(sec);
if(!secm||secm>4) continue;
point hq;
hq.make(w.x+fx[secm][0],
w.y+fx[secm][1],0);
int tmp=g[hq.x][hq.y];
if(tmp>10){
L[hq.x][hq.y]=
g[hq.x][hq.y]=0;
if(tmp==11){
xue=10;
} else if(tmp==12){
siz++;
} else if(tmp==13){
s+=500;
} else if(tmp==14){
s+=1000;
}
} else continue;
} else if(km==7){
sec=getch();
int secm=keymap(sec);
if(!secm||secm>4) continue;
if(s<sinc[last]) continue;
point dz;
dz.make(w.x+fx[secm][0],
w.y+fx[secm][1],0);
int tmp=g[dz.x][dz.y];
if(tmp==0){
s-=sinc[last];
L[dz.x][dz.y]=Ls[last];
g[dz.x][dz.y]=last;
} else continue;
} ken();
if(xue<=0) break;
}
return 0;
}
大富翁竞技场
#include<iostream>
#include<string>
#include<cstring>
#include<stdio.h>
#include<stdlib.h>
#include<windows.h> //Xcode涓嶈兘鐢ㄣ€?
#include<time.h>
#include<unistd.h> //sleep()//1s//usleep()//1/1000000s
#include<cstdlib>//system("cls")
#include<conio.h>//getch()
#define random(x) (rand()%x)
using namespace std;
int a[5000],a2[5000],a3[5000],game=0,start=0,move1=0,move2=1,move3=0,e=0,now[5],money[5]={10,10,10,10,10},i=0,j=0,fight=0,b=0,p=0,prop[5][11],st[30],pstar[5],fg[15][15],fn=0,fm=0,f2n=0,f2m=0,win;
double tim;
struct player{
int m;
int hp;
int arrow;
string bow;
string knife;
};
player pp[3];
void outside(string o){
for(int k=0;k<o.length();k++){
cout<<o[k];
usleep(38000);
}
cout<<endl<<endl;
}
void colour(int d){
if(d==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_GREEN|
FOREGROUND_BLUE);
}else if(d==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_RED);
}else if(d==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_GREEN);
}else if(d==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED|
FOREGROUND_BLUE);
}else if(d==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}else if(d==6){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_BLUE);
}else if(d==7){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_RED|BACKGROUND_BLUE|FOREGROUND_INTENSITY |
FOREGROUND_RED|FOREGROUND_GREEN);
}else if(d==8){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |BACKGROUND_INTENSITY|FOREGROUND_GREEN|BACKGROUND_RED|
BACKGROUND_BLUE|FOREGROUND_BLUE);
}else if(d==9){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_INTENSITY);
}else
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY |
FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
cout<<d<<" ";
}
void say(int a){
cout<<endl<<endl<<endl;
outside("1会给你三块钱。");
outside("2会扣掉你三块钱。");
outside("3会给你一个随机事件。");
outside("4会给你一个邪恶的转盘。");
outside("5会给你一个好的转盘。");
outside("6会让你和一个人决斗。如果你赢了,你可以拿走那个玩家一半的钱。");
outside("7是星星商家的家,你可以用30元换一个星星。在你买了星星后,星星商人会去地图上的任何地方。一张地图上有30个星星商人。");
outside("8是道具店。(开发中)");
outside("9号是道具供应点。你可以通过经过或停留来获得道具。");
outside("10,11,12,13 分别是玩家 1,2,3,4。");
outside("收集10颗星的玩家就获胜。");
outside("游戏中有10种道具。");
outside("道具1:两倍樱桃。功能:步数乘以2(5块钱)");
outside("道具二:三倍樱桃。功能:步数乘3(10块钱)");
outside("道具三:钱包。功能:给你10元(5元)");
outside("道具四:加速蘑菇。功能:加5步(10元)");
outside("道具5:黄金加速蘑菇。功能:加10步(15元)");
outside("道具六:管道。功能:把你送到地图上的任意位置(15元)");
outside("道具七:金色的管子。功能:传送你到地图上随机星星商人的位置(25元)");
outside("道具八:夹娃娃机。功能:可作为任何道具使用(30元)");
outside("道具9:嘘(boo)。功能:从指定玩家那里偷10块钱,再加35元可以从指定玩家那里偷一颗星星(15块钱)");
outside("道具十:战斗手套。功能:让你和一个指定的玩家战斗,如果你赢了,你可以偷那个玩家的一半钱(15钱)");
outside("按1掷骰子");
outside("按2使用道具");
system("pause");
return;
}
void say2(){
outside("Alpha 1.7.2:增加了更新日志。修复了一些bug。");
outside("Alpha 1.8.0:改进了随机事件。修复了一些bug。");
outside("Alpha 1.9.0:添加了好转盘。修复了一些bug。");
outside("Alpha 1.9.2:修复了一些bug。");
outside("Alpha 1.9.3:增加了夹娃娃机。修复了一些bug。");
outside("Alpha 1.9.4:增加了嘘(boo)。修复了一些bug。");
outside("Alpha 1.9.5:修复了一些bug。");
outside("Alpha 1.10.0:增加了战斗1和战斗手套。修复了一些bug。");
outside("Alpha 1.10.1:修复了一些bug。");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
outside("Bata 1.0.0:添加了星星商人。你可以成为这场比赛的赢家!!!");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
system("pause");
return;
}
void merchant(int c){
int cc=0,cd=0;
pstar[j]++;
outside("Loading...");
for(int i=0;i<30;i++){
if(st[i]==now[j]){
cc=i;
break;
}
}
a3[now[j]]=a2[now[j]];
a[now[j]]=a2[now[j]];
a3[cd=(random(5000))]=7;
a[cd=(random(5000))]=7;
return;
}
void begg(int ran,int use){
int give=0;
if(ran>use*25){
outside("Thank you");
outside("I have a prop");
outside("But I can't use it");
outside("So I want to give you!");
sleep(1);
give=(random(10));
switch(give){
case 0:outside("The begger will give you a double cherry");prop[j][0]++;prop[j][10]++;
break;
case 1:outside("The begger will give you a triple cherry");prop[j][1]++;prop[j][10]++;
break;
case 2:outside("The begger will give you a wallet");prop[j][2]++;prop[j][10]++;
break;
case 3:outside("The begger will give you a sprint mushroom");prop[j][3]++;prop[j][10]++;
break;
case 4:outside("The begger will give you a golden mushroom");prop[j][4]++;prop[j][10]++;
break;
case 5:outside("The begger will give you a pipe");prop[j][5]++;prop[j][10]++;
break;
case 6:outside("The begger will give you a golden pipe");prop[j][6]++;prop[j][10]++;
break;
case 7:outside("The begger will give you a doll clamping machine");prop[j][7]++;prop[j][10]++;
break;
case 8:outside("The begger will give you a boo");prop[j][8]++;prop[j][10]++;
break;
case 9:outside("The begger will give you the combat gloves");prop[j][9]++;prop[j][10]++;
break;
}
}else
outside("Sorry.I don't have any props. :(");
return;
}
void event(int player){
int e=0,use=0,ran=0,qqq,qqqq,qqqqq,qn;
e=(random(6));
switch(e){
case 0:outside("Nothing happened");break;
case 1:cout<<"Player "<<j<<" meets a beggar"<<endl;
outside("Press 1 to gives the begger twenty money");
outside("Press 2 to gives the begger ten money");
outside("Press 3 to gives the begger five money");
outside("Press 4 not to give money to beggars");
cin>>use;
ran=(random(100));
switch(use){
case 1:if(money[j]<20){
outside("You don't have enouth money");
break;
}money[j-1]-=20;
begg(ran,use);
break;
case 2:if(money[j]<10){
outside("You don't have enouth money");
break;
}money[j-1]-=10;begg(ran,use);
break;
case 3:if(money[j]<5){
outside("You don't have enouth money");
break;
}money[j]-=5;begg(ran,use);
break;
case 4:outside("QAQ");break;
}
break;
case 2:cout<<"Player "<<j<<" meets a student"<<endl;
outside("Your money -10 because you give a student 10 money");money[j]-=10;break;
case 3:cout<<"Player "<<j<<" going to the park now"<<endl;
outside("Please waiting 20 seconds. :)");
sleep(20);break;
case 4:cout<<"Player "<<j<<" going to the school now"<<endl;
sleep(1);
qqq=(random(1000000000));
qqqq=(random(1000000000));
cout<<"teacher:"<<qqq<<"+"<<qqqq<<"=? :)"<<endl;
cin>>qqqqq;
if(qqqqq==qqq+qqqq){
outside("GREAT!give you 15 money. :D");
money[j]+=15;break;
}else
outside("NO! (your money-13)");
money[j]-=13;break;
case 5:cout<<"Player "<<j<<" going to the S* tree."<<endl;
sleep(1);
outside("tree:can you give me 11 money?(1 or 0)");
cin>>qn;
if(qn==1){
outside("tree: thank you.");money[j]-=11;break;
}else
outside("tree: ww... (waiting 40 seconds)");
sleep(40);break;
}
}
void evil(int pl,int &yuan){
int ran=0,w=0;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED | FOREGROUND_BLUE);
outside("clear your 10 money(2/9)");
outside("clear your 20 money(2/9)");
outside("clear your a half of money(2/9)");
outside("clear your a prop(2/9)");
outside("clear your all money(1/18)");
outside("clear your a star(1/18)");
system("pause");
ran=(random(18));
if(ran<4){
yuan-=10;
cout<<"player "<<pl<<"'s tan money has been cleared. :|"<<endl<<endl;
sleep(1);
return;
}else if(ran<8){
yuan-=20;
cout<<"player "<<pl<<"'s twenty money has been cleared. :("<<endl<<endl;
sleep(1);
return;
}else if(ran<12){
yuan/=2;
cout<<"player "<<pl<<"'s half of the money has been cleared. :|"<<endl<<endl;
sleep(1);
return;
}else if(ran<16){
cout<<"player "<<pl<<" will clear a prop. :|"<<endl<<endl;
sleep(1);
w=(random(10));
prop[pl][w]--;
cout<<"The prop "<<w<<" has been removed."<<endl<<endl;
sleep(1);
if(prop[pl][w]<0){
prop[pl][w]++;
outside("But he or she doesn't have the prop. :)");
sleep(1);
}else
prop[pl][10]--;
return;
}else if(ran=16){
yuan=0;
cout<<"player "<<pl<<"'s money has been cleared. X("<<endl<<endl;
sleep(1);
return;
}else
pstar[pl]--;
cout<<"player "<<pl<<"'s star -1. XX("<<endl<<endl;
if(pstar[pl]<0){
pstar[pl]++;
outside("But he or she doesn't have a star. XD");
}
sleep(1);
return;
}
void ppp(){
int ran;
ran=(random(100));
prop[j][10]++;
cout<<"player "<<j<<" get a ";
if(ran<20){
cout<<"double cherry!"<<endl<<endl;//20%
prop[j][1]++;
}else if(ran<40){
cout<<"sprint mushroom!"<<endl<<endl;//20%
prop[j][4]++;
}else if(ran<60){
cout<<"pipe!"<<endl<<endl;//20%
prop[j][6]++;
}else if(ran<70){
cout<<"wallet!"<<endl<<endl;//10%
prop[j][3]++;
}else if(ran<78){
cout<<"triple cherry!!"<<endl<<endl;//8%
prop[j][2]++;
}else if(ran<86){
cout<<"combat gloves!!"<<endl<<endl;//8%
prop[j][9]++;
}else if(ran<91){
cout<<"boo!!"<<endl<<endl;//5%
prop[j][8]++;
}else if(ran<95){
cout<<"golden mushroom!!"<<endl<<endl;//4%
prop[j][5]++;
}else if(ran<98){
cout<<"golden pipe!!!"<<endl<<endl;//3%
prop[j][7]++;
}else
cout<<"doll clamping machine!!!"<<endl<<endl;//2%
prop[j][8]++;
sleep(2);
return;
}
void good(int pl){
int ran=0,w=0;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED | FOREGROUND_BLUE|FOREGROUND_GREEN);
outside("give you 10 money(2/9)");
outside("give you 20 money(2/9)");
outside("give you 10~25 money(2/9)");
outside("give you a prop(2/9)");
outside("give you a star(1/9)");
system("pause");
ran=(random(9));
if(ran<2){
cout<<"player "<<pl<<"'s money+10."<<endl;money[j]+=10;sleep(1);return;
}else if(ran<4){
cout<<"player "<<pl<<"'s money+20."<<endl;money[j]+=20;sleep(1);return;
}else if(ran<6){
w=(random(15))+11;
cout<<"player "<<pl<<"'s money+"<<w<<endl;money[j]+=w;sleep(1);return;
}else if(ran<8){
cout<<"player "<<pl<<"'s prop+1."<<endl;ppp();sleep(1);return;
}else
cout<<"player "<<pl<<"'s star+1!!!"<<endl;pstar[j]++;return;
}
void fight1_1b(){
pp[1].arrow--;
if(fn==f2n||fm==f2m){
pp[2].hp--;
}
return;
}
void fight1_2b(){
pp[2].arrow--;
if(fn==f2n||fm==f2m){
pp[1].hp--;
}
return;
}
void fight1_1c(){
if(fg[fn-1][fm]=='2'||fg[fn+1][fm]=='2'||fg[fn][fm-1]=='2'||fg[fn][fm+1]=='2'||fg[fn-1][fm-1]=='2'||fg[fn-1][fm+1]=='2'||fg[fn+1][fm-1]=='2'||fg[fn+1][fm+1]=='2'){
pp[2].hp-=7;
}
}
void fight1_2c(){
if(fg[f2n-1][f2m]=='1'||fg[f2n+1][f2m]=='1'||fg[f2n][f2m-1]=='1'||fg[f2n][f2m+1]=='1'||fg[f2n-1][f2m-1]=='1'||fg[f2n-1][f2m+1]=='1'||fg[f2n+1][f2m-1]=='1'||fg[f2n+1][f2m+1]=='1'){
pp[1].hp-=7;
}
}
void fight1_2(int mo2,int &p1m,int &p2m){
if(mo2=='w'){
if(fn>0&&fg[fn-1][fm]!='2'){
fn--;
fg[fn+1][fm]=' ';
fg[fn][fm]='1';
}
p1m+=(random(5))+1;
return;
}
if(mo2=='s'){
if(fn<12&&fg[fn+1][fm]!='2'){
fn++;
fg[fn-1][fm]=' ';
fg[fn][fm]='1';
}
p1m+=(random(5))+1;
return;
}
if(mo2=='a'){
if(fm>0&&fg[fn][fm-1]!='2'){
fm--;
fg[fn][fm+1]=' ';
fg[fn][fm]='1';
}
p1m+=(random(5))+1;
return;
}
if(mo2=='d'){
if(fm<12&&fg[fn][fm+1]!='2'){
fm++;
fg[fn][fm-1]=' ';
fg[fn][fm]='1';
}
p1m+=(random(5))+1;
return;
}
if(mo2=='8'){
if(f2n>0&&fg[f2n-1][f2m]!='1'){
f2n--;
fg[f2n+1][f2m]=' ';
fg[f2n][f2m]='2';
}
p2m+=(random(5))+1;
return;
}
if(mo2=='5'){
if(f2n<12&&fg[f2n+1][f2m]!='1'){
f2n++;
fg[f2n-1][f2m]=' ';
fg[f2n][f2m]='2';
}
p2m+=(random(5))+1;
return;
}
if(mo2=='4'){
if(f2m>0&&fg[f2n][f2m-1]!='1'){
f2m--;
fg[f2n][f2m+1]=' ';
fg[f2n][f2m]='2';
}
p2m+=(random(5))+1;
return;
}
if(mo2=='6'){
if(f2m<12&&fg[f2n][f2m+1]!='1'){
f2m++;
fg[f2n][f2m-1]=' ';
fg[f2n][f2m]='2';
}
p2m+=(random(5))+1;
return;
}
if(mo2=='q'){
if(p1m>=50&&pp[1].bow=="no"){
p1m-=50;
pp[1].bow="yes";
return;
}
if(pp[1].arrow>=1){
fight1_1b();
}
return;
}
if(mo2=='x'){
if(pp[1].m>=20){
pp[1].arrow+=5;
p1m-=20;
}
return;
}
if(mo2=='7'){
if(p2m>=50&&pp[2].bow=="no"){
p2m-=50;
pp[2].bow="yes";
return;
}
if(pp[2].arrow>=1){
fight1_2b();
}
return;
}
if(mo2=='2'){
if(pp[2].m>=20){
pp[2].arrow+=5;
p2m-=20;
}
return;
}
if(mo2=='e'){
if(p1m>=80&&pp[1].knife=="no"){
p1m-=80;
pp[1].knife="yes";
return;
}
fight1_1c();
}
if(mo2=='9'){
if(p2m>=80&&pp[1].knife=="no"){
p2m-=80;
pp[2].knife="yes";
return;
}
fight1_2c();
}
}
int fight1_1(){
char mo;
for(int i=1;i<=2;i++){
pp[i].hp=100;
pp[i].m=100;
pp[i].arrow=0;
pp[i].bow="no";
pp[i].knife="no";
}
memset(fg,' ',sizeof(fg));
fg[0][0]='1';
fg[13][0]='2';
fn=0;fm=0;f2n=12;f2m=0;
for( ; ; ){
system("cls");
if(pp[1].hp<=0){
return j;
}
if(pp[2].hp<=0){
return fight;
}
cout<<"# # # # # # # # # # # # # # #| | | | | | | | | | | | | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[0][i]<<" ";cout<<"| | | player 1 | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[1][i]<<" ";cout<<"| | | $:"<<pp[1].m<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[2][i]<<" ";cout<<"| | | hp:"<<pp[1].hp<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[3][i]<<" ";cout<<"| | | arrow:"<<pp[1].arrow<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[4][i]<<" ";cout<<"| | | Bow:"<<pp[1].bow<<" Knife:"<<pp[1].knife<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[5][i]<<" ";cout<<"| | | | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[6][i]<<" ";cout<<"| | | | | | | | | | | | | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[7][i]<<" ";cout<<"| | | player 2 | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[8][i]<<" ";cout<<"| | | $:"<<pp[2].m<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[9][i]<<" ";cout<<"| | | hp:"<<pp[2].hp<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[10][i]<<" ";cout<<"| | | arrow:"<<pp[2].arrow<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[11][i]<<" ";cout<<"| | | Bow:"<<pp[2].bow<<" Knife:"<<pp[2].knife<<" | | |"<<endl;
cout<<"# ";for(int i=0;i<13;i++) cout<<fg[12][i]<<" ";cout<<"| | | | | |"<<endl;
cout<<"# # # # # # # # # # # # # # #| | | | | | | | | | | | | | |"<<endl<<endl<<endl;
mo=getch();
fight1_2(mo,pp[1].m,pp[2].m);
}
return 0;
}
void winner(){
cout<<"Player "<<win<<" won the game!";
cout<<"Time uesd: "<<(double)clock()/CLOCKS_PER_SEC-tim<<" second!"<<endl<<endl;
sleep(1);
cout<<"You get he or she a half of money!"<<endl<<endl;
if(win==j){
money[j]+=money[fight]/2;
money[fight]/=2;
}else{
money[fight]+=money[j]/2;
money[j]/=2;
}
system("pause");
return;
}
void fight1(){
int e;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |BACKGROUND_INTENSITY|FOREGROUND_GREEN|
FOREGROUND_BLUE|BACKGROUND_RED|BACKGROUND_GREEN);
system("cls");
cout<<"------------C++ good game-----------"<<endl;
outside("Press 1 to start this game.\nPress 2 to view help.");
cin>>e;
if(e==1){
outside("GOGOGO!!!");
tim=(double)clock()/CLOCKS_PER_SEC;
win=fight1_1();
winner();
}else{
outside("1./*map*/");
cout<<"# # # # # # # # # # # # # # #| | | | | | | | | | | | | | |"<<endl;
cout<<"# 1/*player 1*/ #| | | player 1 | | |"<<endl;
cout<<"# #| | /*money*/$:100 | | |"<<endl;
cout<<"# #| | | hp:100 | | |"<<endl;
cout<<"# #| | | arrow:0/*arrow's namber*/|"<<endl;
cout<<"# #| | | Bow:no Knife:no | | |"<<endl;
cout<<"# #| | | | | |"<<endl;
cout<<"# #| | | | | | | | | | | | | | |"<<endl;
cout<<"# #| | | player 2 | | |"<<endl;
cout<<"# #| | | $:100 | | |"<<endl;
cout<<"# #| | | hp:100 | | |"<<endl;
cout<<"# #| | | arrow:0 | | |"<<endl;
cout<<"# #| | | Bow:no Knife:no | | |"<<endl;
cout<<"# 2/*player 2*/ #| | | | | |"<<endl;
cout<<"# # # # # # # # # # # # # # #| | | | | | | | | | | | | | |"<<endl<<endl<<endl;
sleep(5);
outside("2.How to play.");
outside("player 1:\n w:up s:down a:left d:right");
outside(" q:buy or use the bow(50 $ to buy.1 arrow to use)");
outside(" e:buy or use the knife(80 $ to buy)");
outside(" x:buy the arrow(20$ 5 arrow)");
outside("player 2:\n 8:up 5:down 4:left 6:right");
outside(" 7:buy or use the bow(50 $ to buy.1 arrow to use)");
outside(" 9:buy or use the knife(80 $ to buy)");
outside(" 2:buy the arrow(20$ 5 arrow)");
outside("Bow:attack 1 you need use an arrow to use it.\n You and a player in a straight line you can fight it.");
outside("Knife:attack 7.\n You near a player 1M you can fight it.");
outside("every round your $ +1~5");
system("pause");
tim=(double)clock()/CLOCKS_PER_SEC;
win=fight1_1();
winner();
}
return;
}
void fight_(int fgame){
outside("Which player do you want to fight?");
cin>>fight;
cout<<"Player "<<j<<" will fight player "<<fight;
sleep(1);
fight1();
return;
}
void star(int yy){
outside("这就跟你问声好!你想要一个星星吗?(1或0)");sleep(1);
outside("30元买1个~~~");
cin>>yy;
if(yy==1){
if(money[j]>=30){
outside("谢谢~~~");sleep(1);
outside("星星商人将去一个随机的地点。");
merchant(yy);
return;
}
outside("你没有足够的钱。");sleep(1);
}
outside("BYE~~~~~~~~~~");
return;
}
void shop(int &yuan){
}
void moved(int max){
move1=0;
move1+=(random(4));
move1+=(random(4));
move1+=(random(4));
move1+=1;
move1*=move2;
move1+=move3;
sleep(1);
cout<<"Loading..."<<endl;
sleep(1);
cout<<"玩家"<<j<<"可以走"<<move1<<"步。"<<endl<<endl;
while(move1>1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
a[now[j]]=9+j;
a[now[j]-1]=a2[now[j]-1];
cout<<a[now[j]-2]<<" "<<a[now[j]-1]<<" "<<a[now[j]]<<" "<<a[now[j]+1]<<" "<<a[now[j]+2]<<endl<<endl<<endl<<endl<<endl;
cout<<" 钱"<<endl;
cout<<" 玩家1:"<<money[1]<<endl;
cout<<" 玩家2:"<<money[2]<<endl;
cout<<" 玩家3:"<<money[3]<<endl;
cout<<" 玩家4:"<<money[4]<<endl;
now[j]++;
sleep(1);
move1--;
cout<<endl<<endl<<endl<<endl<<endl<<endl;
if(a[now[j]]==7&&move1>1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_RED | FOREGROUND_GREEN);cout<<"玩家"<<j<<"将要去买星星!!!"<<endl<<endl;star(b);system("cls");sleep(3);system("cls");
}
if(a[now[j]]==8&&move1>1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<"玩家"<<j<<"将要去购物!"<<endl<<endl;system("cls");shop(money[j]);sleep(2);system("cls");
}
if(a[now[j]]==9&&move1>1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY);
cout<<"玩家"<<j<<"将要获得一个道具"<<endl<<endl;sleep(2),system("cls");ppp();system("cls");
}
}
a[now[j]]=9+j;
a[now[j]-1]=a2[now[j]-1];
cout<<a[now[j]-2]<<" "<<a[now[j]-1]<<" "<<a[now[j]]<<" "<<a[now[j]+1]<<" "<<a[now[j]+2]<<endl<<endl;
switch(a3[now[j]]){
case 1:cout<<"玩家"<<j<<"将要加3块钱"<<endl<<endl;money[j]+=3;sleep(2);system("cls");break;
case 2:cout<<"玩家"<<j<<"将要扣3块钱"<<endl<<endl;money[j]-=3;sleep(2);system("cls");break;
case 3:cout<<"玩家"<<j<<"将遇到一个事件发生"<<endl<<endl;event(j);sleep(2);system("cls");break;
case 4:cout<<"玩家"<<j<<"将要转动一个邪恶的转盘"<<endl<<endl;system("cls");evil(j,money[j]);sleep(2);system("cls");break;
case 5:cout<<"玩家"<<j<<"将要转动一个好的转盘"<<endl<<endl;system("cls");good(j);sleep(2);system("cls");break;
case 6:cout<<"玩家"<<j<<"将要与一个玩家决斗"<<endl<<endl;system("cls");fight_(b);sleep(2);system("cls");break;
case 7:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_RED | FOREGROUND_GREEN);cout<<"玩家"<<j<<"将要去买星星!!!"<<endl<<endl;system("cls");star(b);sleep(3);system("cls");break;
case 8:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<"玩家"<<j<<"将要去购物!"<<endl<<endl;system("cls");shop(money[j]);sleep(2);system("cls");break;
case 9:SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY);cout<<"玩家"<<j<<"将要获得一个道具"<<endl<<endl;system("cls");sleep(2),ppp();system("cls");break;
default:cout<<"HaHa"<<endl<<endl;sleep(2);system("cls");a[now[j]-1]=a2[now[j]-1];break;
}
move2=1;
move3=0;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
return;
}
void boo(){
int p,s;
outside("你想抢哪个人的钱?");
cin>>p;
if(money[p]>=10){
if(money[j]>=45&&pstar[p]>0){
outside("你想偷他或她一颗星星吗?(钱-35)(1 or 0)");
cin>>s;
if(s>0){
outside("OK!");
money[j]-=35;
pstar[p]--;pstar[j]++;
prop[j][8]--;prop[j][10]--;
return;
}else
outside("OK!");
sleep(1);
}
outside("你偷了他或她10块钱。");
prop[j][8]--;prop[j][10]--;
}else
outside("他或她没有10块钱");
return;
}
void dcm(){
int p;
outside("你想用什么道具(输入编号)");
cin>>p;
outside("道具已使用");
switch(p){
case 1:move2=2;moved(b);break;
case 2:move2=3;moved(b);break;
case 3:money[j]+=10;moved(b);break;
case 4:move3+=5;moved(b);break;
case 5:move3+=10;moved(b);break;
case 6:now[j]=(random(5000));moved(b);break;
case 7:now[j]=st[(random(30))];moved(b);break;
}
}
int main(){
int m,m2,ran,s=0;
char mm,mm2,ee;
memset(now,0,sizeof(now));
memset(prop,0,sizeof(prop));
memset(pstar,0,sizeof(pstar));
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<"---------------大富翁----------------"<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED|FOREGROUND_GREEN);
cout<<" \\ Bata 1.0.0 / "<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
cout<<"--------请输入你们的玩家数-----------"<<endl;
cout<<" (2~4)"<<endl;
mm=getch();
m=mm-'0';
if(m<2){
m=2;
}
if(m>4){
m=4;
}
cout<<m<<endl;
cout<<"-------------按1查看帮助-------------"<<endl;
cout<<"------------按2不查看帮助------------"<<endl;
cout<<"-----------按3查看更新日志-----------"<<endl;
mm2=getch();
m2=mm2-'0';
cout<<m2<<endl;
cout<<" GO "<<endl;
cout<<"Tip:Press '9999'view help."<<endl;
sleep(3);
cout<<endl;
srand((int)time(0));
for(i=0;i<5000;i++){
ran=(random(100));
if(ran<40){//40%
a[i]=1;
}else if(ran<70){//30%
a[i]=2;
}else if(ran<87){//17%
a[i]=3;
}else if(ran<92){//5%
a[i]=4;
}else if(ran<97){//5%
a[i]=5;
}else if(ran<99){//2%
a[i]=6;
}else a[i]=0;//1%
a2[i]=a[i];
a3[i]=a[i];
cout<<i<<"/5000 loading..."<<endl;
usleep(10);
}
system("cls");
if(m2==1){
say(b);
}else if(m2==3){
say2();
}
cout<<"loading..."<<endl;
sleep(3);
system("cls");
for(int i=0;i<200;i++){
ran=(random(5000));
a[ran]=9;
a2[ran]=9;
a3[ran]=9;
}
for(int i=0;i<150;i++){
ran=(random(5000));
a[ran]=8;
a2[ran]=8;
a3[ran]=8;
}
for(int i=0;i<30;i++){
ran=(random(5000));
a[ran]=7;
a3[ran]=7;
}
for(int i=0;i<5000;i++){
colour(a[i]);
if(a[i]==7){
st[s]=i;
s++;
}
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY |FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE
|FOREGROUND_INTENSITY);
system("pause");
system("cls");
game=0;
for(int i=1;game!=38264;i++){
cout<<"第"<<i<<"轮"<<endl;
for(j=1;j<=m;j++){
if(money[j]<0){
money[j]=0;
}
if(pstar[j]>=10){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_RED | FOREGROUND_GREEN);
cout<<"PLAYER ";sleep(1);cout<<j;sleep(1);cout<<" WIN!!!"<<endl<<endl;sleep(1);
return 0;
}
cout<<"现在是玩家"<<j<<"的回合"<<endl;
ee=getch();
e=ee-'0';
cout<<e<<endl;
if(e==1){
if(i>1){
now[j]+=1;
}
moved(m);
}
if(e==2){
if(prop[j][10]==0){
cout<<"错误!!!"<<endl;
outside("你必须有道具!");
sleep(3);
outside("自动调整为骰子。");
moved(b);
break;
}else
outside("你想用什么道具(输入编号)");
cin>>p;
if(prop[j][p]==0){
cout<<"错误!!!"<<endl;
outside("你必须有这个道具!");
sleep(3);
outside("自动调整为骰子。");
moved(m);
break;
}else
outside("道具已使用");
switch(p){
case 1:move2=2;prop[j][10]--;prop[j][0]--;moved(b);break;
case 2:move2=3;prop[j][10]--;prop[j][1]--;moved(b);break;
case 3:money[j]+=10;prop[j][10]--;prop[j][2]--;moved(b);break;
case 4:move3+=5;prop[j][10]--;prop[j][3]--;moved(b);break;
case 5:move3+=10;prop[j][10]--;prop[j][4]--;moved(b);break;
case 6:now[j]=(random(5000));prop[j][10]--;prop[j][5]--;moved(b);break;
case 7:now[j]=st[(random(30))]-1;prop[j][10]--;prop[j][6]--;moved(b);break;
case 8:dcm();prop[j][10]--;prop[j][7]--;moved(b);break;
case 9:boo();moved(b);break;
case 10:fight_(b);prop[j][10]--;prop[j][9]--;moved(b);break;
}
}
}
}
return 0;
}
球球大作战
//奇怪的游戏
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
void pass() {
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
SetConsoleCursorInfo(
GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
}
int jjda;
void ys()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),(++jjda)%15+1);
}
void gotoxy(int x,int y)
{
COORD c= {y-1,x-1};
SetConsoleCursorPosition(
GetStdHandle(STD_OUTPUT_HANDLE),c);
}
void ys(int yyin)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),yyin);
}
int oop,ool;
int ooj,oof;
int a[1000][1000]=
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},};
int i=4,j=4,k,l,o,p;
int kl=20,ow=20,fs;
int main(void)
{
system("mode con cols=111");
pass();
SetConsoleTitle("球球大作战");
for(k=0;k<100;k++)
{
for(l=0;l<100;l++)
{
if(a[k][l]==0)
{
ys();
printf(".");
}
}
}
for(;;)
{
gotoxy(1,1);
ys(10);
printf("1P的大小:%dkg\n\n",o);
gotoxy(2,1);
ys(11);
printf("2P的大小:%dkg\n\n",fs);
gotoxy(i,j);
ys(10);
printf("●");
gotoxy(kl,ow);
ys(11);
printf("●");
if(i==kl&&j==ow)
{
if(o>fs)
{
system("cls");
printf("1P Win!");
Sleep(1000);
break;
}
else
if(o<fs)
{
system("cls");
printf("2P Win!");
Sleep(1000);
break;
}
else
if(o==fs)
{
system("cls");
printf("平局!");
Sleep(1000);
break;
}
}
p=getch();
Sleep((o+fs)/20);
if(p==119)
{
i--;
gotoxy(i+1,j);
printf(" ");
if(a[i][j]==0)
{
o++;
a[i+1][j]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==115)
{
i++;
gotoxy(i-1,j);
printf(" ");
if(a[i][j]==0)
{
o++;
a[i-1][j]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==97)
{
j--;
if(a[i][j]==0)
{
o++;
a[i][j+1]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==100)
{
j++;
if(a[i][j]==0)
{
o++;
a[i][j-1]=1;
}
else
if(a[i][j]!=0)
{
o+0;
}
}
if(p==72)
{
kl--;
gotoxy(kl+1,ow);
printf(" ");
if(a[kl][ow]==0)
{
fs++;
a[kl+1][ow]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==80)
{
kl++;
gotoxy(kl-1,ow);
printf(" ");
if(a[kl][ow]==0)
{
fs++;
a[kl-1][ow]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==75)
{
ow--;
if(a[kl][ow]==0)
{
fs++;
a[kl][ow+1]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==77)
{
ow++;
if(a[kl][ow]==0)
{
fs++;
a[kl][ow-1]=1;
}
else
if(a[kl][ow]!=0)
{
fs+0;
}
}
if(p==27)
{
break;
}
srand(time(NULL));
oop=rand()%20+1;
srand(time(NULL));
ool=rand()%20+1;
gotoxy(oop,ool);
}
}
随机小游戏?
转自:https://www.luogu.com.cn/team/32221#main
#include <bits/stdc++.h>
#include<conio.h>
#include<windows.h>
using namespace std;
int gj3 = 100, fy3 = 100, sm3 = 1000, gu = 1, sc = 0;
char* (s[]) = { "小刀","铁刀","铜刀","银刀","金刀","手枪","步枪","突击步枪","狙击枪","冲锋枪","藤甲","铁甲","铜甲","银甲","金甲" };
int sl[15] = { 0 }, ysl = 0, msx;
string name;
int sm1, sm2, gj1, gj2, fy1, fy2, rs = 999999, rw, gos, smc, rea, sr, srt, tes, sa, srf, srth; //smc是血量上限;
int gj[] = { 10,15,20,30,50,80,100,120,150,200,0,0,0,0,0 }, fy[] = { 0,5,10,15,20,0,0,0,0,0,20,30,50,80,100 }; //攻击、防御、数量、医疗箱数量
void bag()
{
int xz1, jx;
for (int i = 0; i < 15; i++)
{
cout << s << ": " << sl << "级" << endl;
}
cout << "医疗箱:" << ysl << "个" << endl << "0.退出 1.使用医疗箱" << endl;
cin >> xz1;
system("cls");
if (xz1 == 1) {
if (ysl == 0)
{
cout << "你没有医疗箱!" << endl;
Sleep(1000);
}
if (smc <= sm1)
{
cout << "你已满血!";
Sleep(1000);
}
else
{
jx = sm1 + 500;
if (jx > smc)
{
jx = smc;
}
sm1 = jx;
cout << "加血成功!";
Sleep(1000);
ysl--;
}
system("cls");
}
}
int into() {
srand(time(NULL));
sa = rand() % 16;
switch (sa)
{
case 15:
ysl++;
cout << "你捡到了医疗箱一级";
break;
default:
cout << "你捡到了" << s[sa] << "一级";
gj1 += gj[sa];
fy1 += fy[sa];
sl[sa]++;
break;
}
Sleep(1000);
system("cls");
return 0;
}
int unp()
{
int sm4, gj4, fy4;
cout << "第" << gu << "关" << endl;
cout << "你碰到了野兽" << endl;
Sleep(2000);
sm4 = sm3;
gj4 = gj3;
fy4 = fy3;
while (sm1 > 0 || sm4 > 0)
{
if (gj1 - fy4 <= 0)
{
cout << "他被打掉了0滴血,还剩" << sm4 << "滴血";
Sleep(1000);
system("cls");
sc++;
}
else
{
sm4 = sm4 - gj1 + fy4;
cout << "他被打掉了" << gj1 - fy4 << "滴血,还剩" << sm4 << "滴血";
Sleep(1000);
system("cls");
}
if (sm4 <= 0)
{
cout << "他死了!";
Sleep(1000);
system("cls");
into();
gu++;
return 0;
}
if (gj4 - fy1 <= 0)
{
cout << "你被打掉了0滴血,还剩" << sm1 << "滴血";
Sleep(1000);
system("cls");
sc++;
}
else
{
sm1 = sm1 - gj4 + fy1;
cout << "你被打掉了" << gj4 - fy1 << "滴血,还剩" << sm1 << "滴血";
Sleep(1000);
system("cls");
}
if (sc == 2)
{
cout << "你们打了个平手";
Sleep(1000);
system("cls");
into();
sc = 0;
return 0;
}
if (sm1 <= 0)
{
cout << "你死了!";
Sleep(1000);
system("cls");
return 0;
}
sc = 0;
}
gj3 += 50;
fy3 += 50;
sm3 += 100;
}
void puto()
{
srf = rand() % 15;
Sleep(199);
srth = rand() % 2;
if (srth == 1)
{
if (gj1 - srf < 0)
{
srf = gj1;
}
cout << "你丢失了" << srf << "点攻击力";
gj1 -= srf;
}
if (srth == 0)
{
if (fy1 - srf < 0)
{
srf = fy1;
}
cout << "你丢失了" << srf << "点防御力";
fy1 -= srf;
}
Sleep(1500);
system("cls");
}
int unf()
{
int gf, xzi, js = 0;
sm2 = rand() % 2200 + 800;
gj2 = rand() % 500 + 200;
fy2 = rand() % 300 + 10;
cout << "你碰到了一个人 1.战斗 2.逃跑" << endl;
cin >> tes;
gf = (gj2 - fy1) / 3;
if (tes == 2)
{
if (gf < 0)
{
gf = 0;
}
cout << "你还是被他打掉了" << gf << "滴血,然后逃脱成功!";
Sleep(1500);
system("cls");
sm1 -= gf;
}
if (tes == 1)
{
while (sm1 > 0 && sm2 > 0 && js != 1)
{
if (gj1 - fy2 <= 0)
{
cout << "他被打掉了0滴血,还剩" << sm2 << "滴血";
Sleep(1000);
system("cls");
sc++;
}
else
{
sm2 = sm2 - gj1 + fy2;
cout << "他被打掉了" << gj1 - fy2 << "滴血,还剩" << sm2 << "滴血";
Sleep(1000);
system("cls");
}
if (sm2 <= 0)
{
cout << "他死了!";
Sleep(1000);
system("cls");
rs--;
into();
return 0;
}
if (gj2 - fy1 <= 0)
{
cout << "你被打掉了0滴血,还剩" << sm1 << "滴血";
Sleep(1000);
system("cls");
sc++;
}
else
{
sm1 = sm1 - gj2 + fy1;
cout << "你被打掉了" << gj2 - fy1 << "滴血,还剩" << sm1 << "滴血";
Sleep(1000);
system("cls");
}
if (sc == 2)
{
cout << "你们打了个平手";
Sleep(1000);
system("cls");
into();
sc = 0;
}
sc = 0;
}
}
if (sm1 <= 0)
{
cout << "你死了!重新开始!";
Sleep(1000);
system("cls");
}
}
void sra()
{
sr = rand() % 9;
switch (sr)
{
case 0:
if (msx == 2)
{
unf();
}
else
{
unp();
}
break;
case 1:
into();
break;
case 2:
into();
break;
case 3:
puto();
break;
case 4:
puto();
break;
case 5:
puto();
break;
case 6:
puto();
break;
default:
cout << "你没有获得什么……";
Sleep(1000);
system("cls");
break;
}
}
int main()
{
srand(time(NULL));
cout << "你的名字:";
cin >> name;
system("cls");
aga:
cout << "0.退出游戏 1.开始游戏" << endl;
cin >> gos;
system("cls");
if (gos == 0) {
cout << "由似花还似飞花出品,欢迎再来!!";
Sleep(1500);
return 0;
}
retu:
while (1)
{
int sl[15] = { 0 }, ysl = 0;
if (msx == 2)
{
cout << "1.无限闯关模式 2.实战模式" << endl;
cin >> msx;
system("cls");
cout << name << ",生死枪战,现在开始!!";
Sleep(1500);
system("cls");
cout << "名字:" << name;
cout << endl << "(人越多越好玩)(包括你自己) " << "枪战人数:";
cin >> rs;
system("cls");
}
xz:
cout << "人物选择:" << endl;
cout << "1.步兵 生命:1000 攻击:50 防御:50" << endl;
cout << "2.丧尸 生命:1250 攻击:35 防御:40" << endl;
cout << "3.医生 生命:1500 攻击:20 防御:30" << endl;
cout << "4.铠甲人 生命:800 攻击:40 防御:80" << endl;
cin >> rw;
system("cls");
switch (rw)
{
case 1:
sm1 = 1000;
smc = 1000;
gj1 = 50;
fy1 = 50;
break;
case 2:
sm1 = 1250;
smc = 1250;
gj1 = 35;
fy1 = 40;
break;
case 3:
sm1 = 1500;
smc = 1500;
gj1 = 20;
fy1 = 30;
break;
case 4:
sm1 = 800;
smc = 800;
gj1 = 40;
fy1 = 80;
break;
default:
goto xz;
}
cout << "开局一抽奖" << endl;
Sleep(1500);
sr = rand() % 16;
switch (sr)
{
case 15:
ysl += 2;
cout << "你获得了医疗箱二级";
break;
default:
cout << "你获得了" << s[sr] << "二级";
gj1 += gj[sr] * 2;
fy1 += fy[sr] * 2;
sl[sr] += 2;
break;
}
Sleep(1000);
system("cls");
while (sm1 > 0 && rs > 1)
{
cout << "名字:" << name << endl;
cout << "生命:" << sm1 << endl;
cout << "攻击:" << gj1 << endl;
cout << "防御:" << fy1 << endl;
cout << "1.向前 2.向左 3.向右 4.向后 5.查看背包 6.退出" << endl;
cin >> rea;
system("cls");
if (rea == 6)
{
system("cls");
goto aga;
}
if (rea == 5)
{
bag();
}
if (rea >= 1 && rea <= 4)
{
sra();
}
}
if (sm1 > 0 && rs == 1)
{
cout << "你赢了!再来一局!" << endl;
Sleep(1000);
system("cls");
goto retu;
}
}
return 0;
}
//技能大乱斗v1.4.1壮志凌云
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
long long q,p,m,ji[10001]={0},dji[10001]={0},hp=1000,dhp=1000,pg=100,dpg=100,pw,dpw,c=1,b=0,a=0,s=0,ss=0,dc=0,db=0,da=0,ds=0,dss=0,u=3,o,r=1,l,www=0,god=0,lv=1,sa=1,d=1,win=0,lose=0,jie,e=0,du=0,GFS,dGFS,tz=1,atk=0,wake=1,need=1,have=0,story=1,zl=500,cause=0,zneed=300;
long long firecircle=0,ironline=0,mindctrl=0,cawnoodles=0,angry=0,oldman=0,cheater=0,electricity=0,ghost=0,zombie=0,sea=0,fruitice=0,Greatwall=0,seller=0,reliver=0,ghosttomb=0,roundcut=0,useless=0;
long long dfirecircle=0,dironline=0,dmindctrl=0,dcawnoodles=0,dangry=0,doldman=0,dcheater=0,delectricity=0,dghost=0,dzombie=0,dsea=0,dfruitice=0,dGreatwall=0,dseller=0,dreliver=0,dghosttomb=0,droundcut=0,duseless=0;
long long x_maxrecharge=0,x_change=0,x_angry=0,x_destorylight_c=0,x_sea=0,x_fruitice=0,x_destorylight_b=0,x_destorylight_a=0,x_turtlesoup=0,x_singer=0,x_gzkill=0;
long long dx_maxrecharge=0,dx_change=0,dx_angry=0,dx_destorylight_c=0,dx_sea=0,dx_fruitice=0,dx_destorylight_b=0,dx_destorylight_a=0,dx_turtlesoup=0,dx_singer=0,dx_gzkill=0;
void save()
{
ifstream fin("技能大乱斗存档.txt");
while(fin>>sa)
{
story=sa%100;
wake=(sa%1000-story)/100;
GFS=(sa%10000-wake*100-story)/1000;
dGFS=(sa%100000-GFS*1000-wake*100-story)/10000;
c=(sa%10000000000-dGFS*10000-GFS*1000-wake*100-story)/100000;
lv=(sa-c*100000-dGFS*10000-GFS*1000-wake*100-story)/10000000000;
}
if(c>=2)
{
p=c%2;
c-=p;
c/=2;
b+=c;
c=p;
}
if(b>=2)
{
p=b%2;
b-=p;
b/=2;
a+=b;
b=p;
}
if(a>=2)
{
p=a%2;
a-=p;
a/=2;
s+=a;
a=p;
}
if(s>=2)
{
p=s%2;
s-=p;
s/=2;
ss+=s;
s=p;
}
}
int main()
{
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"///////////////////////////////////技能大乱斗///////////////////////////////////";
Sleep(2000);
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"///////////////////////////////////史诗工作室///////////////////////////////////";
Sleep(2000);
system("cls");
cout<<"健康游戏忠告:"<<endl<<"抵制不良游戏,拒绝盗版游戏。"<<endl<<"注意自我保护,谨防受骗上当。"<<endl<<"适度游戏益脑,沉迷游戏伤身。"<<endl<<"合理安排时间,享受健康生活。";
Sleep(5000);
system("cls");
cout<<"v1.4.1壮志凌云"<<endl<<"更新说明:"<<endl<<"1.更新了剧情模式"<<endl<<"2.修复了一些已知bug"<<endl;
cout<<"注意,想退游戏必须在主界面扣4,否则存档不会更新"<<endl;
system("pause");
save();
ji[1]=1;
ji[2]=1;
ji[3]=1;
dji[1]=1;
dji[2]=1;
dji[3]=1;
srand((unsigned)time(NULL));
if(GFS!=0&&dGFS!=0)goto play;
CGFS:system("cls");
cout<<"选择你的天赋:"<<endl;
cout<<"1.水系"<<endl;
cout<<"2.火系"<<endl;
cout<<"3.木系"<<endl;
cin>>q;
if(q<=0||q>=4)goto CGFS;
if(q>=1&&q<=3)
{
GFS=q;
l=rand()%3+1;
dGFS=l;
cout<<"敌人选择了";
if(dGFS==1)cout<<"水系,";
if(dGFS==2)cout<<"火系,";
if(dGFS==3)cout<<"木系,";
if(GFS==dGFS)cout<<"跟你一样!"<<endl;
if(GFS==1&&dGFS==3||GFS==2&&dGFS==1||GFS==3&&dGFS==2)cout<<"克你!"<<endl;
if(GFS==1&&dGFS==2||GFS==2&&dGFS==3||GFS==3&&dGFS==1)cout<<"被你克!"<<endl;
system("pause");
}
play:system("cls");
choose:cout<<"段位:";
if(lv==1)cout<<"兵I"<<endl;
if(lv==2)cout<<"将I"<<endl;
if(lv==3)cout<<"君II"<<endl;
if(lv==4)cout<<"君I"<<endl;
if(lv==5)cout<<"王III"<<endl;
if(lv==6)cout<<"王II"<<endl;
if(lv==7)cout<<"王I"<<endl;
if(lv==8)cout<<"帝III"<<endl;
if(lv==9)cout<<"帝II"<<endl;
if(lv==10)cout<<"帝I"<<endl;
if(lv==11)cout<<"半圣"<<endl;
if(lv==12)cout<<"圣IV"<<endl;
if(lv==13)cout<<"圣III"<<endl;
if(lv==14)cout<<"圣II"<<endl;
if(lv==15)cout<<"圣I"<<endl;
if(lv==16)cout<<"半神"<<endl;
if(lv==17)cout<<"神V"<<endl;
if(lv==18)cout<<"神IV"<<endl;
if(lv==19)cout<<"神III"<<endl;
if(lv==20)cout<<"神II"<<endl;
if(lv==21)cout<<"神I"<<endl;
if(lv>=22)cout<<"超神"<<lv-21<<"星"<<" ";
zl=0;
cause=0;
for(int i=4;i<=33;i++)
{
if(4<=i<=6&&ji[i]==1)zl+=100;
if(7<=i<=14&&ji[i]==1)sa+=200;
if(15<=i<=22&&ji[i]==1)sa+=400;
if(23<=i<=26&&ji[i]==1)sa+=800;
if(27<=i<=33&&ji[i]==1)sa+=1600;
}
zl+=300;
zl+=wake*200;
cout<<"战斗力:"<<zl<<endl;
cout<<"1.游玩"<<endl<<"2.技能"<<endl<<"3.自动合成技能券"<<endl<<"4.退出"<<endl;
cin>>q;
if(q==1)
{
mod:system("cls");
cout<<"1.人机模式"<<endl;
cout<<"2.挑战模式"<<endl;
cout<<"3.剧情模式"<<endl;
cout<<"4.返回"<<endl;
cin>>q;
if(q==1)
{
system("cls");
m=1;
cout<<"1.段位模式"<<endl<<"2.休闲模式"<<endl;
cin>>q;
if(q==1)d=1;
else d=0;
bet:system("cls");
cout<<"是否下注?(1下2不下)"<<endl;
cin>>q;
if(q==1)
{
e=1;
bett:system("cls");
cout<<"押多少?(换算成初级券,0取消)"<<endl;
cin>>q;
if(q>c+2*b+4*a+8*s+16*ss)
{
cout<<"券不够!"<<endl;
system("pause");
goto bett;
}
if(q==0)goto bet;
du=q;
}
else e=0;
goto fight;
}
if(q==2)
{
system("cls");
m=2;
cout<<"1.极限攻击"<<endl<<"2.绝对防御"<<endl;
cin>>q;
if(q==1)tz=1;
else tz=2;
goto fight;
}
if(q==3)
{
system("cls");
m=3;
goto fight;
}
else
{
system("cls");
goto play;
}
}
if(q==2)
{
skill:system("cls");
cout<<"1.查看技能"<<endl;
cout<<"2.学习技能"<<endl;
cout<<"3.升级技能(目前仅限于天赋技能)"<<endl;
cout<<"4.返回"<<endl;
cin>>q;
if(q==1)
{
system("cls");
cout<<"已学技能:"<<endl;
cout<<"普攻"<<endl;
cout<<"治愈术"<<endl;
cout<<"解印术"<<endl;
if(ji[4]==1)cout<<"火圈"<<endl;
if(ji[5]==1)cout<<"铁索连环"<<endl;
if(ji[6]==1)cout<<"火球术"<<endl;
if(ji[7]==1)cout<<"附身"<<endl;
if(ji[8]==1)cout<<"毁灭飞弹"<<endl;
if(ji[9]==1)cout<<"极限治愈术"<<endl;
if(ji[10]==1)cout<<"反转术"<<endl;
if(ji[11]==1)cout<<"牛犇面"<<endl;
if(ji[12]==1)cout<<"狂暴"<<endl;
if(ji[13]==1)cout<<"老头胡拉茬"<<endl;
if(ji[14]==1)cout<<"当老千"<<endl;
if(ji[15]==1)cout<<"初等毁灭之光"<<endl;
if(ji[16]==1)cout<<"封雷斩"<<endl;
if(ji[17]==1)cout<<"死灵之术"<<endl;
if(ji[18]==1)cout<<"生化危机"<<endl;
if(ji[19]==1)cout<<"海纳百川"<<endl;
if(ji[20]==1)cout<<"火锅诱惑"<<endl;
if(ji[21]==1)cout<<"果冻之海"<<endl;
if(ji[22]==1)cout<<"伟大的墙"<<endl;
if(ji[23]==1)cout<<"中等毁灭之光"<<endl;
if(ji[24]==1)cout<<"战争商贩"<<endl;
if(ji[25]==1)cout<<"机关长枪"<<endl;
if(ji[26]==1)cout<<"无效化"<<endl;
if(ji[27]==1)cout<<"完全毁灭之光"<<endl;
if(ji[28]==1)cout<<"逆天十全王八大补汤"<<endl;
if(ji[29]==1)cout<<"歌者入侵"<<endl;
if(ji[30]==1)cout<<"秽土转生"<<endl;
if(ji[31]==1)cout<<"尸鬼封尽"<<endl;
if(ji[32]==1)cout<<"圣灵墓地"<<endl;
if(ji[33]==1)cout<<"轮回斩"<<endl;
if(GFS==1)cout<<"水漫金山"<<endl;
if(GFS==2)cout<<"星火燎原"<<endl;
if(GFS==3)cout<<"荆棘之触"<<endl;
system("pause");
goto skill;
}
if(q==2)
{
system("cls");
cout<<"你想学什么技能?(输入技能编号)"<<endl;
cout<<"4.火圈"<<endl;
cout<<"5.铁索连环"<<endl;
cout<<"6.火球术"<<endl;
cout<<"7.附身"<<endl;
cout<<"8.毁灭飞弹"<<endl;
cout<<"9.极限治愈术"<<endl;
cout<<"10.反转术"<<endl;
cout<<"11.牛犇面"<<endl;
cout<<"12.狂暴"<<endl;
cout<<"13.老头胡拉茬"<<endl;
cout<<"14.当老千"<<endl;
cout<<"15.初等毁灭之光"<<endl;
cout<<"16.封雷斩"<<endl;
cout<<"17.死灵之术"<<endl;
cout<<"18.生化危机"<<endl;
cout<<"19.海纳百川"<<endl;
cout<<"20.火锅诱惑"<<endl;
cout<<"21.果冻之海"<<endl;
cout<<"22.伟大的墙"<<endl;
cout<<"23.中等毁灭之光"<<endl;
cout<<"24.战争商贩"<<endl;
cout<<"25.机关长枪"<<endl;
cout<<"26.无效化"<<endl;
cout<<"27.完全毁灭之光"<<endl;
cout<<"28.逆天十全王八大补汤"<<endl;
cout<<"29.歌者入侵"<<endl;
cout<<"30.秽土转生"<<endl;
cout<<"31.尸鬼封尽"<<endl;
cout<<"32.圣灵墓地"<<endl;
cout<<"33.轮回斩"<<endl;
cin>>q;
if(q>=3&&q<=33)goto learn;
goto skill;
}
if(q==3)
{
system("cls");
if(GFS==1)cout<<"水漫金山";
if(GFS==2)cout<<"星火燎原";
if(GFS==3)cout<<"荆棘之触";
if(wake==1)
{
cout<<"当前C级,";
need=1;
}
if(wake==2)
{
cout<<"当前B级,";
need=2;
}
if(wake==3)
{
cout<<"当前A级,";
need=4;
}
if(wake==4)
{
cout<<"当前S级,";
need=8;
}
if(wake==5)
{
cout<<"当前SS级,已满级"<<endl;
system("pause");
goto skill;
}
have=c+2*b+4*a+8*s+16*ss;
if(have<need)
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
cout<<"是否升级?(1是2否)"<<endl;
cin>>q;
if(q==1)
{
have-=need;
c=have;
wake++;
cout<<"升级成功!"<<endl;
system("pause");
goto play;
}
else goto play;
}
if(q==4)goto play;
else goto skill;
}
if(q==3)
{
if(c>=2)
{
p=c%2;
c-=p;
c/=2;
b+=c;
c=p;
}
if(b>=2)
{
p=b%2;
b-=p;
b/=2;
a+=b;
b=p;
}
if(a>=2)
{
p=a%2;
a-=p;
a/=2;
s+=a;
a=p;
}
if(s>=2)
{
p=s%2;
s-=p;
s/=2;
ss+=s;
s=p;
}
if(dc>=2)
{
p=dc%2;
dc-=p;
dc/=2;
db+=dc;
dc=p;
}
if(db>=2)
{
p=db%2;
db-=p;
db/=2;
da+=db;
db=p;
}
if(da>=2)
{
p=da%2;
da-=p;
da/=2;
ds+=da;
da=p;
}
if(ds>=2)
{
p=ds%2;
ds-=p;
ds/=2;
dss+=ds;
ds=p;
}
}
if(q==4)
{
sa=story;
sa+=wake*100;
sa+=GFS*1000;
sa+=dGFS*10000;
sa+=100000*c+200000*b+400000*a+800000*s+1600000*ss;
for(int i=4;i<=33;i++)
{
if(4<=i<=6&&ji[i]==1)sa+=100000;
if(7<=i<=14&&ji[i]==1)sa+=200000;
if(15<=i<=22&&ji[i]==1)sa+=400000;
if(23<=i<=26&&ji[i]==1)sa+=800000;
if(27<=i<=33&&ji[i]==1)sa+=1600000;
}
sa+=lv*10000000000;
ofstream out("技能大乱斗存档.txt");
out<<sa;
out.close();
cin.get();
return 0;
}
if(q==1618986342/618)
{
cout<<"开启上帝模式!"<<endl;
god=1;
system("pause");
system("color e0");
ss=999;
hp=99999;
pg=99999;
wake=5;
goto play;
}
goto play;
learn:system("cls");
cout<<"你拥有:"<<endl;
cout<<"初级券*"<<c<<endl;
cout<<"中级券*"<<b<<endl;
cout<<"高级券*"<<a<<endl;
cout<<"特级券*"<<s<<endl;
cout<<"神级券*"<<ss<<endl;
if(q==4&&ji[4]==0)
{
cout<<"火圈需1初级券"<<endl;
if(c>=1||b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=4;
goto buy;
}
if(q==5&&ji[5]==0)
{
cout<<"铁索连环需1初级券"<<endl;
if(c>=1||b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=5;
goto buy;
}
if(q==6&&ji[6]==0)
{
cout<<"火球术需1初级券"<<endl;
if(c>=1||b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
cin>>q;
www=6;
goto buy;
}
if(q==7&&ji[7]==0)
{
cout<<"附身需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=7;
goto buy;
}
if(q==8&&ji[8]==0)
{
cout<<"毁灭飞弹需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=8;
goto buy;
}
if(q==9&&ji[9]==0)
{
cout<<"极限治愈术需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=9;
goto buy;
}
if(q==10&&ji[10]==0)
{
cout<<"反转术需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=10;
goto buy;
}
if(q==11&&ji[11]==0)
{
cout<<"牛犇面需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=11;
goto buy;
}
if(q==12&&ji[12]==0)
{
cout<<"狂暴需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=12;
goto buy;
}
if(q==13&&ji[13]==0)
{
cout<<"老头胡拉茬需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=13;
goto buy;
}
if(q==14&&ji[14]==0)
{
cout<<"当老千需1中级券"<<endl;
if(b>=1||a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=14;
goto buy;
}
if(q==15&&ji[15]==0)
{
cout<<"初等毁灭之光需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=15;
goto buy;
}
if(q==16&&ji[16]==0)
{
cout<<"封雷斩需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=16;
goto buy;
}
if(q==17&&ji[17]==0)
{
cout<<"死灵之术需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=17;
goto buy;
}
if(q==18&&ji[18]==0)
{
cout<<"生化危机需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=18;
goto buy;
}
if(q==19&&ji[19]==0)
{
cout<<"海纳百川需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=19;
goto buy;
}
if(q==20&&ji[20]==0)
{
cout<<"火锅诱惑需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=20;
goto buy;
}
if(q==21&&ji[21]==0)
{
cout<<"果冻之海需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=21;
goto buy;
}
if(q==22&&ji[22]==0)
{
cout<<"伟大的墙需1高级券"<<endl;
if(a>=1||s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=22;
goto buy;
}
if(q==23&&ji[23]==0)
{
cout<<"中等毁灭之光需1特级券"<<endl;
if(s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=23;
goto buy;
}
if(q==24&&ji[24]==0)
{
cout<<"战争商贩需1特级券"<<endl;
if(s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=24;
goto buy;
}
if(q==25&&ji[25]==0)
{
cout<<"机关长枪需1特级券"<<endl;
if(s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=25;
goto buy;
}
if(q==26&&ji[26]==0)
{
cout<<"无效化需1特级券"<<endl;
if(s>=1||ss>=1)cout<<"确认学习?(1确认2取消,可能需要分解更高级的技能券,高一级技能券可分解为2张低一级技能券)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=26;
goto buy;
}
if(q==27&&ji[27]==0)
{
cout<<"完全毁灭之光需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=27;
goto buy;
}
if(q==28&&ji[28]==0)
{
cout<<"逆天十全王八大补汤需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=28;
goto buy;
}
if(q==29&&ji[29]==0)
{
cout<<"歌者入侵需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=29;
goto buy;
}
if(q==30&&ji[30]==0)
{
cout<<"秽土转生需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=30;
goto buy;
}
if(q==31&&ji[31]==0)
{
cout<<"尸鬼封尽需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=31;
goto buy;
}
if(q==32&&ji[32]==0)
{
cout<<"圣灵墓地需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=32;
goto buy;
}
if(q==33&&ji[33]==0)
{
cout<<"轮回斩需1神级券"<<endl;
if(ss>=1)cout<<"确认学习?(1确认2取消)"<<endl;
else
{
cout<<"券不够!"<<endl;
system("pause");
goto skill;
}
www=33;
goto buy;
}
goto play;
fight:system("cls");
firecircle=0;
ironline=0;
mindctrl=0;
cawnoodles=0;
angry=0;
oldman=0;
cheater=0;
electricity=0;
ghost=0;
fruitice=0;
Greatwall=0;
seller=0;
reliver=0;
ghosttomb=0;
roundcut=1;
dfirecircle=0;
dironline=0;
dmindctrl=0;
dcawnoodles=0;
dangry=0;
doldman=0;
dcheater=0;
delectricity=0;
dghost=0;
dfruitice=0;
dGreatwall=0;
dseller=0;
dreliver=0;
dghosttomb=0;
droundcut=1;
x_maxrecharge=0;
x_change=0;
x_angry=0;
x_destorylight_c=0;
x_sea=0;
x_fruitice=0;
x_destorylight_b=0;
x_destorylight_a=0;
x_turtlesoup=0;
x_singer=0;
x_gzkill=0;
dx_maxrecharge=0;
dx_change=0;
dx_angry=0;
dx_destorylight_c=0;
dx_sea=0;
dx_fruitice=0;
dx_destorylight_b=0;
dx_destorylight_a=0;
dx_turtlesoup=0;
dx_singer=0;
dx_gzkill=0;
if(god==0)hp=1000;
else hp=99999;
dhp=1000;
if(god==0)pg=100;
else pg=99999;
dpg=100;
r=1;
if(m==1)
{
AImod:system("cls");
if(hp<=0)goto die;
if(dhp<=0)goto live;
cout<<"第"<<r<<"回合"<<endl;
cout<<"敌人血量:"<<dhp<<endl;
cout<<"你的血量:"<<hp<<endl;
cout<<"本回合你出:(1石头2剪刀3布)"<<endl;
cin>>q;
o=rand()%3+1;
if(mindctrl==1)
{
mindctrl=0;
goto win;
}
if(dmindctrl==1)
{
dmindctrl=0;
goto lose;
}
if(q==1&&o==1||q==2&&o==2||q==3&&o==3)
{
cout<<"平!"<<endl;
Sleep(1000);
goto AImod;
}
if(q==1&&o==2||q==2&&o==3||q==3&&o==1)
{
win:r++;
if(firecircle==1)
{
cout<<"你被火圈烧掉了100滴血"<<endl;
hp-=100;
}
if(dfirecircle==1)
{
cout<<"敌人被火圈烧掉了100滴血"<<endl;
dhp-=100;
}
if(ghost>=1)
{
cout<<"敌人被"<<ghost<<"只死灵打掉了"<<50*ghost<<"滴血"<<endl;
dhp-=50*ghost;
}
if(dghost>=1)
{
cout<<"你被"<<dghost<<"只死灵打掉了"<<50*dghost<<"滴血"<<endl;
hp-=50*ghost;
}
if(zombie>=1)
{
cout<<"敌人被"<<zombie<<"只丧尸打掉了"<<50*zombie<<"滴血"<<endl;
dhp-=50*zombie;
}
if(dzombie>=1)
{
cout<<"你被"<<dzombie<<"只丧尸打掉了"<<50*dzombie<<"滴血"<<endl;
hp-=50*zombie;
}
if(sea==1)
{
cout<<"浩然正气汇成涓涓细流,给你回了100滴血"<<endl;
hp+=100;
}
if(dsea==1)
{
cout<<"弥天邪气汇成涓涓细流,给敌人回了100滴血"<<endl;
dhp+=100;
}
if(seller>=1||dseller>=1)
{
cout<<"你从"<<seller+dseller<<"名商人那里买到了"<<50*(seller+dseller)<<"点普攻伤害"<<endl;
pg+=50*(seller+dseller);
cout<<"敌人从"<<seller+dseller<<"名商人那里买到了"<<50*(seller+dseller)<<"点普攻伤害"<<endl;
dpg+=50*(seller+dseller);
}
if(reliver>=1)
{
cout<<"敌人被"<<reliver<<"只转生体打掉了"<<100*reliver<<"滴血"<<endl;
dhp-=100*reliver;
}
if(dreliver>=1)
{
cout<<"你被"<<dreliver<<"只转生体打掉了"<<100*dreliver<<"滴血"<<endl;
hp-=100*reliver;
}
if(ghosttomb==1)
{
ghost++;
cout<<"我方圣灵墓地派出了一只亡灵"<<endl;
}
winn:system("pause");
system("cls");
cout<<"胜!"<<endl;
if(Greatwall>=1)
{
Greatwall--;
goto AImod;
}
if(fruitice>=1)
{
fruitice--;
goto AImod;
}
if(electricity==1)
{
electricity=0;
goto AImod;
}
if(cawnoodles==1)
{
cawnoodles=0;
goto AImod;
}
if(useless>=1)
{
useless--;
goto AImod;
}
Sleep(1000);
cout<<"选择一个已学习的技能来释放:"<<endl;
cout<<"1.普攻"<<endl;
cout<<"2.治愈术"<<endl;
cout<<"3.解印术"<<endl;
cout<<"4.火圈"<<endl;
cout<<"5.铁索连环"<<endl;
cout<<"6.火球术"<<endl;
cout<<"7.附身"<<endl;
cout<<"8.毁灭飞弹"<<endl;
cout<<"9.极限治愈术"<<endl;
cout<<"10.反转术"<<endl;
cout<<"11.牛犇面"<<endl;
cout<<"12.狂暴"<<endl;
cout<<"13.老头胡拉茬"<<endl;
cout<<"14.当老千"<<endl;
cout<<"15.初等毁灭之光"<<endl;
cout<<"16.封雷斩"<<endl;
cout<<"17.死灵之术"<<endl;
cout<<"18.生化危机"<<endl;
cout<<"19.海纳百川"<<endl;
cout<<"20.火锅诱惑"<<endl;
cout<<"21.果冻之海"<<endl;
cout<<"22.伟大的墙"<<endl;
cout<<"23.中等毁灭之光"<<endl;
cout<<"24.战争商贩"<<endl;
cout<<"25.机关长枪"<<endl;
cout<<"26.无效化"<<endl;
cout<<"27.完全毁灭之光"<<endl;
cout<<"28.逆天十全王八大补汤"<<endl;
cout<<"29.歌者入侵"<<endl;
cout<<"30.秽土转生"<<endl;
cout<<"31.尸鬼封尽"<<endl;
cout<<"32.圣灵墓地"<<endl;
cout<<"33.轮回斩"<<endl;
if(GFS==1)cout<<"34.水漫金山"<<endl;
if(GFS==2)cout<<"34.星火燎原"<<endl;
if(GFS==3)cout<<"34.荆棘之触"<<endl;
cin>>q;
if(ji[q]==1||q==34)goto pow;
goto winn;
pow:if(q==1)//普攻
{
if(angry==1)pg*=2;
if(oldman==1)pg/=2;
if(cheater==1)pg/=2;
oldman=0;
cheater=0;
dhp-=pg;
cout<<"你打了敌人一拳造成了"<<pg<<"点伤害"<<endl;
if(ironline==1)
{
hp-=pg;
cout<<"你被铁索勒掉了"<<pg<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(q==2)//治愈术
{
hp+=100;
oldman=0;
cheater=0;
cout<<"你给自己回了100滴血"<<endl;
system("pause");
goto AImod;
}
if(q==3)//解印术
{
oldman=0;
cheater=0;
if(firecircle==1)
{
firecircle=0;
jie=4;
}
if(ironline==1)
{
ironline=0;
jie=5;
}
out3:cout<<"你解除了你身上的";
if(jie==4)cout<<"火圈"<<endl;
if(jie==5)cout<<"铁索"<<endl;
system("pause");
goto AImod;
}
if(q==4)//火圈
{
pw=100;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
cout<<"你给敌人套了一个会持续造成伤害的火圈";
if(dfirecircle==1)cout<<"(已存在,本次只造成伤害)";
cout<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
dfirecircle=1;
oldman=0;
cheater=0;
system("pause");
goto AImod;
}
if(q==5)//铁索连环
{
oldman=0;
cheater=0;
if(dironline<1)
{
dironline=1;
cout<<"你给敌人套了一层会自动反噬伤害的铁索"<<endl;
system("pause");
goto AImod;
}
cout<<"铁索已存在!"<<endl;
system("pause");
goto AImod;
}
if(q==6)//火球术
{
pw=200;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
oldman=0;
cheater=0;
cout<<"你用一个火球轰掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(q==7)//附身
{
q=rand()%2+1;
if(q==1)
{
cout<<"你附在了敌人身上,下次猜拳你必胜"<<endl;
mindctrl=1;
}
if(q==2)cout<<"附身失败"<<endl;
oldman=0;
cheater=0;
system("pause");
goto AImod;
}
if(q==8)//毁灭飞弹
{
pw=300;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
oldman=0;
cheater=0;
cout<<"你用一颗飞弹轰掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(q==9)//极限治愈术
{
if(x_maxrecharge==1)
{
x_maxrecharge=0;
hp=1000;
oldman=0;
cheater=0;
cout<<"你给自己回满了血"<<endl;
x_maxrecharge=0;
system("pause");
goto AImod;
}
cout<<"极限治愈术蓄能完成"<<endl;
x_maxrecharge=1;
system("pause");
goto AImod;
}
if(q==10)//反转术
{
if(x_change==1)
{
x_change=0;
swap(hp,dhp);
oldman=0;
cheater=0;
cout<<"你跟敌人的血量互换了"<<endl;
system("pause");
goto AImod;
}
cout<<"反转术蓄能完成"<<endl;
x_change=1;
system("pause");
goto AImod;
}
if(q==11)//牛犇面
{
pw=200;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
cout<<"你给敌人扣了一碗牛犇面"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
dcawnoodles++;
oldman=0;
cheater=0;
system("pause");
goto AImod;
}
if(q==12)//狂暴
{
oldman=0;
cheater=0;
if(x_angry==1)
{
angry=1;
cout<<"你狂暴了,伤害翻倍"<<endl;
system("pause");
goto AImod;
}
cout<<"狂暴蓄能完成"<<endl;
x_angry=1;
system("pause");
goto AImod;
}
if(q==13)//老头胡拉茬
{
oldman=1;
cheater=0;
cout<<"你把敌人变成了伤害减半的老头,持续一回合"<<endl;
system("pause");
goto AImod;
}
if(q==14)//当老千
{
oldman=0;
cheater=1;
cout<<"你让敌人因为出千而心存愧疚,伤害减半,持续一回合"<<endl;
system("pause");
goto AImod;
}
if(q==15)//初等毁灭之光
{
oldman=0;
cheater=0;
if(x_destorylight_c==5)
{
cout<<"你放出毁灭之光,毁灭了除你以外的一切"<<endl;
system("pause");
goto live;
}
x_destorylight_c++;
if(x_destorylight_c==5)
{
cout<<"初等毁灭之光蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"初等毁灭之光蓄能"<<x_destorylight_c<<"/5次"<<endl;
system("pause");
goto AImod;
}
if(q==16)//封雷斩
{
pw=300;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
q=rand()%2+1;
if(q==1)
{
cout<<"你砍了敌人一刀,并成功封印了他"<<endl;
delectricity=1;
oldman=0;
cheater=0;
system("pause");
goto AImod;
}
cout<<"你砍了敌人一刀,但没封住他"<<endl;
oldman=0;
cheater=0;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(q==17)//死灵之术
{
oldman=0;
cheater=0;
ghost++;
cout<<"你召唤了一只死灵"<<endl;
system("pause");
goto AImod;
}
if(q==18)//生化危机
{
oldman=0;
cheater=0;
zombie++;
cout<<"你召唤了一只丧尸"<<endl;
system("pause");
goto AImod;
}
if(q==19)//海纳百川
{
oldman=0;
cheater=0;
sea=1;
cout<<"你周身环绕着浩然正气,喃喃自语:“海纳百川,有容乃大,壁立千仞,无欲则刚!!!”"<<endl;
system("pause");
goto AImod;
}
if(q==20)//火锅诱惑
{
oldman=0;
cheater=0;
dfirecircle=0;
dironline=0;
dmindctrl=0;
dcawnoodles=0;
dangry=0;
doldman=0;
dcheater=0;
delectricity=0;
dsea=0;
dfruitice=0;
dGreatwall=0;
dreliver=0;
dghosttomb=0;
cout<<"你将敌人用火锅从各种加成中引了出来"<<endl;
system("pause");
goto AImod;
}
if(q==21)//果冻之海
{
oldman=0;
cheater=0;
dfruitice++;
cout<<"你将敌人泡在了"<<dfruitice<<"层的果冻之海里"<<endl;
system("pause");
goto AImod;
}
if(q==22)//伟大的墙
{
oldman=0;
cheater=0;
dGreatwall++;
cout<<"你建起了第"<<Greatwall<<"层伟大的墙"<<endl;
system("pause");
goto AImod;
}
if(q==23)//中等毁灭之光
{
oldman=0;
cheater=0;
if(x_destorylight_b==4)
{
cout<<"你放出毁灭之光,毁灭了除你以外的一切"<<endl;
system("pause");
goto live;
}
x_destorylight_b++;
if(x_destorylight_a==4)
{
cout<<"中等毁灭之光蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"中等毁灭之光蓄能"<<x_destorylight_b<<"/4次"<<endl;
system("pause");
goto AImod;
}
if(q==24)//战争商贩
{
oldman=0;
cheater=0;
seller++;
cout<<"你招来了一名战争商人,他会卖给你伤害"<<endl;
system("pause");
goto AImod;
}
if(q==25)//机关长枪
{
pw=400;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
oldman=0;
cheater=0;
cout<<"你用一根长枪扎掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(q==26)
{
oldman=0;
cheater=0;
duseless++;
cout<<"下次敌人释放的技能将无效"<<endl;
system("pause");
goto AImod;
}
if(q==27)//完全毁灭之光
{
oldman=0;
cheater=0;
if(x_destorylight_a==3)
{
cout<<"你放出毁灭之光,毁灭了除你以外的一切"<<endl;
system("pause");
goto live;
}
x_destorylight_a++;
if(x_destorylight_a==3)
{
cout<<"完全毁灭之光蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"完全毁灭之光蓄能"<<x_destorylight_a<<"/3次"<<endl;
system("pause");
goto AImod;
}
if(q==28)//逆天十全王八大补汤
{
oldman=0;
cheater=0;
if(x_turtlesoup==2)
{
hp+=1000;
x_turtlesoup=0;
cout<<"你喝下了逆天十全王八大补汤,回了1000滴血(无视血量上限)"<<endl;
system("pause");
goto AImod;
}
x_turtlesoup++;
if(x_turtlesoup==2)
{
cout<<"逆天十全王八大补汤蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"逆天十全王八大补汤蓄能"<<x_turtlesoup<<"/2次"<<endl;
system("pause");
goto AImod;
}
if(q==29)//歌者入侵
{
oldman=0;
cheater=0;
if(x_singer==2)
{
x_singer=0;
cout<<"你命令歌者发出二向箔,敌人被二维化"<<endl;
system("pause");
goto live;
}
x_singer++;
if(x_singer==2)
{
cout<<"二向箔蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"歌者入侵了敌人的文明"<<endl;
system("pause");
goto AImod;
}
if(q==30)//秽土转生
{
oldman=0;
cheater=0;
reliver++;
cout<<"你召唤了一名转生体"<<endl;
system("pause");
goto AImod;
}
if(q==31)//尸鬼封尽
{
oldman=0;
cheater=0;
if(x_gzkill==3)
{
cout<<"你放出尸鬼封尽,毁灭了敌人的灵魂"<<endl;
system("pause");
goto live;
}
x_gzkill++;
if(x_gzkill==3)
{
cout<<"尸鬼封尽蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"尸鬼封尽蓄能"<<x_gzkill<<"/3次"<<endl;
system("pause");
goto AImod;
}
if(q==32)//圣灵墓地
{
oldman=0;
cheater=0;
if(ghosttomb<1)
{
ghosttomb=1;
cout<<"你建起了圣灵墓地,它会不断派出亡灵"<<endl;
system("pause");
goto AImod;
}
cout<<"墓地已存在!"<<endl;
system("pause");
goto AImod;
}
if(q==33)
{
pw=roundcut*100;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
oldman=0;
cheater=0;
cout<<"你释放了第"<<roundcut<<"层轮回斩打掉了敌人"<<pw<<"滴血"<<endl;
roundcut++;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(q==34)
{
pw=100*wake;
if(GFS==1&&dGFS==2)pw*=2;
if(GFS==1&&dGFS==3)pw/=2;
if(GFS==2&&dGFS==3)pw*=2;
if(GFS==2&&dGFS==1)pw/=2;
if(GFS==3&&dGFS==1)pw*=2;
if(GFS==3&&dGFS==2)pw/=2;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
oldman=0;
cheater=0;
cout<<"你用自己的天赋技能打掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
}
if(q==1&&o==3||q==2&&o==1||q==3&&o==2)
{
lose:r++;
if(firecircle==1)
{
cout<<"你被火圈烧掉了100滴血"<<endl;
hp-=100;
}
if(dfirecircle==1)
{
cout<<"敌人被火圈烧掉了100滴血"<<endl;
dhp-=100;
}
if(ghost>=1)
{
cout<<"敌人被"<<ghost<<"只死灵打掉了"<<50*ghost<<"滴血"<<endl;
dhp-=50*ghost;
}
if(dghost>=1)
{
cout<<"你被"<<dghost<<"只死灵打掉了"<<50*dghost<<"滴血"<<endl;
hp-=50*ghost;
}
if(zombie>=1)
{
cout<<"敌人被"<<zombie<<"只丧尸打掉了"<<50*zombie<<"滴血"<<endl;
dhp-=50*zombie;
}
if(dzombie>=1)
{
cout<<"你被"<<dzombie<<"只丧尸打掉了"<<50*dzombie<<"滴血"<<endl;
hp-=50*zombie;
}
if(sea==1)
{
cout<<"浩然正气汇成涓涓细流,给你回了100滴血"<<endl;
hp+=100;
}
if(dsea==1)
{
cout<<"弥天邪气汇成涓涓细流,给敌人回了100滴血"<<endl;
dhp+=100;
}
if(seller>=1||dseller>=1)
{
cout<<"你从"<<seller+dseller<<"名商人那里买到了"<<50*(seller+dseller)<<"点普攻伤害"<<endl;
pg+=50*(seller+dseller);
cout<<"敌人从"<<seller+dseller<<"名商人那里买到了"<<50*(seller+dseller)<<"点普攻伤害"<<endl;
dpg+=50*(seller+dseller);
}
if(reliver>=1)
{
cout<<"敌人被"<<reliver<<"只转生体打掉了"<<100*reliver<<"滴血"<<endl;
dhp-=100*reliver;
}
if(dreliver>=1)
{
cout<<"你被"<<dreliver<<"只转生体打掉了"<<100*dreliver<<"滴血"<<endl;
hp-=100*reliver;
}
system("pause");
system("cls");
cout<<"败!"<<endl;
Sleep(1000);
if(Greatwall>=1)
{
Greatwall--;
goto AImod;
}
if(dfruitice>=1)
{
dfruitice--;
goto AImod;
}
if(delectricity==1)
{
delectricity=0;
goto AImod;
}
if(dcawnoodles==1)
{
dcawnoodles=0;
goto AImod;
}
if(duseless>=1)
{
duseless--;
goto AImod;
}
cout<<"敌人正在思考......"<<endl;
rand:l=rand()%u+1;
if(dji[l]!=1)goto rand;
if(dji[l]==1)
{
if(l==1)//普攻
{
if(dangry==1)dpg*=2;
if(doldman==1)dpg/=2;
if(dcheater==1)dpg/=2;
doldman=0;
dcheater=0;
hp-=dpg;
cout<<"敌人打了你一拳造成了"<<dpg<<"点伤害"<<endl;
if(dironline==1)
{
dhp-=dpg;
cout<<"敌人被铁索勒掉了"<<dpg<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(l==2)//治愈术
{
dhp+=100;
doldman=0;
dcheater=0;
cout<<"敌人给自己回了100滴血"<<endl;
system("pause");
goto AImod;
}
if(l==3)//解印术
{
doldman=0;
dcheater=0;
if(dfirecircle==1)
{
dfirecircle=0;
jie=4;
goto dout3;
}
if(dironline==1)
{
dironline=0;
jie=5;
goto dout3;
}
else goto rand;
dout3:cout<<"敌人解除了身上的";
if(jie==4)cout<<"火圈"<<endl;
if(jie==5)cout<<"铁索"<<endl;
system("pause");
goto AImod;
}
if(l==4)//火圈
{
dpw=100;
if(angry==1)dpw*=2;
if(oldman==1)dpw/=2;
if(cheater==1)dpw/=2;
hp-=dpw;
cout<<"敌人给你套了一个会持续造成伤害的火圈";
if(firecircle==1)cout<<"(已存在,本次只造成伤害)";
cout<<endl;
if(dironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<pw<<"滴血"<<endl;
}
firecircle=1;
doldman=0;
dcheater=0;
system("pause");
goto AImod;
}
if(l==5)//铁索连环
{
doldman=0;
dcheater=0;
if(ironline<1)
{
ironline=1;
cout<<"敌人给你套了一层会自动反噬伤害的铁索"<<endl;
system("pause");
goto AImod;
}
cout<<"铁索已存在!"<<endl;
system("pause");
goto AImod;
}
if(l==6)//火球术
{
dpw=200;
if(dangry==1)dpw*=2;
if(doldman==1)dpw/=2;
if(dcheater==1)dpw/=2;
hp-=dpw;
doldman=0;
dcheater=0;
cout<<"敌人用一个火球轰掉了你"<<dpw<<"滴血"<<endl;
if(dironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<dpw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(l==7)//附身
{
l=rand()%2+1;
if(l==1)
{
cout<<"敌人附在了你身上,下次猜拳敌人必胜"<<endl;
dmindctrl=1;
}
if(l==2)cout<<"敌人附身失败"<<endl;
doldman=0;
dcheater=0;
system("pause");
goto AImod;
}
if(l==8)//毁灭飞弹
{
dpw=300;
if(dangry==1)dpw*=2;
if(doldman==1)dpw/=2;
if(dcheater==1)dpw/=2;
hp-=dpw;
doldman=0;
dcheater=0;
cout<<"敌人用一颗飞弹轰掉了你"<<dpw<<"滴血"<<endl;
if(dironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<dpw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(l==9)//极限治愈术
{
if(dx_maxrecharge==1)
{
dx_maxrecharge=0;
dhp=1000;
doldman=0;
dcheater=0;
cout<<"敌人给自己回满了血"<<endl;
dx_maxrecharge=0;
system("pause");
goto AImod;
}
cout<<"极限治愈术蓄能完成"<<endl;
dx_maxrecharge=1;
system("pause");
goto AImod;
}
if(l==10)//反转术
{
if(dx_change==1)
{
dx_change=0;
swap(hp,dhp);
doldman=0;
dcheater=0;
cout<<"敌人跟你的血量互换了"<<endl;
system("pause");
goto AImod;
}
cout<<"反转术蓄能完成"<<endl;
dx_change=1;
system("pause");
goto AImod;
}
if(l==11)//牛犇面
{
dpw=200;
if(dangry==1)dpw*=2;
if(doldman==1)dpw/=2;
if(dcheater==1)dpw/=2;
hp-=dpw;
cout<<"敌人给你扣了一碗牛犇面造成了"<<dpw<<"点伤害"<<endl;
if(dironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<dpw<<"滴血"<<endl;
}
dcawnoodles++;
doldman=0;
dcheater=0;
system("pause");
goto AImod;
}
if(l==12)//狂暴
{
doldman=0;
dcheater=0;
if(dx_angry==1)
{
dangry=1;
cout<<"敌人狂暴了,伤害翻倍"<<endl;
system("pause");
goto AImod;
}
cout<<"狂暴蓄能完成"<<endl;
dx_angry=1;
system("pause");
goto AImod;
}
if(l==13)//老头胡拉茬
{
doldman=1;
dcheater=0;
cout<<"敌人把你变成了伤害减半的老头,持续一回合"<<endl;
system("pause");
goto AImod;
}
if(l==14)//当老千
{
doldman=0;
dcheater=1;
cout<<"敌人让你因为出千而心存愧疚,伤害减半,持续一回合"<<endl;
system("pause");
goto AImod;
}
if(l==15)//初等毁灭之光
{
doldman=0;
dcheater=0;
if(dx_destorylight_c==5)
{
cout<<"敌人放出毁灭之光,毁灭了除敌人以外的一切"<<endl;
system("pause");
goto die;
}
dx_destorylight_c++;
if(dx_destorylight_c==5)
{
cout<<"初等毁灭之光蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"初等毁灭之光蓄能"<<dx_destorylight_c<<"/5次"<<endl;
system("pause");
goto AImod;
}
if(l==16)//封雷斩
{
dpw=300;
if(dangry==1)dpw*=2;
if(doldman==1)dpw/=2;
if(dcheater==1)dpw/=2;
hp-=dpw;
l=rand()%2+1;
if(l==1)
{
cout<<"敌人砍了你一刀造成了"<<dpw<<"点伤害,并成功封印了你"<<endl;
electricity=1;
doldman=0;
dcheater=0;
system("pause");
goto AImod;
}
cout<<"敌人砍了你一刀,但没封住你"<<endl;
doldman=0;
dcheater=0;
if(dironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(l==17)//死灵之术
{
doldman=0;
dcheater=0;
dghost++;
cout<<"敌人召唤了一只死灵"<<endl;
system("pause");
goto AImod;
}
if(l==18)//生化危机
{
doldman=0;
dcheater=0;
dzombie++;
cout<<"敌人召唤了一只丧尸"<<endl;
system("pause");
goto AImod;
}
if(l==19)//海纳百川
{
doldman=0;
dcheater=0;
dsea=1;
cout<<"敌人周身环绕着浩然正气,喃喃自语:“海纳百川,有容乃大,壁立千仞,无欲则刚!!!”"<<endl;
system("pause");
goto AImod;
}
if(l==20)//火锅诱惑
{
doldman=0;
dcheater=0;
firecircle=0;
ironline=0;
mindctrl=0;
cawnoodles=0;
angry=0;
oldman=0;
cheater=0;
electricity=0;
sea=0;
fruitice=0;
Greatwall=0;
reliver=0;
ghosttomb=0;
cout<<"敌人将你用火锅从各种加成中引了出来"<<endl;
system("pause");
goto AImod;
}
if(l==21)//果冻之海
{
doldman=0;
dcheater=0;
fruitice++;
cout<<"敌人将你泡在了"<<fruitice<<"层的果冻之海里"<<endl;
system("pause");
goto AImod;
}
if(l==22)//伟大的墙
{
doldman=0;
dcheater=0;
dGreatwall++;
cout<<"敌人建起了第"<<dGreatwall<<"层伟大的墙"<<endl;
system("pause");
goto AImod;
}
if(l==23)//中等毁灭之光
{
doldman=0;
dcheater=0;
if(dx_destorylight_b==4)
{
cout<<"敌人放出毁灭之光,毁灭了除敌人以外的一切"<<endl;
system("pause");
goto die;
}
dx_destorylight_b++;
if(dx_destorylight_a==4)
{
cout<<"中等毁灭之光蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"中等毁灭之光蓄能"<<dx_destorylight_b<<"/4次"<<endl;
system("pause");
goto AImod;
}
if(l==24)//战争商贩
{
doldman=0;
dcheater=0;
dseller++;
cout<<"敌人招来了一名战争商人,他会卖给敌人伤害"<<endl;
system("pause");
goto AImod;
}
if(l==25)//机关长枪
{
dpw=400;
if(dangry==1)dpw*=2;
if(doldman==1)dpw/=2;
if(dcheater==1)dpw/=2;
hp-=dpw;
doldman=0;
dcheater=0;
cout<<"敌人用一根长枪扎掉了你"<<dpw<<"滴血"<<endl;
if(ironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<dpw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
if(l==26)
{
doldman=0;
dcheater=0;
duseless++;
cout<<"下次你释放的技能将无效"<<endl;
system("pause");
goto AImod;
}
if(l==27)//完全毁灭之光
{
doldman=0;
dcheater=0;
if(dx_destorylight_a==3)
{
cout<<"敌人放出毁灭之光,毁灭了除敌人以外的一切"<<endl;
system("pause");
goto die;
}
dx_destorylight_a++;
if(dx_destorylight_a==3)
{
cout<<"完全毁灭之光蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"完全毁灭之光蓄能"<<dx_destorylight_a<<"/3次"<<endl;
system("pause");
goto AImod;
}
if(l==28)//逆天十全王八大补汤
{
doldman=0;
dcheater=0;
if(dx_turtlesoup==2)
{
dhp+=1000;
dx_turtlesoup=0;
cout<<"敌人喝下了逆天十全王八大补汤,回了1000滴血(无视血量上限)"<<endl;
system("pause");
goto AImod;
}
dx_turtlesoup++;
if(dx_turtlesoup==2)
{
cout<<"逆天十全王八大补汤蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"逆天十全王八大补汤蓄能"<<dx_turtlesoup<<"/2次"<<endl;
system("pause");
goto AImod;
}
if(l==29)//歌者入侵
{
doldman=0;
dcheater=0;
if(dx_singer==2)
{
dx_singer=0;
cout<<"敌人命令歌者发出二向箔,你被二维化"<<endl;
system("pause");
goto live;
}
dx_singer++;
if(dx_singer==2)
{
cout<<"二向箔蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"歌者入侵了你的文明"<<endl;
system("pause");
goto AImod;
}
if(l==30)//秽土转生
{
doldman=0;
dcheater=0;
dreliver++;
cout<<"敌人召唤了一名转生体"<<endl;
system("pause");
goto AImod;
}
if(l==31)//尸鬼封尽
{
doldman=0;
dcheater=0;
if(dx_gzkill==3)
{
cout<<"敌人放出尸鬼封尽,毁灭了你的灵魂"<<endl;
system("pause");
goto live;
}
dx_gzkill++;
if(dx_gzkill==3)
{
cout<<"尸鬼封尽蓄能完成"<<endl;
system("pause");
goto AImod;
}
cout<<"尸鬼封尽蓄能"<<dx_gzkill<<"/3次"<<endl;
system("pause");
goto AImod;
}
if(l==32)//圣灵墓地
{
doldman=0;
dcheater=0;
if(dghosttomb<1)
{
dghosttomb=1;
cout<<"敌人建起了圣灵墓地,它会不断派出亡灵"<<endl;
system("pause");
goto AImod;
}
cout<<"墓地已存在!"<<endl;
system("pause");
goto AImod;
}
if(l==33)//轮回斩
{
dpw=droundcut*100;
if(dangry==1)dpw*=2;
if(doldman==1)dpw/=2;
if(dcheater==1)dpw/=2;
dhp-=pw;
doldman=0;
dcheater=0;
cout<<"敌人释放了第"<<droundcut<<"层轮回斩打掉了你"<<dpw<<"滴血"<<endl;
droundcut++;
if(dironline==1)
{
dhp-=dpw;
cout<<"敌人被铁索勒掉了"<<dpw<<"滴血"<<endl;
}
system("pause");
goto AImod;
}
goto rand;
}
goto rand;
}
}
if(m==2)
{
if(tz==1||tz==2)
{
dhp=99999;
atk=0;
tzmod:system("cls");
r++;
if(r>=10&&tz==1||hp<=0&&tz==2)goto over;
cout<<"第"<<r<<"回合"<<endl;
cout<<"敌人血量:"<<dhp<<endl;
cout<<"你的血量:"<<hp<<endl;
if(tz==2)
{
hp-=250;
cout<<"敌人对你造成了250点真实伤害"<<endl;
}
system("pause");
winnn:system("cls");
cout<<"选择一个已学习的技能来释放:"<<endl;
cout<<"1.普攻"<<endl;
cout<<"2.治愈术"<<endl;
cout<<"3.解印术"<<endl;
cout<<"4.火圈"<<endl;
cout<<"5.铁索连环"<<endl;
cout<<"6.火球术"<<endl;
cout<<"7.附身"<<endl;
cout<<"8.毁灭飞弹"<<endl;
cout<<"9.极限治愈术"<<endl;
cout<<"10.反转术"<<endl;
cout<<"11.牛犇面"<<endl;
cout<<"12.狂暴"<<endl;
cout<<"13.老头胡拉茬"<<endl;
cout<<"14.当老千"<<endl;
cout<<"15.初等毁灭之光"<<endl;
cout<<"16.封雷斩"<<endl;
cout<<"17.死灵之术"<<endl;
cout<<"18.生化危机"<<endl;
cout<<"19.海纳百川"<<endl;
cout<<"20.火锅诱惑"<<endl;
cout<<"21.果冻之海"<<endl;
cout<<"22.伟大的墙"<<endl;
cout<<"23.中等毁灭之光"<<endl;
cout<<"24.战争商贩"<<endl;
cout<<"25.机关长枪"<<endl;
cout<<"26.无效化"<<endl;
cout<<"27.完全毁灭之光"<<endl;
cout<<"28.逆天十全王八大补汤"<<endl;
cout<<"29.歌者入侵"<<endl;
cout<<"30.秽土转生"<<endl;
cout<<"31.尸鬼封尽"<<endl;
cout<<"32.圣灵墓地"<<endl;
cout<<"33.轮回斩"<<endl;
if(GFS==1)cout<<"34.水漫金山"<<endl;
if(GFS==2)cout<<"34.星火燎原"<<endl;
if(GFS==3)cout<<"34.荆棘之触"<<endl;
cin>>q;
if(ji[q]==1||q==34)goto poww;
goto winnn;
poww:if(q==1)//普攻
{
if(angry==1)pg*=2;
if(oldman==1)pg/=2;
if(cheater==1)pg/=2;
oldman=0;
cheater=0;
dhp-=pg;
atk+=pg;
cout<<"你打了敌人一拳造成了"<<pg<<"点伤害"<<endl;
if(ironline==1)
{
hp-=pg;
cout<<"你被铁索勒掉了"<<pg<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
if(q==2)//治愈术
{
hp+=100;
oldman=0;
cheater=0;
cout<<"你给自己回了100滴血"<<endl;
system("pause");
goto tzmod;
}
if(q==3)//解印术
{
oldman=0;
cheater=0;
if(firecircle==1)
{
firecircle=0;
jie=4;
}
if(ironline==1)
{
ironline=0;
jie=5;
}
out33:cout<<"你解除了你身上的";
if(jie==4)cout<<"火圈"<<endl;
if(jie==5)cout<<"铁索"<<endl;
system("pause");
goto tzmod;
}
if(q==4)//火圈
{
pw=100;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
cout<<"你给敌人套了一个会持续造成伤害的火圈(挑战模式中无效)";
if(dfirecircle==1)cout<<"(已存在,本次只造成伤害)";
cout<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
dfirecircle=1;
oldman=0;
cheater=0;
system("pause");
goto tzmod;
}
if(q==5)//铁索连环
{
oldman=0;
cheater=0;
if(dironline<1)
{
dironline=1;
cout<<"你给敌人套了一层会自动反噬伤害的铁索"<<endl;
system("pause");
goto tzmod;
}
cout<<"铁索已存在!"<<endl;
system("pause");
goto tzmod;
}
if(q==6)//火球术
{
pw=200;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
oldman=0;
cheater=0;
cout<<"你用一个火球轰掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
if(q==7)//附身
{
q=rand()%2+1;
if(q==1)
{
cout<<"你附在了敌人身上,下次猜拳你必胜"<<endl;
mindctrl=1;
}
if(q==2)cout<<"附身失败"<<endl;
oldman=0;
cheater=0;
system("pause");
goto tzmod;
}
if(q==8)//毁灭飞弹
{
pw=300;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
oldman=0;
cheater=0;
cout<<"你用一颗飞弹轰掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
if(q==9)//极限治愈术
{
if(x_maxrecharge==1)
{
x_maxrecharge=0;
hp=1000;
oldman=0;
cheater=0;
cout<<"你给自己回满了血"<<endl;
x_maxrecharge=0;
system("pause");
goto tzmod;
}
cout<<"极限治愈术蓄能完成"<<endl;
x_maxrecharge=1;
system("pause");
goto tzmod;
}
if(q==10)//反转术
{
if(x_change==1)
{
x_change=0;
swap(hp,dhp);
oldman=0;
cheater=0;
cout<<"你跟敌人的血量互换了"<<endl;
system("pause");
goto tzmod;
}
cout<<"反转术蓄能完成"<<endl;
x_change=1;
system("pause");
goto tzmod;
}
if(q==11)//牛犇面
{
pw=200;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
cout<<"你给敌人扣了一碗牛犇面"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
dcawnoodles++;
oldman=0;
cheater=0;
system("pause");
goto tzmod;
}
if(q==12)//狂暴
{
oldman=0;
cheater=0;
if(x_angry==1)
{
angry=1;
cout<<"你狂暴了,伤害翻倍"<<endl;
system("pause");
goto tzmod;
}
cout<<"狂暴蓄能完成"<<endl;
x_angry=1;
system("pause");
goto tzmod;
}
if(q==13)//老头胡拉茬
{
oldman=1;
cheater=0;
cout<<"你把敌人变成了伤害减半的老头,持续一回合"<<endl;
system("pause");
goto tzmod;
}
if(q==14)//当老千
{
oldman=0;
cheater=1;
cout<<"你让敌人因为出千而心存愧疚,伤害减半,持续一回合"<<endl;
system("pause");
goto tzmod;
}
if(q==15)//初等毁灭之光
{
oldman=0;
cheater=0;
if(x_destorylight_c==5)
{
cout<<"你放出毁灭之光,毁灭了除你以外的一切"<<endl;
system("pause");
goto over;
}
x_destorylight_c++;
if(x_destorylight_c==5)
{
cout<<"初等毁灭之光蓄能完成"<<endl;
system("pause");
goto tzmod;
}
cout<<"初等毁灭之光蓄能"<<x_destorylight_c<<"/5次"<<endl;
system("pause");
goto tzmod;
}
if(q==16)//封雷斩
{
pw=300;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
q=rand()%2+1;
if(q==1)
{
cout<<"你砍了敌人一刀,并成功封印了他"<<endl;
delectricity=1;
oldman=0;
cheater=0;
system("pause");
goto tzmod;
}
cout<<"你砍了敌人一刀,但没封住他"<<endl;
oldman=0;
cheater=0;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
if(q==17)//死灵之术
{
oldman=0;
cheater=0;
ghost++;
cout<<"你召唤了一只死灵"<<endl;
system("pause");
goto tzmod;
}
if(q==18)//生化危机
{
oldman=0;
cheater=0;
zombie++;
cout<<"你召唤了一只丧尸"<<endl;
system("pause");
goto tzmod;
}
if(q==19)//海纳百川
{
oldman=0;
cheater=0;
sea=1;
cout<<"你周身环绕着浩然正气,喃喃自语:“海纳百川,有容乃大,壁立千仞,无欲则刚!!!”"<<endl;
system("pause");
goto tzmod;
}
if(q==20)//火锅诱惑
{
cout<<"你将敌人用火锅从各种加成中引了出来"<<endl;
system("pause");
goto tzmod;
}
if(q==21)//果冻之海
{
oldman=0;
cheater=0;
dfruitice++;
cout<<"你将敌人泡在了"<<dfruitice<<"层的果冻之海里"<<endl;
system("pause");
goto tzmod;
}
if(q==22)//伟大的墙
{
oldman=0;
cheater=0;
dGreatwall++;
cout<<"你建起了第"<<Greatwall<<"层伟大的墙"<<endl;
system("pause");
goto tzmod;
}
if(q==23)//中等毁灭之光
{
oldman=0;
cheater=0;
if(x_destorylight_b==4)
{
cout<<"你放出毁灭之光,毁灭了除你以外的一切"<<endl;
system("pause");
goto over;
}
x_destorylight_b++;
if(x_destorylight_a==4)
{
cout<<"中等毁灭之光蓄能完成"<<endl;
system("pause");
goto tzmod;
}
cout<<"中等毁灭之光蓄能"<<x_destorylight_b<<"/4次"<<endl;
system("pause");
goto tzmod;
}
if(q==24)//战争商贩
{
oldman=0;
cheater=0;
seller++;
cout<<"你招来了一名战争商人,他会卖给你伤害"<<endl;
system("pause");
goto tzmod;
}
if(q==25)//机关长枪
{
pw=400;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
oldman=0;
cheater=0;
cout<<"你用一根长枪扎掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
if(q==26)
{
oldman=0;
cheater=0;
duseless++;
cout<<"下次敌人释放的技能将无效"<<endl;
system("pause");
goto tzmod;
}
if(q==27)//完全毁灭之光
{
oldman=0;
cheater=0;
if(x_destorylight_a==3)
{
cout<<"你放出毁灭之光,毁灭了除你以外的一切"<<endl;
system("pause");
goto over;
}
x_destorylight_a++;
if(x_destorylight_a==3)
{
cout<<"完全毁灭之光蓄能完成"<<endl;
system("pause");
goto tzmod;
}
cout<<"完全毁灭之光蓄能"<<x_destorylight_a<<"/3次"<<endl;
system("pause");
goto tzmod;
}
if(q==28)//逆天十全王八大补汤
{
oldman=0;
cheater=0;
if(x_turtlesoup==2)
{
hp+=1000;
x_turtlesoup=0;
cout<<"你喝下了逆天十全王八大补汤,回了1000滴血(无视血量上限)"<<endl;
system("pause");
goto tzmod;
}
x_turtlesoup++;
if(x_turtlesoup==2)
{
cout<<"逆天十全王八大补汤蓄能完成"<<endl;
system("pause");
goto tzmod;
}
cout<<"逆天十全王八大补汤蓄能"<<x_turtlesoup<<"/2次"<<endl;
system("pause");
goto tzmod;
}
if(q==29)//歌者入侵
{
oldman=0;
cheater=0;
if(x_singer==2)
{
x_singer=0;
cout<<"你命令歌者发出二向箔,敌人被二维化"<<endl;
system("pause");
goto over;
}
x_singer++;
if(x_singer==2)
{
cout<<"二向箔蓄能完成"<<endl;
system("pause");
goto tzmod;
}
cout<<"歌者入侵了敌人的文明"<<endl;
system("pause");
goto tzmod;
}
if(q==30)//秽土转生
{
oldman=0;
cheater=0;
reliver++;
cout<<"你召唤了一名转生体"<<endl;
system("pause");
goto tzmod;
}
if(q==31)//尸鬼封尽
{
oldman=0;
cheater=0;
if(x_gzkill==3)
{
cout<<"你放出尸鬼封尽,毁灭了敌人的灵魂"<<endl;
system("pause");
goto over;
}
x_gzkill++;
if(x_gzkill==3)
{
cout<<"尸鬼封尽蓄能完成"<<endl;
system("pause");
goto tzmod;
}
cout<<"尸鬼封尽蓄能"<<x_gzkill<<"/3次"<<endl;
system("pause");
goto tzmod;
}
if(q==32)//圣灵墓地
{
oldman=0;
cheater=0;
if(ghosttomb<1)
{
ghosttomb=1;
cout<<"你建起了圣灵墓地,它会不断派出亡灵"<<endl;
system("pause");
goto tzmod;
}
cout<<"墓地已存在!"<<endl;
system("pause");
goto tzmod;
}
if(q==33)
{
pw=roundcut*100;
if(angry==1)pw*=2;
if(oldman==1)pw/=2;
if(cheater==1)pw/=2;
dhp-=pw;
atk+=pw;
oldman=0;
cheater=0;
cout<<"你释放了第"<<roundcut<<"层轮回斩打掉了敌人"<<pw<<"滴血"<<endl;
roundcut++;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
if(q==34)
{
pw=100*wake;
dhp-=pw;
atk+=pw;
oldman=0;
cheater=0;
cout<<"你用自己的天赋技能打掉了敌人"<<pw<<"滴血"<<endl;
if(ironline==1)
{
hp-=pw;
cout<<"你被铁索勒掉了"<<pw<<"滴血"<<endl;
}
system("pause");
goto tzmod;
}
goto tzmod;
}
goto tzmod;
}
goto tzmod;
if(m==3)
{
zneed=300*story;
cause=0;
if(story==1)
{
cout<<"1.1祖上大业独苗相传,连年战火生于忧患"<<endl;
cout<<"需要战斗力"<<zneed<<endl;
if(zl<zneed)
{
cause=1;
goto cant;
}
cout<<"战斗力足够!"<<endl;
system("pause");
system("cls");
cout<<"你出生在一个陌生的大陆上,一个帝国统治着这里,你的家族是这个帝国的军事世家,在皇帝的命令下南征北战"<<endl;
Sleep(1000);
cout<<"这天你的父亲对年少的你说他要奉陛下之命外出征战"<<endl;
Sleep(1000);
cout<<"手无缚鸡之力的你眼睁睁地看着父亲走出了家"<<endl;
Sleep(1000);
cout<<"你好不容易忍住了泪水走回了房间"<<endl;
Sleep(1000);
cout<<"没想到这一次是生离死别"<<endl;
Sleep(1000);
system("pause");
c++;
story++;
goto play;
}
if(story==2)
{
cout<<"1.2壮志凌云参军作战,战死沙场为国贡献"<<endl;
cout<<"需要战斗力"<<zneed<<endl;
if(zl<zneed)
{
cause=1;
goto cant;
}
cout<<"战斗力足够!"<<endl;
system("pause");
system("cls");
cout<<"你和你的母亲在家望眼欲穿"<<endl;
Sleep(1000);
cout<<"但不久后却从前线传来了父亲阵亡的消息"<<endl;
Sleep(1000);
cout<<"听人说他最后的话是嘱咐你要将家业发扬光大"<<endl;
Sleep(1000);
cout<<"你和母亲守丧三年,这时你刚好十八岁"<<endl;
Sleep(1000);
cout<<"你和母亲开始重操家业"<<endl;
Sleep(1000);
system("pause");
c++;
story++;
goto play;
}
cant:system("cls");
if(cause==1)cout<<"战斗力不足!"<<endl;
else cout<<"后续剧情敬请期待!"<<endl;
system("pause");
goto play;
}
over:system("cls");
if(tz==1)
{
cout<<"你打掉了敌人"<<atk<<"滴血获得了"<<atk/100<<"张初级券"<<endl;
c+=atk/100;
}
if(tz==2)
{
cout<<"你撑了"<<r<<"回合获得了"<<r<<"张初级券"<<endl;
c+=r;
}
system("pause");
goto play;
die:system("cls");
cout<<"输了!"<<endl<<"获得初级券*1(敌人获得中级券*1)"<<endl;
c++;
db++;
if(d==1&&lv>=2)
{
lv--;
cout<<"段位下降!"<<endl;
}
if(e==1)
{
cout<<"押错了,赌注清零!"<<endl;
c=c+2*b+4*a+8*s+16*ss;
c-=du;
if(c>=2)
{
p=c%2;
c-=p;
c/=2;
b+=c;
c=p;
}
if(b>=2)
{
p=b%2;
b-=p;
b/=2;
a+=b;
b=p;
}
if(a>=2)
{
p=a%2;
a-=p;
a/=2;
s+=a;
a=p;
}
if(s>=2)
{
p=s%2;
s-=p;
s/=2;
ss+=s;
s=p;
}
}
lose++;
cout<<"这是你"<<lose<<"次失败"<<endl;
cout<<"没关系,我相信你不会放弃!"<<endl;
for(int i=1;i++;)
{
if(dji[i]==0)
{
if(i>=4&&i<=5&&c>=1)
{
dc--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=6&&i<=13&&b>=1)
{
db--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=14&&i<=21&&a>=1)
{
da--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=22&&i<=24&&s>=1)
{
ds--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=25&&i<=30&&ss>=1)
{
dss--;
dji[i]=1;
u++;
system("pause");
goto play;
}
}
}
system("pause");
goto play;
live:system("cls");
cout<<"赢了!"<<endl<<"获得中级券*1(敌人获得初级券*1)"<<endl;
b++;
dc++;
if(d==1)
{
lv++;
cout<<"段位上升!"<<endl;
}
if(e==1)
{
cout<<"押中了,赌注翻倍!"<<endl;
c=c+2*b+4*a+8*s+16*ss;
c+=du;
if(c>=2)
{
p=c%2;
c-=p;
c/=2;
b+=c;
c=p;
}
if(b>=2)
{
p=b%2;
b-=p;
b/=2;
a+=b;
b=p;
}
if(a>=2)
{
p=a%2;
a-=p;
a/=2;
s+=a;
a=p;
}
if(s>=2)
{
p=s%2;
s-=p;
s/=2;
ss+=s;
s=p;
}
}
win++;
cout<<"这是你第"<<win<<"次胜利!"<<endl;
if(win==1)
{
cout<<"当年,我们还都是小学生"<<endl;
Sleep(1000);
cout<<"正处在懵懂无知的年龄"<<endl;
Sleep(1000);
cout<<"却在现在看来似乎很幼稚的“小刀一把”游戏中相识相知"<<endl;
Sleep(1000);
cout<<"不经意间定下了一直维持到现在的缘分"<<endl;
}
if(win==2)
{
cout<<"Z当时在我们中学习最好,人缘也好"<<endl;
Sleep(1000);
cout<<"G有点小腹黑,但也开朗善良"<<endl;
Sleep(1000);
cout<<"S“见多识广”,总是充当了我们的搞笑担当"<<endl;
Sleep(1000);
cout<<"我比较平凡,最大的优点可能就是善于交往……"<<endl;
}
if(win==4)
{
cout<<"这个游戏一开始是个口头游戏(声控游戏,S语)"<<endl;
Sleep(1000);
cout<<"可以说它承载着我们从小学五年级到现在的回忆"<<endl;
Sleep(1000);
cout<<"当时我们已经很好了,还自称“铁四角”"<<endl;
Sleep(1000);
cout<<"那个同名微信群现在还沉寂在我妈的手机里"<<endl;
}
if(win==7)
{
cout<<"时光荏苒,不久后我们小升初了"<<endl;
Sleep(1000);
cout<<"各自奔前程的身影,匆匆渐行渐远"<<endl;
Sleep(1000);
cout<<"原学校附属中学只留下了我和S"<<endl;
Sleep(1000);
cout<<"只有假期或升学,我们铁四角才能聚一聚"<<endl;
}
if(win==10)
{
cout<<"我接触了C++编程,萌生了把它变成真正游戏的念头"<<endl;
Sleep(1000);
cout<<"一开始我提出了这个想法,初中同学没一个支持我的,"<<endl;
Sleep(1000);
cout<<"老师还差点给我停课(他规定不能编写游戏代码)"<<endl;
Sleep(1000);
cout<<"但我默默地把这个想法埋在了心里"<<endl;
}
if(win==15)
{
cout<<"为了编写成功,我开始奋力弥补因“颓废”落下的编程课"<<endl;
Sleep(1000);
cout<<"无数个日夜,左手面包右手鼠标奋战在机房"<<endl;
Sleep(1000);
cout<<"为了它,我还做了几个游戏练手"<<endl;
Sleep(1000);
cout<<"我感觉我在不断地接近梦想"<<endl;
}
if(win==20)
{
cout<<"我在发布的半年前在OJ上筹备,之后销声匿迹了半年"<<endl;
Sleep(1000);
cout<<"导致不少人都以为这游戏烂尾了"<<endl;
Sleep(1000);
cout<<"但只有我知道,我不可能放弃它,不可能放弃我的回忆与羁绊"<<endl;
Sleep(1000);
cout<<"结果大家有目共睹,我成功了"<<endl;
}
if(win==21)
{
cout<<"如果你是连胜,到现在都超神了吧"<<endl;
Sleep(1000);
cout<<"应该已经看开了很多"<<endl;
Sleep(1000);
cout<<"那么,我告诉你一个秘密:"<<endl;
Sleep(1000);
cout<<"26,代表Z,"<<endl;
Sleep(1000);
cout<<"19,代表我"<<endl;
Sleep(1000);
cout<<"7,代表G"<<endl;
Sleep(1000);
cout<<"又一个19,代表S"<<endl;
Sleep(1000);
cout<<"连在一起,就能在主界面开启上帝模式"<<endl;
Sleep(1000);
cout<<"祝您游戏愉快,方便的话,在http://noi.openjudge.cn/topic/111677/留个言,"<<endl;
Sleep(1000);
cout<<"愿我们的友谊都能长存"<<endl;
}
if(win>=22)cout<<"愿我们的友谊都能长存"<<endl;
for(int i=1;i++;)
{
if(dji[i]==0)
{
if(i>=4&&i<=5&&c>=1)
{
dc--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=6&&i<=13&&b>=1)
{
db--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=14&&i<=21&&a>=1)
{
da--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=22&&i<=24&&s>=1)
{
ds--;
dji[i]=1;
u++;
system("pause");
goto play;
}
if(i>=25&&i<=30&&ss>=1)
{
dss--;
dji[i]=1;
u++;
system("pause");
goto play;
}
}
}
system("pause");
goto play;
buy:cin>>q;
if(q==1)
{
if(c>=1&&www>=4&&www<=6)
{
c--;
ji[www]=1;
goto play;
}
if(b>=1&&www>=4&&www<=14)
{
b--;
if(www>=3&&www<=5)c++;
ji[www]=1;
goto play;
}
if(a>=1&&www>=3&&www<=22)
{
a--;
if(www>=3&&www<=13)b++;
if(www>=3&&www<=5)c++;
ji[www]=1;
goto play;
}
if(s>=1&&www>=3&&www<=26)
{
s--;
if(www>=3&&www<=21)a++;
if(www>=3&&www<=13)b++;
if(www>=3&&www<=5)c++;
ji[www]=1;
goto play;
}
if(ss>=1&&www>=3&&www<=33)
{
ss--;
if(www>=3&&www<=24)s++;
if(www>=3&&www<=21)a++;
if(www>=3&&www<=13)b++;
if(www>=3&&www<=5)c++;
ji[www]=1;
goto play;
}
}
goto skill;
make:if(c>=2)
{
p=c%2;
c-=p;
c/=2;
b+=c;
c=p;
}
if(b>=2)
{
p=b%2;
b-=p;
b/=2;
a+=b;
b=p;
}
if(a>=2)
{
p=a%2;
a-=p;
a/=2;
s+=a;
a=p;
}
if(s>=2)
{
p=s%2;
s-=p;
s/=2;
ss+=s;
s=p;
}
if(dc>=2)
{
p=dc%2;
dc-=p;
dc/=2;
db+=dc;
dc=p;
}
if(db>=2)
{
p=db%2;
db-=p;
db/=2;
da+=db;
db=p;
}
if(da>=2)
{
p=da%2;
da-=p;
da/=2;
ds+=da;
da=p;
}
if(ds>=2)
{
p=ds%2;
ds-=p;
ds/=2;
dss+=ds;
ds=p;
}
goto play;
}
/*
自带:普攻,治愈术,解印术
初级:火圈,铁索连环,火球术
中级:附身,毁灭飞弹,极限治愈术,反转术,牛犇面,狂暴,老头胡拉茬,当老千
高级:初等毁灭之光,封雷斩,死灵之术,生化危机,海纳百川,火锅诱惑,果冻之海,伟大的墙
特级:中等毁灭之光,战争商贩,机关长枪,无效化
神级:完全毁灭之光,逆天十全王八大补汤,歌者入侵,秽土转生,尸鬼封尽,圣灵墓地,轮回斩
*/
神域
//转自:https://vijos.org/discuss/5d65f1e8f413620440abf452#1612701914
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <windows.h>
#include <ctime>
#include<fstream>
#include <conio.h>
#define n 20
using namespace std;
//函数定义
void sc(int color);
void fileout();
void print(const char a[],int b);
void Initialize();
void gotoxy(int x,int y);
void cursor(bool a);
void shop(int c);
void warout(int xx,int yy);
void war(int c);
void game();
bool issame(string x);
bool charsame(char a[105],char b[105],int blen);
int canfind(int len);
bool login_register();
void enter();
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//存档系统
struct users{
char name[105];int namelen;
char password[105];int passwordlen;
int gold,h,u;
}user[100005];
int usertot,nowuser;
void fileout(){
freopen("game.txt","w",stdout);
cout<<usertot<<endl;
for (int i=1;i<=usertot;i++)cout<<user[i].name<<' '<<user[i].namelen<<' '<<user[i].password<<' '<<user[i].passwordlen<<' '<<user[i].gold<<' '<<user[i].h<<' '<<user[i].u<<endl;
exit(0);
}
//存档系统
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//工具程序
void sc(int color){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
return;
}
void print(const char a[],int b){
int s=strlen(a);
for(int i=0;i<s;i++){
printf("%c",a[i]);
Sleep(b);
}
}
void Initialize(){
system("color f0");
RECT rect;
HWND hwnd=GetForegroundWindow();
GetWindowRect(hwnd,&rect);
MoveWindow(hwnd,0,0,rect.right-rect.left,rect.bottom-rect.top,TRUE);
system("mode con cols=90 lines=30");
}
void gotoxy(int x,int y){
COORD pos;
pos.X=2*x;
pos.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void cursor(bool a){
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);
CursorInfo.bVisible = a;
SetConsoleCursorInfo(handle, &CursorInfo);
}
//工具程序
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//神之商城
void shop(int c){
system("cls");
cout<<"剩余金币:"<<user[c].gold<<endl;
cout<<"按H购买武器"<<endl;
cout<<"按U购买技能"<<endl;
char x;
x=getch();
if (x!='H'&&x!='U'){cout<<"操作失败!"<<endl;Sleep(500);return;}
if (x=='H'){
cout<<endl<<"请输入武器编号购买武器"<<endl;
cout<<"1 神之剑 花费0金币"<<endl;
cout<<"2 激光枪 花费200金币" <<endl;
cout<<"3 激光炮 花费400金币"<<endl;
cout<<"4 概率枪 花费1500金币"<<endl;
cout<<"5 电之弓 花费1000金币"<<endl;
int cost[105]={0,0,200,400,1500,1000};
char s=getch();
if (s<'1'||s>'5'){cout<<"操作失败"<<endl;Sleep(500);return;}
if ((user[c].h&(1<<s-1-48))||(user[c].gold<cost[s-48])){cout<<"操作失败!"<<endl;Sleep(500);return;}
user[c].h|=(1<<s-1-48),user[c].gold-=cost[s-48];
cout<<"购买成功!"<<endl;
Sleep(500);
}
if (x=='U'){
cout<<endl<<"请输入技能编号购买技能"<<endl;
cout<<"1 箭雨 花费0金币"<<endl;
cout<<"2 生命法阵 花费600金币" <<endl;
cout<<"3 法术传送 花费800金币"<<endl;
cout<<"4 突刺 花费600金币"<<endl;
cout<<"5 时空跃迁 花费1000金币"<<endl;
int cost[105]={0,0,600,800,600,1000};
char s=getch();
if (s<'1'||s>'5'){cout<<"操作失败!"<<endl;Sleep(500);return;}
if ((user[c].u&(1<<s-1-48))||(user[c].gold<cost[s-48])){cout<<"操作失败!"<<endl;Sleep(500);return;}
user[c].u|=1<<(s-1-48),user[c].gold-=cost[s-48];
cout<<"购买成功!"<<endl;
Sleep(500);
}
return;
}
//神之商城
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//神域战争
struct warmap{
int a,b,hp;
}mp[30][30];
int ccc[30][30];
void warout(int xx,int yy){
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++){
if (ccc[i][j]){
cout<<'@';
}
else{
if (mp[i][j].b){
cout<<mp[i][j].hp;
}
else if(i!=xx||j!=yy)cout<<'.';
else{
cout<<"#";
}
}
}
cout<<endl;
}
Sleep(700);
return;
}
void war(int c){
int book[30][30];
int cd[105]={0,10,30,5,8,10};
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
mp[i][j].a=mp[i][j].b=0;
srand((unsigned)time(NULL));
char hc,uc;
if (user[c].h==0||user[c].u==0){
system("cls");
cout<<"请先购买武器和技能"<<endl;
Sleep(500);
return;
}
system("cls");
int sss=user[c].h;
cout<<"请输入编号选择武器"<<endl;
if (sss&1)cout<<"1 神之剑"<<endl;
if (sss&2)cout<<"2 激光枪"<<endl;
if (sss&4)cout<<"3 激光炮"<<endl;
if (sss&8)cout<<"4 概率枪"<<endl;
if (sss&16)cout<<"5 电之弓"<<endl;
hc=getch();
if (hc<'1'||hc>'5'||(!(sss&(1<<(hc-48-1))))){
system("cls");
cout<<"操作失败!"<<hc-48-1<<endl;
Sleep(500);
return;
}
else cout<<"选择成功!"<<endl;
Sleep(500);
hc-=48;
system("cls");
sss=user[c].u;
cout<<"请输入编号选择技能"<<endl;
if (sss&1)cout<<"1 箭雨"<<endl;
if (sss&2)cout<<"2 生命法阵"<<endl;
if (sss&4)cout<<"3 法术传送"<<endl;
if (sss&8)cout<<"4 突刺"<<endl;
if (sss&16)cout<<"5 时空跃迁"<<endl;
uc=getch();
if (uc<'1'||uc>'5'||(!(sss&(1<<(uc-1-48))))){
system("cls");
cout<<"操作失败!"<<endl;
Sleep(500);
return;
}
else cout<<"选择成功!"<<endl;
uc-=48;
Sleep(500);
int hp=5;
int xx=1+rand()%n;
int yy=1+rand()%n;
int ucd=cd[uc],gold=0;
int cnt=0,kill=0,killl;
int lx=xx,ly=yy,last=0;
while(1){
if (cnt==200){
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
cout<<'!';
cout<<endl;
}
Sleep(1500);
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
mp[i][j].b=0;
}
cout<<"通关了!"<<endl;
user[c].gold+=1000;
cout<<"获得1000金币!"<<endl;
Sleep(3000);
return;
}
for (int i=4;i;i--)
if (rand()%i){
int x=1+rand()%n;
int y=1+rand()%n;
if (mp[x][y].b==0&&(x!=xx||y!=yy)){
mp[x][y].b=1;
mp[x][y].hp=1+rand()%9;
}
}
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
if (mp[i][j].b){
cout<<mp[i][j].hp;
}
else if(i!=xx||j!=yy)cout<<'.';
else{
cout<<"#";
}
cout<<endl;
}
Sleep(500);
if (hp<=0){
system("cls");
cout<<"神失败了!"<<endl;
cout<<"共进行"<<cnt<<"回合"<<endl;
cout<<"共获得"<<gold<<"金币"<<endl;
cout<<"共击杀"<<killl<<"敌人"<<endl;
user[c].gold+=gold;
Sleep(2000);
return;
}
cout<<"当前生命值:"<<hp<<endl;
cout<<"当前能量值:"<<kill<<endl;
cout<<"当前回合数:"<<cnt<<endl;
cout<<"移动请输入W或A或S或D"<<endl;
cout<<"技能请输入U 当前CD:"<<ucd<<endl;
cout<<"攻击请输入I或J或K或L"<<endl;
cout<<"消耗40能量值回复生命请输入H"<<endl;
cout<<"消耗100能量值清除所有敌人请输入C"<<endl;
cout<<"退出游戏请输入B"<<endl;
char cc=getch();
if (cc=='B'){
system("cls");
cout<<"共获得"<<gold<<"金币"<<endl;
user[c].gold+=gold;
Sleep(500);
return;
}
if (cc=='H'&&kill>=40){
kill-=40;
hp=5;
cout<<"回复成功!"<<endl;
}
if (cc=='C'&&kill>=100){
kill-=100;
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
if (mp[i][j].b)cout<<mp[i][j].hp;
else if(i!=xx||j!=yy)cout<<'.';
else cout<<"#";
cout<<endl;
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
mp[i][j].b=0;
Sleep(500);
}
if (cc=='W'&&xx>1&&mp[xx-1][yy].b==0)xx--;
if (cc=='A'&&yy>1&&mp[xx][yy-1].b==0)yy--;
if (cc=='S'&&xx<n&&mp[xx+1][yy].b==0)xx++;
if (cc=='D'&&yy<n&&mp[xx][yy+1].b==0)yy++;
if (cc=='U'&&ucd==0&&uc==1){
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
if (mp[i][j].b)cout<<mp[i][j].hp;
else if(i!=xx||j!=yy)cout<<'.';
else cout<<"#";
cout<<endl;
}
Sleep(500);
ucd=cd[uc]+1;
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++){
if (mp[i][j].b){
mp[i][j].hp-=2;
if (mp[i][j].hp<=0)mp[i][j].b=0,gold+=rand()%3,kill++,killl++;
}
}
}
if (cc=='U'&&ucd==0&&uc==2){
hp=5;
ucd=cd[uc]+1;
}
if (cc=='U'&&ucd==0&&uc==3){
int nx=1+rand()%n,ny=1+rand()%n;
while(mp[nx][ny].b)nx=1+rand()%n,ny=1+rand()%n;
xx=nx,yy=ny;
ucd=cd[uc]+1;
}
if (cc=='U'&&ucd==0&&uc==4){
cout<<"请选择突刺方向,输入I或J或K或L"<<endl;
char inc;
inc=getch();
if (inc!='I'&&inc!='J'&&inc!='K'&&inc!='L'){
cout<<"操作失败!"<<endl;
Sleep(500);
}
int nnx=xx,nny=yy;
if (inc=='I'){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=3&&xx>i;i++){
ccc[xx-i][yy]=1;
if (mp[xx-i][yy].b)gold+=rand()%3,kill++,killl++;
mp[xx-i][yy].b=0;
}
xx=max(xx-3,1);
}
if (inc=='J'){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=3&&yy>i;i++){
ccc[xx][yy-i]=1;
if (mp[xx][yy-i].b)gold+=rand()%3,kill++,killl++;
mp[xx][yy-i].b=0;
}
yy=max(yy-3,1);
}
if (inc=='K'){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=3&&xx+i<=n;i++){
ccc[xx+i][yy]=1;
if (mp[xx+i][yy].b)gold+=rand()%3,kill++,killl++;
mp[xx+i][yy].b=0;
}
xx=min(xx+3,n);
}
if (inc=='L'){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=3&&yy+i<=n;i++){
ccc[xx][yy+i]=1;
if (mp[xx][yy+i].b)gold+=rand()%3,kill++,killl++;
mp[xx][yy+i].b=0;
}
yy=min(yy+3,n);
}
ccc[nnx][nny]=1;
warout(nnx,nny);
ucd=cd[uc]+1;
}
if (cc=='U'&&ucd==0&&uc==5){
cout<<"请选择移动方向,输入I或J或K或L"<<endl;
char inc;
inc=getch();
if (inc=='I')xx=1;
if (inc=='J')yy=1;
if (inc=='K')xx=n;
if (inc=='L')yy=n;
ucd=cd[uc]+1;
mp[xx][yy].b=0;
}
if (cc=='I'||cc=='J'||cc=='K'||cc=='L'){
memset(ccc,0,sizeof(ccc));
if (hc==1&&cc=='I'){
if (xx>1)ccc[xx-1][yy]=1;
if (xx>2)ccc[xx-2][yy]=1;
warout(xx,yy);
if (xx>1&&mp[xx-1][yy].b){
if (!mp[xx-1][yy].b)continue;
mp[xx-1][yy].hp-=8;
if (mp[xx-1][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx-1][yy].b=0;
}
if (xx>2&&mp[xx-2][yy].b){
if (!mp[xx-2][yy].b)continue;
mp[xx-2][yy].hp-=8;
if (mp[xx-2][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx-2][yy].b=0;
}
}
if (hc==1&&cc=='J'){
if (yy>1)ccc[xx][yy-1]=1;
if (yy>2)ccc[xx][yy-2]=1;
warout(xx,yy);
if (yy>1&&mp[xx][yy-1].b){
if (mp[xx][yy-1].b)mp[xx][yy-1].hp-=8;
if (mp[xx][yy-1].b&&mp[xx][yy-1].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][yy-1].b=0;
}
if (yy>2&&mp[xx][yy-2].b){
if (mp[xx][yy-2].b)mp[xx][yy-2].hp-=8;
if (mp[xx][yy-2].hp<=0&&mp[xx][yy-2].b)gold+=rand()%3,kill++,killl++,mp[xx][yy-2].b=0;
}
}
if (hc==1&&cc=='K'){
if (xx+1<=n)ccc[xx+1][yy]=1;
if (xx+2<=n)ccc[xx+2][yy]=1;
warout(xx,yy);
if (xx+1<=n&&mp[xx+1][yy].b){
if (mp[xx+1][yy].b)mp[xx+1][yy].hp-=8;
if (mp[xx+1][yy].hp<=0&&mp[xx+1][yy].b)gold+=rand()%3,kill++,killl++,mp[xx+1][yy].b=0;
}
if (xx+2<=n&&mp[xx+2][yy].b){
if (mp[xx+2][yy].b)mp[xx+2][yy].hp-=8;
if (mp[xx+2][yy].hp<=0&&mp[xx+2][yy].b)gold+=rand()%3,kill++,killl++,mp[xx+2][yy].b=0;
}
}
if (hc==1&&cc=='L'){
if (yy+1<=n)ccc[xx][yy+1]=1;
if (yy+2<=n)ccc[xx][yy+2]=1;
warout(xx,yy);
if (yy+1<=n&&mp[xx][yy+1].b){
if (mp[xx][yy+1].b)mp[xx][yy+1].hp-=8;
if (mp[xx][yy+1].hp<=0&&mp[xx][yy+1].b)gold+=rand()%3,kill++,killl++,mp[xx][yy+1].b=0;
}
if (yy+2<=n&&mp[xx][yy+2].b){
if (mp[xx][yy+2].b)mp[xx][yy+2].hp-=8;
if (mp[xx][yy+2].hp<=0&&mp[xx][yy+2].b)gold+=rand()%3,kill++,killl++,mp[xx][yy+2].b=0;
}
}
if (hc==2&&cc=='I'){
for (int i=xx-1;i;i--)ccc[i][yy]=1;
warout(xx,yy);
for (int i=xx-1;i;i--){
if (!mp[i][yy].b)continue;
mp[i][yy].hp-=3+rand()%3;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
}
}
if (hc==2&&cc=='J'){
for (int i=yy-1;i;i--)ccc[xx][i]=1;
warout(xx,yy);
for (int i=yy-1;i;i--){
if (!mp[xx][i].b)continue;
mp[xx][i].hp-=3+rand()%3;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
}
}
if (hc==2&&cc=='K'){
for (int i=xx+1;i<=n;i++)ccc[i][yy]=1;
warout(xx,yy);
for (int i=xx+1;i<=n;i++){
if (!mp[i][yy].b)continue;
mp[i][yy].hp-=3+rand()%3;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
}
}
if (hc==2&&cc=='L'){
for (int i=yy+1;i<=n;i++)ccc[xx][i]=1;
warout(xx,yy);
for (int i=yy+1;i<=n;i++){
if (!mp[xx][i].b)continue;
mp[xx][i].hp-=3+rand()%3;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
}
}
if (hc==3&&cc=='I'){
for (int i=xx-1;i;i--){
ccc[i][yy-1]=1;
ccc[i][yy]=1;
ccc[i][yy+1]=1;
}
warout(xx,yy);
for (int i=xx-1;i;i--){
if (mp[i][yy].b){
mp[i][yy].hp-=2+rand()%2;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
}
if (mp[i][yy-1].b){
mp[i][yy-1].hp-=2+rand()%2;
if (mp[i][yy-1].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy-1].b=0;
}
if (mp[i][yy+1].b){
mp[i][yy+1].hp-=2+rand()%2;
if (mp[i][yy+1].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy+1].b=0;
}
}
}
if (hc==3&&cc=='J'){
for (int i=yy-1;i;i--){
ccc[xx][i]=1;
ccc[xx-1][i]=1;
ccc[xx+1][i]=1;
}
warout(xx,yy);
for (int i=yy-1;i;i--){
if (mp[xx][i].b){
mp[xx][i].hp-=2+rand()%2;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
}
if (mp[xx-1][i].b){
mp[xx-1][i].hp-=2+rand()%2;
if (mp[xx-1][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx-1][i].b=0;
}
if (mp[xx+1][i].b){
mp[xx+1][i].hp-=2+rand()%2;
if (mp[xx+1][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx+1][i].b=0;
}
}
}
if (hc==3&&cc=='K'){
for (int i=xx+1;i<=n;i++){
ccc[i][yy-1]=1;
ccc[i][yy]=1;
ccc[i][yy+1]=1;
}
warout(xx,yy);
for (int i=xx+1;i<=n;i++){
if (mp[i][yy].b){
mp[i][yy].hp-=2+rand()%2;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
}
if (mp[i][yy-1].b){
mp[i][yy-1].hp-=2+rand()%2;
if (mp[i][yy-1].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy-1].b=0;
}
if (mp[i][yy+1].b){
mp[i][yy+1].hp-=2+rand()%2;
if (mp[i][yy+1].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy+1].b=0;
}
}
}
if (hc==3&&cc=='L'){
for (int i=yy+1;i<=n;i++){
ccc[xx-1][i]=1;
ccc[xx][i]=1;
ccc[xx+1][i]=1;
}
warout(xx,yy);
for (int i=yy+1;i<=n;i++){
if (mp[xx][i].b){
mp[xx][i].hp-=2+rand()%2;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
}
if (mp[xx-1][i].b){
mp[xx-1][i].hp-=2+rand()%2;
if (mp[xx-1][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx-1][i].b=0;
}
if (mp[xx+1][i].b){
mp[xx+1][i].hp-=2+rand()%2;
if (mp[xx+1][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx+1][i].b=0;
}
}
}
if (hc==4&&cc=='I'){
for (int i=xx-1;i;i--)ccc[i][yy]=1;
warout(xx,yy);
for (int i=xx-1;i;i--){
if (!mp[i][yy].b)continue;
int r=rand()%3;
mp[i][yy].hp-=mp[i][yy].hp*r;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
}
}
if (hc==4&&cc=='J'){
for (int i=yy-1;i;i--)ccc[xx][i]=1;
warout(xx,yy);
for (int i=yy-1;i;i--){
if (!mp[xx][i].b)continue;
int r=rand()%3;
mp[xx][i].hp-=mp[xx][i].hp*r;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
}
}
if (hc==4&&cc=='K'){
for (int i=xx+1;i<=n;i++)ccc[i][yy]=1;
warout(xx,yy);
for (int i=xx+1;i<=n;i++){
if (!mp[i][yy].b)continue;
int r=rand()%3;
mp[i][yy].hp-=mp[i][yy].hp*r;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
}
}
if (hc==4&&cc=='L'){
for (int i=yy+1;i<=n;i++)ccc[xx][i]=1;
warout(xx,yy);
for (int i=yy+1;i<=n;i++){
if (!mp[xx][i].b)continue;
int r=rand()%3;
mp[xx][i].hp-=mp[xx][i].hp*r;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
}
}
if (hc==5&&cc=='I'){
int i;
for (i=xx;i;i--)
if (mp[i][yy].b)break;
mp[i][yy].hp-=5;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
if (i){
memset(ccc,0,sizeof(ccc));
ccc[i][yy]=1;
warout(xx,yy);
if (rand()%10==0){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (mp[i][j].b){
mp[i][j].hp--;
if (mp[i][j].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][j].b=0;
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
ccc[i][j]=1;
warout(xx,yy);
}
}
}
if (hc==5&&cc=='J'){
int i;
for (i=yy;i;i--)
if (mp[xx][i].b)break;
mp[xx][i].hp-=5;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
if (i){
memset(ccc,0,sizeof(ccc));
ccc[xx][i]=1;
warout(xx,yy);
if (rand()%10==0){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (mp[i][j].b){
mp[i][j].hp--;
if (mp[i][j].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][j].b=0;
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
ccc[i][j]=1;
warout(xx,yy);
}
}
}
if (hc==5&&cc=='K'){
int i;
for (i=xx;i<=n;i++)
if (mp[i][yy].b)break;
mp[i][yy].hp-=5;
if (mp[i][yy].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][yy].b=0;
if (i<=n){
memset(ccc,0,sizeof(ccc));
ccc[i][yy]=1;
warout(xx,yy);
if (rand()%10==0){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (mp[i][j].b){
mp[i][j].hp--;
if (mp[i][j].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][j].b=0;
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
ccc[i][j]=1;
warout(xx,yy);
}
}
}
if (hc==5&&cc=='L'){
int i;
for (i=yy;i<=n;i++)
if (mp[xx][i].b)break;
mp[xx][i].hp-=5;
if (mp[xx][i].hp<=0)gold+=rand()%3,kill++,killl++,mp[xx][i].b=0;
if (i<=n){
memset(ccc,0,sizeof(ccc));
ccc[xx][i]=1;
warout(xx,yy);
if (rand()%10==0){
memset(ccc,0,sizeof(ccc));
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (mp[i][j].b){
mp[i][j].hp--;
if (mp[i][j].hp<=0)gold+=rand()%3,kill++,killl++,mp[i][j].b=0;
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
ccc[i][j]=1;
warout(xx,yy);
}
}
}
}
memset(book,0,sizeof(book));
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++){
if (book[i][j])continue;
if (!mp[i][j].b)continue;
int movex[4]={1,0,0,-1};
int movey[4]={0,1,-1,0};
int s=rand()%4;
int mmm=rand()%4;
int nx,ny;
if (!mmm)nx=i+movex[s],ny=j+movey[s];
else{
nx=i,ny=j;
int mmmm=rand()%2;
if (nx==xx)mmmm=1;
if (nx==yy)mmmm=0;
if (mmmm==0){
if (nx<xx)nx++;
if (nx>xx)nx--;
}
if (mmmm==1){
if (ny<yy)ny++;
if (ny>yy)ny--;
}
}
if (nx<1||ny<1||nx>n||ny>n)continue;
book[nx][ny]=1;
if (nx==xx&&ny==yy){
hp-=2;
mp[i][j].b=0;
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
if (mp[i][j].b)cout<<mp[i][j].hp;
else if(i!=xx||j!=yy)cout<<'.';
else cout<<"!";
cout<<endl;
}
Sleep(500);
continue;
}
if (!mp[nx][ny].b){
mp[i][j].b=0;
mp[nx][ny].b=1;
mp[nx][ny].hp=mp[i][j].hp;
}
}
if (xx==lx&&yy==ly)last++;
else last=0,lx=xx,ly=yy;
if (last>=5){
system("cls");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
if (mp[i][j].b)cout<<mp[i][j].hp;
else if(i!=xx||j!=yy)cout<<'.';
else cout<<"!";
cout<<endl;
}
Sleep(500);
hp--;
}
ucd--;
ucd=max(ucd,0);
cnt++;
}
return;
}
//神域战争
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void game(){
char x;
while(x!='B'){
cout<<"退出并保存游戏请输入:B"<<endl;
cout<<"打开神之商城请输入:S"<<endl;
cout<<"进入神域战争请输入:W"<<endl;
x=getch();
if (x=='S')shop(nowuser);
if (x=='W')war(nowuser);
system("cls");
}
return;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//注册 登录
char rere[105];
bool issame(string x){
for (int i=1;i<x.size();i++)
if (rere[i]!=x[i])return 0;
return 1;
}
bool charsame(char a[105],char b[105],int blen){
for (int i=0;i<blen;i++)if (a[i]!=b[i])return 0;
return 1;
}
int canfind(int len){
int ansi=0;
for (int i=1;i<=usertot;i++)
if (charsame(rere,user[i].name,user[i].namelen)&&len==user[i].namelen)ansi=i;
return ansi;
}
bool login_register(){
char k=getch();
while(k!='1'&&k!='2'){
system("cls");
cout<<"抱歉,请您再试一次"<<endl;
cout<<"登陆请按1"<<' '<<"用户名"<<' '<<"密码"<<endl;
cout<<"注册请按2"<<' '<<"用户名"<<' '<<"密码"<<endl;
k=getch();
}
system("cls");
if (k=='1'){
if (usertot==0){cout<<"ERROR"<<endl;return 0;}
cout<<"请输入用户名:"<<endl;
int len;
scanf("%s",rere);
len=strlen(rere);
system("cls");
while(!canfind(len)){
cout<<"抱歉,未找到用户名"<<endl;
cout<<"请重新输入"<<endl;
scanf("%s",rere);
len=strlen(rere);
system("cls");
}
nowuser=canfind(len);
cout<<"请输入密码:"<<endl;
scanf("%s",rere);
len=strlen(rere);
system("cls");
while(!charsame(rere,user[nowuser].password,user[nowuser].passwordlen)||(len!=user[nowuser].passwordlen)){
cout<<"抱歉,密码错误"<<endl;
cout<<"请重新输入"<<endl;
scanf("%s",rere);
len=strlen(rere);
system("cls");
}
}
if (k=='2'){
usertot++;
nowuser=usertot;
cout<<"请输入用户名:"<<endl;
scanf("%s",rere);
while(canfind(strlen(rere))){
system("cls");
cout<<"抱歉,用户名重复,请重新输入"<<endl;
scanf("%s",rere);
}
for (int i=0;i<strlen(rere);i++)user[usertot].name[i]=rere[i];
user[usertot].namelen=strlen(rere);
cout<<"请输入密码:"<<endl;
scanf("%s",user[usertot].password);
user[usertot].passwordlen=strlen(user[usertot].password);
user[usertot].gold=user[usertot].h=user[usertot].u=0;
}
return 1;
}
//注册 登录
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//出场动画
void enter(){
Initialize();
cursor(0);
gotoxy(20,11);print("神 域",75);
gotoxy(22,12);print("by MC_OMG",75);
Sleep(600);system("cls");
Sleep(500);
system("cls");
gotoxy(16,11);print("OIGames工作室",50);
gotoxy(7,12);print("https://www.luogu.org/team/show?teamid=18434",50);
Sleep(500);
gotoxy(17,13);print("F键打开",50);
Sleep(600);
gotoxy(15,11);print("请输入任意键继续",50);
char k=getch();
if(k=='F')system("start https://www.luogu.org/team/show?teamid=18434");
system("cls");
return;
}
//出场动画
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(){
freopen("game.txt","r",stdin);
cin>>usertot;
for (int i=1;i<=usertot;i++)cin>>user[i].name>>user[i].namelen>>user[i].password>>user[i].passwordlen>>user[i].gold>>user[i].h>>user[i].u;
enter();
freopen("CON", "r", stdin);
cout<<"登陆请按1"<<endl;
cout<<"注册请按2"<<endl;
string name,password;
if (!login_register())return 0;
cout<<"欢迎,"<<user[nowuser].name<<"!"<<endl;
Sleep(1500);
game();
system("cls");
cout<<"保存中,请稍等..."<<endl;
fileout();
system("cls");
return 0;
}
战争
//转自:https://www.luogu.com.cn/blog/I-am-your-dad/xiao-you-hu-8-da-zhang-you-hu
#include<windows.h>
#include<iostream>
#include<conio.h>
#include<ctime>
using namespace std;
int g=50,o1=3000,o2,e1=3000,e2,s,l,sl,pj,dd,i,ts,k,tk,tke,tkk,xx,bt,gs,fj,fje,fk;
char d;
void xs(){
cout<<"金币数:"<<g<<endl;
cout<<"我方人数:"<<o2<<endl;
cout<<"敌方人数:"<<e2<<endl;
cout<<"我方血量:"<<o1<<endl;
cout<<"敌方血量:"<<e1<<endl;
return ;
}
void bg();
int main(){
if(e1<1000) bg();
cout<<"战争 1.3.5\n";
cout<<"开始!";
getch();
system("cls");
cout<<"加载中...\n";
srand(time(0));
xx=rand()%5;
switch(xx){
case 0:cout<<"高射炮不仅可以打飞机,把它压下来也可以打地面敌人!";break;
case 1:cout<<"迫击炮不仅可以打小兵,还能打敌方基地!";break;
case 2:cout<<"小兵打敌方基地的伤害十分可观。";break;
case 3:cout<<"导弹可以直接打对方的基地!";break;
case 4:cout<<"千万别让小兵接近你的基地,你的建筑十分危险!";break;
}
Sleep(3000);
system("cls");
while(o1>0&&e1>0&&g<=1000&&o1<=3000){
xs();
d=' ';
srand(time(NULL));
l=rand()%18;
if(l>=0&&l<=1){
sl=rand()%20+1;
cout<<sl<<"个小兵出现了\n";
e2+=sl;
}
if(l>=2&&l<=3){
o1-=100;
cout<<"一颗导弹在空中画出了一道完美的弧线\n";
}
if(l>=4&&l<=5){
if(o2==0)
if(tk!=0){
cout<<"迫击炮轰然发射出一颗炮弹,炸毁一辆坦克\n";
tk--;
}
else{
cout<<"迫击炮轰然发射出一颗炮弹,向你方飞来\n";
o1-=80;
}
else{
o2-=40;
if(o2<0) o2=0;
cout<<"迫击炮轰然发射出一颗炮弹,炸死一批小兵\n";
}
}
if(l>=6&&l<=7){
cout<<"一块巨石忽忽悠悠地飞来\n";
o2-=35;
if(o2<0) o2=0;
}
if(l>=8&&l<=9){
cout<<"一颗狙击枪子弹射来,";
if(pj!=0){
cout<<"一门迫击炮炸了\n";
pj--;
}
else if(ts!=0){
cout<<"一门投石机炸了\n";
ts--;
}
else if(bt!=0){
cout<<"一座哨兵塔炸了\n";
bt--;
}
else{
cout<<"扣血150点\n";
o1-=150;
}
}
if(l>=10&&l<=10){
srand(time(NULL));
sl=rand()%3+1;
if(sl==3) sl=2;
else sl=1;
cout<<sl<<"辆坦克轰然出现\n";
tke+=sl;
}
if(l>=11&&l<=12){
cout<<"这轮什么也没出现\n";
}
if(l>=13&&l<=14){
if(fj!=0){
cout<<"高射炮向天空扫去,一架飞机掉了下来\n";
fj--;
}
else{
if(tk!=0){
cout<<"高射炮向地面扫去,炸毁一辆坦克\n";
tk--;
}
else{
if(o2!=0){
cout<<"高射炮向地面扫去,炸死一个小兵\n";
o2--;
}
else cout<<"高射炮没有目标\n";
}
}
}
if(l>=15&&l<=15){
cout<<"一架飞机出现了\n";
fje++;
}
if(l>=16&&l<=17){
cout<<"瘟疫发生了\n";
o2/=2;
}
dd=rand()%30+1;
cout<<"你得到了"<<dd<<"个金币\n";
g+=dd;
Sleep(3000);
system("cls");
while(d!='0'){
xs();
cout<<"1 派出小兵 3$/1\n";
cout<<"2 导弹 50$/1\n";
cout<<"3 迫击炮 120$/1\n";
cout<<"4 投石机 100$/1\n";
cout<<"5 坦克 60$/1\n";
cout<<"6 哨兵塔 100$/1\n";
cout<<"7 高射炮 120$/1\n";
cout<<"8 飞机 80$/1\n";
cout<<"9 瘟疫 50$/1\n";
cout<<"0 退出\n";
d=getch();
if(d=='1'){
system("cls");
xs();
cout<<"数量:";
cin>>s;
while(s*3>g){
system("cls");
xs();
cout<<"数量:";
cin>>s;
}
o2+=s;
g-=s*3;
system("cls");
}
if(d=='2')
if(g>=50){
g-=50;
e1-=100;
}
if(d=='3')
if(g>=120){
g-=120;
pj++;
}
if(d=='4')
if(g>=100){
g-=100;
ts++;
}
if(d=='5')
if(g>=60){
g-=60;
tk++;
}
if(d=='6'){
if(g>=100){
g-=100;
bt++;
}
}
if(d=='7'){
if(g>=120){
g-=120;
gs++;
}
}
if(d=='8'){
if(g>=80){
g-=80;
fj++;
}
}
if(d=='9'){
if(g>=50){
g-=50;
e2/=2;
}
}
system("cls");
}
for(i=1;i<=pj;i++)
if(e2==0)
if(tke!=0){
cout<<"迫击炮轰然发射出一颗炮弹,炸毁一辆坦克\n";
tke--;
}
else{
cout<<"迫击炮轰然发射出一颗炮弹,向敌方飞去\n";
e1-=80;
}
else{
if(e2>=40){
g+=80;
e2-=40;
}
else{
g+=e2*2;
e2=0;
}
if(e2<0) e2=0;
cout<<"迫击炮轰然发射出一颗炮弹,炸死一批小兵\n";
}
for(i=1;i<=ts;i++){
if(e2>=35){
e2-=35;
g+=70;
}
else{
g+=e2*2;
e2=0;
}
cout<<"一块巨石忽忽悠悠地飞去\n";
}
for(i=1;i<=bt;i++){
cout<<"5个小兵慢悠悠地从哨兵塔里走出来\n";
o2+=5;
}
for(i=1;i<=gs;i++){
if(fje!=0){
cout<<"高射炮向天空扫去,一架飞机掉了下来\n";
fje--;
}
else{
if(tke!=0){
cout<<"高射炮向地面扫去,炸毁一辆坦克\n";
tke--;
}
else{
if(e2!=0){
cout<<"高射炮向地面扫去,炸死一个小兵\n";
e2--;
}
else cout<<"高射炮没有目标\n";
}
}
}
if(fj!=0&&fje!=0){
fk=fj<fje?fj:fje;
fj-=fk;fje-=fk;
cout<<"双方都有"<<fk<<"架飞机从空中落下来了\n";
}
for(i=1;i<=fj;i++){
cout<<"我方俯冲轰炸!\n";
e1-=150;
}
for(i=1;i<=fje;i++){
cout<<"敌方俯冲轰炸!\n";
o1-=150;
}
if(tk!=0&&tke!=0){
tkk=tk<tke?tk:tke;
cout<<"坦克开炮了,双方都有"<<tkk<<"门坦克损毁了\n";
tk-=tkk;tke-=tkk;
}
if(o2!=0&&tke*20>o2){
cout<<"坦克开炮了,"<<o2<<"个小兵死去了\n";
if(o2/20!=0)
cout<<o2/20<<"门坦克损毁了\n";
o2=0;tke-=o2/20;
}
if(tke!=0&&o2>=tke*20){
cout<<"坦克开炮了,"<<tke*20<<"个小兵死去了\n";
g+=tke*60;
cout<<tke<<"门坦克损毁了\n";
o2-=tke*20;tke=0;
}
if(o2!=0&&e2!=0)
cout<<"有小兵倒下去了\n";
else cout<<"没有小兵倒下\n";
if(e2!=0&&tk*20>e2){
cout<<"坦克开炮了,"<<e2<<"个小兵死去了\n";
g+=tk*60;
if(e2/20!=0)
cout<<e2/20<<"门坦克损毁了\n";
e2=0;tk-=e2/20;
}
if(tk!=0&&e2>=tk*20){
cout<<"坦克开炮了,"<<tk*20<<"个小兵死去了\n";
g+=tk*60;
cout<<tk<<"门坦克损毁了\n";
e2-=tk*20;tk=0;
}
if(o2>e2){
g+=e2*2;
o2-=e2;
e2=0;
}
else{
g+=o2*2;
e2-=o2;
o2=0;
}
if(o2!=0){
e1-=o2*5;
cout<<"我方小兵围殴敌方,扣血"<<o2*5<<"点\n";
}
if(tk!=0){
e1-=tk*20;
cout<<"我方坦克围殴敌方,扣血"<<tk*20<<"点\n";
}
if(e2!=0){
k=e2;
if(pj*30>k){
if(k/30!=0)
cout<<k/30<<"门迫击炮损坏了\n";
pj-=k/30;
}
else{
if(pj!=0)
cout<<pj<<"门迫击炮损坏了\n";
k-=pj*30;pj=0;
if(ts*25>k){
if(k/25!=0)
cout<<k/25<<"门投石机损坏了\n";
ts-=k/25;
}
else{
if(ts!=0)
cout<<ts<<"门投石机损坏了\n";
k-=ts*25;ts=0;
if(bt*20>k){
if(k/20!=0)
cout<<k/20<<"座哨兵塔损坏了\n";
bt-=k/20;
}
else{
if(bt!=0)
cout<<bt<<"座哨兵塔损坏了\n";
k-=bt*20;bt=0;
if(k!=0){
cout<<"敌方小兵围殴我方,扣血"<<k*5<<"点\n";
o1-=k*5;
}
}
}
}
}
for(i=1;i<=tke;i++){
if(pj!=0){
pj--;
cout<<"1门迫击炮损坏了\n";
}
else if(ts!=0){
ts--;
cout<<"1门投石机损坏了\n";
}
else if(bt!=0){
bt--;
cout<<"1座哨兵塔损坏了\n";
}
else{
o1-=(tke-i+1)*100;
cout<<"敌方坦克围殴我方,扣血"<<(tke-i+1)*100<<"点\n";
i=tke;
}
}
Sleep(2000);
system("cls");
}
if(g>10000||o1>10000) bg();
if(o1<=0) cout<<"你死了!";
else cout<<"敌方死了!";
return 0;
}
void bg(){
cout<<"小朋友提前改代码是不好的\n";
Sleep(3000);
xs();
for(i=1;i<=100000000;i++)
cout<<"迫击炮轰然发射出一颗炮弹,向你方飞来\n";
cout<<"你死了!";
}
砸电脑
//转自:https://www.luogu.com.cn/blog/I-am-your-dad/xiao-you-hu-7-shuai-dian-nao-you-hu
#include<windows.h>
#include<iostream>
#include<conio.h>
#include<ctime>
using namespace std;
string s,m;
int i,j,BUGs,k,x,sj,bf,bl,sy,c,f;
bool t;
int main(){
system("mode con cols=50 lines=20");
cout<<"游戏版本:1.3.1 正式版本\n";
cout<<"温馨提示:玩此游戏你可能崩溃\n";
cout<<"就问你做好砸电脑的准备了吗?\n";
cout<<"任意键继续...";
getch();system("cls");
cout<<"目标是:A了这道题\n";
cout<<"祝你们成功(滑稽)\n";
cout<<"你确认要进入吗?\n";
cout<<"任意键继续...";
getch();system("cls");
cout<<"请选择模式...\n";
cout<<"1=菜鸡,2=大佬,3=巨佬,4=贼刺激\n";
cin>>m;system("cls");
while(m!="1"&&m!="2"&&m!="3"&&m!="4"){
cout<<"请重新选择模式...\n";
cout<<"1=菜鸡,2=大佬,3=巨佬,4=贼刺激\n";
cin>>m;system("cls");
}
if(m=="1") c=250,f=0;
if(m=="2") c=220,f=10;
if(m=="3") c=200,f=20;
if(m=="4") c=180,f=30;
for(i=0;i<=100;i++){
cout<<"进度:"<<i<<"% 时间:"<<++sj<<" 分数:"<<++f<<" 请在"<<c<<"秒内完成"<<endl;
for(j=1;j<=i/2;j++)
cout<<"<";
Sleep(100);
system("cls");
srand(time(NULL));
k=(rand()%233+i*i)%20;
if(k==0){
cout<<"发现一个BUG!\n";
t=1;
while(t){
cout<<"要不要修?\n";
cout<<"1=修,2=不修\n";
s="";cin>>s;
while(s!="1"&&s!="2"){
cout<<"修不修?\n";
cout<<"1=修,2=不修\n";
s="";cin>>s;
}
if(s=="1"){
f++;
cout<<"5秒之后...\n";
sj+=5;
if(sj>c){
cout<<"时间到了!\n";
return 0;
}
srand(time(NULL));
x=rand()%5;
if(x==0){
cout<<"BUG被修好了!\n";
t=0;f+=10;
}
else cout<<"BUG没被修好!\n";
}
else{
t=0;
BUGs++;
}
}
Sleep(1000);
system("cls");
}
if(k==1){
cout<<"你的损友向你伸出了手...\n";
t=1;
while(t){
cout<<"要不要赶走他?\n";
cout<<"1=赶,2=不赶\n";
s="";cin>>s;
while(s!="1"&&s!="2"){
cout<<"要不要赶走他?\n";
cout<<"1=赶,2=不赶\n";
s="";cin>>s;
}
if(s=="1"){
f++;
cout<<"3秒之后...\n";
sj+=3;
if(sj>c){
cout<<"时间到了!\n";
return 0;
}
srand(time(NULL));
x=rand()%5;
if(x==0){
cout<<"损友被赶跑啦!\n";
t=0;f+=10;
}
else cout<<"损友又回来了!\n";
}
else{
t=0;
srand(time(NULL));
sy=rand()%3;
if(sy==0){
cout<<"损友使用三点杀!关机了...\n";
i=0;BUGs=0;f+=20;
}
else cout<<"损友没按到键盘...\n";
}
}
Sleep(1000);
system("cls");
}
srand(time(NULL));
bf=rand()%12+1;
if(bf<=BUGs){
BUGs--;
cout<<" $^%&%*%&$ % $#$ @ $#%$ &^%*^& $#$ !%$#^%&%^#%@%(抽搐)\n";
cout<<"BUG发作了!\n";
srand(time(NULL));
bl=rand()%2;
if(bl==0){
cout<<"进度归0!\n";
i=0;f+=20;
}
else{
cout<<"进度变成了原来的一半!\n";
i/=2;f+=10;
}
Sleep(3000);
system("cls");
}
if(sj>c){
cout<<"时间到了!\n";
return 0;
}
}
cout<<"成功!\n";
cout<<"你的得分:"<<f;
return 0;
}
Beat BIT
//转自:https://www.luogu.com.cn/user/364963
//转自:https://www.luogu.com.cn/user/428154
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
namespace GB {
#define keydown(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
#define downL ((GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1:0)
#define downR ((GetAsyncKeyState(VK_RBUTTON) & 0x8000) ? 1:0)
#define Get GetStdHandle(STD_OUTPUT_HANDLE)
#define color(a) SetConsoleTextAttribute(Get,a)
#define pgrey 7
#define pblue 9
#define pgreen 10
#define pred 12
#define pyellow 14
#define pwhite 15
#define iv inline void
#define ib inline bool
#define ii inline int
#define rep(i,a,b) for(int i=(a); i<=(b); ++i)
#define rrep(i,a,b) for(int i=(a); i>=(b); --i)
inline char DtoHsu(int x) {return x<10?x^48:(x-9)^96;} //dec to hex (single and unsigned)
inline string DtoHu(int x) {string ret="00"; ret[0]=DtoHsu(x>>4), ret[1]=DtoHsu(x&15); return ret;}
inline string DtoH(int x) {return x<0?DtoHu(x+256):DtoHu(x);}
iv getxy(int &x, int &y) {
POINT pt;
HWND hwnd=GetForegroundWindow();
GetCursorPos(&pt), ScreenToClient(hwnd,&pt);
x=pt.y/16+1, y=pt.x/8+1;
}
iv mouse(int a) {
HANDLE handle=Get;
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle,&CursorInfo);
CursorInfo.bVisible=a;
SetConsoleCursorInfo(handle,&CursorInfo);
}
iv goxy(int x, int y) {
COORD position = { y-1, x-1 };
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, position);
}
inline string freads(FILE *in) {
string res=""; char c;
while(!isalnum(c=fgetc(in))) ;
while(isalnum(c)) res+=c, c=fgetc(in);
return res;
}
ii fread(FILE *in) {
int t=0, f=1; char c;
while(!isdigit(c=fgetc(in))) f=c^45;
while(isdigit(c)) t=t*10+(c^48), c=fgetc(in);
return t;
}
iv fwrites(string s, FILE *in) {
for(int i=0; s[i]; ++i) fputc(s[i], in);
}
iv writes(string s) {
for(int i=0; s[i]; ++i) putchar(s[i]);
}
iv print(int c, string s) {
color(c), writes(s), color(15);
}
inline string iturns(int x, int len) {
string res="";
if(x==0) res="0";
while(x) res=char(x%10+48)+res, x/=10;
while(res.size()<len) res+=' ';
return res;
}
inline string cturns(char c, int len) {
string res="";
while(res.size()<len) res+=c;
return res;
}
inline string sdown(string s) {
for(int i=0; s[i]; ++i) if(isupper(s[i])) s[i]=tolower(s[i]);
return s;
}
struct button {
int u, d, l, r;
button() {
l=r=u=d=0;
}
button(int u, int d, int l, int r):
u(u), d(d), l(l), r(r) {}
};
ii button_check(button q[], int siz, int px, int py) {
for(int i=1; i<=siz; ++i) if(px>=q[i].u&&px<=q[i].d&&py>=q[i].l&&py<=q[i].r) return i;
return -1;
}
iv sleep(int t) {
t/=100;
while(t--) {
if(keydown(32)) return;
Sleep(90);
}
}
}
using namespace GB;
namespace BT {
const int col[8]={0, pblue, pred, 13, pgreen, 11, 14, 15};
const int MNLEN=28, typsiz=20;
int LEN;
int type[20];
int retik;
int nxttyp;
int px=19, py=10;
string bat;
int pbat=0;
ii back(int a) {
return a%LEN;
}
iv show() {
goxy(px, py-2);
for(int p=pbat-2, c=-2; c<=MNLEN; c++, p++) {
p=back(p);
print(col[c<retik? 0: (bat[p]^48)]*16, " ");
}
goxy(px-1, py), print(pyellow, "||");
goxy(px, py), print(pyellow+col[0<retik? 0: (bat[pbat]^48)]*16, "|");
print(pyellow+col[1<retik? 0: (bat[pbat+1]^48)]*16, "|");
goxy(px+1, py), print(pyellow, "||");
}
iv update_nxt(int tapd) {
retik=0;
for(int p=pbat, c=0; ; ++c, ++p) {
p=back(p);
if(c>tapd+1&&bat[p]!=48) {
nxttyp=bat[p]^48;
break;
}
retik++;
}
}
iv init(string baat) {
string add="";
bat="";
for(int i=0; baat[i]; ++i) add+=baat[i], add+=baat[i];
do bat+=add, LEN=bat.size(); while(LEN<MNLEN);
pbat=0, update_nxt(-2);
}
bool music=0;
ii tap(int typ) { //此处,上传按下的键
typ=type[typ];
if(music) cout<<(char)7;
int res=666;
if((typ&nxttyp)!=0 && retik>=-2 && retik<=2) {
res=retik;
// goxy(px, py+retik), print(col[0], " ");
update_nxt(res);
}
goxy(px-1, py-2);
if(res==666) {
print(pred, "F"), sleep(1000);
return -1;
} else if(res==0) {
print(pyellow, "P");
return 0;
} else {
print(pblue, "G");
return res>=-1&&res<=1? 1:2;
}
}
ii drop() {
retik--, pbat++, pbat=back(pbat);
if(retik<-3) {
goxy(px-1, py-2), print(pred, "F"), sleep(1000);
return -1;
}
return 0;
}
iv test() {
init("000100100200");
px=19, py=10;
type[0]=type[1]=type[3]=1, type[2]=2;
int now=0, t=clock(), th=clock()-160;
while(1) {
if(clock()-t>=160) {
t=clock(), show();
if(drop()==-1) break;
}
if(clock()-th>=160) {
if(keydown('W')) now=tap(0), th=clock();
if(keydown('D')) now=tap(1), th=clock();
if(keydown('S')) now=tap(2), th=clock();
if(keydown('A')) now=tap(3), th=clock();
if(now==-1) break;
}
}
}
}
namespace MP {
const int dx[]= {0, 1, 0, -1}, dy[]= {1, 0, -1, 0}, maxkind=3, maxmap=10, nowtype=7;
const int ty_xy[BT::typsiz][2]= {{8, 38}, {9, 39}, {9, 38}, {9, 37}, {8, 37}, {8, 39}, {10, 38}};
string prt[]= {"", " ", "==", "[]", "LL", "RR", " "};
const string jump[]= {"/\\", ">>", "\\/", "<<"};
const int bl_col[]= {0, 8*16, 8*16+7, 8*16+6, 8*16, 8*16, 8*16};
const char ty_char[BT::typsiz]= {'W', 'D', 'S', 'A', 'Q', 'E', 'X'};
int px=0, py=0, pdir=0, num_mp=1, deduct=5, nowj=1, score=50;
double gamespeed=2;
string cycle;
struct Block { //方块
int kind, col;
vector <int> data;
Block (int kind, int col=pwhite): kind(kind), col(col) {}
Block () {}
};
map <pair<int, int>, Block> pre_floor[maxmap], floor[maxmap];
map <pair<int, int>, int> pre_door[maxmap][2], door[maxmap][2];
iv PrintFloor(int cnt, int x, int y) { //打印单个方块
#define pcol(cl) ((cl>>4<<4)+BT::col[cl&15])
goxy(cnt/7*2+4, cnt%7*4+8);
if(floor[nowj].find(make_pair(x, y))==floor[nowj].end()) putchar(32), putchar(32);
else {
Block b2=floor[nowj][make_pair(x, y)];
if(b2.kind==6) prt[6]=jump[(b2.data[0]-pdir+4)&3];
// if(x==2 && y==5) goxy(22, 1), printf("%d\n", b2.data[0]), system("pause");
if(x==px && y==py) color(b2.col | pwhite), putchar(1), color(pcol(b2.col)), putchar(prt[b2.kind][1]), color(pwhite);
else print(pcol(b2.col), prt[b2.kind]);
}
}
iv PrintDoor(int opt, int cnt, int kind, int x, int y) {
// if(opt==1) goxy(22, 1), printf("%d %d %d \n", cnt, x, y), system("pause");
opt==0 ? goxy(cnt/7*2+5, cnt%7*4+8) : goxy(cnt/6*2+4, cnt%6*4+10);
// if(x==0 && y==0 && opt==1 && door[nowj][kind].find(make_pair(x, y))==door[nowj][kind].end()) cout<<cnt<<endl, system("pause");
if(door[nowj][kind].find(make_pair(x, y))==door[nowj][kind].end()) putchar(32), putchar(32);
else {
int c2=door[nowj][kind][make_pair(x, y)];
print(BT::col[7-c2]|8, opt==0 ? "==" : "||");
}
}
iv PrintType(int typ) { //打印按键
goxy(ty_xy[typ][0], ty_xy[typ][1]), color((BT::col[BT::type[typ]])^(keydown(ty_char[typ])<<3)), putchar(ty_char[typ]), color(15);
}
iv PrintScore() { //打印分数
goxy(5, 37), printf("%d ", score);
}
iv PrintMap() { //打印地图
int cnt=0;
switch (pdir) {
case 0: {
rrep(j, 3, -3) rep(i, -3, 3) PrintFloor(cnt++, px+i, py+j); cnt=0;
rrep(j, 2, -3) rep(i, -3, 3) PrintDoor(0, cnt++, 0, px+i, py+j); cnt=0;
rrep(j, 3, -3) rep(i, -3, 2) PrintDoor(1, cnt++, 1, px+i, py+j);
break;
}
case 1: {
rrep(i, 3, -3) rrep(j, 3, -3) PrintFloor(cnt++, px+i, py+j); cnt=0;
rrep(i, 2, -3) rrep(j, 3, -3) PrintDoor(0, cnt++, 1, px+i, py+j); cnt=0;
rrep(i, 3, -3) rrep(j, 2, -3) PrintDoor(1, cnt++, 0, px+i, py+j);
break;
}
case 2: {
rep(j, -3, 3) rrep(i, 3, -3) PrintFloor(cnt++, px+i, py+j); cnt=0;
rep(j, -3, 2) rrep(i, 3, -3) PrintDoor(0, cnt++, 0, px+i, py+j); cnt=0;
rep(j, -3, 3) rrep(i, 2, -3) PrintDoor(1, cnt++, 1, px+i, py+j);
break;
}
case 3: {
rep(i, -3, 3) rep(j, -3, 3) PrintFloor(cnt++, px+i, py+j); cnt=0;
rep(i, -3, 2) rep(j, -3, 3) PrintDoor(0, cnt++, 1, px+i, py+j); cnt=0;
rep(i, -3, 3) rep(j, -3, 2) PrintDoor(1, cnt++, 0, px+i, py+j);
break;
}
}
}
iv InitMap() { //初始化地图
system("cls");
goxy(1, 1);
puts("");
puts(" o======================================o");
puts(" | --------------------------- |");
puts(" | | X X X X X X X | score |");
puts(" | | | ??? |");
puts(" | | X O O O O O X | |");
puts(" | | | |");
puts(" | | X O O O O O X | QWE |");
puts(" | | | ASD |");
puts(" | | X O O @ O O X | X |");
puts(" | | | |");
puts(" | | X O O O O O X | |");
puts(" | | | |");
printf(" | | X O O O O O X | %c |\n", 2);
puts(" | | | |");
puts(" | | X X X X X X X | |");
puts(" | --------------------------- |");
puts(" | |");
puts(" | mcgc |");
puts(" | |");
puts(" o======================================o");
PrintMap();
PrintScore();
rep(i, 0, 6) PrintType(i);
}
ib load(string s) { //加载地图种子
#define Lchecks(i) (i+1<=len && isdigit(s[i])||s[i]>='a'&&s[i]<='f')
#define Lcheck(i) (Lchecks(i)&&Lchecks(i+1))
#define Lgetsu(i) (isdigit(s[i])?s[i]^48:(s[i]^96)+9)
#define Lgetu(i) ((Lgetsu(i)<<4)+Lgetsu(i+1))
#define Lget(i) (Lgetu(i)-(Lgetu(i)<128?0:256))
goxy(21, 1), puts("loading...");
int len=s.size(), i=0;
if(!Lcheck(i)) return 0; //地图速度,循环节长度,循环节
gamespeed=Lgetu(i)/16.0, i+=2;
if(!Lcheck(i)) return 0;
int lenc=Lgetu(i); i+=2;
if(i+lenc>s.size()) return 0;
rep(di, 0, lenc-1) if(!Lchecks(i)) return 0;
cycle.assign(s, i, lenc), i+=lenc;
if(!Lcheck(i)) return 0; //扣分值
deduct=Lgetu(i), i+=2;
rep(j, 0, 7) { //按键种类
if(!Lchecks(i)) return 0;
BT::type[j]=Lgetsu(i), ++i;
}
if(!Lcheck(i)) return 0; //地图数量,地图
num_mp=Lgetu(i), i+=2;
rep(j, 1, num_mp) pre_floor[j].clear(), pre_door[j][0].clear(), pre_door[j][1].clear();
// puts("1");
rep(j, 1, num_mp) {
if(!Lcheck(i) || !Lcheck(i+2) || !Lcheck(i+4) || !Lcheck(i+6)) return 0;
int n=Lgetu(i), m=Lgetu(i+2), sx=Lget(i+4), sy=Lget(i+6), tmp=0;
i+=8;
while(tmp<n*m) {
if(!Lchecks(i)) return 0;
int opt=Lgetsu(i); ++i;
if(opt==0) {if(!Lcheck(i)) return 0; int cnt=Lgetu(i); i+=2, tmp+=cnt;}
else {
int nx=tmp%m, ny=tmp/m;
pair <int, int> pxy=make_pair(nx-sx, ny-sy);
if(opt>=1 && opt<=3) {
Block b2(opt, bl_col[opt]);
pre_floor[j][pxy]=b2;
} else if(opt==4 || opt==5) {
if(!Lchecks(i)) return 0;
int col=Lgetsu(i); ++i;
if(col>7) return 0;
Block b2(opt, bl_col[opt]+col);
pre_floor[j][pxy]=b2;
} else if(opt==6) {
if(!Lchecks(i) && !Lchecks(i+1)) return 0;
int col=Lgetsu(i), dir=Lgetsu(i+1); i+=2;
if(col>7 || dir>3) return 0;
// if(nx==2 && ny==5) printf("%d %d\n", col, dir), system("pause");
Block b2(6, bl_col[5]+col);
b2.data.push_back(dir);
pre_floor[j][pxy]=b2;
} else return 0;
++tmp;
}
}
// printf("%d\n", n*m);
// puts("3");
tmp=0;
while(tmp<(n-1)*m) {
// puts("while 1");
if(!Lchecks(i)) return 0;
int opt=Lgetsu(i); ++i;
if(opt==0) {if(!Lcheck(i)) return 0; int cnt=Lgetu(i); i+=2, tmp+=cnt;}
else {
int nx=tmp%m, ny=tmp/m;
if(opt>=1 && opt<=7) pre_door[j][0][make_pair(nx-sx, ny-sy)]=opt;
++tmp;
}
}
tmp=0;
// puts("4");
while(tmp<n*(m-1)) {
if(!Lchecks(i)) return 0;
int opt=Lgetsu(i);
++i;
if(opt==0) {if(!Lcheck(i)) return 0; int cnt=Lgetu(i); i+=2, tmp+=cnt;}
else {
int nx=tmp%(m-1), ny=tmp/(m-1);
if(opt>=1 && opt<=7) pre_door[j][1][make_pair(nx-sx, ny-sy)]=opt;
++tmp;
}
}
}
// puts("5");
if(i!=len) return 0;
BT::init(cycle);
return 1;
}
ii leave(int x, int y) { //离开..时的交互
pair <int, int> pxy=make_pair(x, y);
if(floor[nowj].find(pxy)==floor[nowj].end()) return 0;
int kind=floor[nowj][pxy].kind;
if(kind==2) {
floor[nowj].erase(pxy);
} else if(kind==4 || kind==5 || kind==6) {
Block b2=floor[nowj][pxy];
BT::type[kind]-=b2.data.back(), b2.data.pop_back(), floor[nowj][pxy]=b2;
}
return 0;
}
ii from_to(int xf, int yf, int xt, int yt, int thistik) { //从..移动到..时的交互
int xft=xf+xt>>1, yft=yf+yt>>1, kind=(xf==xt?0:1), typ=BT::type[thistik];
if(door[nowj][kind].find(make_pair(xft, yft))!=door[nowj][kind].end()) {
int c2=door[nowj][kind][make_pair(xft, yft)];
goxy(22, 1);
if((typ&c2)==typ) return -1;
}
return 0;//...
}
ii reach(int x, int y) { //到达..时的交互
pair <int, int> pxy=make_pair(x, y);
if(floor[nowj].find(pxy)==floor[nowj].end()) return -1;
int kind=floor[nowj][pxy].kind;
if(kind==3) {
score+=100;
return -1;
} else if(kind==4 || kind==5 || kind==6) {
Block b2=floor[nowj][pxy];
int typk=BT::type[kind], dtyp=(BT::type[kind]|b2.col-bl_col[kind])-BT::type[kind];
BT::type[kind]+=dtyp, b2.data.push_back(dtyp), floor[nowj][pxy]=b2;
} else return 0;
}
ii move(int kind) { //移动
if(kind>=0 && kind<=3) {
int Mdir=pdir+kind&3;
if(from_to(px, py, px+dx[Mdir], py+dy[Mdir], kind)==-1) return -1;
if(leave(px, py)==-1) return -1;
px+=dx[Mdir], py+=dy[Mdir];
if(reach(px, py)==-1) return -1;
PrintMap();
} else if(kind>=4 && kind<=5) {
kind==4?--pdir:++pdir;
pdir=pdir+4&3;
PrintMap();
} else if(kind==6) {
// goxy(22, 1), puts("1");
if(floor[nowj].find(make_pair(px, py))==floor[nowj].end()) return -1;
Block b2=floor[nowj][make_pair(px, py)];
// puts("1.5");
if(b2.kind==6) {
// puts("2");
int dir=b2.data[0];
// puts("3");
rep(t, 0, 1) if(from_to(px+t*dx[dir], py+t*dy[dir], px+(t+1)*dx[dir], py+(t+1)*dy[dir], kind)==-1) return -1;
// puts("4");
if(leave(px, py)==-1) return -1;
px+=2*dx[dir], py+=2*dy[dir];
// puts("5");
if(reach(px, py)==-1) return -1;
PrintMap();
} else return -1;
}
// if(kind==6) goxy(22, 1), system("pause");
return 0;
}
iv init() { //初始化
rep(j, 1, num_mp) floor[j]=pre_floor[j], door[j][0]=pre_door[j][0], door[j][1]=pre_door[j][1];
px=py=0, pdir=0, nowj=1;
}
iv talk(int p) {
switch(p) {
case 0: {
goxy(11, 36), print(pyellow, "跟节拍");
goxy(12, 36), print(pyellow, "按adws");
goxy(13, 36), print(pyellow, "移动到");
goxy(14, 36), print(pyellow, "终点[]");
break;
}
case 1: {
goxy(11, 36), print(pyellow, "加油!");
break;
}
}
}
ii main(int p) {
int stik=1000/gamespeed;
score=100;
InitMap();
talk(p);
goxy(19, 10), print(pyellow, "输入S以开始");
while(1) if(keydown('S')) break;
BT::show();
sleep(200);
reach(0, 0);
clock_t tim=clock();
int b=-1;
while(1) {
if(BT::drop()==-1) break;
BT::show();
PrintScore();
int thistik=-1;
while(clock()-tim<=stik) { //循环到过了一个 tik
if(b!=-1 && !keydown(ty_char[b])) b=-1;
if(b==-1)
rep(typ, 0, nowtype-1) if(keydown(ty_char[typ])) b=thistik=typ;
rep(typ, 0, nowtype-1) PrintType(typ);
if(keydown('P')) {
system("mode con cols=60 lines=22");
InitMap(), talk(p), BT::show();
goxy(3, 47), print(pyellow, "已暂停");
goxy(6, 47), print(pwhite, "1:继续");
goxy(8, 47), print(pwhite, "2:退出");
goxy(10, 47), print(pwhite, "3:重来");
int ret=-1;
while(1) {
if(keydown('1')) break;
if(keydown('2')) {ret=233; break;}
if(keydown('3')) {ret=666; break;}
}
system("mode con cols=44 lines=22");
InitMap(), talk(p), BT::show();
if(ret!=-1) return ret;
}
}
tim=clock();
if(thistik!=-1) {
int ret=BT::tap(thistik);
if(ret==-1) break; //炸掉了
score-=ret*deduct;
if(score<=0) break; //分数太少
if(move(thistik)==-1) break;
}
}
// goxy(22, 1);
// printf("%d", b);
// system("pause");
// PrintScore();
PrintMap();
tim=clock();
while(clock()-tim>=2500) if(keydown('P')) break;
score-=100;
return score;
}
iv test() {
string seed;
cin>>seed;
while(!load(seed)) puts("error!"), cin>>seed;
init();
system("cls");
for(map <pair<int, int>, Block> :: iterator it=floor[1].begin(); it!=floor[1].end(); ++it) {
printf("(%d, %d): %d\n", it->first.first, it->first.second, it->second.kind);
}
rep(t, 0, 1) {
puts("");
for(map <pair<int, int>, int> :: iterator it=door[1][t].begin(); it!=door[1][t].end(); ++it) {
printf("(%d, %d): %d\n", it->first.first, it->first.second, it->second);
}
}
system("pause");
main(-1);
}
}
namespace BS {
const int totL=6, MXL=250;
string mp[MXL]={
"",
"a01000001000100020000211210000010302000012210013004003",
"a00c00010010020001112100000105050200002100120021110022213121100211001014014",
"a00c0001001002000111210000010607040100222300321001100120012100112121222111211212002210012001023024",
"a00c00010010020002112100000106030002002200162021262200120021002622300f00c",
"a00c0001001002000211210000010c0301000012001621222262026202001222226212200162262062020012222220013001021018",
"a00c0001001002000211210000010606030300241141152151001100111002152001200110011001300111100352001101e01e"
};
map<string, string> spmp;
int score[MXL];
bool opn[MXL]={0, 1};
string diymp[4]={"", "NuLl", "NuLl", "NuLl"};
string diykey[4]={"", "NuLl", "NuLl", "NuLl"};
int wich[30][50], px, py, p;
const int tipsiz=17;
string tips[tipsiz+2]={
"acbc!!!",
"mcgc!!!",
"no tip",
"也许这个游戏可以在今年内做完?",
"ITA:为什么我被插队了",
"Beeeeeeeeeeeeeeeeeat!!",
"ac特别喜欢bc",
"我觉得有必要扩充一下tips",
"算上这条, tips一共有"+iturns(tipsiz, 0)+"条",
"acbc是BBIT世界中的唯一真理。",
"不会真有人觉得tips里会有提示吧?(",
"一定要把快速编辑模式给关掉!",
"不要在显示 按S以开始 的时候干一些奇奇怪怪的事啊!",
"为什么这个游戏是在愚人节开始做的呢?",
"我个人感觉, 这游戏挺简单的--ztue",
"这真的是一条为了写tip而写的tip",
"《关于我什么都没干bug却自己好了的这档事儿》",
"本游戏没有任何彩蛋, 真的"
};
iv special_map() {
spmp["EZ"]="500c0001001002000110210000010705030000320015252415142415141424152414142525241415142415252424100230020056001560016560026655500260070076565001600160026600255005";
}
iv data_save() {
FILE *fout=fopen("BBITdata.txt", "w");
rep(i, 1, MXL) fwrites(iturns(score[i], 0)+' ', fout);
fputc('\n', fout);
rep(i, 0, MXL) fwrites(iturns(opn[i], 0)+' ', fout);
fputc('\n', fout);
rep(i, 1, 3) fwrites(diymp[i]+'\n', fout);
rep(i, 1, 3) fwrites(diykey[i]+' ', fout);
fclose(fout);
}
iv data_read() {
FILE *fin;
if(!(fin=fopen("BBITdata.txt", "r"))) data_save();
fin=fopen("BBITdata.txt", "r");
rep(i, 1, MXL) score[i]=fread(fin);
rep(i, 0, MXL) opn[i]=fread(fin);
rep(i, 1, 3) diymp[i]=freads(fin);
rep(i, 1, 3) {
diykey[i]=freads(fin);
if(diykey[i]!="NuLl") spmp[diykey[i]]=diymp[i];
}
fclose(fin);
}
namespace DIY {
const int prtsiz=12;
const int front_col[prtsiz+2]= {0, 15, 0, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15};
const int back_col[prtsiz+2]= {0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0};
const bool hav_col[prtsiz+2]= {0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0};
const bool out_map[prtsiz+2]= {0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0};
const string prt[prtsiz+2]= {"", "c ", " ", "==", "[]", "LL", "RR", "==", "||", "<<", ">>", "/\\", "\\/"};
const int col[8]={0, pblue, pred, 13, pgreen, 11, 14, 15};
int pagesiz=ceil(1.0*prtsiz/5);
int block[6];
button bq[1000];
int bqsiz;
int wich[50][50];
int tx[55], ty[55];
int type_block[55]; //1 起点,2 普通,3 塌陷,4 终点,56 左右转,78 \,9abc 左右上下跳
int col_block[55];
//1 2 3 4 5 6 7
//8 9 a b c d e
//...
int owich[50][50];
int otx[110], oty[110], outf[110];
int type_o[110]; //123456 \,78 横竖门
int col_o[110];
int de_score;
double speed;
int bat_len; //速度;循环节长度
int bat_col[20]; //循环节颜色,如 000100200100 从 1 开始
int key_col[20]; //以 qweasdx 的顺序的颜色
iv epty_map_show() {
system("cls");
puts("");
puts(" o======================================o");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" o======================================o");
}
iv block_show(int page, int chos) {
goxy(19, 4), print(pyellow, page>1? "<-": " ");
goxy(19, 40), print(pyellow, page<pagesiz? "->": " ");
rep(i, 6, 10) bq[i]=button(0, 0, 0, 0);
int bg=(page-1)*5, up=min(5, prtsiz-bg);
bqsiz=5;
rep(i, up+1, 5) goxy(19, i*8-2), print(0, " ");
rep(i, 1, 5) goxy(18, i*8-2), print(0, " ");
rep(i, 1, up) {
goxy(19, i*8-2), print(front_col[bg+i]+back_col[bg+i]*16, prt[bg+i]);
bq[++bqsiz]=button(19, 19, i*8-2, i*8-1), block[i]=bg+i;
if(block[i]==chos) goxy(18, i*8-2), print(pgreen, "\\/");
}
}
inline string seed_produce() { //mcbc
// goxy(22, 1);
// rep(i, 1, 20) cout<<col_o[i]<<' ';
// system("pause");
string seed="";
seed+=DtoHu((int) ceil(speed*16));
seed+=DtoHu(bat_len);
// rep(i, 1, 16) cout<<DtoHsu(bat_col[i])<<' ';
// system("pause");
rep(i, 1, bat_len) seed+=DtoHsu(bat_col[i]);
seed+=DtoH(de_score);
seed+=DtoHsu(key_col[2]); seed+=DtoHsu(key_col[6]); seed+=DtoHsu(key_col[5]); seed+=DtoHsu(key_col[4]);
seed+=DtoHsu(key_col[1]); seed+=DtoHsu(key_col[3]); seed+=DtoHsu(key_col[7]); seed+='0';
seed+="010707";
int cnt=0;
rep(tmp, 0, 48) if(type_block[tmp+1]==1) ++cnt, seed+=DtoHu(tmp%7), seed+=DtoHu(6-tmp/7);
if(cnt!=1) return seed="error";
#define checkcnt if(cnt!=0) seed+="0", seed+=DtoHu(cnt), cnt=0
cnt=0;
rep(tmp, 0, 48) {
int tb=type_block[(6-tmp/7)*7+tmp%7+1], cb=col_block[(6-tmp/7)*7+tmp%7+1];
if(tb==0) ++cnt;
else {
// cout<<seed;
checkcnt;
// cout<<endl<<seed<<endl;
// system("pause");
if(tb==1) seed+="1";
else if(tb>=2 && tb<=4) seed+=DtoHsu(tb-1);
else if(tb>=5 && tb<=6) seed+=DtoHsu(tb-1), seed+=DtoHsu(cb);
else if(tb>=9 && tb<=12) {
seed+="6", seed+=DtoHsu(cb);
if(tb==9) seed+="3";
if(tb==10) seed+="1";
if(tb==11) seed+="0";
if(tb==12) seed+="2";
} else return seed="error and mcbc";
}
}
checkcnt;
rep(tmp, 0, 41) {
int tmp2=tmp%7==6?(6-tmp/7)*13:(5-tmp/7)*13+tmp%7*2+2, to=type_o[tmp2], co=col_o[tmp2]^(to==0?0:7);
if(to==0) ++cnt;
else {
checkcnt;
if(to==7) seed+=DtoHsu(co);
else return seed="error and mcbc too";
}
}
checkcnt;
rep(tmp, 0, 41) {
int tmp2=tmp<6?6*13+tmp+1:(6-tmp/6)*13+tmp%6*2+1, to=type_o[tmp2], co=col_o[tmp2]^(to==0?0:7);
if(to==0) ++cnt;
else {
checkcnt;
if(to==8) seed+=DtoHsu(co);
else return seed="error and mcbc three";
}
}
checkcnt;
return seed;
#undef checkcnt
}
ib map_draw() {
system("cls");
puts("");
puts(" o======================================o");
puts(" | --------------------------- |");
puts(" | | | |");
puts(" | | | 选择 |");
puts(" | | |颜色和 |");
puts(" | | |方块, |");
puts(" | | |用左键 |");
puts(" | | |添加右 |");
puts(" | | |键删除 |");
puts(" | | | |");
puts(" | | | |");
puts(" | | | |");
puts(" | | | |");
puts(" | | | |");
puts(" | | | |");
puts(" | --------------------------- |");
puts(" | |");
puts(" | |");
puts(" | |");
puts(" o======================================o");
/*
1-chos_red 2-chos_blue 3-chos-green
4-last_page 5-next_page
6~10 block
*/
memset(wich, 0, sizeof(wich));
goxy(1, 1), print(pred, "exit"), wich[1][1]=wich[1][2]=wich[1][3]=wich[1][4]=-1;
goxy(1, 41), print(pgreen, "next"), wich[1][41]=wich[1][42]=wich[1][43]=wich[1][44]=-2;
goxy(12, 37), print(pred*16, " "), bq[1]=button(12, 12, 37, 39);
goxy(14, 37), print(pblue*16, " "), bq[2]=button(14, 14, 37, 39);
goxy(16, 37), print(pgreen*16, " "), bq[3]=button(16, 16, 37, 39);
bq[4]=button(19, 19, 4, 5), bq[5]=button(19, 19, 40, 41);
for(int x=4, cnt=0, ocnt=0; x<=16; x+=2) for(int y=8; y<=32; y+=4) {
wich[x][y]=wich[x][y+1]=(++cnt), tx[cnt]=x, ty[cnt]=y, goxy(x, y), print(7*16, " ");
if(y!=32) owich[x][y+2]=owich[x][y+3]=++ocnt, otx[ocnt]=x, oty[ocnt]=y+2, outf[ocnt]=1;
if(x!=16) owich[x+1][y]=owich[x+1][y+1]=++ocnt, otx[ocnt]=x+1, oty[ocnt]=y, outf[ocnt]=2;
}
int px, py, chos_block=1;
int chos_col=0;
int page=1, click;
block_show(1, chos_block);
int now=clock();
while(1) if(clock()-now>100) {
now=clock();
if(downL) {
getxy(px, py);
// goxy(1, 5), print(pwhite, iturns(px, 2)+" "+iturns(py, 2));
click=button_check(bq, bqsiz, px, py);
// goxy(1, 20), print(pred, iturns(click, 0));
switch(click) {
case -1: {
break;
}
case 1: {
chos_col^=2, goxy(12, 37), print(((chos_col&2)? pgrey: pred)*16, " ");
break;
}
case 2: {
chos_col^=1, goxy(14, 37), print(((chos_col&1)? pgrey: pblue)*16, " ");
break;
}
case 3: {
chos_col^=4, goxy(16, 37), print(((chos_col&4)? pgrey: pgreen)*16, " ");
break;
}
case 4: {
if(page>1) block_show(--page, chos_block);
break;
}
case 5: {
if(page<pagesiz) block_show(++page, chos_block);
break;
}
default: {
block_show(page, chos_block=block[click-5]);
break;
}
}
click=wich[px][py];
if(click==-1) return 0;
if(click==-2) return 1;
if(!out_map[chos_block]&&click>0) {
goxy(tx[click], ty[click]);
print((hav_col[chos_block]? front_col[chos_block]: (col[chos_col]? col[chos_col]: pgrey))+back_col[chos_block]*16, prt[chos_block]);
type_block[click]=chos_block, col_block[click]=chos_col;
}
click=owich[px][py];
if(out_map[chos_block]&&click>0) {
goxy(otx[click], oty[click]);
print((hav_col[chos_block]? front_col[chos_block]: (col[chos_col]? col[chos_col]: pgrey))+back_col[chos_block]*16, prt[chos_block]);
type_o[click]=chos_block, col_o[click]=chos_col;
}
}
if(downR) {
getxy(px, py);
click=wich[px][py];
if(click>0) {
goxy(tx[click], ty[click]), print(pgrey*16, " ");
type_block[click]=0;
}
click=owich[px][py];
if(click>0) {
goxy(otx[click], oty[click]), print(0, " ");
type_o[click]=0;
}
}
}
}
/*
---------------------------------------------
| --- 1
o======================================o |
| | |
| QWE | | --- 4
| ASD red blu gre | |
| X | |
| | | --- 7
| | |
| | |
| | | --- 10
| [ 1 2 3 ] | |
| | |
| | | --- 13
| | |
| | |
| | | --- 16
| | |
| | |
| | | --- 19
| | |
o======================================o |
| --- 22
---------------------------------------------
| | | | | | | | | | | |
1 3 6 10 14 18 22 26 30 34 38 42
[] [] [] [] []
page 1
block
*/
ib beat_draw() {
int px, py;
memset(wich, 0, sizeof(wich));
bat_back:;
epty_map_show();
goxy(1, 1), print(pred, "exit"), wich[1][1]=wich[1][2]=wich[1][3]=wich[1][4]=-1;
goxy(4, 12), print(pgreen, "请输入节拍循环的总长度");
goxy(5, 12), print(pred, "范围4~16!");
mouse(1), goxy(6, 12), cin>>bat_len, mouse(0);
if(bat_len>16||bat_len<4) goto bat_back;
speed_back:;
epty_map_show();
goxy(1, 1), print(pred, "exit"), wich[1][1]=wich[1][2]=wich[1][3]=wich[1][4]=-1;
goxy(4, 12), print(pgreen, "请输入节拍的速度(一秒几个块)");
goxy(5, 12), print(pred, "范围4~14");
mouse(1), goxy(6, 12), cin>>speed, mouse(0);
if(speed>14||speed<4) goto speed_back;
scor_back:;
epty_map_show();
goxy(1, 1), print(pred, "exit"), wich[1][1]=wich[1][2]=wich[1][3]=wich[1][4]=-1;
goxy(4, 12), print(pgreen, "请输入扣分值");
goxy(5, 12), print(pred, "范围1~100");
mouse(1), goxy(6, 12), cin>>de_score, mouse(0);
if(de_score<1||de_score>100) goto speed_back;
epty_map_show();
goxy(1, 1), print(pred, "exit"), wich[1][1]=wich[1][2]=wich[1][3]=wich[1][4]=-1;
goxy(1, 41), print(pgreen, "next"), wich[1][41]=wich[1][42]=wich[1][43]=wich[1][44]=-2;
int bat_cnt=0;
goxy(11, 7);
rep(i, 1, bat_len) print(pgrey*16, " "), wich[11][5+i*2]=wich[11][6+i*2]=++bat_cnt;
int chos_col=0, ktx[20], kty[20];
string kc[20];
goxy(5, 19), print(pred*16, " "), bq[1]=button(5, 5, 19, 21);
goxy(5, 25), print(pblue*16, " "), bq[2]=button(5, 5, 25, 27);
goxy(5, 31), print(pgreen*16, " "), bq[3]=button(5, 5, 31, 33);
goxy(4, 9), print(pgrey, kc[4]="Q"), bq[4]=button(ktx[4]=4, 4, kty[4]=9, 9);
print(pgrey, kc[5]="W"), bq[5]=button(ktx[5]=4, 4, kty[5]=10, 10);
print(pgrey, kc[6]="E"), bq[6]=button(ktx[6]=4, 4, kty[6]=11, 11);
goxy(5, 9), print(pgrey, kc[7]="A"), bq[7]=button(ktx[7]=5, 5, kty[7]=9, 9);
print(pgrey, kc[8]="S"), bq[8]=button(ktx[8]=5, 5, kty[8]=10, 10);
print(pgrey, kc[9]="D"), bq[9]=button(ktx[9]=5, 5, kty[9]=11, 11);
goxy(6, 10), print(pgrey, kc[10]="X"), bq[10]=button(ktx[10]=6, 6, kty[10]=10, 10);
int now=clock(), click;
while(1) if(clock()-now>100) {
now=clock();
if(downL) {
getxy(px, py);
click=button_check(bq, 10, px, py);
switch(click) {
case -1: {
break;
}
case 1: {
chos_col^=2, goxy(5, 19), print(((chos_col&2)? pgrey: pred)*16, " ");
break;
}
case 2: {
chos_col^=1, goxy(5, 25), print(((chos_col&1)? pgrey: pblue)*16, " ");
break;
}
case 3: {
chos_col^=4, goxy(5, 31), print(((chos_col&4)? pgrey: pgreen)*16, " ");
break;
}
default: {
key_col[click-3]=chos_col;
goxy(ktx[click], kty[click]), print(col[chos_col]? col[chos_col]: pgrey, kc[click]);
break;
}
}
click=wich[px][py];
// goxy(22, 1), cout<<click;
if(click==-1) return 0;
if(click==-2) return 1;
if(click>0) {
bat_col[click]=chos_col;
goxy(11, 5+click*2), print((col[chos_col]? col[chos_col]: pgrey)*16, " ");
}
}
}
}
iv DIY_clear() {
bqsiz=0;
memset(bat_col, 0, sizeof(bat_col)), memset(key_col, 0, sizeof(key_col));
memset(type_o, 0, sizeof(type_o)), memset(col_o, 0, sizeof(col_o));
memset(owich, 0, sizeof(owich)), memset(otx, 0, sizeof(otx)), memset(oty, 0, sizeof(oty));
memset(type_block, 0, sizeof(type_block)), memset(col_block, 0, sizeof(col_block));
memset(wich, 0, sizeof(wich)), memset(tx, 0, sizeof(tx)), memset(ty, 0, sizeof(ty));
}
inline string DIY_draw() {
DIY_clear();
if(!map_draw()) return "exit";
if(!beat_draw()) return "exit";
return seed_produce();
}
}
iv DIY_map() {
bool flag=1;
int bqsiz;
button bq[1000]={};
string seed;
while(flag) {
system("cls");
goxy(2, 12), print(pgreen, "输入种子(可输入钥匙码)");
goxy(3, 12), print(pgreen, "输入draw进入地图编辑器");
goxy(4, 12), print(pred, "输入exit以离开");
goxy(5, 12), mouse(1), cin>>seed, mouse(0);
if(seed=="draw") seed=DIY::DIY_draw();
if(seed=="exit") return;
if(spmp[seed].size()) seed=spmp[seed];
if(MP::load(seed)) flag=0;
else system("cls"), goxy(2, 16), print(pred, "输错了 :-("), sleep(1000);
}
start:;
int scor;
MP::load(seed), MP::init();
system("cls"), print(pwhite, "tip:"+tips[rand()%tipsiz]), sleep(1000);
system("cls"), scor=MP::main(-1), sleep(1000);
system("cls");
if(scor==233) return;
if(scor==666) goto start;
if(scor>=60) {
goxy(2, 16), print(pyellow, "过关啦!"), sleep(1000);
goxy(3, 16), print(pyellow, "分数 "+iturns(scor, 0));
if(p>0) score[p]=max(score[p], scor);
goxy(4, 16), print(pgreen, "重来 返回 保存");
bqsiz=0, bq[++bqsiz]=button(4, 4, 16, 19), bq[++bqsiz]=button(4, 4, 22, 25), bq[++bqsiz]=button(4, 4, 28, 31);
} else {
goxy(2, 16), print(pyellow, "失败了!"), sleep(1000);
goxy(3, 16), print(pgreen, "重来 返回 保存");
bqsiz=0, bq[++bqsiz]=button(3, 3, 16, 19), bq[++bqsiz]=button(3, 3, 22, 25), bq[++bqsiz]=button(3, 3, 28, 31);
}
int now=clock();
while(1) if(clock()-now>=100) {
now=clock();
if(downL) {
int click;
getxy(px, py), click=button_check(bq, bqsiz, px, py);
if(click==1) goto start;
if(click==2) return;
if(click==3) {
rep(x, 1, 3) {
goxy(10, 6+8*x);
if(diymp[x]=="NuLl") print(pgreen, iturns(x, 0)), bq[++bqsiz]=button(10, 10, 6+8*x, 6+8*x);
else print(pred, iturns(x, 0)), bq[++bqsiz]=button(0, 0, 0, 0);
}
click=-1;
}
if(click>3) {
click-=3, diymp[click]=seed, diykey[click]=iturns(click, 0);
goxy(12, 10), print(pyellow, "设置对应钥匙码(不区分大小写)");
goxy(13, 10), mouse(1), cin>>diykey[click], diykey[click]=sdown(diykey[click]), mouse(0);
while(spmp[diykey[click]].size()) {
goxy(12, 10), print(1, " ");
goxy(12, 10), print(pred, "重复! 请重新设置");
goxy(13, 10), print(1, " ");
goxy(13, 10), mouse(1), cin>>diykey[click], diykey[click]=sdown(diykey[click]), mouse(0);
}
spmp[diykey[click]]=diymp[click], data_save();
system("cls"), print(pyellow, "已保存!"), sleep(2000);
return;
}
}
}
}
iv play(int p) {
if(p==1&&opn[0]==0) p=0;
int scor, bqsiz;
button bq[1000]={};
string seed;
switch(p) {
case 0: {
int diecnt=0;
system("cls"), print(pyellow, "你好!\n"), sleep(1500);
print(pyellow, "我是ITue, 你在这个世界里的向导!"), sleep(2500);
retry:;
MP::load("a01000001000100010000211110000010302000012210013004003"), MP::init();
system("cls"), scor=MP::main(0);
system("cls");
if(scor>=80) {
print(pyellow, "如你所见, 这是一个非常简单的游戏!\n"), sleep(1700);
print(pyellow, "......"), sleep(800);
print(pyellow, "......"), sleep(900);
rep(i, 1, 6) print(pyellow, "."), sleep(i*50);
system("cls"), print(pyellow, "我好像把你的s键搞丢了......"), sleep(2000);
system("cls"), print(pyellow, "没事的! 我还有一个s键!......可能, 有点, 不太适配?"), sleep(600);
print(pred, "s"), sleep(2000);
system("cls"), print(pyellow, "......"), sleep(1000);
print(pyellow, "我刚才..."), sleep(800), print(pyellow, "去看了一下代码, \n"), sleep(1300);
print(pyellow, "好像这个按钮不能在"), print(pblue, "蓝色方块"), print(pyellow, "下落的时候点......"), sleep(3000);
system("cls"), print(pyellow, "你不会怪我吧? QAQ"), sleep(4000);
system("cls"), print(pyellow, "其实, 还是有补救方案的, 可是那对于你来说, 有点...困难..."), sleep(1500);
system("cls"), print(pyellow, "我帮你换上了"), print(pred, "红色方块"), print(pyellow, "这样你就能按s键了!"), sleep(3000);
p=opn[0]=1, scor=0, data_save();
goto start;
} else {
diecnt++;
if(diecnt==1) print(pyellow, "是我的不对! 我忘记告诉你, 像==这样的方块是只能踩一次的!");
if(diecnt>=2&&diecnt<=5) print(pyellow, "怎么这么不小心呢? 再试一次!");
if(diecnt>=6&&diecnt<=12) print(pyellow, "为什么又回来了?");
if(diecnt==13) {
print(pyellow, "你是不是玩不起?");
memset(opn, 0, sizeof(opn)), memset(score, 0, sizeof(score));
exit(0);
}
sleep(1500);
goto retry;
}
break;
}
case 4: {
if(!opn[5]) {
system("cls"), print(pyellow, "哈喽哈, 又见面了~\n"), sleep(1800);
print(pyellow, "我这次给你带来了一个好玩的东西!"), sleep(1000);
print(pyellow, "那就是跳板!"), sleep(2000);
system("cls"), print(pred, "<< "), sleep(300), print(pred, ">> "), sleep(300), print(pred, "/\\ "), sleep(300), print(pred, "\\/\n"), sleep(1000);
print(pyellow, "这四个分别是往左、右、上、下跳的跳板!\n"), sleep(2000);
print(pyellow, "在踩到跳板的时候, 你可以用"), print(pred, "x"), print(pyellow, "键来触发!"), sleep(2500);
system("cls"), print(pyellow, "跳板会让你快速地前进两格, 祝你玩得愉快!"), sleep(3500);
}
goto start;
break;
}
case 6: {
if(!opn[7]) {
system("cls"), print(pyellow, "通关速度还挺快, 不愧是你\n"), sleep(2000);
print(pyellow, "看来我要给你点更加 有趣 的小东西了呢~"), sleep(3000);
system("cls"), print(pred, "LL RR\n"), sleep(1000);
print(pyellow, "这是两个旋转方块, 左旋和右旋\n"), sleep(2500);
print(pyellow, "站在上面的时候, 分别使用"), print(pred, " Q "), print(pyellow, "和"), print(pred, " E "), print(pyellow, "来使用它们!\n"), sleep(4000);
system("cls"), print(pyellow, "玩得愉快!"), sleep(2000);
}
goto start;
break;
}
default: {
start:;
MP::load(mp[p]), MP::init();
system("cls"), print(pwhite, "tip:"+tips[rand()%tipsiz]), sleep(1000);
system("cls"), scor=MP::main(p), sleep(1000);
system("cls");
if(scor==233) return;
if(scor==666) goto start;
if(scor>=60) {
opn[p+1]=1;
goxy(2, 16), print(pyellow, "过关啦!"), sleep(1000);
goxy(3, 16), print(pyellow, "分数 "+iturns(scor, 0));
if(p>0) score[p]=max(score[p], scor), print(pyellow, " 最高 "+iturns(score[p], 0)), data_save();
goxy(4, 16), print(pgreen, "重来 返回");
bqsiz=0, bq[++bqsiz]=button(4, 4, 16, 19), bq[++bqsiz]=button(4, 4, 22, 25);
while(1) if(downL) {
int chos;
getxy(px, py), chos=button_check(bq, bqsiz, px, py);
if(chos==1) goto start;
if(chos==2) return;
}
} else {
goxy(2, 16), print(pyellow, "失败了!"), sleep(1000);
goxy(3, 16), print(pgreen, "重来 返回");
bqsiz=0, bq[++bqsiz]=button(3, 3, 16, 19), bq[++bqsiz]=button(3, 3, 22, 25);
while(1) if(downL) {
int chos;
getxy(px, py), chos=button_check(bq, bqsiz, px, py);
if(chos==1) goto start;
if(chos==2) return;
}
}
break;
}
}
}
iv lock() {
goxy(20, 12), print(pred, "该关卡尚未解锁!"), sleep(1000), print(pwhite, " ");
}
iv map_choser() {
chosing:;
memset(wich, 0, sizeof(wich));
px=4, py=7;
int p=1;
//7 15 23 31
string seed;
system("cls");
goxy(2, 10), print(pred, "exit");
wich[2][10]=wich[2][11]=wich[2][12]=wich[2][13]=-1;
goxy(2, 16), print(pwhite, "Choose Map");
while(p<=totL) {
goxy(px, py), print(pred+(opn[p]? pyellow*16: pgrey*16), iturns(p, 3));
wich[px][py]=wich[px][py+1]=wich[px][py+2]=(opn[p]? p: -2);
py+=6, p++;
if(py>31) py=7, px+=2;
}
goxy(px, py), print(pred+pyellow*16, "DIY");
wich[px][py]=wich[px][py+1]=wich[px][py+2]=totL+1;
bool flag=1, sptip=0;
while(flag) if(downL) {
getxy(px, py), p=wich[px][py];
if(p>0&&p<=totL) play(p), flag=0;
else if(p==totL+1) DIY_map(), flag=0;
else if(p==-1) return;
else if(p==-2) lock();
}
goto chosing;
}
iv about() {
system("cls");
print(pwhite, "游戏名称 Beat BIT!\n");
sleep(1000);
print(pwhite, "作者 atue, ztue\n");
sleep(1000);
print(pwhite, "开始制作时间 2021/4/1\n\n");
sleep(1000);
print(pyellow, "一些提示:\n");
sleep(1000);
print(pyellow, "按P以暂停\n");
sleep(1000);
print(pyellow, "事实上, aczbc\n");
sleep(1000);
print(pyellow, "几乎所有的等待时间都可以用空格跳过哦~\n");
sleep(1000);
print(pred, "\n\n按s以返回");
while(1) if(keydown('S')) return;
}
iv test_main() {
special_map();
begin:;
data_read();
system("cls"), sleep(200), goxy(2, 16);
string out[9]={"B", "E", "A", "T", " ", "B", "I", "T", "!"};
rep(i, 0, 8) print(rand()%2? pred: pblue, out[i]), sleep(20);
goxy(1, 1), print(pred, "exit");
goxy(1, 41), print(pgreen, "关于");
int t=clock(), scren=0;
if(opn[0]==0) goxy(12, 6), print(pred, "请先确保你的快速编辑模式已关闭!");
while(1) {
if(downL) {
getxy(px, py);
if(px==1&&py>=1&&py<=4) return;
if(px==1&&py>=41&&py<=44) {
about();
goto begin;
}
}
if(clock()-t>=700) {
goxy(4, 16), print(rand()%8+8, scren? " ": "按S以开始");
scren^=1, t=clock();
}
if(keydown('S')) break;
}
map_choser();
goto begin;
}
iv main() {
//没的很, 甚至比story还要没得很
}
}
int main() {
system("mode con cols=44 lines=22");
color(pwhite), mouse(0), srand(time(NULL));
BS::test_main();
system("mode con cols=82 lines=25");
color(7), mouse(1);
}
大乱斗
//转自:https://www.luogu.com.cn/discuss/30357?page=59
//为了打代码时方便, 几乎所有变量名及函数名为拼音。
#include<bits/stdc++.h>
#include<Windows.h>
#include<sys/stat.h>
#include<cstdlib>
#define int long long
using namespace std;
int x;
string yonghuming;
int jinbi=150,zuanshi=25,dengji=1,jingyanzhi,paiwei1=1,paiwei2=1,xing=1,shengming=120,gongji=15,fangyu=8;
int shengmingdengji,gongjidengji,fangyudengji;
int zhudongji[101],beidongji[101];
string duanwei[101]={"","黑铁","青铜","白银","黄金","铂金","钻石","王者","枭雄","无敌霸主"};
string zhudongji1[101]={"","利剑","火焰","毒气","冰冻","横扫"};
string zhudongjishuoming[101]={"","本次攻击+100","目标3回合内每回合生命-(攻击*1.2)","目标3回合内每回合生命-(目标当前生命*0.2)","使目标1回合内无法行动","所有敌人生命-(攻击*0.8)"};
int zhudongjizuanshi[101]={0,24,15,18,12,20};
string beidongji1[101]={"","盾牌","灭火【开发中】","解毒【开发中】","解冻【开发中】","荆棘"};
string beidongjishuoming[101]={"","防御+500【当受到非技能攻击时】","解除以自身为目标的火焰","解除以自身为目标的毒气","解除以自身为目标的冰冻","使攻击者受到(攻击者的攻击*5)的伤害【对技能伤害无效】"};
int beidongjizuanshi[101]={0,20,12,15,10,15};
string duanweishuzi[101]={"","I","II","III","IV","V","VI","VII","VIII","IX","X"};
int xing1[101]={0,1,3,3,5,5,5,6,8,1e9},duanweidengji[101]={0,1,3,3,3,5,5,10,10,1e9};
int duanweidiren[101]={0,1,3,3,5,5,5,8,8,10};
int diren,dishengming[10001],digongji[10001],difangyu[10001];
int shengming1,gongji1,fangyu1;
int huoyan[101],duqi[101],bingdong[101];
int win;
bool jingji1,fuhuo;
void jiemian()
{
system("cls");
printf("-------------------------------***** 大乱斗 *****-------------------------------\n");
if(paiwei1!=9)
{
cout<<yonghuming<<" "<<duanwei[paiwei1]<<duanweishuzi[paiwei2]<<" ";
for(int i=1;i<=xing;i++)
cout<<"★";
for(int i=xing+1;i<=xing1[paiwei1];i++)
cout<<"☆";
cout<<endl;
}
else
{
cout<<yonghuming<<" "<<duanwei[paiwei1]<<" ";
for(int i=1;i<=xing;i++)
cout<<"★";
cout<<endl;
}
printf("Level:%lld exp:%lld/%lld\n",dengji,jingyanzhi,dengji*100);
printf("金币:%lld 钻石:%lld\n",jinbi,zuanshi);
}
void jiemian1()
{
system("cls");
printf("-------------------------------***** 大乱斗 *****-------------------------------\n");
}
void jiazai()
{
printf("正在加载中");
for(int i=1;i<=3;i++)
{
Sleep(300);
printf(".");
}
Sleep(300);
}
bool isFileExists_stat(string& name)
{
struct stat buffer;
return (stat(name.c_str(),&buffer)==0);
}
void dudang(string s)
{
FILE *fin;
fin=fopen(s.c_str(),"r");
fscanf(fin,"%lld",&jinbi);
fscanf(fin,"%lld",&zuanshi);
fscanf(fin,"%lld",&dengji);
fscanf(fin,"%lld",&jingyanzhi);
fscanf(fin,"%lld",&paiwei1);
fscanf(fin,"%lld",&paiwei2);
fscanf(fin,"%lld",&xing);
fscanf(fin,"%lld",&shengming);
fscanf(fin,"%lld",&gongji);
fscanf(fin,"%lld",&fangyu);
fscanf(fin,"%lld",&shengmingdengji);
fscanf(fin,"%lld",&gongjidengji);
fscanf(fin,"%lld",&fangyudengji);
for(int i=1;i<=5;i++)
fscanf(fin,"%lld",&zhudongji[i]);
for(int i=1;i<=5;i++)
fscanf(fin,"%lld",&beidongji[i]);
fclose(fin);
}
void cundang(string s)
{
FILE *fout;
fout=fopen(s.c_str(),"w");
fprintf(fout,"%lld\n",jinbi);
fprintf(fout,"%lld\n",zuanshi);
fprintf(fout,"%lld\n",dengji);
fprintf(fout,"%lld\n",jingyanzhi);
fprintf(fout,"%lld\n",paiwei1);
fprintf(fout,"%lld\n",paiwei2);
fprintf(fout,"%lld\n",xing);
fprintf(fout,"%lld\n",shengming);
fprintf(fout,"%lld\n",gongji);
fprintf(fout,"%lld\n",fangyu);
fprintf(fout,"%lld\n",shengmingdengji);
fprintf(fout,"%lld\n",gongjidengji);
fprintf(fout,"%lld\n",fangyudengji);
for(int i=1;i<=5;i++)
fprintf(fout,"%lld\n",zhudongji[i]);
for(int i=1;i<=5;i++)
fprintf(fout,"%lld\n",beidongji[i]);
fclose(fout);
}
void zhuce();
void denglu()
{
jiazai();
jiemian1();
printf("\n登录\n\n");
printf("请输入用户名:\n");
cin>>yonghuming;
printf("正在登录中");
for(int i=1;i<=3;i++)
{
Sleep(300);
printf(".");
}
Sleep(300);
string s=yonghuming+".in";
if(!isFileExists_stat(s))
{
printf("\n您没有注册该账号,请先注册!\n");
Sleep(1000);
zhuce();
return;
}
dudang(s);
printf("\n登录成功!\n");
Sleep(1000);
}
void zhuce()
{
jiazai();
jiemian1();
printf("\n注册\n\n");
printf("请输入用户名:\n");
cin>>yonghuming;
printf("正在注册中");
for(int i=1;i<=3;i++)
{
Sleep(300);
printf(".");
}
Sleep(300);
string s=yonghuming+".in";
if(isFileExists_stat(s))
{
printf("\n您已经注册过了该账号,请直接登录!\n");
Sleep(1000);
denglu();
return;
}
cundang(s);
printf("\n注册成功,请登录!\n");
Sleep(1000);
denglu();
}
void shengji()
{
int shuru;
at1:;
jiazai();
jiemian();
printf("\n升级属性\n\n");
printf("生命:%lld级 %lld\n",shengmingdengji,shengming);
printf("攻击:%lld级 %lld\n",gongjidengji,gongji);
printf("防御:%lld级 %lld\n",fangyudengji,fangyu);
int shengmingjinbi=shengmingdengji*50+60,gongjijinbi=gongjidengji*20+30,fangyujinbi=fangyudengji*15+20;
printf("1 生命+30 %lld金币\n",shengmingjinbi);
printf("2 攻击+6 %lld金币\n",gongjijinbi);
printf("3 防御+2 %lld金币\n",fangyujinbi);
printf("4 返回\n");
scanf("%lld",&shuru);
if(shuru==1)
{
if(shengmingjinbi>jinbi)
printf("金币不足!\n");
else
{
printf("升级成功!\n");
shengmingdengji++,shengming+=30,jinbi-=shengmingjinbi;
string s=yonghuming+".in";
cundang(s);
}
}
else if(shuru==2)
{
if(gongjijinbi>jinbi)
printf("金币不足!\n");
else
{
printf("升级成功!\n");
gongjidengji++,gongji+=6,jinbi-=gongjijinbi;
string s=yonghuming+".in";
cundang(s);
}
}
else if(shuru==3)
{
if(fangyujinbi>jinbi)
printf("金币不足!\n");
else
{
printf("升级成功!\n");
fangyudengji++,fangyu+=2,jinbi-=fangyujinbi;
string s=yonghuming+".in";
cundang(s);
}
}
else if(shuru==4)
return;
else
printf("无效输入!!!\n");
Sleep(1000);
goto at1;
}
void jineng()
{
int shuru;
at2:;
jiazai();
jiemian();
printf("\n购买技能\n\n");
printf("1 主动技\n");
printf("2 被动技\n");
printf("3 返回\n");
scanf("%lld",&shuru);
if(shuru==1)
{
jiazai();
jiemian();
for(int i=1;i<=5;i++)
cout<<i<<" "<<zhudongji1[i]<<" "<<zhudongjishuoming[i]<<" "<<ceil(zhudongjizuanshi[i]*paiwei1*0.5)<<endl;
cout<<"6 返回\n";
int x;
scanf("%lld",&x);
if(x==6)
return;
if(x>5||x<1)
printf("无效输入!!!\n");
else
if(ceil(zhudongjizuanshi[x]*paiwei1*0.5)>zuanshi)
printf("钻石不足!\n");
else
{
zhudongji[x]++,zuanshi-=ceil(zhudongjizuanshi[x]*paiwei1*0.5);
printf("购买成功\n");
string s=yonghuming+".in";
cundang(s);
}
}
else if(shuru==2)
{
jiazai();
jiemian();
for(int i=1;i<=5;i++)
cout<<i<<" "<<beidongji1[i]<<" "<<beidongjishuoming[i]<<" "<<ceil(beidongjizuanshi[i]*paiwei1*0.5)<<endl;
cout<<"6 返回\n";
int x;
scanf("%lld",&x);
if(x==6)
return;
if(x>5||x<1)
printf("无效输入!!!\n");
else
{
if(x>=2&&x<=4)
printf("由于人机没有技能,该技能目前没有任何用处,娱乐模式及其附带被动技正在开发中。\n");
else if(ceil(beidongjizuanshi[x]*paiwei1*0.5)>zuanshi)
printf("钻石不足!\n");
else
{
beidongji[x]++,zuanshi-=ceil(beidongjizuanshi[x]*paiwei1*0.5);
printf("购买成功\n");
string s=yonghuming+".in";
cundang(s);
}
}
}
else if(shuru==3)
return;
else
printf("无效输入!!!\n");
goto at2;
}
void dengjitisheng()
{
while(jingyanzhi>=(dengji*100))
{
jingyanzhi-=(dengji*100);
shengming+=10,gongji+=3,fangyu+=1;
dengji++;
printf("恭喜升级!\n");
Sleep(1000);
}
string s=yonghuming+".in";
cundang(s);
}
void duanweitisheng()
{
if(paiwei1<9)
{
if(xing>xing1[paiwei1])
{
xing=1;
paiwei2++;
printf("段位提升*1!\n");
if(paiwei2>duanweidengji[paiwei1])
{
paiwei2=1;
paiwei1++;
printf("段位提升*inf!\n");
}
}
if(xing<0)
{
if(paiwei1>1)
{
paiwei2--;
printf("段位下降*1!\n");
if(paiwei2<1)
{
paiwei1--;
paiwei2=duanweidengji[paiwei1];
printf("段位下降*inf!\n");
}
}
xing=xing1[paiwei1];
}
}
string s=yonghuming+".in";
cundang(s);
}
void paiwei()
{
fuhuo=0;
win=0;
int shuru;
jiazai();
jiemian();
diren=duanweidiren[paiwei1];
int diren1=0;
int q=paiwei1;
if(q==9)
q+=(xing/3);
if(q>=9)
for(int i=1;i<=diren;i++)
{
dishengming[i]=rand()%(q*30+1)+(q*80);
digongji[i]=rand()%(q*5+1)+(q*10);
difangyu[i]=rand()%(q*3+1)+(q*5);
}
else if(paiwei2<=ceil(duanweidengji[q]*0.5))
for(int i=1;i<=diren;i++)
{
dishengming[i]=rand()%(q*30+1)+(q*50);
digongji[i]=rand()%(q*3+1)+(q*7);
difangyu[i]=rand()%(q*2+1)+(q*3);
}
else
for(int i=1;i<=diren;i++)
{
dishengming[i]=rand()%(q*30+1)+(q*80);
digongji[i]=rand()%(q*5+1)+(q*10);
difangyu[i]=rand()%(q*3+1)+(q*5);
}
shengming1=shengming,gongji1=gongji,fangyu1=fangyu;
jiemian();
cout<<yonghuming<<": "<<shengming1<<" "<<gongji1<<" "<<fangyu1<<endl;
for(int i=1;i<=diren;i++)
{
cout<<"P"<<i<<": ";
if(dishengming[i]<=0)
cout<<"Dead\n";
else
cout<<dishengming[i]<<" "<<digongji[i]<<" "<<difangyu[i]<<endl;
}
cout<<"按下回车键以进入战场。\n";
getchar();
getchar();
jiemian1();
cout<<" * * * * *\n";
cout<<" *\n";
cout<<" *\n";
cout<<" *\n";
cout<<" * * * * *\n";
cout<<" *\n";
cout<<" *\n";
cout<<" *\n";
cout<<" * * * * *\n";
Sleep(1000);
jiemian1();
cout<<" * * * * *\n";
cout<<" *\n";
cout<<" *\n";
cout<<" *\n";
cout<<" * * * * *\n";
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * * * * *\n";
Sleep(1000);
jiemian1();
cout<<" * \n";
cout<<" * * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * \n";
cout<<" * * * * *\n";
Sleep(1000);
memset(huoyan,0,sizeof(huoyan));
memset(duqi,0,sizeof(duqi));
memset(bingdong,0,sizeof(bingdong));
win=0;
for(int k=1;;k++)
{
if(shengming1<=0)
win=-1;
if(diren1>=diren)
win=1;
if(win!=0)
break;
gongji1=gongji,fangyu1=fangyu;
aatt1:;
jiemian1();
cout<<"\n回合"<<k<<endl;
cout<<endl<<yonghuming<<": "<<shengming1<<" "<<gongji1<<" "<<fangyu1<<endl;
for(int i=1;i<=diren;i++)
{
cout<<"P"<<i<<": ";
if(dishengming[i]<=0)
cout<<"Dead\n";
else
cout<<dishengming[i]<<" "<<digongji[i]<<" "<<difangyu[i]<<endl;
}
cout<<"技能:\n";
for(int i=1;i<=5;i++)
if(zhudongji[i]>0)
cout<<i<<" "<<zhudongji1[i]<<endl;
cout<<"6 不使用\n";
cin>>shuru;
if(shuru==6)
{
cout<<"您本次未使用技能。\n";
Sleep(1000);
goto aatt;
}
if(shuru<1||shuru>5)
{
cout<<"该技能不存在!请重新选择技能。\n";
goto aatt1;
}
if(zhudongji[shuru]<=0)
{
cout<<"您没有此技能!本次您将无法使用技能。\n";
Sleep(1000);
goto aatt;
}
if(shuru==1)
{
gongji1+=100;
zhudongji[shuru]--;
cout<<"使用成功!\n";
Sleep(1000);
}
if(shuru==2)
{
cout<<"请选择目标。\n";
int x;
cin>>x;
if(x<1||x>diren)
{
cout<<"没有该目标!请重新选择技能。\n";
Sleep(1000);
goto aatt1;
}
if(dishengming[x]<=0)
{
cout<<"目标已经死亡!请重新选择技能。\n";
Sleep(1000);
goto aatt1;
}
huoyan[x]+=3;
zhudongji[shuru]--;
cout<<"使用成功!\n";
Sleep(1000);
}
if(shuru==3)
{
cout<<"请选择目标。\n";
int x;
cin>>x;
if(x<1||x>diren)
{
cout<<"没有该目标!请重新选择技能。\n";
Sleep(1000);
goto aatt1;
}
if(dishengming[x]<=0)
{
cout<<"目标已经死亡!请重新选择技能。\n";
Sleep(1000);
goto aatt1;
}
duqi[x]+=3;
zhudongji[shuru]--;
cout<<"使用成功!\n";
Sleep(1000);
}
if(shuru==4)
{
cout<<"请选择目标。\n";
int x;
cin>>x;
if(x<1||x>diren)
{
cout<<"没有该目标!请重新选择技能。\n";
Sleep(1000);
goto aatt1;
}
if(dishengming[x]<=0)
{
cout<<"目标已经死亡!请重新选择技能。\n";
Sleep(1000);
goto aatt1;
}
bingdong[x]+=1;
zhudongji[shuru]--;
cout<<"使用成功!\n";
Sleep(1000);
}
if(shuru==5)
{
cout<<"使用成功!\n";
Sleep(1000);
for(int i=1;i<=diren;i++)
if(dishengming[i]>0)
{
cout<<"P"<<i<<": "<<dishengming[i]<<"→";
dishengming[i]-=floor(gongji1*0.8);
cout<<dishengming[i]<<endl;
Sleep(1000);
if(dishengming[i]<=0)
{
cout<<yonghuming<<" 杀死了 P"<<i<<endl;
Sleep(1000);
diren1++;
}
}
zhudongji[shuru]--;
}
aatt:;
if(diren1>=diren)
{
win=1;
break;
}
aatt2:;
jiemian1();
cout<<"\n回合"<<k;
cout<<endl<<yonghuming<<": "<<shengming1<<" "<<gongji1<<" "<<fangyu1<<endl;
for(int i=1;i<=diren;i++)
{
cout<<"P"<<i<<": ";
if(dishengming[i]<=0)
cout<<"Dead\n";
else
cout<<dishengming[i]<<" "<<digongji[i]<<" "<<difangyu[i]<<endl;
}
cout<<endl<<"攻击\n";
cout<<"请输入攻击对象:\n";
cin>>shuru;
if(shuru<1||shuru>diren)
{
cout<<"没有该目标!请重新选择目标。\n";
Sleep(1000);
goto aatt2;
}
if(dishengming[shuru]<=0)
{
cout<<"目标已经死亡!请重新选择目标。\n";
Sleep(1000);
goto aatt2;
}
cout<<"攻击成功!\n";
cout<<"P"<<shuru<<": "<<dishengming[shuru]<<"→";
dishengming[shuru]-=max(1ll,(gongji1-difangyu[shuru]));
cout<<dishengming[shuru]<<endl;
Sleep(1000);
if(dishengming[shuru]<=0)
{
cout<<yonghuming<<" 杀死了 P"<<shuru<<endl;
Sleep(1000);
diren1++;
}
for(int i=1;i<=diren;i++)
if(dishengming[i]>0)
{
gongji1=gongji,fangyu1=fangyu;
jiemian1();
cout<<"\n敌方行动\n\n";
cout<<"P"<<i<<":\n";
if(huoyan[i]>0)
{
cout<<"火焰"<<": ";
cout<<dishengming[i]<<"→";
dishengming[i]-=floor(gongji*1.5);
huoyan[i]--;
cout<<dishengming[i]<<endl;
Sleep(1000);
}
if(duqi[i]>0)
{
cout<<"毒气"<<": ";
cout<<dishengming[i]<<"→";
dishengming[i]-=floor(dishengming[i]*0.2);
duqi[i]--;
cout<<dishengming[i]<<endl;
Sleep(1000);
}
if(dishengming[i]<=0)
{
cout<<yonghuming<<" 杀死了 P"<<i<<endl;
Sleep(1000);
diren1++;
continue;
}
if(bingdong[i]>0)
{
cout<<"冰冻"<<endl;
bingdong[i]--;
Sleep(1000);
continue;
}
if(beidongji[5]>0)
{
cout<<yonghuming<<":荆棘\n";
jingji1=1;
Sleep(1000);
beidongji[5]--;
}
if(beidongji[1]>0)
{
cout<<yonghuming<<":盾牌\n";
fangyu1+=500;
Sleep(1000);
beidongji[1]--;
}
cout<<yonghuming<<": "<<shengming1<<"→";
shengming1-=max(1ll,(digongji[i]-fangyu1));
cout<<shengming1<<endl;
Sleep(1000);
if(shengming1<=0)
{
cout<<"P"<<i<<" 杀死了 "<<yonghuming<<endl;
Sleep(1000);
if(fuhuo==0)
{
int jinbi1=shengming-shengming1,zuanshi1=q*10;
printf("是否花费%lld金币+%lld钻石复活?\n",jinbi1,zuanshi1);
cout<<"1 是\n2 否\n";
int qwq;
cin>>qwq;
if(qwq==1)
{
if(jinbi1>jinbi)
{
cout<<"金币不足!\n";
qwq=2;
}
if(zuanshi1>zuanshi)
{
cout<<"钻石不足!\n";
qwq=2;
}
if(qwq==1)
{
fuhuo=1;
cout<<"复活成功!\n";
jinbi-=jinbi1,zuanshi-=zuanshi1;
shengming1=shengming;
}
}
if(qwq==2)
{
cout<<yonghuming<<" 失败了!\n";
Sleep(1000);
win=-1;
break;
}
if(qwq<1||qwq>3)
cout<<"无效输入!\n";
}
}
if(jingji1==1)
{
jingji1=0;
cout<<"P"<<i<<": "<<dishengming[i]<<"→";
dishengming[i]-=floor(digongji[i]*5);
cout<<dishengming[i]<<endl;
Sleep(1000);
if(dishengming[i]<=0)
{
cout<<yonghuming<<" 杀死了 P"<<i<<endl;
diren1++;
Sleep(1000);
}
}
}
}
jiazai();
jiemian();
if(win==1)
{
cout<<"您赢得了这场战斗的胜利!\n";
jingyanzhi+=(q*min(30ll,max(shengming1,shengming/diren)));
jinbi+=min(q*100,shengming1*10);
zuanshi+=30*ceil(q*0.5);
xing++;
}
if(win==-1)
{
cout<<"您输掉了这场战斗!\n";
jingyanzhi+=(q*5);
jinbi+=(diren1+5)*10;
zuanshi+=5*ceil(q*0.5);
xing--;
}
dengjitisheng();
duanweitisheng();
Sleep(1000);
jiemian();
}
void guize()
{
jiazai();
jiemian();
printf("·排位:对战多个人机,所有人机都只以你为目标。");
printf("·段位高,升段所需的星星及该段位包含的等级数就多,且人机数量就多、能力就强,不过每场排位的奖励也多。\n");
printf("·人机不会使用技能。\n");
printf("·排位获胜加1星,失败减1星,若段位为“黑铁”则不掉星。\n");
printf("·到达“无敌霸主”段位后,星星将无限增加。\n");
printf("·无论获胜还是失败都会增加经验、金币、钻石,但获胜增加更多。\n");
printf("·升级属性需要金币,购买技能需要钻石,它们会越来越贵。\n");
printf("·每购买一个技能,使用一次后就没了,但可以购买多个。\n");
printf("·每次只能发动一个主动技和攻击一次。\n");
printf("·若防御大于等于攻击,则伤害为1。\n");
printf("·先使用主动技再攻击。\n");
printf("·主动技选择发动,被动技满足条件一定触发。\n");
printf("·技能“火焰”、“毒气”、“冰冻”可以叠加回合次数,且会在目标开始行动时触发,有多个则都会触发。\n");
printf("·如果发动未拥有的主动技,则会受到惩罚,该回合无法使用技能。\n");
printf("·被动技“盾牌”与“荆棘”不会发生冲突,使用“荆棘”仍然会受到伤害,如果已经死亡,则不会触发“荆棘”。\n");
printf("·回合:所有玩家及人机都行动一次【被冰冻也算】是一个回合。\n");
printf("·大部分除法、小数乘法均向下取整。\n");
printf("·每场排位可花费金币和钻石复活一次。\n");
printf("\n·后续更新:\n");
printf(" ·娱乐:多人乱斗,每人生命、攻击、防御在一定范围内随机。\n");
printf(" ·将来技能“灭火”、“解毒”、“解冻”会在娱乐中派上用场。\n");
printf(" ·以后会更新更多的技能。\n");
printf("\n按下回车键以返回。\n");
getchar();
getchar();
}
signed main()
{
int shuru;
srand((int)time(0));
jiemian1();
printf(" * * * * * * * * * * * * * * *\n");
printf(" * *\n");
printf(" * * * * * * * * * * * *\n");
printf(" * * * * * *\n");
printf(" * * * *\n");
printf(" * * *\n");
printf(" * * * * *\n");
printf(" * * * *\n");
printf(" * * * *\n");
printf(" * * * *\n");
printf(" * * * *\n");
printf(" * * * *\n");
printf(" * * * * *\n");
printf(" * *\n");
printf(" * * * * * * * * * * * * * * *\n");
printf("正在初始化");
for(int i=1;i<=6;i++)
{
Sleep(300);
printf(".");
}
Sleep(300);
printf("\n正在进入游戏");
for(int i=1;i<=3;i++)
{
Sleep(300);
printf(".");
}
Sleep(300);
jiemian1();
printf("\n欢迎来到大乱斗!\n开发者:西安铁一中分校 徐逸飞\n\n");
atat:;
printf("1 登录\n2 注册\n");
scanf("%lld",&shuru);
if(shuru==1)
denglu();
else if(shuru==2)
zhuce();
else
{
printf("无效输入!!!\n");
jiazai();
jiemian1();
goto atat;
}
at:;
jiazai();
jiemian();
printf("1 排位\n");
printf("2 娱乐【开发中】\n");
printf("3 规则\n");
printf("4 升级属性\n");
printf("5 购买技能\n");
printf("6 退出\n");
int shuru1;
scanf("%lld",&shuru1);
if(shuru1==1)
paiwei();
else if(shuru1==2)
cout<<"开发中!\n";
else if(shuru1==3)
guize();
else if(shuru1==4)
shengji();
else if(shuru1==5)
jineng();
else if(shuru1==6)
{
string s=yonghuming+".in";
cundang(s);
printf("下次再来!\n");
return 0;
}
else
printf("无效输入!!!\n");
goto at;
return 0;
}
易帆小游戏
//转自:https://www.luogu.com.cn/paste/8lays4g2
#include<bits/stdc++.h>
#include<conio.h>
#include<windows.h>
#define endl '\n'
using namespace std;
struct bigint
{
vector<int>a;
bigint(int x=0)
{
do
{
a.push_back(x%10);
x/=10;
}while(x);
}
int &operator[](int i)
{
return a[i];
}
int &operator()(string c)
{
do
{
a.push_back(c[c.size()-1]-48);
c.erase(c.size()-1,1);
}while(c.size());
}
void flatten(int l)
{
a.resize(l+1);
for(int i=0;i<l;i++)
a[i+1]+=a[i]/10,a[i]%=10;
while(!a[a.size()-1])a.pop_back();
if(a.size()==0)a.push_back(0);
}
void unflatten(int l)
{
for(int i=0;i<l-1;i++)
if(a[i]<0)a[i]+=10,a[i+1]--;
while(!a[a.size()-1])a.pop_back();
if(a.size()==0)a.push_back(0);
}
void print()
{
for(int i=max(0,int(a.size()-1));i>=0;i--)
cout<<a[i];
}
};
bool operator==(bigint a,bigint b)
{
if(a.a.size()!=b.a.size())return 0;
for(int i=a.a.size()-1;i>=0;i--)
if(a[i]!=b[i])return 0;
return 1;
}
bool operator<(bigint a,bigint b)
{
if(a==b)return 0;
if(a[a.a.size()-1]<0)
{
if(b[b.a.size()>=0])return 1;
else
{
if(a.a.size()<b.a.size())return 0;
if(a.a.size()>b.a.size())return 1;
for(int i=a.a.size()-1;i>=0;i--)
if(b[i]<a[i])return 1;
else if(b[i]>a[i])return 0;
}
}
else
{
if(a.a.size()<b.a.size())return 1;
if(a.a.size()>b.a.size())return 0;
for(int i=a.a.size()-1;i>=0;i--)
if(a[i]<b[i])return 1;
else if(a[i]>b[i])return 0;
}
}
bool operator<=(bigint a,bigint b)
{
if(a<b||a==b)return 1;
else return 0;
}
bool operator>(bigint a,bigint b)
{
if(a<=b)return 0;
else return 1;
}
bool operator>=(bigint a,bigint b)
{
if(a>b||a==b)return 1;
else return 0;
}
bigint operator+(bigint a,bigint b)
{
int size=max(a.a.size(),b.a.size());
b.a.resize(size);
a.a.resize(size);
for(int i=0;i<size;i++)
a[i]+=b[i];
a.flatten(size+1);
return a;
}
bigint operator-(bigint a,bigint b)
{
bool test=0;
int size=max(a.a.size(),b.a.size());
b.a.resize(size);
a.a.resize(size);
if(a==b)return 0;
if(a<b)
{
bigint c=a;a=b;b=c;test=1;
}
for(int i=size-1;i>=0;i--)
a[i]-=b[i];
a.unflatten(size);
if(test)a[a.a.size()-1]=-a[a.a.size()-1];
return a;
}
bigint operator/(bigint &a,int b)
{
bigint c;
b=int(log10(b));
c.a.resize(a.a.size()-b);
for(int i=a.a.size()-1;i>=b;i--)
c[i-b]=a[i];
while(a.a.size()>b)a.a.pop_back();
while(!a[a.a.size()-1]&&a.a.size()>1)a.a.pop_back();
return c;
}
bigint operator*(bigint a,int b)
{
bigint c;
int len=a.a.size();
c.a.resize(len+11);
for(int i=0;i<len;i++)
c[i]=a[i]*b;
c.flatten(len+int(log10(b))+1);
return c;
}
bigint coin(0),val(1000),atk1(10),def1(3);
int x,atk2=0,def2=0,haoyun=0,t;//初始化
struct xxx{
int gongji,jianshang,jiaxue;
}chongwu;
struct xxxx{
bigint gongji,fangyu,xue,coin;
}zuo,you;
int main()
{
SetConsoleTitle("易帆小游戏");//控制标题
srand(time(0));
cout<<"2021年某一天,你很累,刚刚躺下床,突然发现....我在哪里?"<<endl<<endl;
cout<<"请问您干什么?0、掐自己一下 1、走动看看 "<<endl<<endl;
x=getch()-48;
while(x!=1&&x!=0)cout<<"输入错误,请重新输入0或者1"<<endl<<endl,x=getch()-48;
if(x==0){cout<<"哎哟,好疼....你醒了!游戏全部结束";Sleep(2000);return 0;}
while(1)
{system("cls");//清屏
cout<<"温馨提示:当前你拥有金币";coin.print();cout<<"元,拥有生命值";val.print();cout<<",攻击力";atk1.print();cout<<"+"<<atk2<<"=";(atk1+atk2).print();cout<<",防御力";def1.print();cout<<"+"<<def2<<"=";(def1+def2).print();cout<<"!"<<endl;
cout<<"宠物攻击力"<<chongwu.gongji<<" 宠物减伤"<<chongwu.jianshang<<" 宠物加血"<<chongwu.jiaxue<<endl<<endl;
cout<<"你看见四周些建筑,有矿场,有武器防御店,有药店,有宠物店,一条未知的路"<<endl<<endl;
cout<<"请问你要去哪里?1、矿场 2、武器防御店 3、药店 4、宠物店 5、强化武器防御 6、向前走走(危险) 7、呼叫CCF"<<endl<<endl;
x=getch()-48; while(x<1||x>7)x=getch()-48;
switch(x)
{case 1:
cout<<"请问你要干什么?1、打工挖金矿,3000一个月 2、金矿附近逛逛 3、离开"<<endl<<endl;
x=getch()-48; while(x<1||x>3)x=getch()-48;
if(x==1)
{cout<<"你正在挖矿,持续一个月"<<endl<<endl;
coin=coin+3000;
Sleep(1000);cout<<"十天后...";
Sleep(1000);cout<<"二十天后...";
Sleep(1000);cout<<"三十天后...";
if(rand()%10>=9) {coin=coin+10000;cout<<"悄悄偷了10000金币!";}
if(rand()%100>=99&&atk1+atk2<=200){cout<<"你遇到一群强盗!人被打晕!金币全被抢走!"<<endl<<endl<<endl<<endl;coin=0;}
cout<<"你现在拥有金币";coin.print();cout<<"元"<<endl<<endl;
Sleep(1000);
}
if(x==2)
{cout<<"你在散步....按任意键结束散步"<<endl;
while(1)
{Sleep(2000);
int m=rand()%1000;
coin=coin+m;
cout<<"你捡到"<<m<<"金币,窃喜........当前拥有";coin.print();cout<<"金币"<<endl;
if(rand()%1000>=900&&atk1+atk2<=200){cout<<"你遇到一群强盗!人被打晕!金币全被抢走!"<<endl<<endl<<endl<<endl<<endl;coin=0;}
if(kbhit())break;
}
}
if(x==3) break;
break;
case 2:
cout<<"欢迎来到易帆武器防御店,请问有什么需要?我们这里可以购买1、破旧小刀1000 2、极品大刀30000 3、神秘破铁10000000"<<endl;
cout<<"4、破旧衣服1000 5、极品衣服30000 6、神秘布料10000000 7、离开武器防御店"<<endl<<endl;
while(1)
{x=getch()-48; while(x<1||x>7)x=getch()-48;
if(x==1){if(coin>=1000){coin=coin-1000;atk2=10;cout<<"购买破旧小刀成功!还剩";coin.print();cout<<"元,攻击力加10,当前攻击";(atk1+atk2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==2){if(coin>=30000){coin=coin-30000;atk2=100;cout<<"购买极品大刀成功!还剩";coin.print();cout<<"元,攻击力加100,当前攻击";(atk1+atk2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==3){if(coin>=10000000){coin=coin-10000000;atk2=5;cout<<"购买神秘破铁成功!还剩";coin.print();cout<<"元,攻击力加5,当前攻击";(atk1+atk2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==4){if(coin>=1000){coin=coin-1000;def2=10;cout<<"购买破旧衣服成功!还剩";coin.print();cout<<"元,防御力加10,当前防御";(def1+def2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==5){if(coin>=30000){coin=coin-30000;def2=100;cout<<"购买极品衣服成功!还剩";coin.print();cout<<"元,防御力加100,当前防御";(def1+def2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==6){if(coin>=10000000){coin=coin-10000000;def2=5;cout<<"购买神秘布料成功!还剩";coin.print();cout<<"元,防御力加5,当前防御";(def1+def2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==7)break;
}
cout<<"欢迎下次光临易帆武器防御店!!!";
break;
case 3:
cout<<"欢迎来到易帆药店,请问有什么需要?\n1、加血\n2、加攻击力\n3、加防御力\n4、好运来\n5、退出\n\n";
while(1)
{x=getch()-48; while(x<1||x>7)x=getch()-48;
if(x==1){if(coin>=100){val=val+(coin/100);cout<<"购买生命成功!还剩";coin.print();cout<<"元,当前生命";val.print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==2){if(coin>=10000){atk1=atk1+(coin/10000);cout<<"购买攻击强化药水成功!还剩";coin.print();cout<<"元,当前攻击";(atk1+atk2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==3){if(coin>=10000){def1=def1+(coin/10000);cout<<"购买防御强化药水成功!还剩";coin.print();cout<<"元,当前防御";(def1+def2).print();cout<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==4){if(coin>=1000000){coin=coin-1000000;haoyun=1;cout<<"好运来!祝你好运来!\n现在还剩";coin.print();cout<<"元,好运即将到来!"<<endl<<endl;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==5)break;
}
cout<<"欢迎下次光临易帆药水店!!!";
break;
case 4:
cout<<"欢迎来到易帆宠物店,请问需要什么样的宠物?我们这里有1、只会卖萌的宠物1000,攻击1,减伤1,加血1。 2、帮你打怪的宠物100000,攻击100 3、帮你扛伤害的宠物100000,减伤100 ";
cout<<" 4、给你打怪回血的宠物100000,加血10 5、极品宠物1000000,攻击50,减伤50,加血5 6、神宠蛋10000000,未知 7、离开宠物店"<<endl<<endl;
while(1)
{x=getch()-48; while(x<1||x>7)x=getch()-48;
if(x==1){if(coin>=1000){coin=coin-1000;cout<<"购买只会卖萌的宠物成功!还剩";coin.print();cout<<"元"<<endl<<endl;chongwu.gongji=1;chongwu.jianshang=1;chongwu.jiaxue=1;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==2){if(coin>=100000){coin=coin-100000;cout<<"购买帮你打怪的宠物成功!还剩";coin.print();cout<<"元"<<endl<<endl;chongwu.gongji=100;chongwu.jianshang=0;chongwu.jiaxue=0;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==3){if(coin>=100000){coin=coin-100000;cout<<"购买帮你扛伤害的宠物成功!还剩";coin.print();cout<<"元"<<endl<<endl;chongwu.gongji=0;chongwu.jianshang=100;chongwu.jiaxue=0;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==4){if(coin>=100000){coin=coin-100000;cout<<"购买给你打怪回血的宠物成功!还剩";coin.print();cout<<"元"<<endl<<endl;chongwu.gongji=0;chongwu.jianshang=0;chongwu.jiaxue=10;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==5){if(coin>=1000000){coin=coin-1000000;cout<<"购买极品宠物成功!还剩";coin.print();cout<<"元"<<endl<<endl;chongwu.gongji=50;chongwu.jianshang=50;chongwu.jiaxue=10;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==6){if(coin>=10000000){coin=coin-10000000;cout<<"购买神宠蛋成功!还剩";coin.print();cout<<"元"<<endl<<endl;chongwu.gongji=0;chongwu.jianshang=0;chongwu.jiaxue=5;}
else {cout<<"购买失败!您只有";coin.print();cout<<"元钱了"<<endl<<endl; }
}
if(x==7)break;
}
cout<<"欢迎下次光临易帆宠物店!!!";
break;
case 5:
cout<<"欢迎来到易帆武器防御强化店!请问您需要强化什么?1、武器 2、衣服 3、离开" <<endl;
while(1)
{x=getch()-48; while(x<1||x>3)x=getch()-48;
if(x==1)
{int k=atk2%10;
cout<<endl<<"强化第"<<k+1<<"级武器,成功率"<<90-10*k<<"%,费用"<<k*k*k*1000<<"金币,强化成功武器攻击力加10%到20%!"<<endl;
if(coin>=(k*k*k*1000))coin=coin-(k*k*k*1000);
else {cout<<"强化不成功!您只有";coin.print();cout<<"元钱了"<<endl<<endl;Sleep(2000);break;}
if(rand()%10>k){atk2=atk2*12/100*10+k+1;cout<<"恭喜你强化成功,当前金币";coin.print();cout<<"。当前攻击力为";(atk1+atk2).print();cout<<endl;}
else {cout<<"*_*你强化失败,当前金币";coin.print();cout<<"。当前攻击力为";(atk1+atk2).print();cout<<endl;}
}
if(x==2)
{int k=def2%10;
cout<<endl<<"强化第"<<k+1<<"级衣服,成功率"<<90-10*k<<"%,费用"<<k*k*k*1000<<"金币,强化成功衣服防御力加10%到20%!"<<endl;
if(coin>=(k*k*k*1000))coin=coin-(k*k*k*1000);
else {cout<<"强化不成功!您只有";coin.print();cout<<"元钱了"<<endl<<endl;Sleep(2000);break;}
if(rand()%10>k){def2=def2*12/100*10+k+1;cout<<"恭喜你强化成功,当前金币";coin.print();cout<<"。当前防御力为";(def1+def2).print();cout<<endl;}
else {cout<<"*_*你强化失败,当前金币";coin.print();cout<<"。当前防御力为";(def1+def2).print();cout<<endl;}
}
if(x==3)break;
}
cout<<"欢迎下次光临易帆武器防御强化店!!!";
break;
case 6:
t=1;
while(1)
{system("cls");
cout<<"温馨提示:当前你拥有金币";coin.print();cout<<"元,拥有生命值";val.print();cout<<",攻击力";atk1.print();cout<<"+"<<atk2<<"=";(atk1+atk2).print();cout<<",防御力";def1.print();cout<<"+"<<def2<<"=";(def1+def2).print();cout<<"!"<<endl;
cout<<"宠物攻击力"<<chongwu.gongji<<" 宠物减伤"<<chongwu.jianshang<<" 宠物加血"<<chongwu.jiaxue<<endl<<endl;
int key=0;
zuo.gongji=rand()%10*t;
zuo.gongji=zuo.gongji*t;
zuo.gongji=zuo.gongji*t+10;
you.gongji=rand()%10*t;
you.gongji=you.gongji*t;
you.gongji=you.gongji*t+10;
zuo.fangyu=rand()%10*t;
zuo.fangyu=zuo.fangyu*t+1;
you.fangyu=rand()%10*t;
you.fangyu=you.fangyu*t+1;
zuo.xue=rand()%100*t;
zuo.xue=zuo.xue*t;
zuo.xue=zuo.xue*t+10;
you.xue=rand()%100*t;
you.xue=you.xue*t;
you.xue=you.xue*t+10;
zuo.coin=rand()%1000*t;
zuo.coin=zuo.coin*t;
zuo.coin=zuo.coin*t;
zuo.coin=zuo.coin*t+5000;
you.coin=rand()%1000*t;
you.coin=you.gongji*t;
you.coin=you.coin*t;
you.coin=you.coin*t+5000;
cout<<"第"<<t<<"波未知生物属性:"<<endl;
cout<<"左边生物攻击";zuo.gongji.print();cout<<"、防御";zuo.fangyu.print();cout<<"、血量";zuo.xue.print();cout<<"、奖励金币为";zuo.coin.print();cout<<endl;
cout<<"右边生物攻击";you.gongji.print();cout<<"、防御";you.fangyu.print();cout<<"、血量";you.xue.print();cout<<"、奖励金币为";you.coin.print();cout<<endl;
cout<<"你想要?1、攻击1号生物 2、攻击2号生物 3、救命符逃跑-3000金币 (温馨提示:打斗过程中打不赢及时按3键逃跑,死亡金币全部丢失,好运丢失)"<<endl<<endl;
x=getch()-48; while(x<1||x>5)x=getch()-48;
if(x==1){
cout<<"进入战斗模式"<<endl;
bigint shanghai1,shanghai2;
if(atk1+atk2+chongwu.gongji>zuo.fangyu)shanghai1=atk1+atk2+chongwu.gongji-zuo.fangyu;
else shanghai1=0;
if(zuo.gongji>def1+def2+chongwu.jianshang)shanghai2=zuo.gongji-def1-def2-chongwu.jianshang;
else shanghai2=1;
while(1)
{zuo.xue=zuo.xue-shanghai1;
cout<<"你攻击了怪物,怪物丢失";shanghai1.print();cout<<"血量,剩余";zuo.xue.print();cout<<endl;
if(zuo.xue<=0){cout<<"恭喜你战胜怪物!你得到";zuo.coin.print();cout<<"金币!"<<endl;coin=coin+zuo.coin;break;}
val=val-shanghai2+chongwu.jiaxue;
cout<<"怪物攻击了你,你丢失";shanghai2.print();cout<<"血量,但同时宠物给你增加了"<<chongwu.jiaxue<<"血量,你剩余";val.print();cout<<endl;
if(val<=0){cout<<"你挂掉了!!!"<<endl<<"你将会丢失所有金钱,并失去好运状态!100天后复生"<<endl<<"请等待"<<endl;coin=0;haoyun=0;val=1;key=1;Sleep(10000);break;}
Sleep(400);
if(kbhit())break;
}
if(key==1)break;
}
if(x==2)
{
cout<<"进入战斗模式"<<endl;
bigint shanghai1(0),shanghai2(0);
if(atk1+atk2+chongwu.gongji>you.fangyu)shanghai1=atk1+atk2+chongwu.gongji-you.fangyu;
else shanghai1=0;
if(you.gongji>def1+def2+chongwu.jianshang)shanghai2=you.gongji-def1-def2-chongwu.jianshang;
else shanghai2=1;
while(1)
{you.xue=you.xue-shanghai1;
cout<<"你攻击了怪物,怪物丢失";shanghai1.print();cout<<"血量,剩余";you.xue.print();cout<<endl;
if(you.xue<=0){cout<<"恭喜你战胜怪物!你得到";you.coin.print();cout<<"金币!"<<endl;coin=coin+you.coin;break;}
val=val-shanghai2+chongwu.jiaxue;
cout<<"怪物攻击了你,你丢失";shanghai2.print();cout<<"血量,但同时宠物给你增加了"<<chongwu.jiaxue<<"血量,你剩余";val.print();cout<<endl;
if(val<=0){cout<<"你挂掉了!!!"<<endl<<"你将会丢失所有金钱,并失去好运状态!100天后复生"<<endl<<"请等待"<<endl;coin=0;haoyun=0;val=1;key=1;Sleep(10000);break;}
Sleep(400);
if(kbhit())break;
}
if(key==1)break;
}
if(x==3){coin=coin-3000;break;}
t++;
if(t%5==0&&haoyun==1&&coin<1000000)cout<<endl<<"因为钱不够,我好像错过了天大机缘"<<endl<<endl;
if(t%5==0&&haoyun==1&&coin>=1000000)
{cout<<endl<<"恭喜你遇到神秘商店,这里可以1、加工混沌破铁1000000 2、加工混沌金丝银线1000000 3、孵化神兽蛋1000000 4、离开"<<endl<<endl;
bool flag = 0;
int w = 0;
x=getch()-48; while(x<1||x>4)x=getch()-48;
if(x==1){coin=coin-1000000;if(atk2==5){atk2=10000;}else{w++;}flag=1;}
if(x==2){coin=coin-1000000;if(def2==5){def2=10000;}else{w++;}flag=1;}
if(x==3){coin=coin-1000000;if(chongwu.jiaxue==5){chongwu.gongji=1000;chongwu.jianshang=1000;chongwu.jiaxue=20;}else{w++;}flag=1;}
haoyun=haoyun-flag;
coin=coin+w*1000000;
}
}
break;
case 7:
cout<<"我是CCF,请问有什么可以帮你?1、保存游戏并关闭游戏 2、载入游戏 3、返回游戏 "<<endl<<endl;
x=getch()-48; while(x<1||x>3)x=getch()-48;
if(x==1) {cout<<"保存游戏成功!1秒后关闭游戏!"<<endl;
freopen("C:/Users/Public/Documents/system.dll","w",stdout);
coin.print();
cout<<" ";
val.print();
cout<<" ";
atk1.print();
cout<<" "<<atk2<<" ";
def1.print();
cout<<" "<<def2<<" ";
cout<<haoyun<<" ";
cout<<chongwu.gongji<<" ";
cout<<chongwu.jianshang<<" ";
cout<<chongwu.jiaxue;
Sleep(1000);
return 0;
}
if(x==2) {freopen("C:/Users/Public/Documents/system.dll","r",stdin);
string stringg;
coin.a.clear();
val.a.clear();
atk1.a.clear();
def1.a.clear();
cin>>stringg;
coin(stringg);
cin>>stringg;
val(stringg);
cin>>stringg;
atk1(stringg);
cin>>atk2;
cin>>stringg;
def1(stringg);
cin>>def2;
cin>>haoyun;
cin>>chongwu.gongji;
cin>>chongwu.jianshang;
cin>>chongwu.jiaxue;
fclose(stdin);
cout<<"载入游戏成功!"<<endl;Sleep(1000);
}
if(x==3)break;
}
while(kbhit())getch();
}
}
朱日和之战 原作者系BIGBUG bi4xkvza 朱日和之战 v1.9.1 一个多人对战小游戏,增加了不少新颖的元素。有刺激的对战元素,也有有趣的结盟玩法,局势瞬息万变,活到最后的才是赢家。保留BIGBUG游戏的传统风格,由蒟蒻编写。 更新の日志: 10.13 增加身份系统 10.07 增加10级满级 技能改变为资源上限 10.06 击杀者可获得死亡者的资源 10.06 技能增加伤害加成 12.20 战斗、血量等细节调整 12.20 增加团战模式 12.21 给资源出错 调整 12.29 新技能(自己探索) 12.31 更改机制,优化界面 12.31 又是新技能 01.30 技能系统 3个技能 01.31 更改了1个技能内容 04.26 双人联机版出现 04.30 更改了联机版的一个BUG 06.06 修改了一些小BUG 06.26 增加了一些信息和标题 08.25 更改毁伤效果为回血数量减少 08.25 加强所有技能,具体见官方攻略 02.21 暂时隐藏联机版 10.22 把开始界面删了,身份和技能都藏入设置中 朱日和之战出攻略啦! ->whpmm5w3<- 标准 蓝奏云/iUAxwnd6p0h 1.8.4 密码:4sv0 蓝奏云/iblvY0edwp8d 1.9.1 密码:erwb
探险故事
//转自:https://www.luogu.com.cn/discuss/show/30357
#include <stdio.h>
#include <windows.h>
#include <time.h>
int main()
{
int like,g1=20,g2=25,f1=18,f2=5,z1=0,z2,sum=0,x1=1000,x2=100,a,b,d,n=0,m=1,i,j,q=100,g,jq,gz=100,p,jue_din,v,ti_li=20,ji_e=10,yu=0,rou=0,xiang=100,a1,b1,c1,bi_shou=0,tong_chu,mu_tou=0,gs,g_s=0,sj,_a;
char c;
srand((unsigned)time(NULL));
z2=rand()%100;
system("cls");
printf("本游戏由官方认㊣(我说抄袭的你信吗)\n");
Sleep(100);
printf("请认准商标:|玩命工作室|℡卍卐\n");
Sleep(100);
printf("探险故事!\n");
Sleep(100);
printf("|陈纸诺|制造\n");
Sleep(100);
printf("丰(破)富(烂)剧情\n");
Sleep(100);
printf("你的属性:\nHP:%d\nATK:%d\n防御:%d\nIQ:%d\n$:%d\n饥饿值:%d%%\n体力:%d\n",x2,g2,f2,z2,q,ji_e,ti_li);
Sleep(100);
printf("请选择你的人物性格:[1]懦弱的 [2]无畏的 [3]可怜的 [4]暴躁的 [5]在最后一刻爆发的\n");
scanf("%d",&d);
if(d==1)
{
f2-f2+2;
g2=g2-4;
printf("祝贺你! 伤害-4 防御+2\n");
}
if(d==2)
{
g2=g2+5;
printf("祝贺你! 伤害+5\n");
}
if(d==3)
{
g2=g2-5;
f2=f2-3;
printf("祝贺你! 伤害-5 防御-3\n");
}
if(d==4)
{
g2=g2+8;
f2=0;
printf("祝贺你! 伤害+8 防御=0\n");
}
if(d==5)
{
n=1;
printf("祝贺你! 暴击率+30%%(其实没什么卵用)\n");
}
Sleep(1000);
printf("游戏开始……\n");
while(1)
{
srand((unsigned)time(NULL));
g=rand()%100;
srand((unsigned)time(NULL));
jq=rand()%100;
srand((unsigned)time(NULL));
p=rand()%3;
printf("第%d天,战斗开始\n",m);
Sleep(1000);
if(ji_e>=90)
{
Sleep(1000);
printf("你饿(渴)死了\n");
printf("你存活了%d天!\n",m);
system("pause");
return 0;
}
if(ti_li<=5)
{
Sleep(1000);
printf("你累死了\n");
printf("你存活了%d天!\n",m);
system("pause");
return 0;
}
if(m>=100)
{
printf("你的任务成功啦!!!\n");
break;
}
printf("你要干什么?\n");
Sleep(500);
printf("[1]商店[2]战斗[3]恢复10HP[4]沉思[5]工作[6]睡觉[7]看属性[8]吃(喝)东西[9]自杀\n");
scanf("%d",&i);
if(i==1)
{
printf("1.血瓶(50$)\n");
printf("2.鱼(10$)\n");
printf("3.肉(20$)\n");
printf("4.匕首(100$)\n");
printf("5.木头(5$)\n");
printf("6.离开\n");
printf("你要干什么?\n");
scanf("%d",&j);
if(j==1)
{
if(q>=50)
{
q-=50;
x2+=20;
}
else
{
printf("滚!\n");
}
}
if(j==2)
{
if(q>=10)
{
printf("你获得了 鱼 \n");
q-=10;
yu+=1;
}
else
{
printf("滚!\n");
}
}
if(j==3)
{
if(q>=20)
{
printf("你获得了 肉 \n");
q-=20;
rou+=1;
}
else
{
printf("滚!\n");
}
}
if(j==4)
{
if(q>=100)
{
printf("你获得了 匕首\n");
q-=100;
bi_shou+=1;
}
else
{
printf("滚!\n");
}
}
if(j==5)
{
if(q>=5)
{
printf("你获得了 木头\n");
mu_tou+=1;
q-=5;
}
else
{
printf("滚!\n");
}
}
}
if(i==3&&x2<100)
{
x2+=10;
printf("完毕\n");
}
if(i==4)
{
if(q>=10)
{
printf("给10元\n");
printf("沉思中。。。\n");
Sleep(5000);
printf("沉思完毕\n");
z2+=3;
q-=10;
}
else
{
printf("你没有十元\n");
}
}
if(i==5)
{
if(g_s==1)
{
printf("你有两份工作\n[1]上班 [2]建房子\n");
scanf("%d",_a);
if(_a==1)
{
printf("工作中。。。\n");
Sleep(3000);
if(p==0)
{
printf("老板不发工资,你被坑了!!!\n");
printf("要投诉吗?\n");
printf("[1]要 [2]不要\n");
scanf("%d",&jue_din);
if(jue_din==1)
{
printf("你被开除了!\n");
}
else
{
printf("欢迎再来!\n");
q+=gz/10;
}
}
else
{
printf("工作完毕\n");
q+=gz;
}
ti_li-=10;
}
else
{
if(mu_tou>99)
{
Sleep(3000);
printf("房子建好了\n");
g_s=0;
}
else printf("木头不够\n");
}
}
else
{
printf("工作中。。。\n");
Sleep(3000);
if(p==0)
{
printf("老板不发工资,你被坑了!!!\n");
printf("要投诉吗?\n");
printf("[1]要 [2]不要\n");
scanf("%d",&jue_din);
if(jue_din==1)
{
printf("你被开除了!\n");
}
else
{
printf("欢迎再来!\n");
q+=gz/10;
}
}
else
{
printf("工作完毕\n");
q+=gz;
}
ti_li-=10;
}
}
if(i==6)
{
if(g_s==1)
{
printf("你不能睡觉\n");
}
else
{
m++;
x2-=10;
Sleep(1000);
printf("睡觉中。。。\n");
Sleep(1000);
if(m%10==0)
{
printf("你的家遭到了怪兽的攻击!\n");
Sleep(1000);
printf("你要怎么样\n[1]继续睡 [2]跟他打一架 [3]逃跑\n");
scanf("%d",&gs);
if(gs==1)
{
printf("怪兽攻击了你!\n");
Sleep(1000);
system("color 40");
Sleep(300);
system("color a0");
x2-=30;
}
if(gs==2)
{
printf("你与怪兽展开了决斗!\n");
srand((unsigned)time(NULL));
sj=rand()%3;
Sleep(3000);
if(sj=0)
{
printf("你输了!\n");
printf("你活了%d天",m);
system("pause");
return 0;
}
if(sj==1)
{
printf("你打败了怪兽!\n");
}
if(sj==2)
{
printf("你打跑了怪兽,但你也负伤累累\n");
x2-=20;
}
}
if(gs==3)
{
printf("你逃了,但你从此不能睡觉\n");
g_s=1;
}
}
else
{
printf("z");
Sleep(10);
printf("z");
Sleep(10);
printf("z\n");
ti_li+=5;
ji_e+=10;
continue;
}
}
}
if(i==7)
{
printf("HP:%d\nATK:%d\n防御:%d\nIQ:%d\n$:%d\n饥饿值:%d%%\n体力:%d\n",x2,g2,f2,z2,q,ji_e,ti_li);
Sleep(3000);
printf("按任意数字退出\n");
scanf("%d",&v);
}
if(i==8)
{
printf("你要吃什么?\n");
printf("1.鱼 %d\n2.肉 %d\n3.翔 %d\n4.木头 %d\n",yu,rou,xiang,mu_tou);
scanf("%d",&a1);
if(a1==1)
{
if(yu>0)
{
Sleep(1000);
printf("体力+5!\n");
ti_li+=5;
ji_e-=5;
yu-=1;
Sleep(1000);
}
else
{
printf("你没鱼\n");
}
}
if(a1==2)
{
if(rou>0)
{
Sleep(1000);
printf("体力+10!\n");
ti_li+=10;
ji_e-=10;
rou-=1;
Sleep(1000);
}
else printf("你没肉\n");
}
if(a1==3)
{
if(xiang>0)
{
Sleep(1000);
printf("呕吐。。。\n");
ti_li+=1;
ji_e-=10;
xiang-=1;
Sleep(1000);
}
else printf("你没翔\n");
}
if(a1==4)
{
if(mu_tou>0)
{
printf("木头能吃吗?\n");
mu_tou-=0;
}
else printf("你没木头\n");
}
if(ji_e<=0)
{
Sleep(1000);
printf("你吃撑了,拉了一坨翔\n");
xiang+=1;
Sleep(1000);
}
}
if(i==9)
{
if(bi_shou>0)
{
printf("你死了\n");
printf("你活了%d天\n",m);
system("pause");
return 0;
}
else printf("你没匕首\n");
}
if(i==2)
{
Sleep(1000);
printf("战斗开始。。。\n");
Sleep(1000);
printf("敌方属性:\nHP:%d\nATK:%d\n防御:%d\nIQ:%d(他就一白痴)\n",x1,g1,f1,z1);
while(1)
{
srand((unsigned)time(NULL));
b1=rand()%3;
srand((unsigned)time(NULL));
c1=rand()%3;
if(c1==0) c1=1;
Sleep(1000);
printf("双方血量:\n[%d] [%d]\n",x1,x2);
Sleep(500);
printf("你要干啥?\n");
printf("[1]打他 [2]防御 [3]蓄力 [4]思考");
if(bi_shou>0) printf(" [5]捅他\n");
else printf("\n");
scanf("%d",&a);
if(a==1) x1=x1-g2;
if(a==2) x2=x2-g1+f2;
if(a==3)
{
g2=g2+g2/10;
sum++;
printf("<嗯~~~~~~~~~~~~\n");
}
if(a==4)
{
if(z2>=90)
{
printf("。。。\n");
Sleep(1000);
printf("你识破了对方的招式! 敌方HP-15!\n");
x1-=15;
}
else printf("智力不达标!\n");
Sleep(1000);
}
if(a==5)
{
printf("你要捅他哪里?\n");
printf("[1]肚子 [2]心脏\n");
scanf("%d",&tong_chu);
if(tong_chu==1) x1-=40;
if(tong_chu==2) printf("对不起,你没捅到\n");
}
if(a<1||a>5) printf("你在搞什么鬼?\n");
Sleep(1000);
printf("你遭到了宝藏守护者的攻击!\n");
Sleep(1000);
system("color 40");
Sleep(300);
system("color a0");
x2=x2-g1;
if(n==1&&x2<=20)
{
g2=g2+7;
Sleep(1000);
printf("祝贺你! 伤害+7!\n");
Sleep(1000);
}
if(sum%4==0&&sum>0)
{
Sleep(1000);
printf("双方血量:\n[%d] [%d]\n",x1,x2);
printf("你要干啥?\n");
printf("[1]喷他一脸屎 [2]防御 [3]蓄力\n");
scanf("%d",&a);
if(a==1)
{
printf("他被你喷(臭)死了\n");
Sleep(1000);
printf("YOU WIN!\n");
Sleep(1000);
printf("恭喜你得到了1000000000000000000000000000000000000块。。。\n");
Sleep(5000);
printf("假金币!!!!!!!(作者就是来坑你的)\n");
m++;
sum=0;
}
if(a==2) x2=x2-g1+f2;
if(a==3)
{
g2=g2+g2/10;
sum++;
printf("<嗯~~~~~~~~~~~~\n");
x2=x2-g1;
}
q+=jq;
ji_e+=10;
ti_li-=10;
Sleep(1000);
if(b1==0)
{
printf("你获得了 鱼 \n");
yu+=c1;
break;
}
if(b1==1)
{
printf("你获得了 肉 \n");
rou+=c1;
break;
}
if(b1==2)
{
printf("你获得了 翔 \n");
xiang+=c1;
break;
}
}
if(x2<=0)
{
printf("YOU DIE!\n");
Sleep(1000);
printf("你存活了%d天!\n",m);
system("pause");
return 0;
}
}
x1+=g;
}
if(m>=50)
{
printf("你的任务成功啦!!!\n");
break;
}
m++;
}
Sleep(3000);
system("cls");
printf("\n\n\n\n\n\n\n\n\n\n\n\n");
printf(" ");
Sleep(3000);
printf("T");
Sleep(100);
printf("H");
Sleep(100);
printf("E");
Sleep(100);
printf(" ");
Sleep(100);
printf("E");
Sleep(100);
printf("N");
Sleep(100);
printf("D\n");
Sleep(3000);
printf("\n\n\n\n\n\n\n\n\n\n");
printf("----------------------------------我是有底线的----------------------------------");
Sleep(3000);
for(i=0; i<100; i++)
printf("禁止转载!!!\n");
printf("最后给大家一些奇怪的网站:\nhttps://acg18.us\nhttps://acg12.com\ngmgard.com\nhttp://www.zhaifuli.com/forum.php?mod=viewthread&action=printable&tid=970\n");
Sleep(10000);
system("pause");
return 0;
}
元气世界
//转自:http://noi.openjudge.cn/topic/148717/
//@kapu12(LGuid 576316)提供
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main() {
int dd,ms,jb=0,xz,a=3,zheshu=10,qp=0,gm1=0,gm2=0,gm3=0;
char name[30];
cout<<"你";
Sleep(330);
cout<<"在";
Sleep(330);
cout<<"和";
Sleep(33);
cout<<"电";
Sleep(33);
cout<<"脑";
Sleep(33);
cout<<"玩";
Sleep(33);
cout<<"装";
Sleep(33);
cout<<"子";
Sleep(33);
cout<<"弹";
Sleep(33);
cout<<"的";
Sleep(33);
cout<<"游";
Sleep(33);
cout<<"戏"<<endl;
Sleep(33);
cout<<"请输入你的名字:";
cin>>name;
cout<<"Hi!"<<name<<endl;
goto dd;
dd:
cout<<"请选择"<<name<<"要玩的: 常规战(1) Boss战(2) 商店(3)"<<endl;
Sleep(15);
cin>>ms;
int zd=0,yq=0,zd2=0,yq2=0,b,dl,i,nd,k;
int mm[999];
if(ms == 1) {
cout<<"请选择"<<name<<"要玩的难度: 简 单(1) 困 难(2)"<<endl;
cin>>nd;
if(nd == 2) {
int m=3,m2=1+qp;
char mm;
zd2=5;
yq2=9;
cout<<"欢迎来到困难模式!"<<endl;
Sleep(10);
cout<<"电脑有9个元气和5个子弹和3条命!"<<endl;
Sleep(10);
cout<<"小心了哦~ ~ ~"<<endl;
Sleep(10);
cout<<"0.装子弹 1.存元气 2.防御 3.反弹 4.枪 5.元气波"<<endl;
Sleep(10);
while(1) {
if(m == 0) {
cout<<"电脑死了!"<<endl;
Sleep(60);
cout<<"获胜!"<<endl;
Sleep(60);
cout<<"获得金币800!";
jb=jb+800;
goto dd;
}
if(m2 == 0) {
cout<<name<<"死了!"<<endl;
Sleep(600);
cout<<"失败!"<<endl;
Sleep(600);
goto dd;
}
cin>>b;
i=1;
system("cls");
cout<<"0.装子弹 1.存元气 2.防御 3.反弹 4.枪 5.元气波"<<endl;
Sleep(1000);
if(zd2 == 0 && yq2 <= 2 && b != 2053759831) {
srand((unsigned int)time(NULL));
dl=rand()%1;
}
if(yq2 >= 3 && zd2 >= 1 && b != 2053759831) {
srand((unsigned int)time(NULL));
dl=rand()%5;
}
if(yq2 <= 2 && zd2 >= 1 && b != 2053759831) {
srand((unsigned int)time(NULL));
dl=rand()%4;
}
if(yq2 >= 6 && b != 2053759831) {
srand((unsigned int)time(NULL));
dl=rand()%1+5;
}
if(b == 0) {
zd=zd+1;
cout<<name<<"装子弹"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(b == 1) {
yq=yq+1;
cout<<name<<"存元气"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(dl == 0) {
zd2=zd2+1;
cout<<"电脑装子弹"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(dl == 1) {
yq2=yq2+1;
cout<<"电脑存元气"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(b == 2) {
cout<<name<<"防御"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(b == 3) {
cout<<name<<"反弹"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(b == 4 && zd != 0) {
zd=zd-1;
cout<<name<<"向电脑开枪"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
if(dl != 2 && dl != 5 && dl != 4) {
cout<<"电脑减了一滴血!"<<endl;
Sleep(600);
m=m-1;
} else {
cout<<"电脑防御成功"<<endl;
Sleep(600);
i=0;
}
i=0;
}
if(b == 4 && zd == 0 && i == 1) {
cout<<"子弹不足!"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(b == 5 && yq >= a) {
i=0;
yq=yq-a;
cout<<name<<"向电脑使用元气波"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
if(dl != 3 && dl != 5) {
cout<<"电脑减了一滴血!"<<endl;
Sleep(600);
m=m-1;
} else {
cout<<"电脑防御成功"<<endl;
Sleep(600);
i=0;
}
}
if(b == 5 && yq < a && i == 1) {
cout<<"元气不足!"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(dl == 2) {
cout<<"电脑防御"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(dl == 3) {
cout<<"电脑反弹"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(dl == 4) {
zd2=zd2-1;
cout<<"电脑向你开枪"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
if(b != 2 && b != 5 && b != 4) {
cout<<name<<"减了一滴血!"<<endl;
Sleep(600);
m2=m2-1;
} else {
cout<<name<<"防御成功"<<endl;
Sleep(600);
}
}
if(dl == 5) {
yq2=yq2-3;
cout<<"电脑向你使用元气波"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
if(b != 3 && b != 5) {
cout<<name<<"减了一滴血!"<<endl;
Sleep(600);
m2=m2-1;
} else {
cout<<name<<"防御成功"<<endl;
Sleep(600);
}
}
if(dl == 5 && b == 3) {
cout<<"电脑被你反弹了"<<endl;
Sleep(600);
cout<<"电脑减了一滴血!"<<endl;
Sleep(600);
m=m-1;
}
if(b == 5 && dl == 3) {
cout<<name<<"被电脑反弹了"<<endl;
Sleep(600);
cout<<name<<"减了一滴血!"<<endl;
Sleep(600);
m2=m2-1;
}
}
}//困难
if(nd == 1) {
cout<<"欢迎来到简单模式!"<<endl;
Sleep(1000);
cout<<"0.装子弹 1.存元气 2.防御 3.反弹 4.枪 5.元气波"<<endl;
int m=1+qp,m2=1;
while(1) {
if(m2 == 0) {
cout<<"电脑死了!"<<endl;
Sleep(600);
cout<<"获胜!"<<endl;
Sleep(600);
cout<<"获得金币500!"<<endl;
jb=jb+500;
goto dd;
}
if(m == 0) {
cout<<name<<"死了!"<<endl;
Sleep(600);
cout<<"失败!"<<endl;
Sleep(600);
goto dd;
}
cin>>b;
i=1;
system("cls");
cout<<"0.装子弹 1.存元气 2.防御 3.反弹 4.枪 5.元气波"<<endl;
Sleep(1000);
if(zd2 == 0 && yq2 <= 2) {
srand((unsigned int)time(NULL));
dl=rand()%1;
}
if(yq2 >= 3 && zd2 >= 1) {
srand((unsigned int)time(NULL));
dl=rand()%5;
}
if(yq2 <= 2 && zd2 >= 1) {
srand((unsigned int)time(NULL));
dl=rand()%4;
}
if(b == 0) {
zd=zd+1;
cout<<name<<"装子弹"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
}
if(b == 1) {
yq=yq+1;
cout<<name<<"存元气"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
}
if(dl == 0) {
zd2=zd2+1;
cout<<"电脑装子弹"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气"<<endl;
Sleep(600);
}
if(dl == 1) {
yq2=yq2+1;
cout<<"电脑存元气"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气"<<endl;
Sleep(600);
}
if(b == 2) {
cout<<name<<"防御"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
}
if(b == 3) {
cout<<name<<"反弹"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
}
if(b == 4 && zd != 0) {
zd=zd-1;
cout<<name<<"向电脑开枪"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
if(dl != 2 && dl != 5 && dl != 4) {
m2=m2-1;
cout<<"电脑减了一滴血!"<<endl;
} else {
cout<<"电脑防御成功"<<endl;
Sleep(600);
i=0;
}
i=0;
}
if(b == 4 && zd == 0 && i == 1) {
cout<<"子弹不足!"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
}
if(b == 5 && yq >= a) {
i=0;
yq=yq-a;
cout<<name<<"向电脑使用元气波"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
if(dl != 3 && dl != 5) {
m2=m2-1;
cout<<"电脑减了一滴血!"<<endl;
} else {
cout<<"电脑防御成功"<<endl;
Sleep(600);
i=0;
}
}
if(b == 5 && yq < a && i == 1) {
cout<<"元气不足!"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气"<<endl;
Sleep(600);
}
if(dl == 2) {
cout<<"电脑防御"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气"<<endl;
Sleep(600);
}
if(dl == 3) {
cout<<"电脑反弹"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气"<<endl;
Sleep(600);
}
if(dl == 4) {
zd2=zd2-1;
cout<<"电脑向你开枪"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气"<<endl;
Sleep(600);
if(b != 2 && b != 5 && b != 4) {
m=m-1;
cout<<"你减了一滴血!"<<endl;
} else {
cout<<name<<"防御成功"<<endl;
Sleep(600);
}
}
if(dl == 5) {
yq2=yq2-3;
cout<<"电脑向你使用元气波"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气"<<endl;
Sleep(600);
if(b != 3 && b != 5) {
m=m-1;
cout<<"你减了一滴血!"<<endl;
} else {
cout<<name<<"防御成功"<<endl;
Sleep(600);
}
}
if(dl == 5 && b == 3) {
m2=m2-1;
cout<<"电脑减了一滴血!"<<endl;
}
if(b == 5 && dl == 3) {
m=m-1;
cout<<"你减了一滴血!"<<endl;
}
}
}//简单
}//模式
if(ms == 2) {
int m=5+qp,m2=15;
cout<<name<<"有胆量!" <<endl;
Sleep(600);
cout<<"作者赏你5条命! (商店里购买"<<qp<<"条) 共"<<5+qp<<"条"<<endl;
Sleep(600);
cout<<"电脑有15条命!"<<endl;
Sleep(600);
cout<<"开始你精彩的表现吧!"<<endl;
Sleep(600);
cout<<"0.装子弹 1.存元气 2.防御 3.反弹 4.枪 5.元气波"<<endl;
Sleep(1000);
while(1) {
if(m == 0) {
cout<<name<<"死了!"<<endl;
Sleep(600);
cout<<"失败!"<<endl;
Sleep(600);
goto dd;
}
if(m2 == 0) {
cout<<"电脑死了!"<<endl;
Sleep(600);
cout<<"获胜!"<<endl;
Sleep(600);
cout<<"获得金币1000!";
jb=jb+1000;
goto dd;
}
cin>>b;
i=1;
system("cls");
cout<<"0.装子弹 1.存元气 2.防御 3.反弹 4.枪 5.元气波"<<endl;
Sleep(1000);
if(b == 0 || b == 1 || b == 2 || b == 3) {
srand((unsigned int)time(NULL));
dl=rand()%1+1;
}
if(yq2 >= 3) {
srand((unsigned int)time(NULL));
dl=rand()%1+5;
}
if(zd2 == 0 && yq2 <= 2) {
srand((unsigned int)time(NULL));
dl=rand()%1;
}
if(yq2 >= 3 && zd2 >= 1) {
srand((unsigned int)time(NULL));
dl=rand()%5;
}
if(yq2 <= 2 && zd2 >= 1) {
srand((unsigned int)time(NULL));
dl=rand()%4;
}
if(yq2 >= 6) {
srand((unsigned int)time(NULL));
dl=rand()%1+5;
}
if(b == 0) {
zd=zd+1;
cout<<name<<"装子弹"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(b == 1) {
yq=yq+1;
cout<<name<<"存元气"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(dl == 0) {
zd2=zd2+1;
cout<<"电脑装子弹"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(dl == 1) {
yq2=yq2+1;
cout<<"电脑存元气"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(b == 2) {
cout<<name<<"防御"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(b == 3) {
cout<<name<<"反弹"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(b == 4 && zd != 0) {
zd=zd-1;
cout<<name<<"向电脑开枪"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
if(dl != 2 && dl != 5 && dl != 4) {
cout<<"电脑减了一滴血!"<<endl;
Sleep(600);
m2=m2-1;
} else {
cout<<"电脑防御成功"<<endl;
Sleep(600);
i=0;
}
i=0;
}
if(b == 4 && zd == 0 && i == 1) {
cout<<"子弹不足!"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(b == 5 && yq >= a) {
i=0;
yq=yq-a;
cout<<name<<"向电脑使用元气波"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
if(dl != 3 && dl != 5) {
cout<<"电脑减了一滴血!"<<endl;
Sleep(600);
m2=m2-1;
} else {
cout<<"电脑防御成功"<<endl;
Sleep(600);
i=0;
}
}
if(b == 5 && yq < a && i == 1) {
cout<<"元气不足!"<<endl;
Sleep(600);
cout<<name<<"有"<<zd<<"个子弹 "<<yq<<"个元气 "<<m<<"个命"<<endl;
Sleep(600);
}
if(dl == 2) {
cout<<"电脑防御"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(dl == 3) {
cout<<"电脑反弹"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
}
if(dl == 4) {
zd2=zd2-1;
cout<<"电脑向你开枪"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
if(b != 2 && b != 5 && b != 4) {
cout<<name<<"减了一滴血!"<<endl;
Sleep(600);
m=m-1;
} else {
cout<<name<<"防御成功"<<endl;
Sleep(600);
}
}
if(dl == 5) {
yq2=yq2-3;
cout<<"电脑向你使用元气波"<<endl;
Sleep(600);
cout<<"电脑有"<<zd2<<"个子弹 "<<yq2<<"个元气 "<<m2<<"个命"<<endl;
Sleep(600);
if(b != 3 && b != 5) {
cout<<name<<"减了一滴血!"<<endl;
Sleep(600);
m=m-1;
} else {
cout<<name<<"防御成功"<<endl;
Sleep(600);
}
}
if(dl == 5 && b == 3) {
cout<<"电脑被你反弹了"<<endl;
Sleep(600);
cout<<"电脑减了一滴血!"<<endl;
Sleep(600);
m2=m2-1;
}
if(b == 5 && dl == 3) {
cout<<name<<"减了一滴血!"<<endl;
Sleep(600);
m=m-1;
}
}
}//boss
if(ms == 3) {
while(1) {
cout<<"欢迎来到《装子弹》战场的无敌称号补给坑货店!"<<endl;
Sleep(1000);
cout<<"我是店长赫连皓轩!"<<endl;
Sleep(1000);
cout<<"你可以在这里购买许多新奇的东西!"<<endl;
Sleep(1000);
cout<<"你有金币:"<<jb<<endl;
cout<<"1.低费元气 -----价格:"<<5000*zheshu/10<<endl;
cout<<"2.7折卡 -----价格:"<<3000*zheshu/10<<endl;
cout<<"3.增加血量 -----价格:"<<4000*zheshu/10<<endl;
cout<<"4.匕首 -----价格:"<<2500*zheshu/10<<endl;
cout<<"5.退出"<<endl;
cin>>xz;
if(xz == 1 && jb >= 5000*zheshu/10 && gm1 == 0) {
jb=jb-5000*zheshu/10;
a=2;
cout<<"购买成功!"<<endl;
Sleep(1000);
cout<<"现在"<<name<<"只需要2个元气就能用元气波了!!!"<<endl;
goto dd;
gm1=gm1+1;
}
if(xz == 1 && jb < 5000*zheshu/10) {
cout<<"对不起,您的金币不足,购买失败!"<<endl;
goto dd;
}
if(xz == 1 && gm1 == 1) {
cout<<"您已购买!"<<endl;
goto dd;
}
if(xz == 2 && jb >= 3000*zheshu/10) {
jb=jb-3000*zheshu/10;
zheshu=7;
cout<<"购买成功!"<<endl;
Sleep(1000);
cout<<"现在所有商品打7折!!!"<<endl;
goto dd;
gm2=gm2+1;
}
if(xz == 2 && jb < 3000*zheshu/10) {
cout<<"对不起,您的金币不足,购买失败!"<<endl;
goto dd;
}
if(xz == 2 && gm2 == 1) {
cout<<"您已购买!"<<endl;
goto dd;
}
if(xz == 3 && jb >= 4000*zheshu/10) {
jb=jb-4000*zheshu/10;
qp=qp+1;
cout<<"购买成功!"<<endl;
Sleep(1000);
cout<<"你增加1条命!!!"<<endl;
goto dd;
gm3=gm3+1;
}
if(xz == 3 && jb < 4000*zheshu/10) {
cout<<"对不起,您的金币不足,购买失败!"<<endl;
goto dd;
}
if(xz == 3 && gm1 == 5) {
cout<<"您的血量上限已到达最高!"<<endl;
goto dd;
}
if(xz == 5) {
goto dd;
}
}
}
return 0;
}
创意棋类游戏
//转自:https://www.luogu.com.cn/paste/kjqt4pja
//作者:https://www.luogu.com.cn/user/85994
/*
All right!
*/
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
#define maxn 10
#define GREY 8*17
#define WHITE 255
#define BLACK 0
#define YELLOW 14*17
#define accept_ 1.1
#define space 1
#define black 2
#define white 3
#define side 0
#define MaxCal 300000000
#define relaxTime 12
#define out_of_board -1290687
#define notSet -128370
#define RIGHT 10
#define WRONG -10
#define RESET_TIMES 5
const int fx_1[4]={0,0,1,-1};
const int fx_2[4]={1,-1,0,0};
int D=0;
int calNum=0;//the number of calculation in order to relax the CP
int warn=0,turn=0;
void color(int a)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
}
string num_str(int n)
{
int m=n;
char s[20];
char ss[20];
int i=0,j=0;
if (n<0)// 处理负数
m=-m,j=1,ss[0]='-';
while(m>0)
s[i++]=m%10+'0',m/=10;
s[i]='\0';
--i;
while (i >= 0)
{
ss[j++]=s[i--];
}
ss[j]='\0';
return ss;
}
void HideCursor(void)
{
HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle,&CursorInfo);//获取控制台光标信息
CursorInfo.bVisible=false; //隐藏控制台光标
SetConsoleCursorInfo(handle,&CursorInfo);//设置控制台光标状态
}
void SetXY(int x, int y) {
COORD pos={x,y};
HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);// 获取标准输出设备句柄
SetConsoleCursorPosition(hOut,pos);//两个参数分别是指定哪个窗体,具体位置
}
inline double drand(void)
{
double d=1.0,ans=0.0;
for(int i=0;i<15;i++)
{
d*=0.5;
if(rand()%2) ans+=d;
}
return ans;
}
inline bool gl(double a)
{
if(a>=drand()) return true;
else return false;
}
inline char* str_ch(string str)
{
char* strc=new char[strlen(str.c_str())+1];
strcpy(strc,str.c_str());
return strc;
}
void Game(void);
class MAP
{
public:
int d[maxn][maxn];
bool is_white;
int White,Black;
void Set(void)
{
is_white=true,White=0,Black=0;
for(int i=0;i<maxn;i++)
for(int j=0;j<maxn;j++)
d[i][j]=space;
for(int i=0;i<maxn;i++)
d[i][0]=side,d[i][maxn-1]=side,d[maxn-1][i]=side,d[0][i]=side;
}//set a board with nothing
void draw_(void)
{
for(int i=0;i<maxn;i++)
{
for(int j=0;j<maxn;j++)
{
color(15);
if(d[i][j]==space)
{
SetXY(i+1,j+1),color(GREY),cout<<' ';
continue;
}
if(d[i][j]==white)
{
SetXY(i+1,j+1),color(WHITE),cout<<' ';
continue;
}
if(d[i][j]==black)
{
SetXY(i+1,j+1),color(BLACK),cout<<' ';
continue;
}
if(d[i][j]==side)
{
SetXY(i+1,j+1),color(YELLOW),cout<<' ';
continue;
}
}
color(15),cout<<endl;
}
}//just draw a MAP
void count_(void)
{
White=0,Black=0;
for(int i=1;i<maxn-1;i++)
for(int j=1;j<maxn-1;j++)
if(d[i][j]==white) ++White;
else if(d[i][j]==black) ++Black;
}//count the MAP,must do this after you change it
void turn(int a,int b)
{
if(d[a][b]==white) d[a][b]=black;
else d[a][b]=white;
}//turn a piece
int Change(int a,int b)
{
if(a>=maxn-1||a<1||b>=maxn-1||b<1) return WRONG;
if(d[a][b]!=space) return WRONG;
if(is_white) d[a][b]=white;
else d[a][b]=black;
is_white=!is_white;
bool t[4]={1,1,1,1};
for(int i=1;i<maxn;i++)
{
for(int j=0;j<4;j++)
if(t[j])
if(d[a+fx_1[j]*i][b+fx_2[j]*i]!=space&&d[a+fx_1[j]*i][b+fx_2[j]*i]!=side) turn(a+fx_1[j]*i,b+fx_2[j]*i);
else t[j]=false;
}
return RIGHT;
}//lay at (a,b)
void from(MAP map_)
{
for(int i=0;i<maxn;i++)
for(int j=0;j<maxn;j++)
d[i][j]=map_.d[i][j];
}//copy a MAP
int Space_() {return (maxn-2)*(maxn-2)-White-Black;}//the space number
};
string name;
void rule(void)
{
system("cls");
color(10);
printf("In the rolling chess,if you put a piece at everywhere in a ");
puts("chess board which is 8*8,it will turn all the pieces on the same line with it and next to it into a different color.");
puts("White first,and then is black's turn.Finally,who has more pieces of his own color will win.");
puts("You can play with your friend at a CP ,play with the CP or even just watching CPs' play.");
puts("'W','A','S','D' to move a piece and ' ' to lay it");
puts("When you are using Adviser,'q' to get the advice and 'l' to know your now point");
puts("To avoid copying and peace,black give white a piece.");
color(15),puts("MADE BY efX!");
printf("Now the AI is right,never do foolish things\n");
system("pause");
Game();
}
#define MIX 2
#define RATE 1
#define POINT 0
class MCTS
{
private:
double judge(MAP mp)
{
if(mp.Space_()<=7)
if(mp.White>mp.Black)
return 1.0;
else return -1.0;
return (double)(mp.White>mp.Black)*0.125+(mp.White>mp.Black?1.0:-1.0);
}
public:
double now_point;
int work_depth;
int workNum;//how many borads
int advX,advY;//advise to go
int type;
bool is_white;
/*double randSearch(MAP mp,int restDepth)
{
mp.count_();
if(restDepth==0||mp.Space_()<=1) return judge(mp);
int place[(maxn-2)*(maxn-2)][2],q=0,r=0;
for(int i=1;i<maxn-1;i++)
for(int j=1;j<maxn-1;j++)
if(mp.d[i][j]==space)
place[q][0]=i,place[q][1]=j,++q;
r=rand()%q;
mp.Change(place[r][0],place[r][1]);
return randSearch(mp,restDepth-1);
}
void MIX_WORK(MAP mp)
{
mp.count_();
if(mp.Space_()%2) mp.is_white=true;
else mp.is_white=false;
int point[(maxn-2)*(maxn-2)][3];
double count_point[(maxn-2)*(maxn-2)];
memset(count_point,0,sizeof(count_point));
int q=0,r=0;
//0.X;1.Y;2.count times
double realPoint[(maxn-2)*(maxn-2)],nowBest;
for(int i=0;i<(maxn-2)*(maxn-2);i++)
realPoint[i]=0.0;
for(int i=0;i<(maxn-2)*(maxn-2);i++)
for(int j=0;j<3;j++)
point[i][j]=0;//first set
for(int i=1;i<maxn-1;i++)
for(int j=1;j<maxn-1;j++)
if(mp.d[i][j]==space)
point[q][0]=i,point[q][1]=j,++q;
for(int i=0;i<workNum;i++)
{
r=rand()%q;
mp.Change(point[r][0],point[r][1]);
count_point[r]+=randSearch(mp,work_depth),++point[r][2];
mp.Change(point[r][0],point[r][1]);
mp.d[point[r][0]][point[r][1]]=space;
}//search the point
for(int i=0;i<q;++i)
realPoint[i]=count_point[i]/(double)(point[i][2]);
//get the mean
nowBest=realPoint[0],r=0;
if(mp.is_white)
for(int i=1;i<q;++i)
if(realPoint[i]>nowBest)
r=i,nowBest=realPoint[i];
else for(int i=1;i<q;++i)
if(realPoint[i]<nowBest)
r=i,nowBest=realPoint[i];
advX=point[r][0],advY=point[r][1];
now_point=realPoint[r];
return;
}//maybe finish*/
int RandSearch(MAP mp,int restDepth)
{
mp.count_();
if(restDepth==0||mp.Space_()<=1)
{
if(type==POINT)
return (mp.White-mp.Black);
if(type==RATE)
if(mp.White>mp.Black)
return 1;
else return 0;
if(type==MIX)
{
if(is_white)
if(mp.White>mp.Black)
return (((mp.White-mp.Black)+1)>>1);
else return ((mp.White-mp.Black)>>1)-1;
else
if(mp.White>mp.Black)
return ((mp.White-mp.Black)>>1)+1;
else return (((mp.White-mp.Black)-1)>>1);
}
}
int place[(maxn-2)*(maxn-2)][2],q=0,r=0;
for(int i=1;i<maxn-1;i++)
for(int j=1;j<maxn-1;j++)
if(mp.d[i][j]==space)
place[q][0]=i,place[q][1]=j,++q;
r=rand()%q;
mp.Change(place[r][0],place[r][1]);
return RandSearch(mp,restDepth-1);
}
void Work(MAP mp)
{
mp.count_();
if(mp.Space_()%2) mp.is_white=true,is_white=true;
else mp.is_white=false,is_white=false;
int point[(maxn-2)*(maxn-2)][4];
int q=0,r=0;
//0.X;1.Y;2.point;3.count times
double realPoint[(maxn-2)*(maxn-2)],nowBest;
for(int i=0;i<(maxn-2)*(maxn-2);i++)
realPoint[i]=0.0;
for(int i=0;i<(maxn-2)*(maxn-2);i++)
for(int j=0;j<4;j++)
point[i][j]=0;//first set
for(int i=1;i<maxn-1;i++)
for(int j=1;j<maxn-1;j++)
if(mp.d[i][j]==space)
point[q][0]=i,point[q][1]=j,++q;
for(int i=0;i<workNum;i++)
{
r=rand()%q;
mp.Change(point[r][0],point[r][1]);
point[r][2]+=RandSearch(mp,work_depth),++point[r][3];
mp.Change(point[r][0],point[r][1]);
mp.d[point[r][0]][point[r][1]]=space;
}//search the point
for(int i=0;i<q;++i)
realPoint[i]=(double)(point[i][2])/(double)(point[i][3]);
//get the mean
nowBest=realPoint[0],r=0;
if(mp.is_white)
for(int i=1;i<q;++i)
if(realPoint[i]>nowBest)
r=i,nowBest=realPoint[i];
else for(int i=1;i<q;++i)
if(realPoint[i]<nowBest)
r=i,nowBest=realPoint[i];
advX=point[r][0],advY=point[r][1];
now_point=realPoint[r];
return;
}
};
int type=0,st=0;
void Adviser(MAP &mp,MCTS mct,ofstream &fout)
{
system("cls");
printf("1.with POINT\n2.with RATE\n3.with MIX");
char ch=getch();
if(ch=='1') mct.type=POINT;
else if(ch=='2') mct.type=RATE;
else mct.type=MIX;
system("cls");
for(int i=st;i<(maxn-2)*(maxn-2)-1;i++)
{
char ch='\0';
int X=(maxn-2)/2,Y=(maxn-2)/2;
SetXY((maxn)/2-2,0),printf("turn %d",i+1);
double P[(maxn-2)*(maxn-2)],best;
int allow[(maxn-2)*(maxn-2)][2]={0},ac=0;
int p[(maxn-2)*(maxn-2)][2];
int q=0;
for(int t=1;t<maxn-1;++t)
for(int j=1;j<maxn-1;++j)
if(mp.d[t][j]==space)
p[q][0]=t,p[q][1]=j,++q;//every tile's point
while(ch!=' ')
{
memset(allow,0,sizeof(allow));
for(int j=0;j<(maxn-2)*(maxn-2);j++) P[j]=0.0;
mp.draw_();
color(15),SetXY(X+1,Y+1);
if(mp.d[X][Y]==space)
if(!mp.is_white) color(BLACK+10),putchar('X');
else color(BLACK-7),putchar('X');
else color(14),putchar('O');
ch=getch();
if(ch==' '&&mp.d[X][Y]!=space) ch='\0';
if(ch=='w'||ch=='W') {Y=((Y-1>0)?Y-1:maxn-2);continue;}
if(ch=='s'||ch=='S') {Y=((Y+1<maxn-1)?Y+1:1);continue;}
if(ch=='a'||ch=='A') {X=((X-1>0)?X-1:maxn-2);continue;}
if(ch=='d'||ch=='D') {X=((X+1<maxn-1)?X+1:1);continue;}
if(ch=='q'||ch=='Q')
{
MAP m;
m.from(mp);
m.count_();
int work_depth=mct.work_depth;
//mct.work_depth/=m.Space_();
ac=0;
for(int t=0;t<q;t++)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
//P[t]*=0.999;//slowly forget
P[t]+=mct.now_point;
}
best=P[0],X=p[0][0],Y=p[0][1];
for(int t=1;t<q;t++)
{
if(i%2&&P[t]<best)
{
X=p[t][0],Y=p[t][1],best=P[t];
continue;
}
if(i%2==0&&P[t]>best)
{
X=p[t][0],Y=p[t][1],best=P[t];
continue;
}
if(i%2&&P[t]*accept_<best)
{
allow[ac][0]=p[t][0],allow[ac][1]=p[t][1],ac++;
continue;
}
if(i%2==0&&P[t]>best*accept_)
{
allow[ac][0]=p[t][0],allow[ac][1]=p[t][1],ac++;
continue;
}
}
mct.work_depth=work_depth;
mp.draw_();
color(15);
SetXY(X+1,Y+1),color(13*17),putchar(' ');
for(int j=0;j<ac;j++)
{
color(15),SetXY(allow[j][0]+1,allow[j][1]+1);
color(10*17),putchar(' ');
}
getch();
//mct.Work(mp);
//SetXY(mct.advX+1,mct.advY+1),color(12*17),putchar(' '),getch();
}
if((ch=='l'||ch=='L')&&mp.d[X][Y]==space)
{
if(i%2) mp.d[X][Y]=black;
else mp.d[X][Y]=white;
mp.Change(X,Y);
mct.Work(mp);
color(15);
SetXY(0,maxn+6);
printf("this move's point: ");
SetXY(18,maxn+6),printf("%0.3f",mct.now_point);
mp.Change(X,Y),mp.d[X][Y]=space;
// system("pause");
}
}
mp.Change(X,Y);
if(i%2) mp.d[X][Y]=black;
else mp.d[X][Y]=white;
color(15);
mct.Work(mp);
if(mct.type==POINT)
SetXY(0,maxn+1),printf("now point: ");
else SetXY(0,maxn+1),printf("now rate : ");
SetXY(10,maxn+1),printf("%0.3f",mct.now_point);
mp.count_();
SetXY(2,maxn+7),printf("White: ");
SetXY(2,maxn+8),printf("Black: ");
SetXY(8,maxn+7),printf("%d",mp.White);
SetXY(8,maxn+8),printf("%d",mp.Black);
fout<<X<<' '<<Y<<endl;
SetXY(maxn/2-3,maxn+3),printf("X,Y:%d,%d",X,Y);
// mp=next_(mp,dos);
}
/*if(mp.White-mp.Black>0) printf("The White win %d pieces!\n",mp.White-mp.Black);
else if(mp.White-mp.Black<0) printf("The Black win %d pieces!\n",mp.Black-mp.White);
else cout<<"Nobody win!\n";
system("pause");*/
}
void Fight(MAP &mp,MCTS mct,ofstream &fout)
{
bool point_print=0;
printf("1.with POINT\n2.with RATE\n");
char ch=getch();
if(ch=='1') mct.type=POINT;
else if(ch=='2') mct.type=RATE;
else mct.type=MIX;
system("cls");
printf("1.White 2.Black(you are):");
cin>>D;
system("cls");
printf("Would AI print the point out(Y or N)");
ch=getch();
if(ch=='y'||ch=='Y') point_print=1;
system("cls");
for(int i=st;i<(maxn-2)*(maxn-2)-1;i++)
{
char ch='\0';
int X=(maxn-2)/2,Y=(maxn-2)/2;
SetXY((maxn)/2-2,0),printf("turn %d",i+1),mp.draw_();
if((D==1&&i%2==0)||(D!=1&&i%2))
{
SetXY((maxn)/2-2,0),printf("turn %d",i+1);
while(ch!=' ')
{
mp.draw_();
color(15),SetXY(X+1,Y+1);
if(mp.d[X][Y]==space)
if(!mp.is_white) color(BLACK+10),putchar('X');
else color(BLACK-7),putchar('X');
else color(14),putchar('O');
ch=getch();
if(ch==' '&&mp.d[X][Y]!=space) ch='\0';
if(ch=='w'||ch=='W') Y=((Y-1>0)?Y-1:maxn-2);
if(ch=='s'||ch=='S') Y=((Y+1<maxn-1)?Y+1:1);
if(ch=='a'||ch=='A') X=((X-1>0)?X-1:maxn-2);
if(ch=='d'||ch=='D') X=((X+1<maxn-1)?X+1:1);
}
}
else
{
MAP m;
m.from(mp);
int work_depth=mct.work_depth;
int workNum=mct.workNum;
//mct.work_depth/=mp.Space_(),mct.work_depth+=rand()%60;
double P[(maxn-2)*(maxn-2)],best,p_=0.0;
int p[(maxn-2)*(maxn-2)][2];
int q=0;
for(int t=1;t<maxn-1;++t)
for(int j=1;j<maxn-1;++j)
if(mp.d[t][j]==space)
p[q][0]=t,p[q][1]=j,++q;
mct.work_depth>>=RESET_TIMES;
for(int t=0;t<q;t++)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
p_+=P[t];
}
p_/=(double)q;
for(int T=0;T<RESET_TIMES;T++)
{
mct.work_depth<<=1;
for(int t=0;t<q;t++)
if(P[t]>=p_)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
}
p_=0.0;for(int t=0;t<q;t++) p_+=P[t];p_/=(double)q;
}
best=P[0],X=p[0][0],Y=p[0][1];
for(int t=1;t<q;t++)
{
if(i%2&&P[t]<best)
X=p[t][0],Y=p[t][1],best=P[t];
if(i%2==0&&P[t]>best)
X=p[t][0],Y=p[t][1],best=P[t];
}
mct.workNum=workNum;
mct.work_depth=work_depth;
mct.workNum+=256;
}
if(i%10==0) /*mct.work_depth++,*/mct.workNum+=256;
if(i==40) ++mct.work_depth;
mp.Change(X,Y);
if(i%2) mp.d[X][Y]=black;
else mp.d[X][Y]=white;
mp.draw_();
mp.count_();
color(15);
if(point_print)
{
if(mct.type==POINT)
SetXY(0,maxn+1),printf("now point: ");
else SetXY(0,maxn+1),printf("now rate : ");
SetXY(10,maxn+1),printf("%0.3f",mct.now_point);
}
SetXY(2,maxn+7),printf("White: "),SetXY(2,maxn+8),printf("Black: ");
SetXY(8,maxn+7),printf("%d",mp.White),SetXY(8,maxn+8),printf("%d",mp.Black);
SetXY(maxn/2-3,maxn+3),printf("X,Y:%d,%d",X,Y);
fout<<X<<' '<<Y<<endl;
}
/*if(mp.White-mp.Black>0) printf("The White win %d pieces!\n",mp.White-mp.Black);
else if(mp.White-mp.Black<0) printf("The Black win %d pieces!\n",mp.Black-mp.White);
else cout<<"Nobody win!\n";
system("pause");*/
}
void Watch(MAP &mp,MCTS mct,ofstream &fout)
{
system("cls");
int KIND[2];
char ch='0';
printf("1.AI_White is POINT\n2.AI_White is RATE\n3.AI_White is MIX\n");
ch=getch();
if(ch=='1') KIND[0]=POINT;
else if(ch=='2') KIND[0]=RATE;
else KIND[0]=MIX;
system("cls");
printf("1.AI_Black is POINT\n2.AI_Black is RATE\n3.AI_Black is MIX\n");
ch=getch();
if(ch=='1') KIND[1]=POINT;
else if(ch=='2') KIND[1]=RATE;
else KIND[1]=MIX;
system("cls");
mp.count_();
int moved[maxn-2][maxn-2];
memset(moved,0,sizeof(moved));
for(int i=st;i<(maxn-2)*(maxn-2)-1;i++)
{
mct.type=KIND[i%2];
SetXY((maxn)/2-2,0),printf("turn %d",i+1);
SetXY((maxn)/2-3,maxn+2),printf("space ");
SetXY((maxn)/2+3,maxn+2),printf("%d",mp.Space_());
mp.draw_();
char ch='\0';
int X=(maxn-2)/2,Y=(maxn-2)/2;
int work_depth=mct.work_depth;
//if(i%2) mct.work_depth/=mp.Space_(),mct.work_depth+=rand()%60;
double P[(maxn-2)*(maxn-2)],best;
double countNum=0.0;
int p[(maxn-2)*(maxn-2)][2];
int q=0,r;
for(int t=1;t<maxn-1;t++)
for(int j=1;j<maxn-1;j++)
{
if(moved[t-1][j-1]==0)
p[q][0]=t,p[q][1]=j,q++;
}
for(int t=0;t<q;t++) P[t]=0.0;
for(int t=0;t<q;t++)
if(mp.d[p[t][0]][p[t][1]]!=space)
{
for(int j=t+1;j<q;j++)
p[j-1][0]=p[j][0],p[j-1][1]=p[j][1];
--q;
}
MAP m;
m.from(mp);
if(type==2)
{
double p_=0.0;
m.draw_();
countNum+=1.0;
mct.work_depth>>=RESET_TIMES;
for(int t=0;t<q;t++)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
p_+=P[t];
}
p_/=(double)q;
for(int T=0;T<RESET_TIMES;T++)
{
mct.work_depth<<=1;
for(int t=0;t<q;t++)
if(P[t]>=p_)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
}
p_=0.0;for(int t=0;t<q;t++) p_+=P[t];p_/=(double)q;
}
//TRUE_WORK:;
best=P[0],X=p[0][0],Y=p[0][1];
for(int t=1;t<q;t++)
{
if(i%2&&P[t]<best)
r=t,X=p[t][0],Y=p[t][1],best=P[t]/countNum;
if(i%2==0&&P[t]>best)
r=t,X=p[t][0],Y=p[t][1],best=P[t]/countNum;
}
mct.work_depth=work_depth;
color(15);
if(mct.type==POINT)
SetXY(0,maxn+1),printf("now point: ");
else if(mct.type==RATE)
SetXY(0,maxn+1),printf("now rate : ");
else
SetXY(0,maxn+1),printf("mix rate : ");
SetXY(10,maxn+1),printf("%0.3f",best);
Sleep(500+rand()%300);
}
else
while(ch!=' ')
{
m.draw_();
if(ch=='g')
{
color(10*17);
for(int t=0;t<q;t++)
SetXY(p[t][0]+1,p[t][1]+1),putchar(' ');
ch=getch(),color(15);
continue;
}
countNum+=1.0;
double p_=0.0;
mct.work_depth>>=RESET_TIMES;
for(int t=0;t<q;t++)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
p_+=P[t];
}
p_/=(double)q;
for(int T=0;T<RESET_TIMES;T++)
{
mct.work_depth<<=1;
for(int t=0;t<q;t++)
if(P[t]>=p_)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
}
p_=0.0;for(int t=0;t<q;t++) p_+=P[t];p_/=(double)q;
}
//TRUE_WORK:;
best=P[0],X=p[0][0],Y=p[0][1];
for(int t=1;t<q;t++)
{
if(i%2&&P[t]<best)
r=t,X=p[t][0],Y=p[t][1],best=P[t]/countNum;
if(i%2==0&&P[t]>best)
r=t,X=p[t][0],Y=p[t][1],best=P[t]/countNum;
}
mct.work_depth=work_depth;
color(15);
SetXY(0,maxn+1),printf("now point: ");
SetXY(10,maxn+1),printf("%0.3f",best);
ch=getch();
}
SetXY(maxn/2-3,maxn+3),printf("X,Y:%d,%d",X,Y);
if(mp.d[X][Y]!=space)
SetXY(maxn/2-4,maxn+4),printf("not space!");
moved[X-1][Y-1]=1;
mp.Change(X,Y);
if(i%2) mp.d[X][Y]=black;
else mp.d[X][Y]=white;
mp.count_();
SetXY(2,maxn+7),printf("White: ");
SetXY(2,maxn+8),printf("Black: ");
SetXY(8,maxn+7),printf("%d",mp.White);
SetXY(8,maxn+8),printf("%d",mp.Black);
fout<<X<<' '<<Y<<endl;
}
}
void MCTS_(void)
{
st=0,type=0;
ofstream fout("last.ini");
printf("1.Read\n2.Self-work(don't need to push ' ',only if you choose Watch)\n3.Common\n");
cin>>type;
MAP mp;
mp.Set();
if(type==1)
{
printf("Put in the name:");
cin>>name;
ifstream fin(str_ch(name));
if(fin.is_open())
{
int x=0,y=0;
mp.is_white=true;
while(true)
{
fin>>x;
if(x==EOF) break;
fin>>y;
if(y==EOF) break;
mp.Change(x,y),++st;
}
}
else cout<<"打开失败!\n";
}
MCTS mct;
mct.type=POINT;
system("cls");
HideCursor();
printf("Put in work depth(can reach 6!):"),cin>>D;
if(D<2) D=2;
mct.work_depth=D;
printf("Put in work borads num(1 means 1 kilo):"),cin>>D;
if(D<1) D=1;
mct.workNum=D*1024;
printf("1.Adviser 2.Fight 3.Watch\n"),cin>>D;
if(D==1) Adviser(mp,mct,fout);
if(D==2) Fight(mp,mct,fout);
if(D==3) Watch(mp,mct,fout);
mp.count_(),mp.draw_();
SetXY(0,maxn+5);
if(mp.White-mp.Black>0) printf("The White win %d pieces!\n",mp.White-mp.Black);
else if(mp.White-mp.Black<0) printf("The Black win %d pieces!\n",mp.Black-mp.White);
else cout<<"Nobody win!\n";
system("pause"),SetXY(0,maxn+6),printf(" \n");
Game();
}
void AI_test(void)
{
system("cls");
MAP mp;
MCTS mct;
printf("Put in work depth(can reach 15!):"),cin>>D;
if(D<2) D=2;
mct.work_depth=D;//mct[1].work_depth=mct[0].work_depth;
printf("Put in work borads num(1 means 1 kilo):"),cin>>D;
if(D<1) D=1;
mct.workNum=D*1024;//ct[1].workNum=mct[0].workNum;
//mct.type=POINT,mct[1].type=RATE;
int winner=0,win_num[2]={0},N=0;
int now_color[2];
int whiteWinNum=0;
int moves[(maxn-2)*(maxn-2)][2]={0};
string savingName;
printf("How many times AIs will play:"),cin>>N;
//N=min(1000,max(1,N));
printf("Saving name:"),cin>>savingName;
int fst,sec;
printf("Which AI plays(input twice):\n1.POINT\n2.RATE\n3.MIX\n");
char ch=getch();
if(ch=='1') fst=POINT;
else if(ch=='2') fst=RATE;
else fst=MIX;
ch=getch();
if(ch=='1') sec=POINT;
else if(ch=='2') sec=RATE;
else sec=MIX;
for(int i=1;i<=N;i++)
{
ofstream fout(str_ch("Record\\"+savingName+"_"+num_str(i)+".ini"));
mp.Set();
//now_color[0]=black,now_color[1]=white;
//if(rand()%2) swap(now_color[0],now_color[1]);
//system("cls");
int KIND[2];
//printf("1.AI_White is POINT\n2.AI_White is RATE\n");
if(rand()%2) KIND[0]=fst;
else KIND[0]=sec;
system("cls");
//printf("1.AI_Black is POINT\n2.AI_Black is RATE\n");
if(KIND[0]==sec) KIND[1]=fst;
else KIND[1]=sec;
//system("cls");
mp.count_();
int moved[maxn-2][maxn-2];
memset(moved,0,sizeof(moved));
for(int i=st;i<(maxn-2)*(maxn-2)-1;i++)
{
mct.type=KIND[i%2];
//SetXY((maxn)/2-2,0),printf("turn %d",i+1);
SetXY(0,0),printf("Turn up or enjoy AI's play!");
SetXY((maxn)/2-3,maxn+2),printf("space ");
SetXY((maxn)/2+3,maxn+2),printf("%d",mp.Space_());
mp.draw_();
char ch='\0';
int X=(maxn-2)/2,Y=(maxn-2)/2;
int work_depth=mct.work_depth;
mct.work_depth/=mp.Space_();mct.work_depth+=rand()%60;
double P[(maxn-2)*(maxn-2)],best;
double countNum=0.0;
int p[(maxn-2)*(maxn-2)][2];
int q=0,r;
for(int t=1;t<maxn-1;t++)
for(int j=1;j<maxn-1;j++)
{
if(moved[t-1][j-1]==0)
p[q][0]=t,p[q][1]=j,q++;
}
for(int t=0;t<q;t++) P[t]=0.0;
for(int t=0;t<q;t++)
if(mp.d[p[t][0]][p[t][1]]!=space)
{
for(int j=t+1;j<q;j++)
p[j-1][0]=p[j][0],p[j-1][1]=p[j][1];
--q;
}
MAP m;
m.from(mp);
if(1)
{
m.draw_();
countNum+=1.0;
double p_=0.0;
mct.work_depth>>=RESET_TIMES;
for(int t=0;t<q;t++)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
p_+=P[t];
}
p_/=(double)q;
for(int T=0;T<RESET_TIMES;T++)
{
mct.work_depth<<=1;
for(int t=0;t<q;t++)
if(P[t]>=p_)
{
m.Change(p[t][0],p[t][1]);
if(i%2) m.d[p[t][0]][p[t][1]]=black;
else m.d[p[t][0]][p[t][1]]=white;
mct.Work(m);
//color(15);
//SetXY(0,maxn+6);
m.Change(p[t][0],p[t][1]);
m.d[p[t][0]][p[t][1]]=space;
P[t]+=mct.now_point;
}
p_=0.0;for(int t=0;t<q;t++) p_+=P[t];p_/=(double)q;
}
//TRUE_WORK:;
best=P[0],X=p[0][0],Y=p[0][1];
for(int t=1;t<q;t++)
{
if(i%2&&P[t]<best)
r=t,X=p[t][0],Y=p[t][1],best=P[t]/countNum;
if(i%2==0&&P[t]>best)
r=t,X=p[t][0],Y=p[t][1],best=P[t]/countNum;
}
mct.work_depth=work_depth;
color(15);
if(mct.type==POINT)
SetXY(0,maxn+1),printf("now point: ");
else if(mct.type==RATE)
SetXY(0,maxn+1),printf("now rate: ");
else SetXY(0,maxn+1),printf("mix rate: ");
SetXY(10,maxn+1),printf("%0.3f",best);
Sleep(1000+rand()%500);
}
SetXY(maxn/2-3,maxn+3),printf("X,Y:%d,%d",X,Y);
if(mp.d[X][Y]!=space)
SetXY(maxn/2-4,maxn+4),printf("not space!");
moved[X-1][Y-1]=1;
mp.Change(X,Y);
if(i%2) mp.d[X][Y]=black;
else mp.d[X][Y]=white;
mp.count_();
SetXY(2,maxn+7),printf("White: ");
SetXY(2,maxn+8),printf("Black: ");
SetXY(8,maxn+7),printf("%d",mp.White);
SetXY(8,maxn+8),printf("%d",mp.Black);
fout<<X<<' '<<Y<<endl;
}
mp.count_();
if(mp.White>mp.Black)
if(KIND[0]==fst) winner=0;
else winner=1;
else if(KIND[0]==fst) winner=1;
else winner=0;
win_num[winner]++;
Sleep(50);
if(mp.White>mp.Black) fout<<"White win "<<mp.White-mp.Black<<endl,++whiteWinNum;
else fout<<"Black win "<<mp.Black-mp.White<<endl;
/*for(int t=0;t<(maxn-2)*(maxn-2)-1;t++)
fout<<moves[t][0]<<' '<<moves[t][1]<<endl;*/
Sleep(50);
}
system("cls");
if(fst==POINT) printf("POINT win:%d\n",win_num[0]);
else if(fst==RATE) printf("RATE win:%d\n",win_num[0]);
else printf("MIX win:%d\n",win_num[0]);
if(sec==POINT) printf("POINT win:%d\n",win_num[1]);
else if(sec==RATE) printf("RATE win:%d\n",win_num[1]);
else printf("MIX win:%d\n",win_num[1]);
printf("White win:%d\nBlack win:%d\n",whiteWinNum,N-whiteWinNum);
system("pause");
}
void Game(void)
{
color(15),system("cls"),srand(time(0));
printf("1.Exit\n");
color(12),printf("2.New game\n"),color(15);
printf("3.AI test\n");
cin>>D;
if(D==1) exit(0);
if(D==2) MCTS_();
if(D==3) AI_test();
Game();
}
int main(void)
{
//for(int i=0;i<=15;i++) color(15),cout<<i,color(17*i),cout<<' '<<endl;
MAP m;
m.Set(),m.d[2][2]=white,m.d[3][3]=black,m.draw_();
HideCursor();
cout<<"1.Rule\n2.Play\n";
cin>>D;
if(D==1) rule();
if(D==2) Game();
}
浙公网安备 33010602011771号