初级守护
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
long long a=24,b=24,ca,cb,pa,pb,c,i,a1,b1;
char A[8],t;
string l[101][3];
int main(){
system("color 61");
cout<<"*************** 游戏说明 **************"<<'\n';
cout<<"*每一局黑白两个玩家分别输入五个字符表示*"<<'\n';
cout<<"*上下左右,先在最后一步把棋子移动到对方*"<<'\n';
cout<<"*棋子上的人胜利 *"<<'\n';
cout<<"*攻击,但也可能攻击力度过猛,自己减少一*"<<'\n';
cout<<"*滴血。注意:每人只有24滴血!!! *"<<'\n';
cout<<"****************************************"<<'\n';
cout<<"如果每局开始时需要输出历史记录,请输入Y,否则输入N。"<<'\n';
cin>>t;
system("cls");
while(a!=0&&b!=0){
c++;
cout<<"-------------- 这是第"<<c<<"局 ---------------"<<'\n';
if(c!=1&&t=='Y'){
cout<<"╔═════得分表══════╗"<<'\n';
cout<<"║红方得分║蓝方得分║"<<'\n';
for(i=1;i<c;i++){
cout<<"╠════════╬════════╣"<<'\n';
cout<<"║"<<l[i][1]<<' '<<"║"<<l[i][2]<<' '<<"║"<<'\n';
}
cout<<"╚════════╩════════╝"<<'\n';
}
cout<<"红方原来的血条:";
if(a>=16)for(i=1;i<=a;i++)cout<<'#';
if(a<16&&a>=8)for(i=1;i<=a;i++)cout<<'?';
if(a<8)for(i=1;i<=a;i++)cout<<'!';
cout<<"共"<<a<<"滴"<<'\n';
cout<<"蓝方原来的血条:";
if(b>=16)for(i=1;i<=b;i++)cout<<'#';
if(b<16&&b>=8)for(i=1;i<=b;i++)cout<<'?';
if(b<8)for(i=1;i<=b;i++)cout<<'!';
cout<<"共"<<b<<"滴"<<'\n';
cout<<"请红方输入7个字母,并换行。"<<'\n';
cin>>A[1]>>A[2]>>A[3]>>A[4]>>A[5]>>A[6]>>A[7];
ca=((A[2]*A[7]+A[5]*A[6])+A[1]-A[2])*A[3]*A[5]-A[4]+A[7];
cout<<"请蓝方输入7个字母,并换行。"<<'\n';
cin>>A[1]>>A[2]>>A[3]>>A[4]>>A[5]>>A[6]>>A[7];
cb=((A[5]*A[7]+A[2]*A[1])+A[6]-A[2])*A[3]*A[7]-A[4]+A[6];
pa=ca%3;
pb=cb%3;
if(ca%(a*b)<=10&&cb%(a*b)>10){
a=24;
b1=b;
b=b/4;
cout<<"红方赢了,使用了**攻击,红方血量爆满,蓝方的血量减少到原来的1/4。"<<'\n';
system("color 42");
l[c][1]="24 ";
if(b1<10)l[c][2]=l[c][2]+char(b1+'0')+'/'+'4'+'='+char(b+'0')+' '+' ';
if(b1>=10)l[c][2]=l[c][2]+char(b1/10+'0')+char(b1%10+'0')+'/'+'4'+'='+char(b+'0')+' ';
}
else{
if(cb%(a*b)<=10&&ca%(a*b)>10){
b=24;
a1=a;
a=a/4;
cout<<"蓝方赢了,使用了**攻击,蓝方血量爆满,红方的血量减少到原来的1/4。"<<'\n';
system("color 16");
l[c][2]="24 ";
if(a1<10)l[c][1]=l[c][1]+char(a1+'0')+'/'+'4'+'='+char(a+'0')+' '+' ';
if(a1>=10)l[c][1]=l[c][1]+char(a1/10+'0')+char(a1%10+'0')+'/'+'4'+'='+char(a+'0')+' ';
}
else{
if(pa==1&&pb==2){
a++;
b-=3;
cout<<"红方赢了,锤了蓝方一拳,蓝方减少了3滴血。"<<'\n';
system("color 42");
if(a<10)l[c][1]=l[c][1]+char(a-1+'0')+'+'+'1'+'='+char(a+'0')+' '+' ';
if(a==10)l[c][1]="9+1=10 ";
if(a>10)l[c][1]=l[c][1]+char((a-1)/10+'0')+char((a-1)%10+'0')+'+'+'1'+'='+char(a/10+'0')+char(a%10+'0');
if(b<7)l[c][2]=l[c][2]+char(b+3+'0')+'-'+'3'+'='+char(b+'0')+' '+' ';
if(b==7)l[c][2]="10-3=7 ";
if(b==8)l[c][2]="11-3=8 ";
if(b==9)l[c][2]="12-3=9 ";
if(b==10)l[c][2]="13-3=10";
if(b>10)l[c][2]=l[c][2]+l[c][2]+char((b+3)/10+'0')+char((b+3)%10+'0')+'-'+'3'+'='+char(b/10+'0')+char(b%10+'0');
if(a==25)l[c][1]="24+1=24";
}
if(pa==2&&pb==0){
a++;
b-=4;
cout<<"红方赢了,打了蓝方一巴掌,蓝方减少了4滴血。"<<'\n';
system("color 42");
if(a<10)l[c][1]=l[c][1]+char(a-1+'0')+'+'+'1'+'='+char(a+'0')+' '+' ';
if(a==10)l[c][1]="9+1=10 ";
if(a>10)l[c][1]=l[c][1]+char((a-1)/10+'0')+char((a-1)%10+'0')+'+'+'1'+'='+char(a/10+'0')+char(a%10+'0');
if(b<6)l[c][2]=l[c][2]+char(b+4+'0')+'-'+'4'+'='+char(b+'0')+' '+' ';
if(b==6)l[c][2]="10-4=6 ";
if(b==7)l[c][2]="11-4=7 ";
if(b==8)l[c][2]="12-4=8 ";
if(b==9)l[c][2]="13-4=9 ";
if(b==10)l[c][2]="14-4=10";
if(b>10)l[c][2]=l[c][2]+char((b+4)/10+'0')+char((b+4)%10+'0')+'-'+'4'+'='+char(b/10+'0')+char(b%10+'0');
if(a==25)l[c][1]="24+1=24";
}
if(pa==0&&pb==1){
a++;
b-=6;
cout<<"红方赢了,踢了蓝方一脚,蓝方减少了6滴血。"<<'\n';
system("color 42");
if(a<10)l[c][1]=l[c][1]+char(a-1+'0')+'+'+'1'+'='+char(a+'0')+' '+' ';
if(a==10)l[c][1]="9+1=10 ";
if(a>10)l[c][1]=l[c][1]+char((a-1)/10+'0')+char((a-1)%10+'0')+'+'+'1'+'='+char(a/10+'0')+char(a%10+'0');
if(b<4)l[c][2]=l[c][2]+char(b+3+'0')+'-'+'3'+'='+char(b+'0')+' '+' ';
if(b==4)l[c][2]="10-6=4 ";
if(b==5)l[c][2]="11-6=5 ";
if(b==6)l[c][2]="12-6=6 ";
if(b==7)l[c][2]="13-6=7 ";
if(b==8)l[c][2]="14-6=8 ";
if(b==9)l[c][2]="15-6=9 ";
if(b==10)l[c][2]="16-6=10";
if(b>10)l[c][2]=l[c][2]+char((b+6)/10+'0')+char((b+6)%10+'0')+'-'+'6'+'='+char(b/10+'0')+char(b%10+'0');
if(a==25)l[c][1]="24+1=24";
}
if(pb==1&&pa==2){
b++;
a-=3;
cout<<"蓝方赢了,锤了红方一拳,红方减少了3滴血。"<<'\n';
system("color 16");
if(b<10)l[c][2]=l[c][2]+char(b-1+'0')+'+'+'1'+'='+char(b+'0')+' '+' ';
if(b==10)l[c][2]="9+1=10 ";
if(b>10)l[c][2]=l[c][2]+char((b-1)/10+'0')+char((b-1)%10+'0')+'+'+'1'+'='+char(b/10+'0')+char(b%10+'0');
if(a<7)l[c][1]=l[c][1]+char(a+3+'0')+'-'+'3'+'='+char(a+'0')+' '+' ';
if(a==7)l[c][1]="10-3=7 ";
if(a==8)l[c][1]="11-3=8 ";
if(a==9)l[c][1]="12-3=9 ";
if(a==10)l[c][1]="13-3=10";
if(a>10)l[c][1]=l[c][1]+char((a+3)/10+'0')+char((a+3)%10+'0')+'-'+'3'+'='+char(a/10+'0')+char(a%10+'0');
if(b==25)l[c][2]="24+1=24";
}
if(pb==2&&pa==0){
b++;
a-=4;
cout<<"蓝方赢了,打了红方一巴掌,红方减少了4滴血。"<<'\n';
system("color 16");
if(b<10)l[c][2]=l[c][2]+char(b-1+'0')+'+'+'1'+'='+char(b+'0')+' '+' ';
if(b==10)l[c][2]="9+1=10 ";
if(b>10)l[c][2]=l[c][2]+char((b-1)/10+'0')+char((b-1)%10+'0')+'+'+'1'+'='+char(b/10+'0')+char(b%10+'0');
if(a<6)l[c][1]=l[c][1]+char(a+4+'0')+'-'+'3'+'='+char(a+'0')+' '+' ';
if(a==6)l[c][1]="10-4=6 ";
if(a==7)l[c][1]="11-4=7 ";
if(a==8)l[c][1]="12-4=8 ";
if(a==9)l[c][1]="13-4=9 ";
if(a==10)l[c][1]="14-4=10";
if(a>10)l[c][1]=l[c][1]+char((a+4)/10+'0')+char((a+4)%10+'0')+'-'+'4'+'='+char(a/10+'0')+char(a%10+'0');
if(b==25)l[c][2]="24+1=24";
}
if(pb==0&&pa==1){
b++;
a-=6;
cout<<"蓝方赢了,踢了红方一脚,红方减少了6滴血。"<<'\n';
system("color 16");
if(b<10)l[c][2]=l[c][2]+char(b-1+'0')+'+'+'1'+'='+char(b+'0')+' '+' ';
if(b==10)l[c][2]="9+1=10 ";
if(b>10)l[c][2]=l[c][2]+char((b-1)/10+'0')+char((b-1)%10+'0')+'+'+'1'+'='+char(b/10+'0')+char(b%10+'0');
if(a<4)l[c][1]=l[c][1]+char(a+3+'0')+'-'+'3'+'='+char(a+'0')+' '+' ';
if(a==4)l[c][1]="10-6=4 ";
if(a==5)l[c][1]="11-6=5 ";
if(a==6)l[c][1]="12-6=6 ";
if(a==7)l[c][1]="13-6=7 ";
if(a==8)l[c][1]="14-6=8 ";
if(a==9)l[c][1]="15-6=9 ";
if(a==10)l[c][1]="16-6=10";
if(a>10)l[c][1]=l[c][1]+char((a+6)/10+'0')+char((a+6)%10+'0')+'-'+'6'+'='+char(a/10+'0')+char(a%10+'0');
if(b==25)l[c][2]="24+1=24";
}
if(pb==pa){
if(ca<cb||(ca==cb&&c%2==1)){
a--;
cout<<"红方赢了,但攻击力度过猛,自己减少一滴血。"<<'\n';
system("color 42");
if(a<9)l[c][1]=l[c][1]+char(a+1+'0')+'-'+'1'+'='+char(a+'0')+' '+' ';
if(a==9)l[c][1]="10-1=9 ";
if(a>=10)l[c][1]=l[c][1]+char((a+1)/10+'0')+char((a+1)%10+'0')+'-'+'1'+'='+char(a/10+'0')+char(a%10+'0');
if(b<10)l[c][2]=l[c][2]+char(b+'0')+' '+' '+' '+' '+' '+' ';
else l[c][2]=l[c][2]+char(b/10+'0')+char(b%10+'0')+' '+' '+' '+' '+' ';
}
if(ca>cb||(ca==cb&&c%2==0)){
b--;
cout<<"蓝方赢了,但攻击力度过猛,自己减少一滴血。"<<'\n';
system("color 16");
if(b<9)l[c][2]=l[c][2]+char(b+1+'0')+'-'+'1'+'='+char(b+'0')+' '+' ';
if(b==9)l[c][2]="10-1=9 ";
if(b>=10)l[c][2]=l[c][2]+char((b+1)/10+'0')+char((b+1)%10+'0')+'-'+'1'+'='+char(b/10+'0')+char(b%10+'0');
if(a<10)l[c][1]=l[c][1]+char(a+'0')+" ";
else l[c][1]=l[c][1]+char(a/10+'0')+char(a%10+'0')+" ";
}
}
}
}
if(a>24)a=24;
if(b<0)b=0;
if(b>24)b=24;
if(a<0)a=0;
cout<<"红方的血条:";
if(a>=16)for(i=1;i<=a;i++)cout<<'#';
if(a<16&&a>=8)for(i=1;i<=a;i++)cout<<'?';
if(a<8)for(i=1;i<=a;i++)cout<<'!';
if(a==0)cout<<"空空如也!"<<'\n';
else cout<<"共"<<a<<"滴"<<'\n';
cout<<"蓝方的血条:";
if(b>=16)for(i=1;i<=b;i++)cout<<'#';
if(b<16&&b>=8)for(i=1;i<=b;i++)cout<<'?';
if(b<8)for(i=1;i<=b;i++)cout<<'!';
if(b==0)cout<<"空空如也!"<<'\n';
else cout<<"共"<<b<<"滴"<<'\n';
cout<<"----------------------------------------"<<'\n';
Sleep(1000);
system("cls");
}
if(a==0){
cout<<"这局B赢了,B有"<<b<<"滴血。"<<'\n';
cout<<"但A也不要灰心,下次加油!"<<'\n';
}
if(b==0){
cout<<"这局A赢了,A有"<<a<<"滴血。"<<'\n';
cout<<"但B也不要灰心,下次加油!"<<'\n';
}
Sleep(1000);
system("cls");
system("color 61");
cout<<"*************** 感谢使用 ***************"<<'\n';
cout<<"*感谢您的使用,但我技术有限,如果有不好*"<<'\n';
cout<<"*玩的地方,或者好的建议,可以来找我,欢*"<<'\n';
cout<<"*迎来找我。 *"<<'\n';
cout<<"* ——V1978大黄狗(黄秋实)*"<<'\n';
cout<<"****************************************"<<'\n';
}//石头剪刀布5.1;
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
long long i,j,a[101][101],a1[101][101],x,y,x2,y2,x3=1,y3=1,c;
char t;
int main(){
system("color A4");
for(i=1;i<=40;i++)a[1][i]=1,a[30][i]=1;
for(i=1;i<=30;i++)a[i][1]=1,a[i][40]=1;
a[10][10]=3;
a[10][11]=2;
a[10][12]=2;
a[10][13]=2;
a[10][14]=2;
a[10][15]=2;
a[10][16]=2;
x=10;
y=10;
x2=10;
y2=16;
while(a[x3][y3]!=0){x3=(rand()-2)%26+2;y3=(rand()-2)%36+2;};
a[x3][y3]=4;
while(1){
c=0;
for(i=1;i<=30;i++){
for(j=1;j<=40;j++){
if(a[i][j]==0&&a1[i][j]==0)printf(" ");
else if(a[i][j]==1)printf("##");
else if(a[i][j]==2)printf("()");
else if(a[i][j]==3)printf("::");
else if(a[i][j]==4)printf("$$"),c++;
else if(a1[i][j]==5)printf("<>");
}
cout<<'\n';
}
if(c==0){
x3=1;
y3=1;
while(a[x3][y3]!=0){
x3=(rand()-2)%26+2;
y3=(rand()-2)%36+2;
}
a[x3][y3]=4;
}
if(GetKeyState(81)<0){
swap(x,x2);
swap(y,y2);
a[x2][y2]=2;
a[x][y]=3;
}
else{
a[x][y]=2;
if(GetKeyState(65)<0)y--;
else if(GetKeyState(68)<0)y++;
else if(GetKeyState(87)<0)x--;
else if(GetKeyState(83)<0)x++;
else{
if(a[x-1][y]==2)x++;
else if(a[x+1][y]==2)x--;
else if(a[x][y-1]==2)y++;
else if(a[x][y+1]==2)y--;
}
if(GetKeyState(69)<0){
a[x][y]=2;
a[x2][y2]=0;
if(a[x2+1][y2]==2)x2++;
else if(a[x2-1][y2]==2)x2--;
else if(a[x2][y2+1]==2)y2++;
else if(a[x2][y2-1]==2)y2--;
if(a[x-1][y]==2)x++;
else if(a[x+1][y]==2)x--;
else if(a[x][y-1]==2)y++;
else if(a[x][y+1]==2)y--;
}
if(a1[x][y]==5)a1[x][y]=0;
if(a[x][y]==4){
a1[x][y]=5;
while(a[x3][y3]!=0){x3=(rand()-2)%26+2;y3=(rand()-2)%36+2;};
a[x3][y3]=4;
}
else {
if(a[x][y]!=0)return 0;
a[x2][y2]=0;
if(a[x2+1][y2]==2)x2++;
else if(a[x2-1][y2]==2)x2--;
else if(a[x2][y2+1]==2)y2++;
else if(a[x2][y2-1]==2)y2--;
}
a[x][y]=3;
}
system("cls");
//Sleep(30);
}
}//贪吃蛇1.0
初级启示者
不错,做的蛮好的!!!
我推荐个游戏
XACRAFT 3.2 简体中文版
#include<iostream>
#include<fstream>
#include<windows.h>
#include<cstdio>
#include<cstring>
#include<stdio.h>
#include<conio.h>
#include<sstream>
#include<time.h>
#include<vector>
#include<stdio.h>
#include<stdlib.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
bool allowsave=1;
bool jiandang[21];//建立存档
string nam,pas;
void console()
{
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO bInfo;
GetConsoleScreenBufferInfo(hOut, &bInfo );
SetConsoleTitle("XACRAFT 3.2 简体中文版"); // 设置窗口的标题
}
struct han{
int ui,num;
}hand[21][50],rl[51];
struct pflist{
int num;
han k[101];
han sum;
}lis[10001],rlis[10001];
struct blocklist{
string nam,ape;
int pps,cor,hylink,maxl,mintim;
}bl[10001];
struct Eclist{
string ecs,nam,notice;
int jb,lin,emc;
}eclis[10001];
string tecpas,tecnam,tecpin;
char ch;
int errortimes=0;
string pfd="XZ";//皮肤
long long jb=100;//金币数量
int a[21][5][256][2049],x[21]={0},y[21],cx[21],cy[21],ran[21],mode[21],xuanze=0,lisn,rlisn,rln,eclisn,emc;
int smz[21],jed[21];
int days[21],tims[21],chuancan;
int i,j,kkk;
bool kn=0,echave[10001];
char cmmd;
string comd;
int seed;
bool bpf[51];
string pfs[10]={"XZ","XA","GD","MC","卍","◎","△","◇","□","∞"};
string waitingnotice[100]={
"XACRAFT 1.0版本发布于2021年2月12日",
"XACRAFT刚刚诞生时,代码行数不超过150行!",
"金苹果的生成概率仅为0.05%",
"你会发现,所有的XACRAFT生物群系都有植物生成!",
"加入XACRAFT社区,与伙伴交流XACRAFT的游戏技巧!",
"不要**近仙人掌!",
"生存模式中,按下L键即可查看状态栏。",
"饥饿值小于30时,生命值将不会恢复!",
"多收集一些苹果,这样才不会挨饿。",
"钻石矿石的生成最高高度为16。"
};
int pfp[10]={0,50,50,100,150,150,150,150,150,300},sehao=240,pfn=10;
int shop[21][21]=
{
{ 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,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,17,17,17,0,0,0,11,27,11,0,0,0,18,18,18,0,0,1 },
{ 1,0,0,17,6,17,0,0,0,11,27,11,0,0,0,18,15,18,0,0,1 },
{ 1,0,0,17,17,17,0,0,0,11,27,11,0,0,0,18,18,18,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,11,11,11,11,11,11,11,11,11,27,11,11,11,11,11,11,11,11,11,1 },
{ 1,27,27,27,27,27,27,27,27,27,7,27,27,27,27,27,27,27,27,27,1 },
{ 1,11,11,11,11,11,11,11,11,11,27,11,11,11,11,11,11,11,11,11,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,29,29,29,0,0,0,11,27,11,0,0,0,13,13,13,0,0,1 },
{ 1,0,0,29,28,29,0,0,0,11,27,11,0,0,0,13,14,13,0,0,1 },
{ 1,0,0,29,29,29,0,0,0,11,27,11,0,0,0,13,13,13,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,0,0,0,0,1 },
{ 1,0,0,0,0,0,0,0,0,11,27,11,0,0,0,0,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 },
};
void color(int corcorcor){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),corcorcor);
}
bool kd(char ccc){
if(!KEY_DOWN(ccc)) return 0;
else return 1;
}
int rdm(int aaaaa,int bbbbb){
return rand()%(bbbbb-aaaaa+1)+aaaaa;
}
void cls(){//赟刑道提供,如有侵权请联系删除。
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coordScreen = { 0, 0 }; // home for the cursor
SetConsoleCursorPosition( hConsole, coordScreen );
}
char gl(){
if(kd('Q')) return 'Q';
if(kd('W')) return 'W';
if(kd('E')) return 'E';
if(kd('R')) return 'R';
if(kd('T')) return 'T';
if(kd('Y')) return 'Y';
if(kd('U')) return 'U';
if(kd('I')) return 'I';
if(kd('O')) return 'O';
if(kd('P')) return 'P';
if(kd('A')) return 'A';
if(kd('S')) return 'S';
if(kd('D')) return 'D';
if(kd('F')) return 'F';
if(kd('G')) return 'G';
if(kd('H')) return 'H';
if(kd('J')) return 'J';
if(kd('K')) return 'K';
if(kd('L')) return 'L';
if(kd('Z')) return 'Z';
if(kd('X')) return 'X';
if(kd('C')) return 'C';
if(kd('V')) return 'V';
if(kd('B')) return 'B';
if(kd('N')) return 'N';
if(kd('M')) return 'M';
if(kd('1')) return '1';
if(kd('2')) return '2';
if(kd('3')) return '3';
if(kd('4')) return '4';
if(kd('5')) return '5';
if(kd('6')) return '6';
if(kd('7')) return '7';
if(kd('8')) return '8';
if(kd('9')) return '9';
if(kd('0')) return '0';
}
string getTime(){//该函数如需借鉴请先联系沙兴安
time_t timep;
time (&timep);
char tmp[64];
strftime(tmp, sizeof(tmp), "%m%d",localtime(&timep) );
return tmp;
}
string GetTime(){//该函数如需借鉴请先联系沙兴安
time_t timep;
time (&timep);
char tmp[64];
strftime(tmp, sizeof(tmp), "%Y%m%d",localtime(&timep) );
return tmp;
}
int change_num(string will_change){//该函数如需借鉴请先联系沙兴安
stringstream sin;
sin<<will_change;
int change_ok;
sin>>change_ok;
return change_ok;
}
string change_string(int will_change){//该函数如需借鉴请先联系沙兴安
stringstream sin;
sin<<will_change;
string change_ok;
sin>>change_ok;
return change_ok;
}
void rightLine(string str){//该函数如需借鉴请先联系沙兴安
int i,l,w;
w=80;
l=str.length();
for(i=0;i<80-l;i++)
cout<<" ";
cout<<str<<endl;
return ;
}
void Line(string str){//该函数如需借鉴请先联系沙兴安
int i,l,w;
w=80;
l=str.length();
for(i=0;i<(w-l)/2;i++)
cout<<" ";
cout<<str<<endl;
return ;
}
void line(string str){//该函数如需借鉴请先联系沙兴安
int i,l,w;
w=80;
l=str.length();
for(i=0;i<(w-l)/2;i++)
cout<<" ";
cout<<str;
return ;
}
void jjsc(string str,int cor){//该函数如需借鉴请先联系沙兴安
system("cls");
color(cor);
system("cls");
for(i=1;i<=11;i++) cout<<endl;
color(cor);
Line(str);
color(7);
}
void del(int ccc,int uiui,int numm){
for(i=1;i<=50;i++){
if(uiui==hand[ccc][i].ui){
hand[ccc][i].num-=numm;
if(hand[ccc][i].num<=0){
hand[ccc][i].num=0;
hand[ccc][i].ui=0;
}
return ;
}
}
}
void pus(int ccc,int uiui,int numm){
for(i=1;i<=50;i++){
if(uiui==hand[ccc][i].ui && hand[ccc][i].num+numm<=bl[hand[ccc][i].ui].maxl){
hand[ccc][i].num+=numm;
return ;
}
}
for(i=1;i<=50;i++){
if(hand[ccc][i].ui==0){
hand[ccc][i].ui=uiui;
hand[ccc][i].num=numm;
return ;
}
}
}
void waiting(string notice){
system("cls");
color(15);
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
Line(notice);
cout<<endl<<endl<<endl;
Line("你知道吗?");
cout<<endl;
srand(time(NULL));
Line(waitingnotice[rand()%10]);
}
void HideCursor1(){
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);//获取控制台光标信息
CursorInfo.bVisible = false; //隐藏控制台光标
SetConsoleCursorInfo(handle, &CursorInfo);//设置控制台光标状态
}
//逻辑锁部分(始)
bool end_day(){
string tmp=GetTime(),temp="20220801";
if(tmp>=temp) return 1;
else return 0;
}
bool fool_days(){
string tmp=getTime();
if(tmp=="0401") return 1;
else return 0;
}
//逻辑锁部分(终)
//TEC
void lin(string str){//该函数如需借鉴请先联系沙兴安
int i,l,w;
w=80;
l=str.length();
for(i=0;i<(w-l)/2;i++)
cout<<" ";
cout<<str;
return ;
}
void nameline(string str){
int i,l,w;
w=50;
l=str.length();
for(i=0;i<(w-l)/2-1;i++)
cout<<" ";
cout<<str;
if((w-l)%2==0){
for(i=0;i<(w-l)/2-1;i++)
cout<<" ";
}else{
for(i=0;i<(w-l)/2;i++)
cout<<" ";
}
color(7);
cout<<"|";
return ;
}
void passline(string str){
int i,l,w;
w=50;
l=str.length();
for(i=0;i<(w-l)/2-1;i++)
cout<<" ";
for(i=0;i<str.length();i++) cout<<"*";
if((w-l)%2==0){
for(i=0;i<(w-l)/2-1;i++)
cout<<" ";
}else{
for(i=0;i<(w-l)/2;i++)
cout<<" ";
}
color(7);
cout<<"|";
return ;
}
bool Login_getpass(){
errortimes=0;
cp:;
if(errortimes>=3){
color(13);
cout<<endl;
lin("错误次数过多,登录失败!");
Sleep(3000);
color(7);
return 0;
}
tecpin="";
ch=0;
while(ch!=13){
system("cls");
color(14);
cout<<endl;
lin("登录 TEC 账号");
printf("\n\n\n\n\n\n");
color(7);
cout<<endl;
lin("==================================================");
cout<<endl;
cout<<" |";
color(11);
nameline("欢迎回来,"+tecnam);
cout<<endl;
lin("==================================================");
printf("\n\n\n");
color(10);
cout<<" >>输入密码";
color(7);
cout<<endl;
lin("==================================================");
cout<<endl;
cout<<" |";
passline(tecpin);
cout<<endl;
lin("==================================================");
ch=_getch();
tecpin+=ch;
if(ch==8){
tecpin=tecpin.substr(0,tecpin.length()-1);
tecpin=tecpin.substr(0,tecpin.length()-1);
}
}
stringstream in1;
in1<<tecpin;
in1>>tecpin;
if(tecpin!=tecpas){
cout<<endl;
color(12);
lin("密码错误");
errortimes++;
Sleep(1500);
goto cp;
}
system("cls");
return 1;
}
void getnam(){
tecpin="";
ch=0;
while(ch!=13){
system("cls");
color(14);
cout<<endl;
lin("注册 TEC 账号");
printf("\n\n\n\n\n\n");
color(10);
cout<<" >>用户名";
color(15);
cout<<" {请输入}";
if(tecpin.length()>45){
color(12);
cout<<" 用户名过长";
tecpin=tecpin.substr(0,tecpin.length()-1);
}
color(7);
cout<<endl;
lin("==================================================");
cout<<endl;
cout<<" |";
nameline(tecpin);
cout<<endl;
lin("==================================================");
printf("\n\n\n");
color(10);
cout<<" >>密码";
color(7);
cout<<endl;
lin("==================================================");
cout<<endl;
cout<<" | |";
cout<<endl;
lin("==================================================");
ch=_getch();
tecpin+=ch;
if(ch==8){
tecpin=tecpin.substr(0,tecpin.length()-1);
tecpin=tecpin.substr(0,tecpin.length()-1);
}
}
system("cls");
stringstream in1;
in1<<tecpin;
in1>>tecnam;
if(tecnam.length()==0) getnam();
return ;
}
void getpas(){
tecpin="";
ch=0;
while(ch!=13){
system("cls");
color(14);
cout<<endl;
lin("注册 TEC 账号");
printf("\n\n\n\n\n\n");
color(10);
cout<<" >>用户名 输入完成 √";
color(7);
cout<<endl;
lin("==================================================");
cout<<endl;
cout<<" |";
nameline(tecnam);
cout<<endl;
lin("==================================================");
printf("\n\n\n");
color(10);
cout<<" >>密码";
color(15);
cout<<" {请输入}";
if(tecpin.length()>45){
color(12);
cout<<" 密码过长";
tecpin=tecpin.substr(0,tecpin.length()-1);
}
color(7);
cout<<endl;
lin("==================================================");
cout<<endl;
cout<<" |";
passline(tecpin);
cout<<endl;
lin("==================================================");
ch=_getch();
tecpin+=ch;
if(ch==8){
tecpin=tecpin.substr(0,tecpin.length()-1);
tecpin=tecpin.substr(0,tecpin.length()-1);
}
}
system("cls");
tecpas=tecpin;
if(tecpas.length()==0) getpas();
return ;
}
void TEClogin(){
ifstream fin("TEC账户.tecdata");
fin>>tecnam>>tecpas;
fin.close();
if(tecnam.length()!=0 && tecpas.length()!=0){
if(Login_getpass()==0){
i=0;
cout<<0/i;
}
return ;
}
getnam();
getpas();
ofstream fout("TEC账户.tecdata");
fout<<tecnam<<endl<<tecpas;
fout.close();
return ;
}
//TEC
void sav(){
if(allowsave){
waiting("正在保存您的数据,请耐心等待");
ofstream fout("XACRAFT存档文件.xadata");
fout<<1<<endl;
for(i=1;i<=20;i++) fout<<jiandang[i]<<" ";
fout<<endl;
for(i=1;i<=20;i++){
for(j=1;j<=49;j++){
fout<<hand[i][j].ui<<" "<<hand[i][j].num<<" ";
}
fout<<endl;
}
for(i=1;i<=20;i++){
fout<<mode[i]<<" ";
}
fout<<endl;
fout<<pfd<<endl;
fout<<jb<<" "<<emc<<endl;
for(int iii=1;iii<=20;iii++){
for(int jjj=1;jjj<=4;jjj++){
for(int kkk=1;kkk<=255;kkk++){
for(int lll=1;lll<=2048;lll++){
fout<<a[iii][jjj][kkk][lll]<<" ";
}
fout<<endl;
}
}
}
for(i=1;i<=20;i++){
fout<<x[i]<<" "<<y[i]<<" "<<cx[i]<<" "<<cy[i]<<endl;
}
for(i=1;i<=20;i++){
fout<<smz[i]<<" "<<jed[i]<<endl;
}
for(i=1;i<=20;i++){
fout<<ran[i]<<endl;
}
for(i=1;i<=20;i++){
fout<<days[i]<<" "<<tims[i]<<endl;
}
for(i=1;i<=50;i++){
fout<<bpf[i]<<endl;
}
fout<<sehao;
fout.close();
}
}
void rea(){
if(allowsave){
waiting("正在读取您的数据,请耐心等待");
ifstream fin("XACRAFT存档文件.xadata");
fin>>i;
for(i=1;i<=20;i++) fin>>jiandang[i];
for(i=1;i<=20;i++){
for(j=1;j<=49;j++){
fin>>hand[i][j].ui>>hand[i][j].num;
}
}
for(i=1;i<=20;i++){
fin>>mode[i];
}
fin>>pfd;
fin>>jb>>emc;
for(int iii=1;iii<=20;iii++){
for(int jjj=1;jjj<=4;jjj++){
for(int kkk=1;kkk<=255;kkk++){
for(int lll=1;lll<=2048;lll++){
fin>>a[iii][jjj][kkk][lll];
}
}
}
}
for(i=1;i<=20;i++){
fin>>x[i]>>y[i]>>cx[i]>>cy[i];
}
for(i=1;i<=20;i++){
fin>>smz[i]>>jed[i];
}
for(i=1;i<=20;i++){
fin>>ran[i];
}
for(i=1;i<=20;i++){
fin>>days[i]>>tims[i];
}
for(i=1;i<=50;i++){
fin>>bpf[i];
}
fin>>sehao;
fin.close();
}
}
void checkcun(){
if(allowsave){
ifstream fin("XACRAFT存档文件.xadata");
fin>>i;
fin.close();
if(i!=0) return ;
ofstream fout("XACRAFT存档文件.xadata");
waiting("检测到第一次登录,正在新建存档");
fout<<1<<endl;
for(i=1;i<=20;i++) fout<<0<<" ";
fout<<endl;
for(i=1;i<=20;i++){
for(j=1;j<=49;j++){
fout<<0<<" "<<0<<" ";
}
fout<<endl;
}
for(i=1;i<=20;i++){
fout<<0<<" ";
}
fout<<endl;
fout<<"XZ"<<endl;
fout<<100<<" "<<0<<endl;
for(int iii=1;iii<=20;iii++){
for(int jjj=1;jjj<=4;jjj++){
for(int kkk=1;kkk<=255;kkk++){
for(int lll=1;lll<=2048;lll++){
fout<<0<<" ";
}
fout<<endl;
}
}
}
for(i=1;i<=20;i++){
fout<<0<<" "<<0<<" "<<0<<" "<<0<<endl;
}
for(i=1;i<=20;i++){
fout<<0<<" "<<0<<endl;
}
for(i=1;i<=20;i++){
fout<<0<<endl;
}
for(i=1;i<=20;i++){
fout<<0<<" "<<0<<endl;
}
fout<<1<<endl;
for(i=2;i<=50;i++){
fout<<0<<endl;
}
fout<<240;
fout.close();
return ;
}
}
void ppf(int cor){
color(cor);
cout<<pfd;
color(7);
}
string XAPin(string s){//该函数如需借鉴请先联系沙兴安
int sn=min((int)s.size()+64,90),kn=(int)s.size();
int pin[256];
string sp;
for(int i=0;i<s.size()-1;i++){
pin[i]=(int)(s[i]+s[i+1])/2;
}
for(int i=0;i<s.size();i++){
if(kn%2==(int)pin[i]%3) sp+=(char)(min((int)sn+i*2,127));
sp+=(char)pin[i];
}
return sp;
}
void Logical_Lock(){//该函数如需借鉴请先联系沙兴安
if(fool_days()){
system("cls");
color(252);
system("cls");
cout<<endl;
Line("恭喜你");
cout<<endl<<endl;
color(240);
Line("您获得了豪华大礼包,兑换码:AprilFoolDay");
cmmd=getch();
}
return ;
}
void centerlink(int cor){
if(bl[cor].hylink==1){
color(chuancan+bl[cor].cor);
cout<<bl[cor].ape;
}
}
string wri(int cor){
return bl[cor].nam;
}
int print(int cor){
if(bl[cor].hylink!=0) centerlink(cor);
else{
color(bl[cor].cor);
cout<<bl[cor].ape;
}
}
void lists(){
//bl[].ape="",bl[].cor=,bl[].nam="",bl[].pps=,bl[].hylink=,bl[].maxl=,bl[].mintim=;
bl[0].ape=" ",bl[0].cor=0,bl[0].nam="空气方块",bl[0].pps=0,bl[0].hylink=1,bl[0].maxl=32767,bl[0].mintim=0;
bl[1].ape=" ",bl[1].cor=170,bl[1].nam="草方块",bl[1].pps=0,bl[1].hylink=0,bl[1].maxl=64,bl[1].mintim=500;
bl[2].ape=" ",bl[2].cor=34,bl[2].nam="树叶",bl[2].pps=0,bl[2].hylink=0,bl[2].maxl=64,bl[2].mintim=200;
bl[3].ape=" ",bl[3].cor=136,bl[3].nam="石头",bl[3].pps=0,bl[3].hylink=0,bl[3].maxl=64,bl[3].mintim=2000;
bl[4].ape=" ",bl[4].cor=102,bl[4].nam="泥土",bl[4].pps=0,bl[4].hylink=0,bl[4].maxl=64,bl[4].mintim=500;
bl[5].ape="",bl[5].cor=0,bl[5].nam="",bl[5].pps=0,bl[5].hylink=0,bl[5].maxl=0,bl[5].mintim=0;
bl[6].ape="WO",bl[6].cor=96,bl[6].nam="橡木原木",bl[6].pps=0,bl[6].hylink=0,bl[6].maxl=64,bl[6].mintim=1000;
bl[7].ape="::",bl[7].cor=139,bl[7].nam="钻石矿石",bl[7].pps=0,bl[7].hylink=0,bl[7].maxl=64,bl[7].mintim=2500;
bl[8].ape="::",bl[8].cor=142,bl[8].nam="黄金矿石",bl[8].pps=0,bl[8].hylink=0,bl[8].maxl=64,bl[8].mintim=2500;
bl[9].ape="AP",bl[9].cor=207,bl[9].nam="苹果",bl[9].pps=1,bl[9].hylink=0,bl[9].maxl=16,bl[9].mintim=200;
bl[10].ape="GA",bl[10].cor=239,bl[10].nam="金苹果",bl[10].pps=1,bl[10].hylink=0,bl[10].maxl=1,bl[10].mintim=200;
bl[11].ape=" ",bl[11].cor=238,bl[11].nam="沙子",bl[11].pps=0,bl[11].hylink=0,bl[11].maxl=64,bl[11].mintim=500;
bl[12].ape="==",bl[12].cor=239,bl[12].nam="砂岩",bl[12].pps=0,bl[12].hylink=0,bl[12].maxl=64,bl[12].mintim=2000;
bl[13].ape="##",bl[13].cor=127,bl[13].nam="雪块",bl[13].pps=0,bl[13].hylink=0,bl[13].maxl=64,bl[13].mintim=500;
bl[14].ape="::",bl[14].cor=32,bl[14].nam="仙人掌",bl[14].pps=0,bl[14].hylink=0,bl[14].maxl=64,bl[14].mintim=200;
bl[15].ape="BR",bl[15].cor=112,bl[15].nam="白桦原木",bl[15].pps=0,bl[15].hylink=0,bl[15].maxl=64,bl[15].mintim=1000;
bl[16].ape="HW",bl[16].cor=31,bl[16].nam="HelloWorld",bl[16].pps=0,bl[16].hylink=0,bl[16].maxl=1,bl[16].mintim=0;
bl[17].ape="==",bl[17].cor=96,bl[17].nam="橡木木板",bl[17].pps=0,bl[17].hylink=0,bl[17].maxl=64,bl[17].mintim=1000;
bl[18].ape="==",bl[18].cor=126,bl[18].nam="白桦木板",bl[18].pps=0,bl[18].hylink=0,bl[18].maxl=64,bl[18].mintim=1000;
bl[19].ape="//",bl[19].cor=6,bl[19].nam="木棍堆",bl[19].pps=1,bl[19].hylink=1,bl[19].maxl=64,bl[19].mintim=200;
bl[20].ape="##",bl[20].cor=128,bl[20].nam="熔炉",bl[20].pps=0,bl[20].hylink=0,bl[20].maxl=64,bl[20].mintim=500;
bl[21].ape="::",bl[21].cor=128,bl[21].nam="煤矿石",bl[21].pps=0,bl[21].hylink=0,bl[21].maxl=64,bl[21].mintim=2500;
bl[22].ape="▃",bl[22].cor=0,bl[22].nam="煤炭",bl[22].pps=1,bl[22].hylink=1,bl[22].maxl=64,bl[22].mintim=0;
bl[23].ape="▃",bl[23].cor=14,bl[23].nam="金锭",bl[23].pps=1,bl[23].hylink=1,bl[23].maxl=64,bl[23].mintim=0;
bl[24].ape="▃",bl[24].cor=11,bl[24].nam="钻石",bl[24].pps=1,bl[24].hylink=1,bl[24].maxl=64,bl[24].mintim=0;
bl[25].ape="□",bl[25].cor=15,bl[25].nam="煤炭块",bl[25].pps=0,bl[25].hylink=0,bl[25].maxl=64,bl[25].mintim=2000;
bl[26].ape="□",bl[26].cor=239,bl[26].nam="金块",bl[26].pps=0,bl[26].hylink=0,bl[26].maxl=64,bl[26].mintim=3000;
bl[27].ape="□",bl[27].cor=191,bl[27].nam="钻石块",bl[27].pps=0,bl[27].hylink=0,bl[27].maxl=64,bl[27].mintim=5000;
bl[28].ape="SP",bl[28].cor=96,bl[28].nam="云杉原木",bl[28].pps=0,bl[28].hylink=0,bl[28].maxl=64,bl[28].mintim=1000;
bl[29].ape="--",bl[29].cor=96,bl[29].nam="云杉木板",bl[29].pps=0,bl[29].hylink=0,bl[29].maxl=64,bl[29].mintim=1000;
bpf[0]=1;
lisn=14,rlisn=3,rln=8,eclisn=14;
//lis[x].num=a,lis[x].k[y].num=a,lis[x].k[y].ui=a,lis[x].sum.num=a,lis[x].sum.ui=a;
lis[0].num=2,lis[0].k[1].num=1,lis[0].k[1].ui=1,lis[0].k[2].num=1,lis[0].k[2].ui=2,lis[0].sum.num=1,lis[0].sum.ui=16;
lis[1].num=1,lis[1].k[1].num=1,lis[1].k[1].ui=6,lis[1].sum.num=4,lis[1].sum.ui=17;
lis[2].num=1,lis[2].k[1].num=1,lis[2].k[1].ui=15,lis[2].sum.num=4,lis[2].sum.ui=18;
lis[3].num=1,lis[3].k[1].num=2,lis[3].k[1].ui=17,lis[3].sum.num=4,lis[3].sum.ui=19;
lis[4].num=1,lis[4].k[1].num=2,lis[4].k[1].ui=18,lis[4].sum.num=4,lis[4].sum.ui=19;
lis[5].num=1,lis[5].k[1].num=8,lis[5].k[1].ui=3,lis[5].sum.num=1,lis[5].sum.ui=20;
lis[6].num=1,lis[6].k[1].num=9,lis[6].k[1].ui=22,lis[6].sum.num=1,lis[6].sum.ui=25;
lis[7].num=1,lis[7].k[1].num=1,lis[7].k[1].ui=25,lis[7].sum.num=9,lis[7].sum.ui=22;
lis[8].num=1,lis[8].k[1].num=9,lis[8].k[1].ui=23,lis[8].sum.num=1,lis[8].sum.ui=26;
lis[9].num=1,lis[9].k[1].num=1,lis[9].k[1].ui=26,lis[9].sum.num=9,lis[9].sum.ui=23;
lis[10].num=1,lis[10].k[1].num=9,lis[10].k[1].ui=24,lis[10].sum.num=1,lis[10].sum.ui=27;
lis[11].num=1,lis[11].k[1].num=1,lis[11].k[1].ui=27,lis[11].sum.num=9,lis[11].sum.ui=24;
lis[12].num=2,lis[12].k[1].num=8,lis[12].k[1].ui=23,lis[12].k[2].num=1,lis[12].k[2].ui=9,lis[12].sum.num=1,lis[12].sum.ui=10;
lis[13].num=1,lis[13].k[1].num=1,lis[13].k[1].ui=28,lis[13].sum.num=4,lis[13].sum.ui=29;
lis[14].num=1,lis[14].k[1].num=2,lis[14].k[1].ui=29,lis[14].sum.num=4,lis[14].sum.ui=19;
//rlis[x].num=1,rlis[x].k[1].num=1,rlis[x].k[1].ui=a,rlis[x].sum.num=1,rlis[x].sum.ui=a;
rlis[1].num=1,rlis[1].k[1].num=1,rlis[1].k[1].ui=21,rlis[1].sum.num=1,rlis[1].sum.ui=22;
rlis[2].num=1,rlis[2].k[1].num=1,rlis[2].k[1].ui=8,rlis[2].sum.num=1,rlis[2].sum.ui=23;
rlis[3].num=1,rlis[3].k[1].num=1,rlis[3].k[1].ui=7,rlis[3].sum.num=1,rlis[3].sum.ui=24;
//rl[x].num=a,rl[x].ui=a;
rl[1].num=4,rl[1].ui=6;
rl[2].num=4,rl[2].ui=15;
rl[3].num=2,rl[3].ui=17;
rl[4].num=2,rl[4].ui=18;
rl[5].num=1,rl[5].ui=19;
rl[6].num=8,rl[6].ui=22;
rl[7].num=4,rl[7].ui=28;
rl[8].num=2,rl[8].ui=29;
//eclis[1].ecs="",eclis[1].nam="",eclis[1].notice,eclis[1].jb=,eclis[].emc=,eclis[1].lin=0;
eclis[1].ecs="LTBJICMYPUmsnjfbmplrHt",eclis[1].nam="XACRAFT一周年纪念礼",eclis[1].notice="XACRAFT一年,一路有你相伴!",eclis[1].jb=100,eclis[1].emc=100,eclis[1].lin=0;
eclis[2].ecs="FJUXeUPq\\\\",eclis[2].nam="CIL 2021-Win 一级礼",eclis[2].notice="感谢您对CIL系列赛事的支持!",eclis[2].jb=20,eclis[2].emc=10,eclis[2].lin=0;
eclis[3].ecs="FJU[\\IPqZf\\",eclis[3].nam="CIL 2021-Win 二级礼",eclis[3].notice="感谢您对CIL系列赛事的支持!",eclis[3].jb=50,eclis[3].emc=30,eclis[3].lin=0;
eclis[4].ecs="FJUR[RVNmb\\",eclis[4].nam="CIL 2021-Win 三级礼",eclis[4].notice="感谢您对CIL系列赛事的支持!",eclis[4].jb=80,eclis[4].emc=50,eclis[4].lin=0;
eclis[5].ecs="FJUXeVVTkR\\",eclis[5].nam="CIL 2021-Win 四级礼",eclis[5].notice="感谢您对CIL系列赛事的支持!",eclis[5].jb=100,eclis[5].emc=80,eclis[5].lin=0;
eclis[6].ecs="FJUYRcTTVWqZ`\\",eclis[6].nam="CIL 2021-Win 五级礼",eclis[6].notice="感谢您对CIL系列赛事的支持!",eclis[6].jb=150,eclis[6].emc=100,eclis[6].lin=0;
eclis[7].ecs="MLRLPTNPMZ0\\",eclis[7].nam="HSE 一等奖励",eclis[7].notice="感谢您对HSE系列赛事的支持!",eclis[7].jb=60,eclis[7].lin=0;
eclis[8].ecs="MLRPKRQOVQS4\\",eclis[8].nam="HSE 二等奖励",eclis[8].notice="感谢您对HSE系列赛事的支持!",eclis[8].jb=30,eclis[8].lin=0;
eclis[9].ecs="MLRPHSRLXN2\\",eclis[9].nam="HSE 三等奖励",eclis[9].notice="感谢您对HSE系列赛事的支持!",eclis[9].jb=10,eclis[9].lin=0;
eclis[10].ecs="OOSLPTNPMZ0\\",eclis[10].nam="FXGF--FS 一等奖励",eclis[10].notice="感谢您对FXGF--FS系列赛事的支持!",eclis[10].jb=80,eclis[10].lin=0;
eclis[11].ecs="OOSPKRQOVQS4\\",eclis[11].nam="FXGF--FS 二等奖励",eclis[11].notice="感谢您对FXGF--FS系列赛事的支持!",eclis[11].jb=50,eclis[11].lin=0;
eclis[12].ecs="OOSPHSRLXN2\\",eclis[12].nam="FXGF--FS 三等奖励",eclis[12].notice="感谢您对FXGF--FS系列赛事的支持!",eclis[12].jb=30,eclis[12].lin=0;
eclis[13].ecs="apVrXuZlPXqmjYhZjomXRm ",eclis[13].nam="愚人节补偿",eclis[13].notice="非常抱歉愚人节彩蛋给你带来的损失,已双倍归还。",eclis[13].jb=20,eclis[13].emc=20,eclis[13].lin=0;
eclis[14].ecs="XqmjYVZXomXRmb",eclis[14].nam="愚人节大礼包",eclis[14].notice="惊喜不惊喜?意外不意外?",eclis[14].jb=-10,eclis[14].emc=-10,eclis[14].lin=0;
return ;
}
void print_packback(int com,int xuanz){
color(7);
cout<<endl<<"\t\t\t ";
for(i=1;i<=9;i++){
if(hand[com][i].num!=0){
print(hand[com][i].ui);
}else{
cout<<"□";
}
color(7);
printf(" ");
}
color(7);
cout<<endl<<"\t\t\t ";
for(i=1;i<=9;i++){
if(i==xuanz) color(11);
else color(7);
if(hand[com][i].num!=0){
if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
else cout<<hand[com][i].num%10000/1000<<"^";
}else{
cout<<"--";
}
color(7);
printf(" ");
}
color(7);
cout<<endl<<"\t\t\t ";
for(i=10;i<=18;i++){
color(7);
if(hand[com][i].num!=0){
print(hand[com][i].ui);
}else{
cout<<"□";
}
color(7);
printf(" ");
}
color(7);
cout<<endl<<"\t\t\t ";
for(i=10;i<=18;i++){
if(i==xuanz) color(11);
else color(7);
if(hand[com][i].num!=0){
if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
else cout<<hand[com][i].num%10000/1000<<"^";
}else{
cout<<"--";
}
color(7);
printf(" ");
}
color(7);
cout<<endl<<"\t\t\t ";
for(i=19;i<=27;i++){
color(7);
if(hand[com][i].num!=0){
print(hand[com][i].ui);
}else{
cout<<"□";
}
color(7);
printf(" ");
}
color(7);
cout<<endl<<"\t\t\t ";
for(i=19;i<=27;i++){
if(i==xuanz) color(11);
else color(7);
if(hand[com][i].num!=0){
if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
else cout<<hand[com][i].num%10000/1000<<"^";
}else{
cout<<"--";
}
color(7);
printf(" ");
}
}
bool che(int ccc,int uiui,int numm){
for(int oooo=1;oooo<=50;oooo++){
if(uiui==hand[ccc][oooo].ui && (hand[ccc][oooo].num<numm || hand[ccc][oooo].num==0)){
return false;
}
}
for(int oooo=1;oooo<=50;oooo++){
if(uiui==hand[ccc][oooo].ui){
return true;
}
}
return false;
}
bool jian(int ccc,int cho){
bool flag=true;
for(int oo=1;oo<=lis[cho].num;oo++){
flag=(che(ccc,lis[cho].k[oo].ui,lis[cho].k[oo].num) && flag);
if(!flag) break;
}
return flag;
}
void craftingtable(int com){
for(int oo=1;oo<=50;oo++){
if(hand[com][oo].num==0){
hand[com][oo].num=0;
hand[com][oo].ui=0;
}
}
int xuanz=1;
while(cmmd!='E' && cmmd!='e'){
cmmd='?';
system("cls");
color(14);
Line("工作台");
print_packback(com,-1);
cout<<endl;
Line("W/S-切换 Q-合成 E-退出");
color(10);
Line(wri(lis[xuanz].sum.ui));
color(7);
for(i=max(xuanz-8,1);i<=min(lisn,xuanz+8);i++){
if(i==xuanz) cout<<" > ";
else cout<<" ";
if(jian(com,i)){
color(10);
cout<<" √ ";
}else{
color(12);
cout<<" × ";
}
print(lis[i].sum.ui);
color(7);
cout<<"*";
printf("%02d",lis[i].sum.num);
color(7);
cout<<" = ";
print(lis[i].k[1].ui);
color(7);
cout<<"*";
printf("%02d",lis[i].k[1].num);
for(j=2;j<=lis[i].num;j++){
color(7);
cout<<"+";
print(lis[i].k[j].ui);
color(7);
cout<<"*";
printf("%02d",lis[i].k[j].num);
}
cout<<endl;
}
cmmd=getch();
if(cmmd=='W' || cmmd=='w'){
xuanz--;
}
if(cmmd=='S' || cmmd=='s'){
xuanz++;
}
if(xuanz<=0 || xuanz>lisn) xuanz=1;
if(cmmd=='Q' || cmmd=='q'){
if(jian(com,xuanz)){
for(j=1;j<=lis[xuanz].num;j++){
del(com,lis[xuanz].k[j].ui,lis[xuanz].k[j].num);
}
pus(com,lis[xuanz].sum.ui,lis[xuanz].sum.num);
}
}
}
cmmd='?';
return ;
}
bool rjian(int ccc,int cho){
bool flag=true;
for(int oo=1;oo<=rlis[cho].num;oo++){
flag=(che(ccc,rlis[cho].k[oo].ui,rlis[cho].k[oo].num) && flag);
if(!flag) break;
}
return flag;
}
void furnace(int com){
cmmd='?';
for(int oo=1;oo<=50;oo++){
if(hand[com][oo].num==0){
hand[com][oo].num=0;
hand[com][oo].ui=0;
}
}
int xuanz=1;
while(cmmd!='E' && cmmd!='e'){
cmmd='?';
system("cls");
color(14);
Line("熔炉");
print_packback(com,-1);
cout<<endl;
Line("W/S-切换 Q-冶炼 R-添加燃料 E-退出");
cout<<" 燃料:"<<ran[com]<<endl;
color(10);
Line(wri(rlis[xuanz].sum.ui));
color(7);
for(i=max(xuanz-8,1);i<=min(rlisn,xuanz+8);i++){
if(i==xuanz) cout<<" > ";
else cout<<" ";
if(rjian(com,i)){
if(ran[com]==0){
color(14);
cout<<" ○ ";
}else{
color(10);
cout<<" √ ";
}
}else{
color(12);
cout<<" × ";
}
print(rlis[i].sum.ui);
color(7);
cout<<"*";
printf("%02d",rlis[i].sum.num);
color(7);
cout<<" = ";
print(rlis[i].k[1].ui);
color(7);
cout<<"*";
printf("%02d",rlis[i].k[1].num);
for(j=2;j<=rlis[i].num;j++){
color(7);
cout<<"+";
print(rlis[i].k[j].ui);
color(7);
cout<<"*";
printf("%02d",rlis[i].k[j].num);
}
cout<<endl;
}
cmmd=getch();
if(cmmd=='W' || cmmd=='w'){
xuanz--;
}
if(cmmd=='S' || cmmd=='s'){
xuanz++;
}
if(cmmd=='R' || cmmd=='r'){
int xuanze=1;
while(cmmd!='E' && cmmd!='e'){
system("cls");
color(14);
Line("添加燃料");
print_packback(com,-1);
cout<<endl;
Line("W/S-切换 Q-添加 E-退出");
color(7);
cout<<" 燃料:"<<wri(rl[xuanze].ui)<<endl;
for(i=max(xuanze-8,1);i<=min(rln,xuanze+8);i++){
if(i==xuanze) cout<<" > ";
else cout<<" ";
if(che(com,rl[i].ui,1)){
color(10);
cout<<" √ ";
}else{
color(12);
cout<<" × ";
}
print(rl[i].ui);
color(7);
cout<<endl;
}
cmmd=getch();
if(cmmd=='W' || cmmd=='w'){
xuanze--;
}
if(cmmd=='S' || cmmd=='s'){
xuanze++;
}
if(xuanze<=0 || xuanze>rln) xuanze=1;
if(cmmd=='Q' || cmmd=='q'){
if(che(com,rl[xuanze].ui,1)){
del(com,rl[xuanze].ui,1);
ran[com]+=rl[xuanze].num;
}
}
}
cmmd='?';
}
if(xuanz<=0 || xuanz>rlisn) xuanz=1;
if(cmmd=='Q' || cmmd=='q'){
if(rjian(com,xuanz) && ran[com]>=1){
ran[com]--;
for(j=1;j<=rlis[xuanz].num;j++){
del(com,rlis[xuanz].k[j].ui,rlis[xuanz].k[j].num);
}
pus(com,rlis[xuanz].sum.ui,rlis[xuanz].sum.num);
}
}
}
cmmd='?';
return ;
}
void packback(int com){
while(kd('E')){
}
cmmd='?';
while(cmmd!='E' && cmmd!='e'){
cmmd=getch();
}
int xuanz=xuanze;
cmmd='?';
while(cmmd!='E' && cmmd!='e'){
cmmd='?';
system("cls");
color(14);
Line("背包");
print_packback(com,xuanz);
cout<<endl;
Line(" G-交换 H-合成 E-退出");
cmmd=getch();
if(cmmd=='W' || cmmd=='w'){
if(xuanz<=9) xuanz+=18;
else xuanz-=9;
}
if(cmmd=='A' || cmmd=='a'){
if(xuanz%9==1) xuanz+=8;
else xuanz-=1;
}
if(cmmd=='S' || cmmd=='s'){
if(xuanz>=19) xuanz-=18;
else xuanz+=9;
}
if(cmmd=='D' || cmmd=='d'){
if(xuanz%9==0) xuanz-=8;
else xuanz+=1;
}
if(cmmd=='G' || cmmd=='g'){
int xuz1=1,xuz2=1;
while(cmmd!='P' && cmmd!='p'){
system("cls");
color(14);
Line("选择您需要交换的物品1 (Q-确认 P-退出)");
print_packback(com,xuz1);
cmmd=getch();
if(cmmd=='W' || cmmd=='w'){
if(xuz1<=9) xuz1+=18;
else xuz1-=9;
}
if(cmmd=='A' || cmmd=='a'){
if(xuz1%9==1) xuz1+=8;
else xuz1-=1;
}
if(cmmd=='S' || cmmd=='s'){
if(xuz1>=19) xuz1-=18;
else xuz1+=9;
}
if(cmmd=='D' || cmmd=='d'){
if(xuz1%9==0) xuz1-=8;
else xuz1+=1;
}
if(cmmd=='Q' || cmmd=='q') break;
}
while(cmmd!='P' && cmmd!='p'){
system("cls");
color(14);
Line("选择您需要交换的物品2 (Q-确认 P-退出)");
print_packback(com,xuz2);
cmmd=getch();
if(cmmd=='W' || cmmd=='w'){
if(xuz2<=9) xuz2+=18;
else xuz2-=9;
}
if(cmmd=='A' || cmmd=='a'){
if(xuz2%9==1) xuz2+=8;
else xuz2-=1;
}
if(cmmd=='S' || cmmd=='s'){
if(xuz2>=19) xuz2-=18;
else xuz2+=9;
}
if(cmmd=='D' || cmmd=='d'){
if(xuz2%9==0) xuz2-=8;
else xuz2+=1;
}
if(cmmd=='Q' || cmmd=='q') break;
}
if(cmmd!='P' && cmmd!='p'){
int aaa=hand[com][xuz1].num,bbb=hand[com][xuz1].ui;
hand[com][xuz1].num=hand[com][xuz2].num;
hand[com][xuz1].ui=hand[com][xuz2].ui;
hand[com][xuz2].num=aaa;
hand[com][xuz2].ui=bbb;
}
}
if(cmmd=='H' || cmmd=='h') craftingtable(com);
//if(cmmd=='J' || cmmd=='j') furnace(com);
}
cmmd='?';
for(int oo=1;oo<=50;oo++){
if(hand[com][oo].num==0){
hand[com][oo].num=0;
hand[com][oo].ui=0;
}
}
return ;
}
void handand(int ccc,int xxx){
if(bl[hand[ccc][xxx].ui].maxl==hand[ccc][xxx].num){
for(i=1;i<=50;i++){
if(hand[ccc][i].num<bl[hand[ccc][xxx].ui].maxl && hand[ccc][xxx].ui==hand[ccc][i].ui){
hand[ccc][i].num++;
return ;
}
}
for(i=1;i<=50;i++){
if(hand[ccc][i].ui==0){
hand[ccc][i].ui=hand[ccc][xxx].ui;
hand[ccc][i].num++;
return ;
}
}
}else{
hand[ccc][xxx].num++;
}
}
void pt(int ccc,int jjj,int xxx,int yyy,bool dq){
if(!dq){//na
if(a[ccc][jjj][xxx][yyy]!=0){
//Sleep(bl[a[ccc][jjj][xxx][yyy]].mintim);
if(mode[ccc]==1){
int timew=0;
while(kd('Y') || kd('U') || kd('I') || kd('H') || kd('K') || kd('B') || kd('N') || kd('M')){
//cout<<timew;
timew++;
Sleep(1);
if(timew*100>=bl[a[ccc][jjj][xxx][yyy]].mintim) break;
}
if(timew*100<bl[a[ccc][jjj][xxx][yyy]].mintim) return ;
}
for(i=1;i<=50;i++){
if(a[ccc][jjj][xxx][yyy]==hand[ccc][i].ui){
handand(ccc,i);
a[ccc][jjj][xxx][yyy]=0;
return ;
}
}
for(i=1;i<=50;i++){
if(hand[ccc][i].ui==0){
hand[ccc][i].ui=a[ccc][jjj][xxx][yyy];
handand(ccc,i);
a[ccc][jjj][xxx][yyy]=0;
return ;
}
}
}
return ;
}else if(dq){//fang
if(a[ccc][jjj][xxx][yyy]==0 && hand[ccc][xuanze].num!=0 && bl[hand[ccc][xuanze].ui].pps==0){
a[ccc][jjj][xxx][yyy]=hand[ccc][xuanze].ui;
hand[ccc][xuanze].num--;
if(hand[ccc][xuanze].num==0){
hand[ccc][xuanze].ui=0;
}
}
if(a[ccc][jjj][xxx][yyy]==20) furnace(ccc);
return ;
}
dq='2';
}
void LoginXZ(){
char c;
Log:
system("cls");
color(14);
Line("登录XZ账号 --- Login XZ");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(7);
Line("L-登录 M-退出");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(10);
Line("没有账号? R-注册");
color(7);
c=getch();
system("cls");
if(c=='L' || c=='l'){
ifstream fin("XZ账户.xzdata");
fin>>nam>>pas;
fin.close();
color(14);
Line("输入密码");
color(12);
Line("用户名:"+nam);
color(7);
string pass1;
int i=0;
char ch;
while ((ch=_getch())!=13)
{
pass1+=ch;
cout<<"*";
}
if(pass1!=pas){
system("cls");
Line("抱歉!输入密码错误!请重新登录!(三秒钟后返回)");
goto Log;
}
return ;
}
else if(c=='R' || c=='r'){
color(14);
Line("注册XZ账号 --- Register XZ");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(7);
Line("G-注册一个XZ账号 H-读取王子逸的行走账号");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(10);
Line("已有账号? M-登录");
color(7);
c=getch();
if(c=='M' || c=='m'){
goto Log;
}
else if(c=='H' || c=='h'){
system("cls");
color(14);
Line("读取XZ账号 --- Read XZ");
color(7);
Line("使用提示:请将行走建立的“存档.txt”文件复制到您保存的文件根目录下");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
Line("G-读取存档");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(10);
Line("已有账号? M-登录");
color(7);
c=getch();
if(c=='M' || c=='m'){
goto Log;
}else if(c=='G' || c=='g'){
ifstream fin("存档.txt");
int lllll;
fin>>lllll;
fin>>lllll;
fin>>nam;
fin>>lllll;
fin>>nam;
fin.close();
string s1,s2;
system("cls");
color(14);
Line("设置密码");
color(7);
cin>>s1;
system("cls");
color(14);
Line("再输入一次密码");
color(7);
cin>>s2;
if(s1!=s2){
system("cls");
Line("抱歉!输入密码错误!请重新注册!(三秒钟后返回)");
goto Log;
}
pas=s1;
return ;
}else goto Log;
}
else if(c=='G' || c=='g'){
system("cls");
color(14);
Line("设置用户名");
color(7);
cin>>nam;
string s1,s2;
system("cls");
color(14);
Line("设置密码");
color(7);
cin>>s1;
system("cls");
color(14);
Line("再输入一次密码");
color(7);
cin>>s2;
if(s1!=s2){
system("cls");
Line("抱歉!输入密码错误!请重新注册!(三秒钟后返回)");
goto Log;
}
pas=s1;
return ;
}
else goto Log;
}else if(c=='M' || c=='m'){
goto Logok;
}
else goto Log;
Logok:;
}
void XZLogin(){
color(7);
LoginXZ();
ofstream fout("XZ账户.xzdata");
fout<<nam<<endl<<pas;
fout.close();
return ;
}
void buybf(){
int xuanz=0;
while(cmmd!='M' && cmmd!='m'){
system("cls");
color(12);
Line("购买皮肤");
color(7);
cout<<" 您有金币:"<<jb<<"个"<<endl;
for(int i=0;i<pfn;i++){
cout<<" ";
if(bpf[i]){
color(10);
cout<<"已拥有";
}else{
color(12);
cout<<"未拥有";
}
color(7);
if(xuanz==i) cout<<" > ";
else cout<<" ";
cout<<pfs[i]<<" : "<<pfp[i];
cout<<endl;
}
Line("W/S-切换 E-选择 M-退出");
cmmd=getch();
if(cmmd=='W' || cmmd=='w') xuanz--;
if(cmmd=='S' || cmmd=='s') xuanz++;
if(cmmd=='E' || cmmd=='e'){
if(bpf[xuanz]==1) pfd=pfs[xuanz];
else if(jb>=pfp[xuanz]){
jb=jb-pfp[xuanz];
bpf[xuanz]=1;
pfd=pfs[xuanz];
}
}
if(xuanz>=pfn) xuanz=0;
}
}
void buycor(){
int xuanz=0;
while(cmmd!='M' && cmmd!='m'){
system("cls");
color(12);
Line("切换颜色");
color(7);
for(int i=max(0,xuanz-10);i<=min(255,xuanz+10);i++){
cout<<" ";
color(7);
if(xuanz==i) cout<<" > ";
else cout<<" ";
ppf(i);
cout<<endl;
}
color(7);
Line("W/S-切换 E-选择 M-退出");
cmmd=getch();
if(cmmd=='W' || cmmd=='w') xuanz--;
if(cmmd=='S' || cmmd=='s') xuanz++;
if(cmmd=='E' || cmmd=='e'){
sehao=xuanz;
}
if(xuanz>=256) xuanz=0;
}
}
void shang(){//本市最繁华的商城
system("cls");
color(7);
system("cls");
chuancan=0;
int xxx=10,yyy=10;
while(!(xxx==16 && yyy==16)){
system("cls");
for(i=0;i<21;i++){
cout<<" ";
color(7);
for(j=0;j<21;j++){
if(i==xxx && j==yyy){
ppf(sehao);
}else print(shop[i][j]);
}
color(7);
cout<<endl;
}
cout<<" 您有金币:"<<jb<<"个"<<" "<<"WASD-移动 站在图例格子上即可触发功能";
cout<<endl<<" ";
print(6);
color(7);
cout<<" - 切换皮肤";
cout<<" ";
print(15);
color(7);
cout<<" - 切换颜色";
cout<<endl<<" ";
print(28);
color(7);
cout<<" - 客服服务(需要洛谷账号)";
cout<<" ";
print(14);
color(7);
cout<<" - 退出商城";
cmmd=getch();
if(cmmd=='W' || cmmd=='w') xxx--;
if(cmmd=='A' || cmmd=='a') yyy--;
if(cmmd=='S' || cmmd=='s') xxx++;
if(cmmd=='D' || cmmd=='d') yyy++;
if(xxx<=0) xxx=1;
if(xxx>=20) xxx=19;
if(yyy<=0) yyy=1;
if(yyy>=20) yyy=19;
if(xxx==4 && yyy==4){
buybf();
xxx=10;
yyy=10;
}
if(xxx==4 && yyy==16){
buycor();
xxx=10;
yyy=10;
}
if(xxx==16 && yyy==4){
xxx=10;
yyy=10;
system("start https://www.luogu.com.cn/chat?uid=541826");
}
}
}
bool checks(string s1,string s2){
int num=0;
for(int p=0;p<s2.size();p++){
if(s1[p]!=s2[p]) num++;
}
if(num<=1 && s2.size()>1) return 1;
return 0;
}
void Exchange_code(){
system("cls");
color(240);
system("cls");
Line("兑换码");
cout<<endl<<endl<<endl<<endl<<endl;
Line("请输入你的兑换码");
cout<<endl<<" ";
cin>>comd;
int tot=0;
for(i=1;i<=eclisn;i++){
if(checks(eclis[i].ecs,XAPin(comd))){
tot=i;
if(echave[i]==1) tot=-2;
echave[i]=1;
break;
}else if(checks(eclis[i].ecs,comd)){
tot=-1;
break;
}
}
system("cls");
color(240);
system("cls");
if(tot>0){
Line("兑换成功");
cout<<endl<<endl<<endl<<endl<<endl<<endl;
Line("您兑换到的是"+eclis[tot].nam);
cout<<endl;
Line("您获得了"+change_string(eclis[tot].jb)+"金币");
cout<<endl;
if(eclis[tot].emc!=0){
Line("您获得了"+change_string(eclis[tot].emc)+"经验");
cout<<endl;
}
color(252);
Line(eclis[tot].notice);
cout<<endl;
color(240);
jb+=eclis[tot].jb;
emc+=eclis[tot].emc;
}else if(tot==-1){
Line("兑换失败");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(252);
Line(" XACRAFT检测到您尝试查看代码以获取兑换码,希望您在日常的游戏生活中能够规范自己的游戏行为,诚信游戏!");
cout<<endl<<endl<<endl;
color(240);
}else if(tot==-2){
Line("兑换失败");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(252);
Line("该兑换码已被兑换过");
cout<<endl<<endl<<endl;
color(240);
}else{
Line("兑换失败");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
color(252);
Line("未查找到兑换码");
cout<<endl<<endl<<endl;
color(240);
}
Line("[按任意键退出]");
cmmd=getch();
cmmd='?';
return ;
}
void mycenter(){
while(!(cmmd=='e' || cmmd=='E')){
system("cls");
color(240);
system("cls");
Line("个人中心");
cout<<endl<<endl<<endl<<endl;
color(240);
if(tecnam.empty()) Line("TEC账号:未登录");
else Line("TEC账号:已登录("+tecnam+")");
cout<<endl;
Line("经验值:"+change_string(emc));
Line("等级:Lv."+change_string((emc/50)+1));
cout<<endl;
Line("G-中心商城");
cout<<endl;
Line("H-兑 换 码");
cout<<endl;
Line("E-退出个人中心");
cmmd=getch();
if(cmmd=='G' || cmmd=='g') shang();
if(cmmd=='H' || cmmd=='h') Exchange_code();
}
cmmd='?';
}
void printt(int com){
int wq=10;
cout<<" ";
color(12);
for(i=1;i<=10;i++){
if(smz[com]>=i*10) cout<<"█",wq--;
}
if(smz[com]%10==1) cout<<"▏",wq--;
else if(smz[com]%10==2) cout<<"▎",wq--;
else if(smz[com]%10==3) cout<<"▍",wq--;
else if(smz[com]%10==4 || smz[com]%10==5 || smz[com]%10==6) cout<<"▌",wq--;
else if(smz[com]%10==7) cout<<"▋",wq--;
else if(smz[com]%10==8) cout<<"▊",wq--;
else if(smz[com]%10==9) cout<<"▉",wq--;
for(i=1;i<=wq;i++) cout<<" ";
cout<<" ";
color(6);
for(i=1;i<=10;i++){
if(jed[com]>=i*10) cout<<"█";
}
if(jed[com]%10==1) cout<<"▏";
else if(jed[com]%10==2) cout<<"▎";
else if(jed[com]%10==3) cout<<"▍";
else if(jed[com]%10==4 || jed[com]%10==5 || jed[com]%10==6) cout<<"▌";
else if(jed[com]%10==7) cout<<"▋";
else if(jed[com]%10==8) cout<<"▊";
else if(jed[com]%10==9) cout<<"▉";
cout<<" ";
}
int nw(int com){
smz[com]=100;
jed[com]=100;
jiandang[com]=true;
//1 定型
for(i=0;i<=2047;i++){
for(j=1;j<=255;j++){
a[com][1][j][i]=0;
}
}
for(i=1;i<=50;i++){
hand[com][i].ui=0;
hand[com][i].num=0;
}
int ke=0;
system("cls");
color(252);
system("cls");
Line("我的存档");
color(240);
Line("新的世界");
cout<<endl<<endl;
line("选择模式(1:生存模式 2:创造模式): ");
cin>>mode[com];
cout<<endl;
line("输入种子: ");
cin>>comd;
seed=change_num(comd);
comd="?";
srand((unsigned)seed);
y[com]=1024;
int top=0,tot=rdm(40,60);
for(i=0;i<2048;i++){
if(i==1024){
x[com]=tot;
do{
++x[com];
}while(a[com][1][x[com]][top]!=0);
x[com]+=3;
cx[com]=x[com];
cy[com]=y[com];
}
a[com][1][tot+1][top]=3;
a[com][1][tot+1][top-3]=3;
a[com][1][tot+1][top-2]=3;
a[com][1][tot+1][top-1]=3;
a[com][1][tot+1][top+1]=3;
a[com][1][tot+1][top+2]=3;
a[com][1][tot+1][top+3]=3;
a[com][1][tot+2][top-3]=3;
a[com][1][tot+2][top-2]=3;
a[com][1][tot+2][top]=3;
a[com][1][tot+2][top-1]=3;
a[com][1][tot+2][top+1]=3;
a[com][1][tot+2][top+2]=3;
a[com][1][tot+2][top+3]=3;
a[com][1][tot+3][top-2]=3;
a[com][1][tot+3][top]=3;
a[com][1][tot+3][top-1]=3;
a[com][1][tot+3][top+1]=3;
a[com][1][tot+3][top+2]=3;
a[com][1][tot+4][top]=3;
a[com][1][tot+4][top-1]=3;
a[com][1][tot+4][top+1]=3;
for(j=tot;j>=0;j--){
a[com][1][j][top]=3;
}
top++;
int u=rdm(0,10);
if(u>=9) tot++;
if(u<=1) tot--;
if(tot>=256)tot=255;
if(tot<10) tot=10;
int uu=rdm(0,8);
/* if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && ke+1<top && seed!=1234567890)||(seed==123456789)){
ke=top;
a[com][1][tot+1][top]=6;
a[com][1][tot+2][top]=6;
a[com][1][tot+3][top]=6;
int uuu=rdm(0,3);
if(uuu==1){
a[com][1][tot+4][top]=6;
a[com][1][tot+4][top-3]=2;
a[com][1][tot+4][top-2]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+4][top+2]=2;
a[com][1][tot+4][top+3]=2;
a[com][1][tot+5][top-3]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+5][top+3]=2;
a[com][1][tot+6][top-2]=2;
a[com][1][tot+6][top]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
a[com][1][tot+6][top+2]=2;
a[com][1][tot+7][top]=2;
a[com][1][tot+7][top-1]=2;
a[com][1][tot+7][top+1]=2;
}else{
a[com][1][tot+3][top-3]=2;
a[com][1][tot+3][top-2]=2;
a[com][1][tot+3][top-1]=2;
a[com][1][tot+3][top+1]=2;
a[com][1][tot+3][top+2]=2;
a[com][1][tot+3][top+3]=2;
a[com][1][tot+4][top-3]=2;
a[com][1][tot+4][top-2]=2;
a[com][1][tot+4][top]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+4][top+2]=2;
a[com][1][tot+4][top+3]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+6][top]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
}
}*/
}
//2 定系
int u=rdm(1,100),pl=0;
for(i=1;i<=2048;i++){
int tot;
for(j=256;j>=0;j--){
if(a[com][1][j][i]==3){
tot=j;
break;
}
}
if(u<=30){
a[com][1][tot][i]=1;
a[com][1][tot-1][i]=4;
a[com][1][tot-2][i]=4;
a[com][1][tot-3][i]=4;
int uu=rdm(0,8);
if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
top=i;
pl=i+1;
a[com][1][tot+1][top]=6;
a[com][1][tot+2][top]=6;
a[com][1][tot+3][top]=6;
int uuu=rdm(0,3);
if(uuu==1){
a[com][1][tot+4][top]=6;
a[com][1][tot+4][top-3]=2;
a[com][1][tot+4][top-2]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+4][top+2]=2;
a[com][1][tot+4][top+3]=2;
a[com][1][tot+5][top-3]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+5][top+3]=2;
a[com][1][tot+6][top-2]=2;
a[com][1][tot+6][top]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
a[com][1][tot+6][top+2]=2;
a[com][1][tot+7][top]=2;
a[com][1][tot+7][top-1]=2;
a[com][1][tot+7][top+1]=2;
}else{
a[com][1][tot+3][top-3]=2;
a[com][1][tot+3][top-2]=2;
a[com][1][tot+3][top-1]=2;
a[com][1][tot+3][top+1]=2;
a[com][1][tot+3][top+2]=2;
a[com][1][tot+3][top+3]=2;
a[com][1][tot+4][top-3]=2;
a[com][1][tot+4][top-2]=2;
a[com][1][tot+4][top]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+4][top+2]=2;
a[com][1][tot+4][top+3]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+6][top]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
}
}
}
else if(u<=50){
a[com][1][tot][i]=11;
a[com][1][tot-1][i]=11;
a[com][1][tot-2][i]=11;
a[com][1][tot-3][i]=12;
int uu=rdm(0,8);
if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
top=i;
pl=i+1;
int uuu=rdm(0,3);
if(uuu==1){
a[com][1][tot+1][top]=14;
a[com][1][tot+2][top]=14;
a[com][1][tot+3][top]=14;
a[com][1][tot+4][top]=14;
}else{
a[com][1][tot+1][top]=14;
a[com][1][tot+2][top]=14;
a[com][1][tot+3][top]=14;
}
}
}else if(u<=80){
a[com][1][tot][i]=1;
a[com][1][tot-1][i]=4;
a[com][1][tot-2][i]=4;
a[com][1][tot-3][i]=4;
int uu=rdm(0,8);
if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
top=i;
pl=i+1;
a[com][1][tot+1][top]=15;
a[com][1][tot+2][top]=15;
a[com][1][tot+3][top]=15;
int uuu=rdm(0,3);
if(uuu==1){
a[com][1][tot+4][top]=15;
a[com][1][tot+4][top-3]=2;
a[com][1][tot+4][top-2]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+4][top+2]=2;
a[com][1][tot+4][top+3]=2;
a[com][1][tot+5][top-3]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+5][top+3]=2;
a[com][1][tot+6][top-2]=2;
a[com][1][tot+6][top]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
a[com][1][tot+6][top+2]=2;
a[com][1][tot+7][top]=2;
a[com][1][tot+7][top-1]=2;
a[com][1][tot+7][top+1]=2;
}else{
a[com][1][tot+3][top-3]=2;
a[com][1][tot+3][top-2]=2;
a[com][1][tot+3][top-1]=2;
a[com][1][tot+3][top+1]=2;
a[com][1][tot+3][top+2]=2;
a[com][1][tot+3][top+3]=2;
a[com][1][tot+4][top-3]=2;
a[com][1][tot+4][top-2]=2;
a[com][1][tot+4][top]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+4][top+2]=2;
a[com][1][tot+4][top+3]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+6][top]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
}
}
}else{
a[com][1][tot][i]=13;
a[com][1][tot-1][i]=4;
a[com][1][tot-2][i]=4;
a[com][1][tot-3][i]=4;
int uu=rdm(0,15);
if((uu==6 && i>4 && i<2045 && i!=1023 && i!=1024 && i!=1025 && pl<i && seed!=1234567890)||(seed==123456789)){
top=i;
pl=i+1;
a[com][1][tot+1][top]=28;
a[com][1][tot+2][top]=28;
a[com][1][tot+3][top]=28;
int uuu=rdm(0,3);
if(uuu==1){
a[com][1][tot+4][top]=28;
a[com][1][tot+5][top]=28;
a[com][1][tot+6][top]=28;
a[com][1][tot+7][top]=28;
a[com][1][tot+3][top-3]=2;
a[com][1][tot+3][top-2]=2;
a[com][1][tot+3][top-1]=2;
a[com][1][tot+3][top+3]=2;
a[com][1][tot+3][top+2]=2;
a[com][1][tot+3][top+1]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
a[com][1][tot+8][top]=28;
a[com][1][tot+8][top-1]=2;
a[com][1][tot+8][top+1]=2;
a[com][1][tot+9][top]=2;
}else{
a[com][1][tot+4][top]=28;
a[com][1][tot+5][top]=28;
a[com][1][tot+6][top]=2;
a[com][1][tot+3][top-3]=2;
a[com][1][tot+3][top-2]=2;
a[com][1][tot+3][top-1]=2;
a[com][1][tot+3][top+3]=2;
a[com][1][tot+3][top+2]=2;
a[com][1][tot+3][top+1]=2;
a[com][1][tot+4][top-1]=2;
a[com][1][tot+4][top+1]=2;
a[com][1][tot+5][top-2]=2;
a[com][1][tot+5][top-1]=2;
a[com][1][tot+5][top+2]=2;
a[com][1][tot+5][top+1]=2;
a[com][1][tot+6][top-1]=2;
a[com][1][tot+6][top+1]=2;
a[com][1][tot+7][top]=2;
}
}
}
if(i%128==0 && i!=1024) u=rdm(1,100);
}
//
for(i=1;i<=2048;i++){
for(j=1;j<=16;j++){
if(a[com][1][j][i]==3){
int uuu=rdm(1,1000);
if(uuu<=1){
a[com][1][j][i]=7;
}
}
}
for(j=4;j<=32;j++){
if(a[com][1][j][i]==3){
int uuu=rdm(1,1000);
if(uuu<=5){
a[com][1][j][i]=8;
}
}
}
for(j=1;j<=64;j++){
if(a[com][1][j][i]==3){
int uuu=rdm(1,1000);
if(uuu<=8){
a[com][1][j][i]=21;
}
}
}
for(j=1;j<=256;j++){
if(a[com][1][j][i]==2){
int uuu=rdm(1,1000);
if(uuu<=5){
int uuuu=rdm(1,1000);
if(uuuu>200) a[com][1][j][i]=9;
else a[com][1][j][i]=10;
}
}
}
}
}
int died(){
system("cls");
color(79);
system("cls");
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
Line("你失败了!");
cout<<endl<<endl;
Line("G - ** P - 退出");
while(true){
if(kd('G')){
system("cls");
color(7);
system("cls");
return 1;
}
if(kd('P')){
system("cls");
color(7);
system("cls");
return 2;
}
}
}
void survival(int com){
cls();
int ztl=2,highlowdown=0,dek=0;
while(!(kd('P') || dek==2)){
cls();
tims[com]+=1;
if(tims[com]>=10000){
days[com]++;
tims[com]=0;
}
if(tims[com]<=5500) chuancan=240;
else if(tims[com]<=6000) chuancan=224;
else if(tims[com]<=9500) chuancan=0;
else chuancan=224;
if(tims[com]%100==0){
jb+=(tims[com]+days[com]*10000)/1000;
emc+=1;
}
for(i=x[com]+10;i>=x[com]-10;i--){
for(j=y[com]-19;j<=y[com]+19;j++){
if(i==-1 || j<0 || j>2048){
color(15);
printf("▓");
}
/*else if(a[com][1][i-1][j]!=0 && a[com][1][i+1][j]!=0 && a[com][1][i][j+1]!=0 && a[com][1][i][j-1]!=0){
color(7);
cout<<" ";
}*/else if(i!=x[com] || j!=y[com]){
print(a[com][1][i][j]);
}else{
ppf(sehao);
}
}
cout<<endl;
}
if(x[com]<=1){
x[com]=1;
}
if(x[com]>256){
x[com]=256;
}
if(y[com]<0){
y[com]=0;
}
if(y[com]>2048){
y[com]=2048;
}
color(15);
if(ztl==1){
printf(">>状态栏 坐标: x:%d y:%d ",x[com],y[com]);
cout<<"后位方块:";
print(a[com][1][x[com]][y[com]]);
color(15);
cout<<" 当前:";
if(kn){
color(12);
cout<<"**";
}else{
color(10);
cout<<"建造";
}
color(15);
cout<<"模式(J切换) P-保存并退出 ";
}else if(ztl==2){
printt(com);
}
cout<<endl;
color(7);
Line(" "+wri(hand[com][xuanze].ui)+" ");
color(7);
cout<<"\t\t\t ";
for(i=1;i<=9;i++){
color(7);
if(hand[com][i].num!=0){
print(hand[com][i].ui);
}else{
cout<<"□";
}
}
color(7);
cout<<" ";
cout<<endl<<"\t\t\t ";
for(i=1;i<=9;i++){
if(i==xuanze) color(11);
else color(7);
if(hand[com][i].num!=0){
if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
else cout<<hand[com][i].num%10000/1000<<"^";
}else{
cout<<"--";
}
}
cout<<" ";
//Sleep(100);
if(cmmd=='/'){
cls();
color(12);
Line("命令");
bool flag=0;
while(comd!="esc"){
color(7);
cout<<"/";
cin>>comd;
if(comd=="tp"){
cout<<"/tp @s ";
cin>>i>>j;
flag=1;
x[com]=i;
y[com]=j;
comd="esc";
}
if(!flag){
color(12);
cout<<">>语法错误"<<endl;
color(7);
}
}
comd="?";
}
//掉血、饥饿机制 始
if(a[com][1][x[com]][y[com]]!=0 && tims[com]%10==0){
smz[com]-=8;
}
if(kd('Z') && tims[com]%2==0){
if(hand[com][xuanze].ui==9){
jed[com]+=20;
del(com,9,1);
}
if(hand[com][xuanze].ui==10){
smz[com]+=10;
jed[com]+=40;
del(com,10,1);
}
}
if(tims[com]%50==0 && jed[com]>=30){
smz[com]++;
}
if(tims[com]%100==0){
jed[com]-=2;
}
if(smz[com]>=100) smz[com]=100;
if(jed[com]>=100) jed[com]=100;
if(a[com][1][x[com]-1][y[com]]==0) highlowdown++;
else{
if(highlowdown>=5) smz[com]-=(highlowdown-4)*3;
highlowdown=0;
}
if(a[com][1][x[com]-1][y[com]]==14 || a[com][1][x[com]+1][y[com]]==14 || a[com][1][x[com]][y[com]-1]==14 || a[com][1][x[com]][y[com]+1]==14){
if(tims[com]%10==0) smz[com]-=5;
}
if(smz[com]<=0){
jed[com]=smz[com]=100;
x[com]=cx[com];
y[com]=cy[com];
dek=died();
}
if(jed[com]<=0){
jed[com]=0;
if(tims[com]%25==0) smz[com]-=2;
}
//掉血、饥饿机制 终
if(kd('L')){
if(ztl==1) ztl=2;
else ztl=1;
Sleep(200);
}
if(kd('E')){
while(kd('E')){
}
packback(com);
Sleep(100);
}
if(kd('W')&& a[com][1][x[com]-1][y[com]]!=0){
if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]==0)){
x[com]+=4;
}
else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]!=0)){
x[com]+=3;
}
else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]!=0)){
x[com]+=2;
}
}
//if(cmmd=='S' || cmmd=='s') x[com]--;
if(a[com][1][x[com]-1][y[com]]==0){
Sleep(20);
x[com]--;
}
if(kd('A')){
if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]==0){
x[com]--;
y[com]--;
}
else if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]!=0){
y[com]--;
}
else if(a[com][1][x[com]][y[com]-1]!=0 && a[com][1][x[com]+1][y[com]-1]==0 && a[com][1][x[com]+1][y[com]]==0){
x[com]++;
y[com]--;
}
} //y[com]--;
if(kd('D')){
if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]==0){
x[com]--;
y[com]++;
}
else if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]!=0){
y[com]++;
}
else if(a[com][1][x[com]][y[com]+1]!=0 && a[com][1][x[com]+1][y[com]+1]==0 && a[com][1][x[com]+1][y[com]]==0){
x[com]++;
y[com]++;
}
} //y[com]++;
if(kd('J')){
kn=!kn;
while(kd('J')){
}
}
if(kd('1')) xuanze=1;
if(kd('2')) xuanze=2;
if(kd('3')) xuanze=3;
if(kd('4')) xuanze=4;
if(kd('5')) xuanze=5;
if(kd('6')) xuanze=6;
if(kd('7')) xuanze=7;
if(kd('8')) xuanze=8;
if(kd('9')) xuanze=9;
if(kd('Q') && a[com][1][x[com]+1][y[com]]==0 && /*a[com][1][x[com]-1][y[com]]!=0 &&*/ hand[com][xuanze].num!=0){
x[com]++;
pt(com,1,x[com]-1,y[com],true);
}
if(kn){
if(kd('Y')){
//hand[com][a[com][1][x[com]+1][y[com]-1]]++;
//a[com][1][x[com]+1][y[com]-1]=0;
pt(com,1,x[com]+1,y[com]-1,false);
}
if(kd('U')){
//hand[com][a[com][1][x[com]+1][y[com]]]++;
//a[com][1][x[com]+1][y[com]]=0;
pt(com,1,x[com]+1,y[com],false);
}
if(kd('I')){
//hand[com][a[com][1][x[com]+1][y[com]+1]]++;
//a[com][1][x[com]+1][y[com]+1]=0;
pt(com,1,x[com]+1,y[com]+1,false);
}
if(kd('H')){
//hand[com][a[com][1][x[com]][y[com]-1]]++;
//a[com][1][x[com]][y[com]-1]=0;
pt(com,1,x[com],y[com]-1,false);
}
if(kd('K')){
//hand[com][a[com][1][x[com]][y[com]+1]]++;
//a[com][1][x[com]][y[com]+1]=0;
pt(com,1,x[com],y[com]+1,false);
}
if(kd('B')){
//hand[com][a[com][1][x[com]-1][y[com]-1]]++;
//a[com][1][x[com]-1][y[com]-1]=0;
pt(com,1,x[com]-1,y[com]-1,false);
}
if(kd('N')){
//hand[com][a[com][1][x[com]-1][y[com]]]++;
//a[com][1][x[com]-1][y[com]]=0;
pt(com,1,x[com]-1,y[com],false);
}
if(kd('M')){
//hand[com][a[com][1][x[com]-1][y[com]+1]]++;
//a[com][1][x[com]-1][y[com]+1]=0;
pt(com,1,x[com]-1,y[com]+1,false);
}
}
if(!kn){
if(kd('Y')){
//hand[com][a[com][1][x[com]+1][y[com]-1]]++;
//a[com][1][x[com]+1][y[com]-1]=0;
pt(com,1,x[com]+1,y[com]-1,true);
}
if(kd('U')){
//hand[com][a[com][1][x[com]+1][y[com]]]++;
//a[com][1][x[com]+1][y[com]]=0;
pt(com,1,x[com]+1,y[com],true);
}
if(kd('I')){
//hand[com][a[com][1][x[com]+1][y[com]+1]]++;
//a[com][1][x[com]+1][y[com]+1]=0;
pt(com,1,x[com]+1,y[com]+1,true);
}
if(kd('H')){
//hand[com][a[com][1][x[com]][y[com]-1]]++;
//a[com][1][x[com]][y[com]-1]=0;
pt(com,1,x[com],y[com]-1,true);
}
if(kd('K')){
//hand[com][a[com][1][x[com]][y[com]+1]]++;
//a[com][1][x[com]][y[com]+1]=0;
pt(com,1,x[com],y[com]+1,true);
}
if(kd('B')){
//hand[com][a[com][1][x[com]-1][y[com]-1]]++;
//a[com][1][x[com]-1][y[com]-1]=0;
pt(com,1,x[com]-1,y[com]-1,true);
}
if(kd('N')){
//hand[com][a[com][1][x[com]-1][y[com]]]++;
//a[com][1][x[com]-1][y[com]]=0;
pt(com,1,x[com]-1,y[com],true);
}
if(kd('M')){
//hand[com][a[com][1][x[com]-1][y[com]+1]]++;
//a[com][1][x[com]-1][y[com]+1]=0;
pt(com,1,x[com]-1,y[com]+1,true);
}
}
color(7);
}
while(kd('P')){
}
cmmd='?';
while(cmmd!='P' && cmmd!='p'){
cmmd=getch();
}
cmmd='?';
}
void create(int com){
cls();
while(!kd('P')){
cls();
tims[com]+=1;
if(tims[com]>=10000){
days[com]++;
tims[com]=0;
}
if(tims[com]<=5500) chuancan=240;
else if(tims[com]<=6000) chuancan=224;
else if(tims[com]<=9500) chuancan=0;
else chuancan=224;
if(tims[com]%100==0){
jb+=(tims[com]+days[com]*10000)/1000;
emc+=1;
}
for(i=x[com]+10;i>=x[com]-10;i--){
for(j=y[com]-19;j<=y[com]+19;j++){
if(i==-1 || j<0 || j>2048){
color(15);
printf("▓");
}
/*else if(a[com][1][i-1][j]!=0 && a[com][1][i+1][j]!=0 && a[com][1][i][j+1]!=0 && a[com][1][i][j-1]!=0){
color(7);
cout<<" ";
}*/else if(i!=x[com] || j!=y[com]){
print(a[com][1][i][j]);
}else{
ppf(sehao);
}
}
cout<<endl;
}
if(x[com]<=1){
x[com]=1;
}
if(x[com]>256){
x[com]=256;
}
if(y[com]<0){
y[com]=0;
}
if(y[com]>2048){
y[com]=2048;
}
color(15);
printf(">>状态栏 坐标: x:%d y:%d ",x[com],y[com]);
cout<<"后位方块:";
print(a[com][1][x[com]][y[com]]);
color(15);
cout<<" 当前:";
if(kn){
color(12);
cout<<"**";
}else{
color(10);
cout<<"建造";
}
color(15);
cout<<"模式(J切换) P-保存并退出 ";
cout<<endl;
color(7);
Line(" "+wri(hand[com][xuanze].ui)+" ");
color(7);
cout<<"\t\t\t ";
for(i=1;i<=9;i++){
color(7);
if(hand[com][i].num!=0){
print(hand[com][i].ui);
}else{
cout<<"□";
}
}
color(7);
cout<<" ";
cout<<endl<<"\t\t\t ";
for(i=1;i<=9;i++){
if(i==xuanze) color(11);
else color(7);
if(hand[com][i].num!=0){
if(hand[com][i].num<=64) printf("%02d",hand[com][i].num);
else if(hand[com][i].num<100) cout<<hand[com][i].num%100/10<<"+";
else if(hand[com][i].num<1000) cout<<hand[com][i].num%1000/100<<"*";
else cout<<hand[com][i].num%10000/1000<<"^";
}else{
cout<<"--";
}
}
cout<<" ";
//Sleep(100);
if(cmmd=='/'){
cls();
color(12);
Line("命令");
bool flag=0;
while(comd!="esc"){
color(7);
cout<<"/";
cin>>comd;
if(comd=="tp"){
cout<<"/tp @s ";
cin>>i>>j;
flag=1;
x[com]=i;
y[com]=j;
comd="esc";
}
if(!flag){
color(12);
cout<<">>语法错误"<<endl;
color(7);
}
}
comd="?";
}
if(kd('E')){
while(kd('E')){
}
packback(com);
Sleep(100);
}
if(kd('W')&& a[com][1][x[com]-1][y[com]]!=0){
if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]==0)){
x[com]+=4;
}
else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]==0) && (a[com][1][x[com]+3][y[com]]!=0)){
x[com]+=3;
}
else if((a[com][1][x[com]+1][y[com]]==0) && (a[com][1][x[com]+2][y[com]]!=0)){
x[com]+=2;
}
}
//if(cmmd=='S' || cmmd=='s') x[com]--;
if(a[com][1][x[com]-1][y[com]]==0){
Sleep(20);
x[com]--;
}
if(kd('A')){
if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]==0){
x[com]--;
y[com]--;
}
else if(a[com][1][x[com]][y[com]-1]==0 && a[com][1][x[com]-1][y[com]-1]!=0){
y[com]--;
}
else if(a[com][1][x[com]][y[com]-1]!=0 && a[com][1][x[com]+1][y[com]-1]==0 && a[com][1][x[com]+1][y[com]]==0){
x[com]++;
y[com]--;
}
} //y[com]--;
if(kd('D')){
if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]==0){
x[com]--;
y[com]++;
}
else if(a[com][1][x[com]][y[com]+1]==0 && a[com][1][x[com]-1][y[com]+1]!=0){
y[com]++;
}
else if(a[com][1][x[com]][y[com]+1]!=0 && a[com][1][x[com]+1][y[com]+1]==0 && a[com][1][x[com]+1][y[com]]==0){
x[com]++;
y[com]++;
}
} //y[com]++;
if(kd('J')){
kn=!kn;
while(kd('J')){
}
}
if(kd('1')) xuanze=1;
if(kd('2')) xuanze=2;
if(kd('3')) xuanze=3;
if(kd('4')) xuanze=4;
if(kd('5')) xuanze=5;
if(kd('6')) xuanze=6;
if(kd('7')) xuanze=7;
if(kd('8')) xuanze=8;
if(kd('9')) xuanze=9;
if(kd('Q') && a[com][1][x[com]+1][y[com]]==0 && /*a[com][1][x[com]-1][y[com]]!=0 &&*/ hand[com][xuanze].num!=0){
x[com]++;
pt(com,1,x[com]-1,y[com],true);
}
if(kn){
if(kd('Y')){
//hand[com][a[com][1][x[com]+1][y[com]-1]]++;
//a[com][1][x[com]+1][y[com]-1]=0;
pt(com,1,x[com]+1,y[com]-1,false);
}
if(kd('U')){
//hand[com][a[com][1][x[com]+1][y[com]]]++;
//a[com][1][x[com]+1][y[com]]=0;
pt(com,1,x[com]+1,y[com],false);
}
if(kd('I')){
//hand[com][a[com][1][x[com]+1][y[com]+1]]++;
//a[com][1][x[com]+1][y[com]+1]=0;
pt(com,1,x[com]+1,y[com]+1,false);
}
if(kd('H')){
//hand[com][a[com][1][x[com]][y[com]-1]]++;
//a[com][1][x[com]][y[com]-1]=0;
pt(com,1,x[com],y[com]-1,false);
}
if(kd('K')){
//hand[com][a[com][1][x[com]][y[com]+1]]++;
//a[com][1][x[com]][y[com]+1]=0;
pt(com,1,x[com],y[com]+1,false);
}
if(kd('B')){
//hand[com][a[com][1][x[com]-1][y[com]-1]]++;
//a[com][1][x[com]-1][y[com]-1]=0;
pt(com,1,x[com]-1,y[com]-1,false);
}
if(kd('N')){
//hand[com][a[com][1][x[com]-1][y[com]]]++;
//a[com][1][x[com]-1][y[com]]=0;
pt(com,1,x[com]-1,y[com],false);
}
if(kd('M')){
//hand[com][a[com][1][x[com]-1][y[com]+1]]++;
//a[com][1][x[com]-1][y[com]+1]=0;
pt(com,1,x[com]-1,y[com]+1,false);
}
}
if(!kn){
if(kd('Y')){
//hand[com][a[com][1][x[com]+1][y[com]-1]]++;
//a[com][1][x[com]+1][y[com]-1]=0;
pt(com,1,x[com]+1,y[com]-1,true);
}
if(kd('U')){
//hand[com][a[com][1][x[com]+1][y[com]]]++;
//a[com][1][x[com]+1][y[com]]=0;
pt(com,1,x[com]+1,y[com],true);
}
if(kd('I')){
//hand[com][a[com][1][x[com]+1][y[com]+1]]++;
//a[com][1][x[com]+1][y[com]+1]=0;
pt(com,1,x[com]+1,y[com]+1,true);
}
if(kd('H')){
//hand[com][a[com][1][x[com]][y[com]-1]]++;
//a[com][1][x[com]][y[com]-1]=0;
pt(com,1,x[com],y[com]-1,true);
}
if(kd('K')){
//hand[com][a[com][1][x[com]][y[com]+1]]++;
//a[com][1][x[com]][y[com]+1]=0;
pt(com,1,x[com],y[com]+1,true);
}
if(kd('B')){
//hand[com][a[com][1][x[com]-1][y[com]-1]]++;
//a[com][1][x[com]-1][y[com]-1]=0;
pt(com,1,x[com]-1,y[com]-1,true);
}
if(kd('N')){
//hand[com][a[com][1][x[com]-1][y[com]]]++;
//a[com][1][x[com]-1][y[com]]=0;
pt(com,1,x[com]-1,y[com],true);
}
if(kd('M')){
//hand[com][a[com][1][x[com]-1][y[com]+1]]++;
//a[com][1][x[com]-1][y[com]+1]=0;
pt(com,1,x[com]-1,y[com]+1,true);
}
}
color(7);
}
while(kd('P')){
}
cmmd='?';
while(cmmd!='P' && cmmd!='p'){
cmmd=getch();
}
cmmd='?';
}
int cun(int com)
{
while(kd(char(13))){
}
xuanze=1;
color(255);
//for(i=1;i<=1000;i++) cout<<" ";
if(mode[com]==1){
survival(com);
}else if(mode[com]==2){
create(com);
}
return 0;
}
void fm(){
while(cmmd!='G' && cmmd!='g'){
system("cls");
color(240);
system("cls");
cout<<endl;
Line("XACRAFT 3.2");
cout<<endl<<endl;
color(249);
Line(" **组团队\n");
color(240);
Line("创意/营销/策划 王子逸");
Line("核心程序/外观设计 沙宸安");
cout<<endl;
color(249);
Line(" 特别鸣谢名单\n");
color(240);
Line(" 注:以上排名不分先后\n");
cout<<endl;
Line("吴庞茂旭 武 建 豪 刘 英 杰 杜 文 博 侯 平 仄");
Line("欧阳语聪 张 帆 赵 逸 凡 赵 奕 帆 陈 曦");
Line("许 金 夫 江 齐 悦 孔 小 川 宣 海 宁 王 子 耀");
Line("陈 喆 鹏 包 涵 宇 潘 孝 宇 曹 灿 阳 朱 优 扬");
Line("郑 泓 毅 陈 家 傲 李 玥 仑 赵 泰 来 薛 乘 志");
color(252);
cout<<endl;
Line("注:所有在鸣谢名单上的人可以申请移出,达到光能级别及以上的人可以申请加入。");
color(240);
Line("[1/2]");
Line("G-切换下一页");
cmmd=getch();
}
while(cmmd!='S' && cmmd!='s'){
system("cls");
color(240);
system("cls");
cout<<endl;
Line("XACRAFT 3.2");
cout<<endl<<endl;
color(249);
Line(" 本版本更新内容\n");
color(240);
Line("这是XACRAFT的第6个版本");
Line("本版本更新内容如下:");
cout<<endl;
Line("新增生存模式");
Line("背包堆叠上限");
Line("存档策略更新");
cout<<endl;
color(252);
Line(" XACRAFT**组团队预祝您游玩愉快!\n");
color(249);
Line(" 版权声明\n");
color(240);
Line("本游戏由兴安科技与极昼游戏工坊联合制作");
Line("版权所有 未经授权严禁转载 保留所有权利");
Line("Copyright XAscience & JizhouGameWorkshop All Rights Reserved");
cout<<endl;
color(240);
Line("[2/2]");
Line("S-开始游戏");
cmmd=getch();
}
while(cmmd!='O' && cmmd!='o'){
system("cls");
color(240);
system("cls");
if(tecnam.empty()) rightLine("未登录TEC账号 L-登录");
else rightLine(tecnam+",欢迎您!");
color(240);
cout<<" ▇ ▇ ▇ ▇▇▇ ▇▇▇ ▇ ▇▇▇ ▇▇▇ "<<endl;
cout<<" ▇ ▇ ▇ ▇ ▇ ▇ ▇ ▇ ▇ ▇ ▇ "<<endl;
cout<<" ▇ ▇▇▇ ▇ ▇▇▇ ▇▇▇ ▇▇▇ ▇ "<<endl;
cout<<" ▇ ▇ ▇ ▇ ▇ ▇▇ ▇ ▇ ▇ ▇ "<<endl;
cout<<" ▇ ▇ ▇ ▇ ▇▇▇ ▇ ▇ ▇ ▇ ▇ ▇ "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" ";
color(143);
cout<<" F-单人游戏 ";
color(240);
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" ";
color(143);
cout<<" G-XACRAFT Community ";
color(240);
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" ";
color(143);
cout<<" H-个人中心 ";
color(240);
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" ";
color(143);
cout<<" J-教程 ";
color(240);
cout<<" ";
color(143);
cout<<" O-退出 ";
color(240);
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" XACRAFT 3.2 Copyright XAscience & JizhouGameWorkshop Do not distribute!";
cmmd=getch();
if(cmmd=='F' || cmmd=='f'){
while(cmmd!='P' && cmmd!='p'){
system("cls");
color(252);
system("cls");
Line("我的存档");
color(240);
Line("______________________________________________________________________________");
j=0;
for(i=1;i<=20;i++){
if(jiandang[i]){
cout<<" "<<i<<" - XACRAFT存档"<<i<<endl;
j++;
}
}
for(i=1;i<=20-j;i++) cout<<endl;
Line("______________________________________________________________________________");
Line("F-新建存档 G-读取存档 H-删除存档 P-退出");
cmmd=getch();
if(cmmd=='F' || cmmd=='f'){
for(i=1;i<=20;i++){
if(!jiandang[i]){
nw(i);
jiandang[i]=1;
break;
}
}
}
if(cmmd=='G' || cmmd=='g'){
system("cls");
color(252);
system("cls");
Line("我的存档");
color(240);
Line("读取存档");
cout<<endl<<endl;
line("存档编号(输入负数退出): ");
color(7);
cin>>comd;
kkk=change_num(comd);
comd="?";
if(kkk>=0 && jiandang[kkk]){
cun(kkk);
system("cls");/*
color(12);
Line("XACRAFT存档异常退出");
color(7);
cout<<endl<<" 如您跳转到此界面,可能是因为您在使用XACRAFT存档的过程中未进行字符读入(或字符读入已执行但被清除),请输入任意内容,然后按Enter键即可退出XACRAFT存档";
cin>>comd;
system("cls");*/
}
}
if(cmmd=='H' || cmmd=='h'){
system("cls");
color(252);
system("cls");
Line("我的存档");
color(240);
Line("删除存档");
cout<<endl<<endl;
line("存档编号(输入负数退出): ");
color(7);
cin>>comd;
kkk=change_num(comd);
comd="?";
if(kkk>=0) jiandang[kkk]=0;
}
/*
if(jiandang){
color(7);
cun(1);
cmmd='?';
}else{
system("cls");
color(252);
system("cls");
Line("我的存档");
color(240);
Line("新的世界");
cout<<endl<<endl;
line("输入种子: ");
color(7);
nw(1);
cun(1);
cmmd='?';
jiandang=1;
}
*/
}
cmmd='?';
}
if(cmmd=='G' || cmmd=='g'){
system("cls");
color(252);
system("cls");
Line("XACRAFT Community");
cout<<endl;
color(240);
Line("请保证您连接了互联网,否则将无法进入XACRAFT Community。");
system("start https://www.luogu.com.cn/team/35439");
cout<<endl<<endl<<endl<<endl;
Line("[按任意键退出]");
cmmd=getch();
cmmd='?';
}
if(cmmd=='H' || cmmd=='h') mycenter();
if(cmmd=='L' || cmmd=='l') TEClogin();
if(cmmd=='J' || cmmd=='j'){
system("cls");
color(240);
system("cls");
Line("新手教程");
cout<<endl;
color(240);
Line(" 注:以下键位操作大小写皆可\n");
Line(" W-跳 跃 A-左 走 D-右 走 Q-在脚下放置方块\n");
Line(" J-建造模式/**模式\n");
Line(" YUIHKBNM依次为:放置/**{左上角,上方,右上角,左边,右边,左下角,下方,右下角}的方块\n");
Line(" 游戏区域的正下方为物品栏\n");
Line(" 更多教程请按K键\n");
cout<<endl<<endl<<endl;
Line("[按其他键退出]");
cmmd=getch();
if(cmmd=='K' || cmmd=='k') system("start https://docs.qq.com/doc/DWGtxU0RzeFF1UFFn");
cmmd='?';
}
if(cmmd=='#'){
system("cls");
color(12);
system("cls");
Line("除错模式");
cout<<endl;
color(7);
Line("注:本模式仅供XACRAFT内部人员使用,如果您不是XACRAFT技术人员,在使用XACRAFT除错模式后因操作不当出现问题,兴安科技和极昼工坊将不承担任何责任。");
cout<<endl<<endl;
cout<<"方块外观:";
for(i=1;i<=35;i++){
print(i);
color(7);
}
color(7);
cout<<endl<<"方块UI值:";
for(i=1;i<=35;i++){
if(i%2==1) color(9);
printf("%02d",i);
color(7);
}
cout<<endl<<endl<<endl;
Line("[按任意键退出]");
cmmd=getch();
cmmd='?';
}
}
Sleep(1000);
return ;
}
void exit_saving(){
sav();
}
void XACRAFT_MAIN(){
console();
HideCursor1();
Logical_Lock();
lists();
checkcun();
rea();
fm();
}
int main(){
atexit(exit_saving);
XACRAFT_MAIN();
return 0;
}