Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.25 KB | None | 0 0
  1. #include <windows.h>
  2. #include <conio.h>
  3. #include <bits/stdc++.h>
  4.  
  5. using namespace std;
  6.  
  7. struct schat{string s; int nr;};
  8. schat z;
  9.  
  10. void blue()
  11. {
  12. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 1);
  13. }
  14.  
  15. void green()
  16. {
  17. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 2);
  18. }
  19.  
  20. void aqua()
  21. {
  22. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
  23. }
  24.  
  25. void red()
  26. {
  27. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
  28. }
  29.  
  30. void purple()
  31. {
  32. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 5);
  33. }
  34.  
  35. void yellow()
  36. {
  37. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 6);
  38. }
  39.  
  40. void white()
  41. {
  42. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
  43. }
  44.  
  45. void lblue()
  46. {
  47. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 9);
  48. }
  49.  
  50. void lgreen()
  51. {
  52. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
  53. }
  54.  
  55. void laqua()
  56. {
  57. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
  58. }
  59.  
  60. void lred()
  61. {
  62. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
  63. }
  64.  
  65. void lpurple()
  66. {
  67. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);
  68. }
  69.  
  70. void lyellow()
  71. {
  72. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
  73. }
  74.  
  75. void lwhite()
  76. {
  77. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
  78. }
  79.  
  80. void gray()
  81. {
  82. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8);
  83. }
  84.  
  85. void sqr()
  86. {
  87. cout<<char(219)<<char(219);
  88. }
  89.  
  90. int m1[21][21] ,hp=100 , xp , lvl, iesitmapa,aur=30,nrmap,parctic,pdesert,plava,preta=5,pretd=20,pretl=50,prethp=1,cactus;
  91. int m2[21][21],m3[21][21],m4[21][21];
  92. int xpl[]={100,140,150,280,400,550,750,1000};
  93. char c;
  94. int main()
  95. {
  96. int ieu=5;
  97. int jeu=5;
  98. srand(time(0));
  99. for(int i=1 ; i<=15 ; i++)
  100. {
  101. for(int j=1 ; j<=15 ; j++)
  102. {
  103. m1[i][j]=rand()%2;
  104. m2[i][j]=rand()%2;
  105. if(m3[i][j]!=2)
  106. m3[i][j]=rand()%2;
  107. if(m3[i][j]!=2)
  108. {
  109. if(rand()%25==0)
  110. {
  111. m3[i][j]=2;
  112. m3[i+1][j]=2;
  113. m3[i][j+1]=2;
  114. m3[i+1][j+1]=2;
  115. }
  116. }
  117. }
  118. }
  119. map1:
  120. nrmap=1;
  121. while(1==1)
  122. {
  123. if(c==99)
  124. goto shop;
  125. if(c==97)
  126. {
  127. if(jeu==1)
  128. iesitmapa=1;
  129. if(jeu>1)
  130. jeu--;
  131. }
  132. else
  133. if(c==100)
  134. {
  135. if(jeu==15)
  136. iesitmapa=1;
  137. if(jeu<15)
  138. jeu++;
  139. }
  140. else
  141. if(c==115)
  142. {
  143. if(ieu==15)
  144. iesitmapa=1;
  145. if(ieu<15)
  146. ieu++;
  147. }
  148. else
  149. if(c==119)
  150. {
  151. if(ieu==1)
  152. iesitmapa=1;
  153. if(ieu>1)
  154. ieu--;
  155. }
  156. if(rand()%25==0)
  157. {
  158. int a=1+rand()%15;
  159. int b=1+rand()%15;
  160. if(a==ieu && b==jeu)
  161. {
  162. ;
  163. }
  164. else
  165. m1[a][b]=3;
  166. }
  167. system("CLS");
  168. for(int i=1 ; i<=15 ; i++)
  169. {
  170. for(int j=1 ; j<=15 ; j++)
  171. {
  172. if(ieu==i && jeu==j)
  173. {
  174. lpurple();
  175. sqr();
  176. if(m1[ieu][jeu]==3)
  177. {
  178. aur++;
  179. m1[ieu][jeu]=rand()%2;
  180. }
  181. }
  182. else
  183. if(m1[i][j]==1)
  184. {
  185. green();
  186. sqr();
  187. }
  188. else
  189. if(m1[i][j]==0)
  190. {
  191. lgreen();
  192. sqr();
  193. }
  194. else
  195. if(m1[i][j]==3)
  196. {
  197. lyellow();
  198. sqr();
  199. }
  200. }
  201. if(i==1)
  202. {
  203. lred();
  204. cout<<" VIATA : "<<hp<<" / 100";
  205. }
  206. if(i==15)
  207. {
  208. lyellow();
  209. cout<<" AUR : "<<aur;
  210. }
  211. cout<<'\n';
  212. }
  213. if(iesitmapa==1)
  214. {
  215. cout<<"\n";
  216. lred();
  217. cout<<" NU AI VOIE SA IESI DIN MAPA";
  218. iesitmapa=0;
  219. }
  220. c=getch();
  221. if(c==13)
  222. goto chat;
  223.  
  224. }
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237. map2:
  238. nrmap=2;
  239. while(1==1)
  240. {
  241. if(c==99)
  242. goto shop;
  243. if(c==97)
  244. {
  245. if(jeu==1)
  246. iesitmapa=1;
  247. if(jeu>1)
  248. jeu--;
  249. }
  250. else
  251. if(c==100)
  252. {
  253. if(jeu==15)
  254. iesitmapa=1;
  255. if(jeu<15)
  256. jeu++;
  257. }
  258. else
  259. if(c==115)
  260. {
  261. if(ieu==15)
  262. iesitmapa=1;
  263. if(ieu<15)
  264. ieu++;
  265. }
  266. else
  267. if(c==119)
  268. {
  269. if(ieu==1)
  270. iesitmapa=1;
  271. if(ieu>1)
  272. ieu--;
  273. }
  274. if(rand()%25==0)
  275. {
  276. int a=1+rand()%15;
  277. int b=1+rand()%15;
  278. if(a==ieu && b==jeu)
  279. {
  280. ;
  281. }
  282. else
  283. m2[a][b]=3;
  284. }
  285. system("CLS");
  286. for(int i=1 ; i<=15 ; i++)
  287. {
  288. for(int j=1 ; j<=15 ; j++)
  289. {
  290. if(ieu==i && jeu==j)
  291. {
  292. lpurple();
  293. sqr();
  294. if(m2[ieu][jeu]==3)
  295. {
  296. aur++;
  297. m2[ieu][jeu]=rand()%2;
  298. }
  299. }
  300. else
  301. if(m2[i][j]==1)
  302. {
  303. white();
  304. sqr();
  305. }
  306. else
  307. if(m2[i][j]==0)
  308. {
  309. lwhite();
  310. sqr();
  311. }
  312. else
  313. if(m2[i][j]==3)
  314. {
  315. lyellow();
  316. sqr();
  317. }
  318. }
  319. if(i==1)
  320. {
  321. lred();
  322. cout<<" VIATA : "<<hp<<" / 100";
  323. }
  324. if(i==15)
  325. {
  326. lyellow();
  327. cout<<" AUR : "<<aur;
  328. }
  329. cout<<'\n';
  330. }
  331. if(iesitmapa==1)
  332. {
  333. cout<<"\n";
  334. lred();
  335. cout<<" NU AI VOIE SA IESI DIN MAPA";
  336. iesitmapa=0;
  337. }
  338. c=getch();
  339. if(c==13)
  340. goto chat;
  341.  
  342. }
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371. map3:
  372. nrmap=3;
  373. while(1==1)
  374. {
  375. cactus=0;
  376. if(c==99)
  377. goto shop;
  378. if(c==97)
  379. {
  380. if(jeu==1)
  381. iesitmapa=1;
  382. if(m3[ieu][jeu-1]==2)
  383. cactus=1;
  384. if(jeu>1 && cactus==0)
  385. jeu--;
  386. }
  387. else
  388. if(c==100)
  389. {
  390. if(jeu==15)
  391. iesitmapa=1;
  392. if(m3[ieu][jeu+1]==2)
  393. cactus=1;
  394. if(jeu<15 && cactus==0)
  395. jeu++;
  396. }
  397. else
  398. if(c==115)
  399. {
  400. if(ieu==15)
  401. iesitmapa=1;
  402. if(m3[ieu+1][jeu]==2)
  403. cactus=1;
  404. if(ieu<15 && cactus==0)
  405. ieu++;
  406. }
  407. else
  408. if(c==119)
  409. {
  410. if(ieu==1)
  411. iesitmapa=1;
  412. if(m3[ieu-1][jeu]==2)
  413. cactus=1;
  414. if(ieu>1 && cactus==0)
  415. ieu--;
  416. }
  417. if(rand()%2==0)
  418. {
  419. int a=1+rand()%15;
  420. int b=1+rand()%15;
  421. if((a==ieu && b==jeu) || (m3[a][b]==2))
  422. {
  423. ;
  424. }
  425. else
  426. m3[a][b]=3;
  427. }
  428. if(cactus==1)
  429. hp-=20;
  430. if(hp<1)
  431. goto oof;
  432. system("CLS");
  433. for(int i=1 ; i<=15 ; i++)
  434. {
  435. for(int j=1 ; j<=15 ; j++)
  436. {
  437. if(ieu==i && jeu==j)
  438. {
  439. lpurple();
  440. sqr();
  441. if(m3[ieu][jeu]==3)
  442. {
  443. aur++;
  444. m3[ieu][jeu]=rand()%2;
  445. }
  446. }
  447. else
  448. if(m3[i][j]==1)
  449. {
  450. yellow();
  451. sqr();
  452. }
  453. else
  454. if(m3[i][j]==0)
  455. {
  456. lyellow();
  457. sqr();
  458. }
  459. else
  460. if(m3[i][j]==3)
  461. {
  462. lred();
  463. sqr();
  464. }
  465. else
  466. if(m3[i][j]==2)
  467. {
  468. green();
  469. sqr();
  470. }
  471. }
  472. if(i==1)
  473. {
  474. lred();
  475. cout<<" VIATA : "<<hp<<" / 100";
  476. }
  477. if(i==15)
  478. {
  479. lyellow();
  480. cout<<" AUR : "<<aur;
  481. }
  482. cout<<'\n';
  483. }
  484. if(iesitmapa==1)
  485. {
  486. cout<<"\n";
  487. lred();
  488. cout<<" NU AI VOIE SA IESI DIN MAPA";
  489. iesitmapa=0;
  490. }
  491. c=getch();
  492. if(c==13)
  493. goto chat;
  494.  
  495. }
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525. map4:
  526.  
  527.  
  528.  
  529.  
  530.  
  531. chat:
  532. lwhite();
  533. cout<<"\n /";
  534. cin>>z.s;
  535. if(z.s=="map1")
  536. goto map1;
  537. if(z.s=="map2")
  538. {
  539. if(parctic==1)
  540. goto map2;
  541. else
  542. {
  543. cout<<"mata aia proasta";
  544. c=getch();
  545. if(nrmap==1)
  546. goto map1;
  547. if(nrmap==3)
  548. goto map3;
  549. if(nrmap==10)
  550. goto shop;
  551. }
  552. }
  553. if(z.s=="map3")
  554. {
  555. if(pdesert==1)
  556. goto map3;
  557. else
  558. {
  559. cout<<"mata aia proasta";
  560. c=getch();
  561. if(nrmap==1)
  562. goto map1;
  563. if(nrmap==2)
  564. goto map2;
  565. if(nrmap==10)
  566. goto shop;
  567. }
  568. }
  569. if(z.s=="aur")
  570. {
  571. cin>>z.nr;
  572. aur+=z.nr;
  573. if(nrmap==10)
  574. goto shop;
  575. if(nrmap==1)
  576. goto map1;
  577. if(nrmap==2)
  578. goto map2;
  579. if(nrmap==3)
  580. goto map3;
  581. if(nrmap==4)
  582. goto map4;
  583. }
  584. lred();
  585. cout<<"\n Comanda inexistenta\n";
  586. goto chat;
  587.  
  588.  
  589. shop:
  590. nrmap=10;
  591.  
  592. while(1==1)
  593. {
  594. if(c==49)
  595. {
  596. if(aur>=preta && parctic==0)
  597. {
  598. aur-=preta;
  599. parctic=1;
  600. }
  601.  
  602. }
  603.  
  604. if(c==50)
  605. {
  606. if(aur>=pretd && pdesert==0)
  607. {
  608. aur-=pretd;
  609. pdesert=1;
  610. }
  611.  
  612. }
  613.  
  614. if(c==51)
  615. {
  616. if(aur>=pretl && plava==0)
  617. {
  618. aur-=pretl;
  619. plava=1;
  620. }
  621.  
  622. }
  623.  
  624. if(c==52)
  625. {
  626. if(aur>0 && hp<100)
  627. {
  628. aur--;
  629. hp+=10;
  630. }
  631. }
  632.  
  633. system("CLS");
  634. cout<<"\n";
  635. gray();
  636. for(int i=1 ; i<=30 ; i++)
  637. sqr();
  638. lwhite();
  639. cout<<" 1 - Portal Arctic - ";
  640. if(parctic==1)
  641. {
  642. lpurple();
  643. cout<<"OWNED";
  644. }
  645. if(parctic==0)
  646. {
  647. if(aur<preta)
  648. {
  649. lred();
  650. cout<<preta;
  651. }
  652. else
  653. {
  654. lgreen();
  655. cout<<preta;
  656. }
  657. }
  658. cout<<'\n';
  659.  
  660. gray();
  661. sqr();
  662. for(int i=1 ; i<=28 ; i++)
  663. cout<<" ";
  664. sqr();
  665. cout<<'\n';
  666.  
  667. gray();
  668. sqr();
  669. for(int i=2 ; i<=6 ; i++)
  670. cout<<" ";
  671. white();
  672. for(int i=7 ; i<=12 ; i++)
  673. sqr();
  674. for(int i=13 ; i<=18 ; i++)
  675. cout<<" ";
  676. yellow();
  677. for(int i=19 ; i<=24 ; i++)
  678. sqr();
  679. for(int i=25 ; i<=29 ; i++)
  680. cout<<" ";
  681. gray();
  682. sqr();
  683.  
  684. lyellow();
  685. cout<<" 2 - Portal Desert - ";
  686. if(pdesert==1)
  687. {
  688. lpurple();
  689. cout<<"OWNED";
  690. }
  691. if(pdesert==0)
  692. {
  693. if(aur<pretd)
  694. {
  695. lred();
  696. cout<<pretd;
  697. }
  698. else
  699. {
  700. lgreen();
  701. cout<<pretd;
  702. }
  703. }
  704. gray();
  705.  
  706. for(int j=1 ; j<=4 ; j++)
  707. {
  708. cout<<'\n';
  709. sqr();
  710. for(int i=2 ; i<=6 ; i++)
  711. cout<<" ";
  712. white();
  713. sqr();
  714. lwhite();
  715. for(int j=8 ; j<=11 ; j++)
  716. sqr();
  717. white();
  718. sqr();
  719. for(int i=1 ; i<=6 ; i++)
  720. cout<<" ";
  721. yellow();
  722. sqr();
  723. lyellow();
  724. for(int i=1 ; i<=4 ; i++)
  725. sqr();
  726. yellow();
  727. sqr();
  728. for(int i=1 ; i<=5 ; i++)
  729. cout<<" ";
  730. gray();
  731. sqr();
  732.  
  733. if(j==2)
  734. {
  735. lred();
  736. cout<<" 3 - Portal Vulcan - ";
  737. if(plava==1)
  738. {
  739. lpurple();
  740. cout<<"OWNED";
  741. }
  742. if(plava==0)
  743. {
  744. if(aur<pretl)
  745. {
  746. lred();
  747. cout<<pretl;
  748. }
  749. else
  750. {
  751. lgreen();
  752. cout<<pretl;
  753. }
  754. }
  755. gray();
  756. }
  757.  
  758. if(j==4)
  759. {
  760. lred();
  761. cout<<" 4 - 10 HP - ";
  762. if(aur<prethp)
  763. {
  764. lred();
  765. cout<<prethp;
  766. }
  767. else
  768. {
  769. lgreen();
  770. cout<<prethp;
  771. }
  772. }
  773. gray();
  774.  
  775. }
  776.  
  777.  
  778. cout<<'\n';
  779. sqr();
  780. for(int i=2 ; i<=6 ; i++)
  781. cout<<" ";
  782. white();
  783. for(int i=7 ; i<=12 ; i++)
  784. sqr();
  785. for(int i=13 ; i<=18 ; i++)
  786. cout<<" ";
  787. yellow();
  788. for(int i=19 ; i<=24 ; i++)
  789. sqr();
  790. for(int i=25 ; i<=29 ; i++)
  791. cout<<" ";
  792. gray();
  793. sqr();
  794. cout<<"\n";
  795.  
  796.  
  797.  
  798. // RAFT MIJLOC
  799.  
  800.  
  801. gray();
  802. for(int i=1 ; i<=30 ; i++)
  803. sqr();
  804. cout<<'\n';
  805.  
  806.  
  807. sqr();
  808. for(int i=1 ; i<=28 ; i++)
  809. cout<<" ";
  810. sqr();
  811. cout<<'\n';
  812.  
  813.  
  814. sqr();
  815. for(int i=1 ; i<=5 ; i++)
  816. cout<<" ";
  817. red();
  818. for(int i=1 ; i<=6 ; i++)
  819. sqr();
  820. for(int i=1 ; i<=8 ; i++)
  821. cout<<" ";
  822. lred();
  823. sqr(); sqr();
  824. for(int i=1 ; i<=7 ; i++)
  825. cout<<" ";
  826. gray();
  827. sqr();
  828. cout<<'\n';
  829.  
  830.  
  831. sqr();
  832. for(int i=1 ; i<=5 ; i++)
  833. cout<<" ";
  834. red();
  835. sqr();
  836. lred();
  837. for(int i=1 ; i<=4 ; i++)
  838. sqr();
  839. red();
  840. sqr();
  841. for(int i=1 ; i<=8 ; i++)
  842. cout<<" ";
  843. lred();
  844. sqr(); sqr();
  845. for(int i=1 ; i<=7 ; i++)
  846. cout<<" ";
  847. gray();
  848. sqr();
  849. cout<<'\n';
  850.  
  851.  
  852. for(int j=1 ; j<=2 ; j++ )
  853. {
  854. sqr();
  855. for(int i=1 ; i<=5 ; i++)
  856. cout<<" ";
  857. red();
  858. sqr();
  859. lred();
  860. for(int i=1 ; i<=4 ; i++)
  861. sqr();
  862. red();
  863. sqr();
  864. for(int i=1 ; i<=6 ; i++)
  865. cout<<" ";
  866. lred();
  867. for(int i=1 ; i<=6 ; i++)
  868. sqr();
  869. for(int i=1 ; i<=5 ; i++)
  870. cout<<" ";
  871. gray();
  872. sqr();
  873. cout<<'\n';
  874. }
  875.  
  876.  
  877. sqr();
  878. for(int i=1 ; i<=5 ; i++)
  879. cout<<" ";
  880. red();
  881. sqr();
  882. lred();
  883. for(int i=1 ; i<=4 ; i++)
  884. sqr();
  885. red();
  886. sqr();
  887. for(int i=1 ; i<=8 ; i++)
  888. cout<<" ";
  889. lred();
  890. sqr(); sqr();
  891. for(int i=1 ; i<=7 ; i++)
  892. cout<<" ";
  893. gray();
  894. sqr();
  895. cout<<'\n';
  896.  
  897.  
  898. sqr();
  899. for(int i=1 ; i<=5 ; i++)
  900. cout<<" ";
  901. red();
  902. for(int i=1 ; i<=6 ; i++)
  903. sqr();
  904. for(int i=1 ; i<=8 ; i++)
  905. cout<<" ";
  906. lred();
  907. sqr(); sqr();
  908. for(int i=1 ; i<=7 ; i++)
  909. cout<<" ";
  910. gray();
  911. sqr();
  912. cout<<'\n';
  913.  
  914.  
  915. for(int i=1 ; i<=30 ; i++)
  916. sqr();
  917. cout<<" ";
  918. lyellow();
  919. cout<<"AUR - "<<aur;
  920. lred();
  921. cout<<" VIATA - "<<hp<<" / 100";
  922. cout<<'\n';
  923.  
  924. c=getch();
  925. if(c==13)
  926. goto chat;
  927. }
  928.  
  929. oof:
  930. system("CLS");
  931. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 1+rand()%15);
  932. cout<<"oof";
  933. Beep(1+rand()%10000 , 100);
  934. Sleep(100);
  935. goto oof;
  936.  
  937. return 0;
  938. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement