Advertisement
XOptimistixX

Cookie Clicker Alpha 0.12

Jul 24th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdbool.h>
  4.  
  5. int main()
  6. {
  7.     int amountOfCookies=0, cookiePower=10, alternateCookiePower;
  8.     int cookieInputNumber=1, alternateCookieInputNumber, shopAccessNumber=0;
  9.     int showCookiesNumber=2, changeControlsNumber=101, showControlsNumber=100, quitGameNumber=69;
  10.     int cookieModeInput, shopModeInput;
  11.     int cursorNumber=0, cursorPrice, bakerNumber=0, bakerPrice;
  12.     bool saveCode=0, intro=1, changeControls=0, keepControls=0, correctControls=0, quitGame=0, inGame=1, cookieMode=1, shopMode=0, shopEnteredBefore=0, boughtSomething=1, firstTimeAtIntro=1;;
  13.     printf("Welcome to Cookie Clicker!\nDo you have a save code?(1 for yes, 0 for no).\n");
  14.     scanf("%d", &saveCode);
  15.     if (saveCode==1)
  16.     {
  17.         intro=0;
  18.         scanf("%d %d %d", &amountOfCookies, &cursorNumber, &bakerNumber);
  19.         cookiePower+=cursorNumber;
  20.     }
  21.     else if (saveCode!=0)
  22.     printf("Please try again!");
  23.     if (intro==1)
  24.     {
  25.         printf("In the beginning, you get 1 cookie each time.\nYou can buy things to help you with getting more cookies.\n");
  26.         printf("In case you want to other controls, \ntype in %d anywhere during the game.\n", showControlsNumber);
  27.         printf("Do you wish to change the default controls?(1 for yes, 0 for no)\n");
  28.         scanf("%d", &changeControls);
  29.         if (changeControls==0)
  30.         {
  31.             printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTo click a cookie, use %d\nTo go to the shop, use %d\n", cookieInputNumber, shopAccessNumber);
  32.             intro=0;
  33.         }
  34.     }
  35.     while (quitGame==0)
  36.     {
  37.         while (changeControls==1)
  38.         {
  39.         printf("What number do you want to use to click the cookies?(default \"%d\")\n",cookieInputNumber);
  40.         scanf("%d",&cookieInputNumber);
  41.         printf("What number for shop?(default \"%d\")\n", shopAccessNumber);
  42.         scanf("%d",&shopAccessNumber);
  43.         if (shopAccessNumber!=cookieInputNumber)
  44.             correctControls=1;
  45.         while (correctControls==0)
  46.         {
  47.             printf("You can't do that. Please try again");
  48.             scanf("%d", &shopAccessNumber);
  49.             if (shopAccessNumber!=cookieInputNumber)
  50.                 correctControls=1;
  51.         }
  52.         printf("What number do you want to use to show\nthe amount of cookies you have at anytime(default \"%d\")?\n", showCookiesNumber);
  53.         scanf("%d", &showCookiesNumber);
  54.         printf("Do you want to keep these controls?(1 for yes, 0 for no)\n");
  55.         scanf("%d", &keepControls);
  56.         changeControls=!keepControls;
  57.         if (changeControls==0)
  58.             inGame=1;
  59.             printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  60.         }
  61.         if (firstTimeAtIntro==1)
  62.         {
  63.             printf("Start fabricating cookies!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  64.             firstTimeAtIntro=0;
  65.         }
  66.         else
  67.             printf("Get back to cookie fabricating!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  68.         alternateCookieInputNumber=cookieInputNumber*11;
  69.         while(inGame==1)
  70.         {
  71.             while(cookieMode==1)
  72.             {
  73.                 if (shopEnteredBefore==1)
  74.                     printf("Welcome back to your cookie fabricator!\n");
  75.                 alternateCookiePower=cookiePower*2;
  76.                 scanf("%d",&cookieModeInput);
  77.                 if (cookieModeInput==cookieInputNumber)
  78.                 {
  79.                     amountOfCookies+=cookiePower;
  80.                     if (cookiePower==1)
  81.                     printf("Made %d cookie!\n", cookiePower);
  82.                     else
  83.                     printf("Made %d cookies!\n", cookiePower);
  84.                 }
  85.                 else if (cookieModeInput==alternateCookieInputNumber)
  86.                 {
  87.                     amountOfCookies+=alternateCookiePower;
  88.                     printf("Made %d cookies!\n", alternateCookiePower);
  89.                 }
  90.                 else if (cookieModeInput==showCookiesNumber)
  91.                     printf("Cookies: %d\n", amountOfCookies);
  92.                 else if (cookieModeInput==shopAccessNumber)
  93.                 {
  94.                     cookieMode=0;
  95.                     shopMode=1;
  96.                 }
  97.                 else if (cookieModeInput==changeControlsNumber)
  98.                 {
  99.                     changeControls=1;
  100.                     cookieMode=0;
  101.                     inGame=0;
  102.                 }
  103.                 else if (cookieModeInput==quitGameNumber)
  104.                 {
  105.                     cookieMode=0;
  106.                     inGame=0;
  107.                     quitGame=1;
  108.                 }
  109.                 else if (cookieModeInput==showControlsNumber)
  110.                 {
  111.                     printf("To click cookies: %d\nTo show amount of cookies: %d\n", cookieInputNumber, showCookiesNumber);
  112.                     printf("To go to the shop: %d\nTo change controls: %d\n", shopAccessNumber, changeControlsNumber);
  113.                     printf("To show controls again: %d\nTo quit the game: %d\n", showControlsNumber, quitGameNumber);
  114.                     printf("Got it? Ok resume collecting cookies!\n");
  115.                 }
  116.             }
  117.             if (shopMode==1)
  118.             {
  119.                 if (shopEnteredBefore==0)
  120.                 {
  121.                     printf("Welcome to the shop!(Exit:0)\n");
  122.                     shopEnteredBefore=1;
  123.                 }
  124.                 else
  125.                     printf("Welcome back to the shop!\n");
  126.                 while (shopMode==1)
  127.                 {
  128.                     cursorPrice=500+(cursorNumber*cursorNumber*400);
  129.                     bakerPrice=1000+(cursorNumber*cursorNumber*600);
  130.                     if (boughtSomething==1)
  131.                     {
  132.                         printf("Cookies: %d\n\n", amountOfCookies);
  133.                         printf("Number\t\t%-4s\t\t%-10s", "Name", "Price\t\tYou Have\tAdded CPC\n");
  134.                         printf("<1>\t\t%s(1)\t%-d\t\t%d\t\t%d\n", "Cursor", cursorPrice, cursorNumber, cursorNumber);
  135.                         printf("<2>\t\t%s(5)\t%-d\t\t%d\t\t%d\n", "Baker", bakerPrice, bakerNumber, bakerNumber*5);
  136.                     }
  137.                     else
  138.                         printf("You only have %d cookies.\n", amountOfCookies);
  139.                     scanf("%d",&shopModeInput);
  140.                     if (shopModeInput==1)
  141.                     {
  142.                         if (amountOfCookies>=cursorPrice)
  143.                         {
  144.                             printf("You bought 1 Cursor for %d\n", cursorPrice);
  145.                             cursorNumber++;
  146.                             cookiePower++;
  147.                             amountOfCookies-=cursorPrice;
  148.                             boughtSomething=1;
  149.                         }
  150.                         else
  151.                         {
  152.                             printf("You don't have enough cookies.\n");
  153.                             boughtSomething=0;
  154.                         }
  155.                     }
  156.                     else if (shopModeInput==2)
  157.                     {
  158.                         if (amountOfCookies>=bakerPrice)
  159.                         {
  160.                             printf("You bought 1 Baker for %d\n", bakerPrice);
  161.                             cursorNumber++;
  162.                             cookiePower++;
  163.                             amountOfCookies-=bakerPrice;
  164.                             boughtSomething=1;
  165.                         }
  166.                         else
  167.                         {
  168.                             printf("You don't have enough cookies.\n");
  169.                             boughtSomething=0;
  170.                         }
  171.                     }
  172.                     else if (shopModeInput==0)
  173.                     {
  174.                         printf("You have exit the shop.\n");
  175.                         shopMode=0;
  176.                         cookieMode=1;
  177.                     }
  178.                 }
  179.             }
  180.         }
  181.     }
  182.     printf("Keep this code safe.\n");
  183.     printf("%d %d %d\n", amountOfCookies, cursorNumber, bakerNumber);
  184.     return 0;
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement