Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <string>
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- int PHealth;
- int sodaConsumed = 0;
- bool suitFound = false;
- bool canFound = false;
- //FUNCTIONS
- void preGame();
- void emptySoda();
- void sodaSearch();
- void sodaDrink();
- void monsterFight();
- void endGame();
- //THIS IS THE SOUND THAT PLAYS UPON VARIOUS THINGS OCCURING
- void actionSound(){
- Beep(400,100); Beep(500,500);
- }
- //THIS IS THE TUTORIAL AND WHAT-NOT
- int main(){
- srand(time(0));
- string inputM;
- cout << "Welcome to Soda Sipper 1.0!\n\n"; Sleep(2000);
- cout << "Type 'help' for some basic info, or type 'begin' to start the game!" << endl;
- while(true){
- cin >> inputM;
- if(inputM == "help"){
- cout << "Type 'sip' to drink from your soda!\nType 'punch' to punch monsters!\nType 'search' to search for more sodas!\n\n"; Sleep(4000);
- cout << "Drinking an entire soda will restore your health!\nDrink all five sodas to win the game!\n(NOTE): Type all commands in lowercase!\n\n"; Sleep(2500); system("Pause");
- cout << endl; Sleep(3000);
- preGame();
- }
- else if(inputM == "begin"){
- preGame();
- }
- else{
- cout << "Wha? Say that again, young man?\n";
- }
- }
- }
- //THIS IS THE PREGAME. IT JUST SERVES TO GIVE SOME BACKSTORY
- void preGame(){
- string inputPG;
- cout << "\nIt all began on a seemingly normal day... just before tragedy struck.\n\n"; Sleep(3000);
- cout << "Me: \"Ah! I do enjoy a refreshing soda on such a hot day!\"\n"; Sleep(3000);
- cout << "Me: \"In fact, I think I'll take a SIP of my soda right now!\"" << endl;
- while(true){
- cin >> inputPG;
- if(inputPG=="sip"){
- actionSound();
- emptySoda();
- }
- else{
- cout << "Me: \"Ow! I hit my ear by mistake! Better try again!\"\n";
- }
- }
- }
- //THIS IS WHAT RUNS WHEN THE USER SIPS ALL OF HIS SODA
- void emptySoda(){
- //THIS RESETS THE USERS HEALTH AND CHECKS IF HE HAS DRUNKEN THE GOLDEN SODA
- if(canFound == true){
- PHealth = 15;
- }
- else{
- PHealth = 10;
- }
- string inputES;
- cout << "Me: \"Ah! How refreshing!\"\n"; Sleep(3000);
- cout << "Me: \"Huh?\"\n";Sleep(2000);
- cout << "Me: \"Oh no, my soda's empty! I need SEARCH for more soda pronto!\"\n"; Sleep (2000);
- while(true){
- cin >> inputES;
- if(inputES == "search"){
- sodaSearch();
- }
- else{
- cout << "Me: \"I have no time to do that! I need more soda!\"\n";
- }
- }
- }
- //THIS IS WHAT RUNS WHEN THE USER SEARCHES FOR MORE SODAS. MOST OF THE TIME WACKY THINGS HAPPEN!
- void sodaSearch(){
- while(true){
- int randomEvent = rand() % 12 + 1;
- string inputSS;
- switch(randomEvent){
- case 1:
- cout << "You see a man on a dock drinking a soda.\n"; Sleep(3000);
- cout << "Me: \"Give me that soda!\"\n"; Sleep(3000);
- cout << "Dirty-No-Good-Soda-Hoarder: \"Huh?\"\n"; Sleep(3000);
- cout << "Me: \"You asked for it!\"\n"; Sleep(3000);
- cout << "*PUNCHED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 2:
- cout << "You see an old woman standing outside a gas station.\n"; Sleep(3000);
- cout << "Me: \"Hey, old lady!\"\n"; Sleep(3000);
- cout << "Cheap-Old-Hag: \"Can I help you sonny?\"\n"; Sleep(3000);
- cout << "Me: \"Go buy me a soda from that store!\"\n"; Sleep(3000);
- cout << "Cheap-Old-Hag: \"Oh my. I'd love to, but I need this money to get home!\"\n"; Sleep(3000);
- cout << "Me: \"You need to get your priorities straight, lady!\"\n"; Sleep(3000);
- cout << "*TRIPPED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 3:
- cout << "You see a little boy drinking a soda.\n"; Sleep(3000);
- cout << "Me: \"Give me that soda, you little creep!\"\n"; Sleep(3000);
- cout << "Creepy-Little-Boy: \"Okay.\"\n"; Sleep(3000);
- cout << "*OKAYED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 4:
- cout << "You see a vending machine on the side of a road.\n"; Sleep(3000);
- cout << "Me: \"Give me one of your delicious sodas, metal monstrocity!\"\n"; Sleep(3000);
- cout << "Tightwad-Machine: \"PLEASE INSERT ONE DOLLAR USD\"\n"; Sleep(3000);
- cout << "Me: \"Do you take British Pounds?\"\n"; Sleep(3000);
- cout << "*POUNDED!*\n"; actionSound(); Sleep(3000);
- cout << "Tightwad-Machine: \"ERROR! PLEASE INSERT ONE DOLLAR USD\"\n"; Sleep(3000);
- cout << "Me: \"LONG LIVE THE QUEEN!\"\n"; Sleep(3000);
- cout << "*TIPPED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 5:
- cout << "You see a superhero flying overhead.\n"; Sleep(3000);
- cout << "Me: \"Hey, I need help!\"\n"; Sleep(3000);
- cout << "Super-Chump: \"Is there a problem, citizen?\"\n"; Sleep(3000);
- cout << "Me: \"I need a soda pronto!\"\n"; Sleep(3000);
- cout << "Super-Chump: \"You disctracted me from my heroic efforts for a soda?\"\n"; Sleep(3000);
- cout << "Me: \"You don't understand! I need a soda or I'll DIE!\"\n"; Sleep(3000);
- cout << "Super-Chump: \"Egads! I'll never let Hypoglycemia Man take another life!\"\n"; Sleep(3000);
- cout << "*SAVED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 6:
- cout << "You see a soda in someone's home.\n"; Sleep(3000);
- cout << "Selfish-Whore: \"What are you doing in my home?!\"\n"; Sleep(3000);
- cout << "Me: \"You're house? Don't be selfish!\"\n"; Sleep(3000);
- cout << "*SLAPPED*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 7:
- cout << "You see a toddler holding a soda.\n"; Sleep(3000);
- cout << "Me: \"Hand over the soda!\"\n"; Sleep(3000);
- cout << "Bastard-Child: \"No!\"\n"; Sleep(3000);
- cout << "Me: \"Respect your elders!\"\n"; Sleep(3000);
- cout << "*PUNTED*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 8:
- cout << "You find a soda in a dumpster.\n"; Sleep(3000);
- cout << "*SCAVENGED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 9:
- cout << "You come across a magical genie's lamp.\n"; Sleep(3000);
- cout << "*RUBBED!*\n"; actionSound(); Sleep(3000);
- cout << "Smart-ass-Genie: \"What is it you desi-\"\n"; Sleep(500);
- cout << "Me: \"GIVE ME A SODA. NOW.\"\n"; Sleep(3000);
- cout << "Smart-ass-Genie: \"Umm... are you certai-\"\n"; Sleep(500);
- cout << "Me: \"I SAID NOW.\"\n"; Sleep(3000);
- cout << "*WISHED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- case 10:
- cout << "You come across a hobo sleeping near a soda.\n"; Sleep(3000);
- cout << "Me: \"Give me that soda!\"\n"; Sleep(3000);
- cout << "Filthy-No-Good-Hobo: *Snore*\n"; Sleep(3000);
- cout << "Me: \"Don't sass me!\"\n"; Sleep(3000);
- cout << "*SHANKED!*\n"; actionSound(); Sleep(3000);
- cout << "Soda acquired!\n"; Sleep(3000);
- sodaDrink();
- break;
- //THESE ARE THE SPECIAL ITEMS THE USER CAN FIND
- case 11:
- if(suitFound == false){
- suitFound = true;
- cout << "You see an object gleaming in the distance...\n"; Sleep(3000);
- cout << "Me: \"Could it be? Are the legends true?...\"\n"; Sleep(3000);
- cout << "Me: \"Oh my Soda! It's real! The Suit of a Thousand Soda Cans!\"\n"; Sleep(3000);
- cout << "Soda Suit acquired! All damage negated by 1!\n"; actionSound(); Sleep(3000);
- cout << "Me: \"This is great, but I still need to SEARCH for more sodas.\"\n"; Sleep(3000);
- cin >> inputSS;
- if(inputSS == "search"){
- sodaSearch();
- }
- else{
- cout << "Me: \"I have no time to do that! I need more soda!\"\n";
- }
- }
- else{
- sodaSearch();
- }
- case 12:
- if(canFound == false){
- canFound = true;
- cout << "You see a shiny object in the distance.\n"; Sleep(3000);
- cout << "Me: \"Hmm? Ooh... OOOHHH! Is... is that possibly?...\"\n"; Sleep(3000);
- cout << "Me: \"It is! The Golden Soda of Armirae! I thought it was only a legend!\"\n"; Sleep(3000);
- cout << "Golden Soda acquired! Health increased by 5!\n"; actionSound(); Sleep(3000);
- sodaDrink();
- }
- else{
- sodaSearch();
- }
- }
- }
- }
- //THIS IS WHAT ALLOWS THE USER TO DRINK HIS SODA
- void sodaDrink(){
- string inputSD;
- string coolSayings[10] = {"Delicious!","Tasty!","Orgasmic!","Refreshing!","Cool!","Super!","Mmmm!","Oh yes!","Oh God, yes!","Perfect!"};
- cout << "Me: \"Gee, I sure can't wait to SIP on this soda!\"\n"; Sleep(3000);
- for(int sipCounter = 0; sipCounter < 10; sipCounter++){
- while(true){
- //THIS CAUSES MONSTERS TO APPEAR WHILE YOU ENJOY YOUR SODA
- int randMonster = rand()%10;
- if(randMonster == 5){
- monsterFight();
- }
- else{
- cin >> inputSD;
- if(inputSD == "sip"){
- cout << "Me: \"" << coolSayings[rand()% 10] << "\"" << endl; actionSound();
- break;
- }
- else{
- cout << "Me: \"I have no time for that! I need to drink my soda!\"\n";
- }
- }
- }
- }
- //THIS COUNTS THE AMOUNT OF SODA THE USER HAS DRUNKEN(DRANK?)
- sodaConsumed++;
- if (sodaConsumed == 5){
- endGame();
- }
- else{
- emptySoda();
- }
- }
- //THIS IS THE COMBAT SIMULATOR
- void monsterFight(){
- string inputMF;
- int MHealth = 10;
- string attackSayings[6] = {"\"Take this!\"", "\"Taste justice!\"","\"Have at you!\"","\"Hiya!\"","\"Kapow!\"", "\"Take this, fiend!\""};
- string attackS = attackSayings[rand() % 6];
- string enemyList[10] = {"Zombie", "Baby", "Bucket", "Cop", "Vampire", "Rock", "Car", "Mouse", "Dog", "Man"};
- string enemy = enemyList[rand() % 10];
- Sleep(3000);
- cout << "Me: \"Egad! That " << enemy << " is coming straight at me!\"\n"; Sleep(3000);
- cout << "Me: \"He's probably trying to sip on my delicious soda!\"\n"; Sleep(3000);
- cout << "Me: \"I better PUNCH him before he gets the chance!\"\n"; Sleep(3000);
- while(true){
- int PDamage = rand() % 4 + 1;
- int MDamage;
- //THIS CHECKS IF THE USER HAS FOUND THE SODA-SUIT
- if(suitFound == true){
- MDamage = rand() % 2;
- }
- else{
- MDamage = rand() % 3;
- }
- cin >> inputMF;
- if(inputMF == "punch"){
- cout << "Me: " << attackS; MHealth -= PDamage; Sleep(3000);
- cout << "You hit " << enemy << " for " << PDamage << " damage!\n"; actionSound(); Sleep(3000);
- if(MHealth > 0){
- PHealth -= MDamage;
- cout << enemy << " hit you for " << MDamage << " damage!\n"; actionSound(); Sleep(3000);
- cout << "Me: \"You'll regret that!\"\n";
- if(PHealth <= 0){
- cout << enemy << " cheated and somehow managed to kill you.\n"; Sleep(3000);
- cout << "GAME OVER! YOU LOST!\n"; Sleep(3000);
- exit(EXIT_FAILURE);
- }
- }
- else{
- cout << enemy << " is dead! What a loser!\n"; Sleep(3000);
- cout << "Me: \"Woo! Glad that's over! Now, back to my soda!\"\n"; Sleep(3000);
- break;
- }
- }
- else{
- cout << "Me: \"I cant do that! I have to defend my soda!\"\n";
- }
- }
- }
- //THIS IS THE END GAME
- void endGame(){
- cout << "Me: \"Ah, my thirst is now quenched!\"\n"; Sleep(3000);
- cout << "Me: \"Welp, off to work!\"\n"; Sleep(3000);
- cout << "GAME OVER! YOU WIN!\n"; Sleep(3000);
- exit(EXIT_FAILURE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement