Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <conio.h>
- #include <bits/stdc++.h>
- using namespace std;
- struct schat{string s; int nr;};
- schat z;
- void blue()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 1);
- }
- void green()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 2);
- }
- void aqua()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- }
- void red()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
- }
- void purple()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 5);
- }
- void yellow()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 6);
- }
- void white()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
- }
- void lblue()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 9);
- }
- void lgreen()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
- }
- void laqua()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
- }
- void lred()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
- }
- void lpurple()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);
- }
- void lyellow()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
- }
- void lwhite()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- }
- void gray()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8);
- }
- void sqr()
- {
- cout<<char(219)<<char(219);
- }
- int m1[21][21] ,hp=100 , xp , lvl, iesitmapa,aur=30,nrmap,parctic,pdesert,plava,preta=5,pretd=20,pretl=50,prethp=1,cactus;
- int m2[21][21],m3[21][21],m4[21][21];
- int xpl[]={100,140,150,280,400,550,750,1000};
- char c;
- int main()
- {
- int ieu=5;
- int jeu=5;
- srand(time(0));
- for(int i=1 ; i<=15 ; i++)
- {
- for(int j=1 ; j<=15 ; j++)
- {
- m1[i][j]=rand()%2;
- m2[i][j]=rand()%2;
- if(m3[i][j]!=2)
- m3[i][j]=rand()%2;
- if(m3[i][j]!=2)
- {
- if(rand()%25==0)
- {
- m3[i][j]=2;
- m3[i+1][j]=2;
- m3[i][j+1]=2;
- m3[i+1][j+1]=2;
- }
- }
- }
- }
- map1:
- nrmap=1;
- while(1==1)
- {
- if(c==99)
- goto shop;
- if(c==97)
- {
- if(jeu==1)
- iesitmapa=1;
- if(jeu>1)
- jeu--;
- }
- else
- if(c==100)
- {
- if(jeu==15)
- iesitmapa=1;
- if(jeu<15)
- jeu++;
- }
- else
- if(c==115)
- {
- if(ieu==15)
- iesitmapa=1;
- if(ieu<15)
- ieu++;
- }
- else
- if(c==119)
- {
- if(ieu==1)
- iesitmapa=1;
- if(ieu>1)
- ieu--;
- }
- if(rand()%25==0)
- {
- int a=1+rand()%15;
- int b=1+rand()%15;
- if(a==ieu && b==jeu)
- {
- ;
- }
- else
- m1[a][b]=3;
- }
- system("CLS");
- for(int i=1 ; i<=15 ; i++)
- {
- for(int j=1 ; j<=15 ; j++)
- {
- if(ieu==i && jeu==j)
- {
- lpurple();
- sqr();
- if(m1[ieu][jeu]==3)
- {
- aur++;
- m1[ieu][jeu]=rand()%2;
- }
- }
- else
- if(m1[i][j]==1)
- {
- green();
- sqr();
- }
- else
- if(m1[i][j]==0)
- {
- lgreen();
- sqr();
- }
- else
- if(m1[i][j]==3)
- {
- lyellow();
- sqr();
- }
- }
- if(i==1)
- {
- lred();
- cout<<" VIATA : "<<hp<<" / 100";
- }
- if(i==15)
- {
- lyellow();
- cout<<" AUR : "<<aur;
- }
- cout<<'\n';
- }
- if(iesitmapa==1)
- {
- cout<<"\n";
- lred();
- cout<<" NU AI VOIE SA IESI DIN MAPA";
- iesitmapa=0;
- }
- c=getch();
- if(c==13)
- goto chat;
- }
- map2:
- nrmap=2;
- while(1==1)
- {
- if(c==99)
- goto shop;
- if(c==97)
- {
- if(jeu==1)
- iesitmapa=1;
- if(jeu>1)
- jeu--;
- }
- else
- if(c==100)
- {
- if(jeu==15)
- iesitmapa=1;
- if(jeu<15)
- jeu++;
- }
- else
- if(c==115)
- {
- if(ieu==15)
- iesitmapa=1;
- if(ieu<15)
- ieu++;
- }
- else
- if(c==119)
- {
- if(ieu==1)
- iesitmapa=1;
- if(ieu>1)
- ieu--;
- }
- if(rand()%25==0)
- {
- int a=1+rand()%15;
- int b=1+rand()%15;
- if(a==ieu && b==jeu)
- {
- ;
- }
- else
- m2[a][b]=3;
- }
- system("CLS");
- for(int i=1 ; i<=15 ; i++)
- {
- for(int j=1 ; j<=15 ; j++)
- {
- if(ieu==i && jeu==j)
- {
- lpurple();
- sqr();
- if(m2[ieu][jeu]==3)
- {
- aur++;
- m2[ieu][jeu]=rand()%2;
- }
- }
- else
- if(m2[i][j]==1)
- {
- white();
- sqr();
- }
- else
- if(m2[i][j]==0)
- {
- lwhite();
- sqr();
- }
- else
- if(m2[i][j]==3)
- {
- lyellow();
- sqr();
- }
- }
- if(i==1)
- {
- lred();
- cout<<" VIATA : "<<hp<<" / 100";
- }
- if(i==15)
- {
- lyellow();
- cout<<" AUR : "<<aur;
- }
- cout<<'\n';
- }
- if(iesitmapa==1)
- {
- cout<<"\n";
- lred();
- cout<<" NU AI VOIE SA IESI DIN MAPA";
- iesitmapa=0;
- }
- c=getch();
- if(c==13)
- goto chat;
- }
- map3:
- nrmap=3;
- while(1==1)
- {
- cactus=0;
- if(c==99)
- goto shop;
- if(c==97)
- {
- if(jeu==1)
- iesitmapa=1;
- if(m3[ieu][jeu-1]==2)
- cactus=1;
- if(jeu>1 && cactus==0)
- jeu--;
- }
- else
- if(c==100)
- {
- if(jeu==15)
- iesitmapa=1;
- if(m3[ieu][jeu+1]==2)
- cactus=1;
- if(jeu<15 && cactus==0)
- jeu++;
- }
- else
- if(c==115)
- {
- if(ieu==15)
- iesitmapa=1;
- if(m3[ieu+1][jeu]==2)
- cactus=1;
- if(ieu<15 && cactus==0)
- ieu++;
- }
- else
- if(c==119)
- {
- if(ieu==1)
- iesitmapa=1;
- if(m3[ieu-1][jeu]==2)
- cactus=1;
- if(ieu>1 && cactus==0)
- ieu--;
- }
- if(rand()%2==0)
- {
- int a=1+rand()%15;
- int b=1+rand()%15;
- if((a==ieu && b==jeu) || (m3[a][b]==2))
- {
- ;
- }
- else
- m3[a][b]=3;
- }
- if(cactus==1)
- hp-=20;
- if(hp<1)
- goto oof;
- system("CLS");
- for(int i=1 ; i<=15 ; i++)
- {
- for(int j=1 ; j<=15 ; j++)
- {
- if(ieu==i && jeu==j)
- {
- lpurple();
- sqr();
- if(m3[ieu][jeu]==3)
- {
- aur++;
- m3[ieu][jeu]=rand()%2;
- }
- }
- else
- if(m3[i][j]==1)
- {
- yellow();
- sqr();
- }
- else
- if(m3[i][j]==0)
- {
- lyellow();
- sqr();
- }
- else
- if(m3[i][j]==3)
- {
- lred();
- sqr();
- }
- else
- if(m3[i][j]==2)
- {
- green();
- sqr();
- }
- }
- if(i==1)
- {
- lred();
- cout<<" VIATA : "<<hp<<" / 100";
- }
- if(i==15)
- {
- lyellow();
- cout<<" AUR : "<<aur;
- }
- cout<<'\n';
- }
- if(iesitmapa==1)
- {
- cout<<"\n";
- lred();
- cout<<" NU AI VOIE SA IESI DIN MAPA";
- iesitmapa=0;
- }
- c=getch();
- if(c==13)
- goto chat;
- }
- map4:
- chat:
- lwhite();
- cout<<"\n /";
- cin>>z.s;
- if(z.s=="map1")
- goto map1;
- if(z.s=="map2")
- {
- if(parctic==1)
- goto map2;
- else
- {
- cout<<"mata aia proasta";
- c=getch();
- if(nrmap==1)
- goto map1;
- if(nrmap==3)
- goto map3;
- if(nrmap==10)
- goto shop;
- }
- }
- if(z.s=="map3")
- {
- if(pdesert==1)
- goto map3;
- else
- {
- cout<<"mata aia proasta";
- c=getch();
- if(nrmap==1)
- goto map1;
- if(nrmap==2)
- goto map2;
- if(nrmap==10)
- goto shop;
- }
- }
- if(z.s=="aur")
- {
- cin>>z.nr;
- aur+=z.nr;
- if(nrmap==10)
- goto shop;
- if(nrmap==1)
- goto map1;
- if(nrmap==2)
- goto map2;
- if(nrmap==3)
- goto map3;
- if(nrmap==4)
- goto map4;
- }
- lred();
- cout<<"\n Comanda inexistenta\n";
- goto chat;
- shop:
- nrmap=10;
- while(1==1)
- {
- if(c==49)
- {
- if(aur>=preta && parctic==0)
- {
- aur-=preta;
- parctic=1;
- }
- }
- if(c==50)
- {
- if(aur>=pretd && pdesert==0)
- {
- aur-=pretd;
- pdesert=1;
- }
- }
- if(c==51)
- {
- if(aur>=pretl && plava==0)
- {
- aur-=pretl;
- plava=1;
- }
- }
- if(c==52)
- {
- if(aur>0 && hp<100)
- {
- aur--;
- hp+=10;
- }
- }
- system("CLS");
- cout<<"\n";
- gray();
- for(int i=1 ; i<=30 ; i++)
- sqr();
- lwhite();
- cout<<" 1 - Portal Arctic - ";
- if(parctic==1)
- {
- lpurple();
- cout<<"OWNED";
- }
- if(parctic==0)
- {
- if(aur<preta)
- {
- lred();
- cout<<preta;
- }
- else
- {
- lgreen();
- cout<<preta;
- }
- }
- cout<<'\n';
- gray();
- sqr();
- for(int i=1 ; i<=28 ; i++)
- cout<<" ";
- sqr();
- cout<<'\n';
- gray();
- sqr();
- for(int i=2 ; i<=6 ; i++)
- cout<<" ";
- white();
- for(int i=7 ; i<=12 ; i++)
- sqr();
- for(int i=13 ; i<=18 ; i++)
- cout<<" ";
- yellow();
- for(int i=19 ; i<=24 ; i++)
- sqr();
- for(int i=25 ; i<=29 ; i++)
- cout<<" ";
- gray();
- sqr();
- lyellow();
- cout<<" 2 - Portal Desert - ";
- if(pdesert==1)
- {
- lpurple();
- cout<<"OWNED";
- }
- if(pdesert==0)
- {
- if(aur<pretd)
- {
- lred();
- cout<<pretd;
- }
- else
- {
- lgreen();
- cout<<pretd;
- }
- }
- gray();
- for(int j=1 ; j<=4 ; j++)
- {
- cout<<'\n';
- sqr();
- for(int i=2 ; i<=6 ; i++)
- cout<<" ";
- white();
- sqr();
- lwhite();
- for(int j=8 ; j<=11 ; j++)
- sqr();
- white();
- sqr();
- for(int i=1 ; i<=6 ; i++)
- cout<<" ";
- yellow();
- sqr();
- lyellow();
- for(int i=1 ; i<=4 ; i++)
- sqr();
- yellow();
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- gray();
- sqr();
- if(j==2)
- {
- lred();
- cout<<" 3 - Portal Vulcan - ";
- if(plava==1)
- {
- lpurple();
- cout<<"OWNED";
- }
- if(plava==0)
- {
- if(aur<pretl)
- {
- lred();
- cout<<pretl;
- }
- else
- {
- lgreen();
- cout<<pretl;
- }
- }
- gray();
- }
- if(j==4)
- {
- lred();
- cout<<" 4 - 10 HP - ";
- if(aur<prethp)
- {
- lred();
- cout<<prethp;
- }
- else
- {
- lgreen();
- cout<<prethp;
- }
- }
- gray();
- }
- cout<<'\n';
- sqr();
- for(int i=2 ; i<=6 ; i++)
- cout<<" ";
- white();
- for(int i=7 ; i<=12 ; i++)
- sqr();
- for(int i=13 ; i<=18 ; i++)
- cout<<" ";
- yellow();
- for(int i=19 ; i<=24 ; i++)
- sqr();
- for(int i=25 ; i<=29 ; i++)
- cout<<" ";
- gray();
- sqr();
- cout<<"\n";
- // RAFT MIJLOC
- gray();
- for(int i=1 ; i<=30 ; i++)
- sqr();
- cout<<'\n';
- sqr();
- for(int i=1 ; i<=28 ; i++)
- cout<<" ";
- sqr();
- cout<<'\n';
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- red();
- for(int i=1 ; i<=6 ; i++)
- sqr();
- for(int i=1 ; i<=8 ; i++)
- cout<<" ";
- lred();
- sqr(); sqr();
- for(int i=1 ; i<=7 ; i++)
- cout<<" ";
- gray();
- sqr();
- cout<<'\n';
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- red();
- sqr();
- lred();
- for(int i=1 ; i<=4 ; i++)
- sqr();
- red();
- sqr();
- for(int i=1 ; i<=8 ; i++)
- cout<<" ";
- lred();
- sqr(); sqr();
- for(int i=1 ; i<=7 ; i++)
- cout<<" ";
- gray();
- sqr();
- cout<<'\n';
- for(int j=1 ; j<=2 ; j++ )
- {
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- red();
- sqr();
- lred();
- for(int i=1 ; i<=4 ; i++)
- sqr();
- red();
- sqr();
- for(int i=1 ; i<=6 ; i++)
- cout<<" ";
- lred();
- for(int i=1 ; i<=6 ; i++)
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- gray();
- sqr();
- cout<<'\n';
- }
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- red();
- sqr();
- lred();
- for(int i=1 ; i<=4 ; i++)
- sqr();
- red();
- sqr();
- for(int i=1 ; i<=8 ; i++)
- cout<<" ";
- lred();
- sqr(); sqr();
- for(int i=1 ; i<=7 ; i++)
- cout<<" ";
- gray();
- sqr();
- cout<<'\n';
- sqr();
- for(int i=1 ; i<=5 ; i++)
- cout<<" ";
- red();
- for(int i=1 ; i<=6 ; i++)
- sqr();
- for(int i=1 ; i<=8 ; i++)
- cout<<" ";
- lred();
- sqr(); sqr();
- for(int i=1 ; i<=7 ; i++)
- cout<<" ";
- gray();
- sqr();
- cout<<'\n';
- for(int i=1 ; i<=30 ; i++)
- sqr();
- cout<<" ";
- lyellow();
- cout<<"AUR - "<<aur;
- lred();
- cout<<" VIATA - "<<hp<<" / 100";
- cout<<'\n';
- c=getch();
- if(c==13)
- goto chat;
- }
- oof:
- system("CLS");
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 1+rand()%15);
- cout<<"oof";
- Beep(1+rand()%10000 , 100);
- Sleep(100);
- goto oof;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement