Advertisement
Guest User

hunters dream 2nd update

a guest
May 27th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 15.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <stdlib.h>
  4. #include <time.h>
  5. void imprime_vida(int vida){
  6.     printf("\nHEALTH BAR: [");
  7.     while(vida>0){
  8.         printf("*");
  9.         vida--;
  10.     }
  11.     printf("]\n");
  12. }
  13. int gera_numero(int inicio, int fim){
  14.     int numero;
  15.  
  16.     while(1){
  17.         numero = rand()%fim;
  18.         if(numero >= inicio)
  19.                break;
  20.     }
  21.  
  22.     return numero;
  23. }
  24.  
  25.  int main() {
  26.         int x,y=10,attack1,atk2,ring1=0,ring2=0,ring,troll,soup,terrain,difficulty,juju,kik;
  27.         char place;
  28.         srand(time(NULL));
  29.         while(1){
  30.         printf("\n \n Difficulty set: \n\n 1 for easy \n 2 for normal \n 3 for hard\n");
  31.         scanf("%i",&difficulty);
  32.         if(difficulty==1){
  33.               x= gera_numero(15, 21);
  34.               break;
  35.  
  36.         }
  37.         if(difficulty==2){
  38.                           x=gera_numero(10,16);
  39.                           break;
  40.                           }
  41.         if (difficulty==3){
  42.                 x=gera_numero(6,11);
  43.                             break;
  44.                            }
  45.  
  46.  
  47.  
  48.  
  49.         }
  50.  
  51.         system("CLS");
  52.         imprime_vida(x);
  53.         printf("You have %i lives.\nOh, don't you worry.\nWhatever happens, you may think it all a mere bad dream.\n\n\nPress any button to start your adventure.\n \n",x);
  54.         system("PAUSE");
  55.         system("CLS");
  56.         imprime_vida(x);
  57.         printf("You must find the cure for the curse, this land is doomed, you are the last hopefor the tribes and vilages in here. \n");
  58.         system("PAUSE");
  59.         system("CLS");
  60.         imprime_vida(x);
  61.         printf("Would you like to begin in the swamp or forest? \n 1 for Swamp \n 2 for Forest \n");
  62.         scanf("%i",&terrain);
  63.                 if(terrain==2){
  64.                                 system("CLS");
  65.                                 imprime_vida(x);
  66.                                 printf("'The grand lake of mud, hidden now, from sight.'\n");
  67.                                 system("PAUSE");
  68.                                 system("CLS");
  69.                                 imprime_vida(x);
  70.                                 printf("You descend into a realm of darkness, and find it, mortally wounded, and alone.\n");
  71.                                 system("PAUSE");
  72.                                 system("CLS");
  73.                                 imprime_vida(x);
  74.                                 printf("\n You are being attacked by a pack of wolves\n What do you do?\n");
  75.                                 printf(" 1- Attack them with your sword\n 2- Run away \n 3- Shoot them all with your old rifle\n ");
  76.                                 scanf("%i",&attack1);
  77.                                 system("CLS");
  78.                                 imprime_vida(x);
  79.                                 if(attack1==1 && x>=6){
  80.                                         printf("You couldnt handdle the sword properly, but you still have %i lives remaining\n",x-6);
  81.                                         printf("\n\n\n YOU FOUND THE FROST RING.");
  82.                                         ring2=1;
  83.                                         x=x-6;
  84.                                         system("PAUSE");
  85.                                 }
  86.                                 if(attack1==1 && x<6){
  87.                                         printf("You couldnt handdle the sword properly, you are dead. \n");
  88.                                 }
  89.                                 if(attack1==2 && x>=4) {
  90.                                         printf("You ran away,but one wolf followed your trail, you had to fight it with your\n fists, you have %i lives",x-4);
  91.                                         ring2=1;
  92.                                         printf("\n\n\n YOU RECOVERED THE FROST RING\n");
  93.                                         x=x-4;
  94.                                         system("PAUSE");}
  95.                                 if(attack1==2 && x<4){
  96.                                         system("CLS");
  97.                                         imprime_vida(x);
  98.                                         printf("You ran away, but one of the wolves followed your trail, and ate you alive.");
  99.                                 }
  100.  
  101.                                 if((attack1==3) && (x>=3)){
  102.                                         printf("You killed the wolves, but you weren't able to reload quickly enough and got\nattacked, you have %i lives left. ",x-3);
  103.                                                 printf("\n\n\n YOU RECOVERED THE FROST RING\n");
  104.                                                 x=x-3;
  105.                                                 ring2=1;
  106.                                                 system("PAUSE");
  107.                                                 }
  108.                                 if((attack1==3) && (x<3))
  109.                                         printf("The wolf ate your bones, you died.");
  110.  
  111.                         }
  112.  
  113.                 if(terrain==1){
  114.                 system("CLS");
  115.                 imprime_vida(x);
  116.                 printf("Let us pray... to partake in communion. Let us partake in communion... and feastupon the old blood.\n");
  117.                 system("PAUSE");
  118.                 system("CLS");
  119.                 imprime_vida(x);
  120.                 printf("You walk in the swamp, and it starts to rain.\nYou hear whispers.\n-Their wills are weak, minds young.\n-The foul beasts will dangle nectar and lure the meek into the depths. \n");
  121.                 system("PAUSE");
  122.                 system("CLS");
  123.                 imprime_vida(x);
  124.                  printf("Two uruks approaching your area what do you do?\n");
  125.                  printf("\n 1- Use your axe against them \n 2- Use a debuff that weakens Uruks \n 3- Use mind control in one of the Uruks\n digit a number\n");
  126.                  scanf("%i",&atk2);
  127.                  system("CLS");
  128.                  imprime_vida(x);
  129.                 if(atk2==1 && x<8){
  130.                         printf("You died\n");
  131.                         system("PAUSE");
  132.                 }
  133.                  if(atk2==1 && x>=8){
  134.                         printf("you killed both uruks but only have %i lives remaining\n",x-8);
  135.                                 x=x-8;
  136.                                 system("CLS");
  137.                                 imprime_vida(x);
  138.                                 printf("\n\n\nYOU RECOVERED THE RING OF FIRE\n");
  139.                                  ring1=1;
  140.                                  system("PAUSE");
  141.                                  }
  142.                 if(atk2==2 && x<6)
  143.                         printf("You are dead.\n");
  144.                 if(atk2==2 && x>=6){
  145.                         system("CLS");
  146.                                 x=x-6;
  147.                                imprime_vida(x);
  148.                         printf("Your debuff was very effective, the uruks died in a second, but you only have %i lives left\n",x-6);
  149.                                 printf("\n\n\nYOU RECOVERED THE RING OF FIRE\n");
  150.                                 ring1=1;
  151.                                 system("PAUSE");
  152.                                 }
  153.                 if(atk2==3){
  154.                         printf("you mind controlled the tougher Uruk that killed the other one easily, also it \nwas easy to kill a mind controlled Uruk\n Though he still damaged you.\n You have %i lives.",x-4);
  155.                         printf("\n\n\nYOU RECOVERED THE RING OF FIRE\n");
  156.                         x=x-4;
  157.                         ring1=1;
  158.                         system("PAUSE");
  159.                         }
  160.         }
  161. system("CLS");
  162. imprime_vida(x);
  163. if(ring1==1 || ring2==1){
  164. printf("Use Magic ring?\n 1 for Yes \n 2 for No\n");
  165. scanf("%i",&ring);
  166. }
  167. if(ring==1 && ring1==1){
  168.         system("CLS");
  169.         imprime_vida(x);
  170. printf("YOU USED THE RING OF FIRE \n");
  171. }
  172. if(ring==1 && ring2==1){
  173.         system("CLS");
  174.         imprime_vida(x);
  175.         printf("YOU USED THE FROST RING\n");
  176. }
  177. if(ring==2){
  178.         system("CLS");
  179.         imprime_vida(x);
  180.         printf("Your journey ended now, you felt too scared to use the power of the ring, so you returned home\n");
  181.         ring1=0;
  182.         ring2=0;
  183. }
  184.         if(ring2==1){
  185.                 system("CLS");
  186.                 imprime_vida(x);
  187.                 printf("You gained a misterious power\n");
  188.                 system("PAUSE");
  189.                 system("CLS");
  190.                 imprime_vida(x);
  191.                 printf("You found a cave, it's probably the best place to stay during the night\n");
  192.                 system("PAUSE");
  193.                 system("CLS");
  194.                 imprime_vida(x);
  195.                 printf(" A huge troll is on your way\n What would you like to do?\n 1- Speak with it\n 2- Attack on stealth\n 3- Find out what he's got cooking\n");
  196.                 scanf("%i",&troll);
  197.                 if(troll==1){
  198.                 printf("TROLL SMASHES!\n");
  199.                 system("PAUSE");
  200.                 system("CLS");
  201.                 imprime_vida(x);
  202.                 printf("Your Frost Ring froze the troll, but now its uneffective\n");
  203.                 ring2=0;
  204.         }
  205.                 if(troll==2 && x>=3){
  206.                         system("CLS");
  207.                         imprime_vida(x);
  208.                         system("PAUSE");
  209.                         printf("\nYou go on stealth towards the troll and stab his back\n");
  210.                         system("PAUSE");
  211.                         system("CLS");
  212.                         imprime_vida(x);
  213.                         printf("TROLL DONT WANT.... \nDIE.....\n");
  214.                         system("PAUSE");
  215.                         system("CLS");
  216.                         imprime_vida(x);
  217.                         printf("\n He dies, but still attacks you\n You have %i lives remaining\n",x-3);
  218.                         x=x-3;
  219.                 }
  220.                 if(troll==2 && x<3){
  221.                         system("CLS");
  222.                         imprime_vida(x);
  223.                         system("PAUSE");
  224.                         printf("You go on stealth towards the troll and stab his back\n");
  225.                         system("PAUSE");
  226.                         system("CLS");
  227.                         imprime_vida(x);
  228.                         printf("You almost died, but your ring activated and froze the troll.\n Your frost ring now is uneffective.\n"); }
  229.                         ring2==0;
  230.                 if(troll==3){
  231.                         system("CLS");
  232.                         imprime_vida(x);
  233.                         printf("Troll speaks:\n \n -Troll cooks **heh** elven soup would you like to try it?\n");
  234.                         system("PAUSE");
  235.                         system("CLS");
  236.                         imprime_vida(x);
  237.                         printf("\n 1 for Yes \n 2 for No\n");
  238.                         scanf("%i",&soup);
  239.                         if(soup==1){
  240.                         printf("You got poisoned and died.\n");
  241.                         x=-1;
  242.                 }
  243.                 if(soup==2){
  244.  
  245.                         system("CLS");
  246.                         imprime_vida(x);
  247.                         printf("You refused to drink the soup.\n");
  248.                         system("PAUSE");
  249.                         system("CLS");
  250.                         imprime_vida(x);
  251.                         printf("TROLL ANGRY!!!\n");
  252.                         system("PAUSE");
  253.                         system("CLS");
  254.                         imprime_vida(x);
  255.                         printf("\nYour ring froze the troll, but now it's uneffective\n");
  256.                         ring2=0;
  257.  
  258.                 }
  259.  
  260.                 }
  261.  
  262.  
  263.         }
  264.  
  265.         if(ring1==1){
  266.                 system("CLS");
  267.                 imprime_vida(x);
  268.                 printf("You gained a misterious power\n");
  269.                 system("PAUSE");
  270.                 system("CLS");
  271.                 imprime_vida(x);
  272.                 printf("Seek the old blood... but beware the frailty of men.\n");
  273.                 system("PAUSE");
  274.                 system("CLS");
  275.                 imprime_vida(x);
  276.                 printf("You found a cave, its the best place to hide during the night.\n");
  277.                 system("PAUSE");
  278.                 system("CLS");
  279.                 imprime_vida(x);
  280.                 printf(" A huge troll is on your way\n What would you like to do?\n 1- Speak with it\n 2- Attack on stealth\n 3- Find out what he's got cooking\n");
  281.                 scanf("%i",&troll);
  282.                 if(troll==1){
  283.                 printf("TROLL SMASHES!\n");
  284.                 system("PAUSE");
  285.                 system("CLS");
  286.                 imprime_vida(x);
  287.                 printf("Your Ring of Fire burnt the troll, but now has less power.\n You have %i lives remaning. \n",x-1);
  288.                 ring1=4;
  289.                 x=x-1;
  290.         }
  291.                 if(troll==2 && x>=4){
  292.                         system("CLS");
  293.                         imprime_vida(x);
  294.                         system("PAUSE");
  295.                         printf("\nYou go on stealth towards the troll and stab his back\n");
  296.                         system("PAUSE");
  297.                         system("CLS");
  298.                         imprime_vida(x);
  299.                         printf("TROLL DONT WANT.... \nDIE.....\n");
  300.                         system("PAUSE");
  301.                         system("CLS");
  302.                         imprime_vida(x);
  303.                         printf("\n He dies, but still attacks you\n You have %i lives remaining\n",x-4);
  304.                         x=x-4;
  305.                 }
  306.                 if(troll==2 && x<4){
  307.                         system("CLS");
  308.                         imprime_vida(x);
  309.                         system("PAUSE");
  310.                         printf("You go on stealth towards the troll and stab his back\n");
  311.                         system("PAUSE");
  312.                         system("CLS");
  313.                         imprime_vida(x);
  314.                         printf("You almost died, but your Fire Ring activated and burnt the troll.\n Your Fire Ring now is less poweful.\n");
  315.                         ring1==4;}
  316.                 if(troll==3){
  317.                         system("CLS");
  318.                         imprime_vida(x);
  319.                         printf("Troll speaks:\n \n -Troll cooks **heh** elven soup would you like to try it?\n");
  320.                         system("PAUSE");
  321.                         system("CLS");
  322.                         imprime_vida(x);
  323.                         printf("\n 1 for Yes \n 2 for No\n");
  324.                         scanf("%i",&soup);
  325.                         if(soup==1){
  326.                         printf("You got poisoned and died.\n");
  327.                         x=-1;
  328.                 }
  329.                 if(soup==2){
  330.  
  331.                         system("CLS");
  332.                         imprime_vida(x);
  333.                         printf("You refused to drink the soup.\n");
  334.                         system("PAUSE");
  335.                         system("CLS");
  336.                         imprime_vida(x);
  337.                         printf("TROLL ANGRY!!!\n\n");
  338.                         system("PAUSE");
  339.                         system("CLS");
  340.                         imprime_vida(x);
  341.                         printf("\nYour fire ring burnt the troll to ashes, but now it's less powerful.\n");
  342.                         ring2=4;        }
  343.                                 }
  344.                 }
  345.                 system("CLS");
  346.                 x=0;
  347.                 system("CLS");
  348.                 imprime_vida(x);
  349.                 printf("And remember... \n this was just a mere dream... \n");
  350.         system("PAUSE");
  351. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement