From 752b590b5e3b6a708a0933e87a7713eda83a44f1 Mon Sep 17 00:00:00 2001 From: Jasleen Villamil Date: Tue, 5 Jan 2021 21:16:40 -0500 Subject: [PATCH 1/3] Making sure this gets saved, unlike my original work RIP --- .gitignore | 1 + package-lock.json | 127 +++++++++++++++++++++++++++++++++++++++++- package.json | 1 + storyline.txt | 57 +++++++++++++++++++ textBasedAdventure.js | 78 +++++++++++++++++++++++++- 5 files changed, 260 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 storyline.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4e5e2be..1082e20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,138 @@ { "name": "FSW-Text-Based-Adventure", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "chalk": "^4.1.0", + "readline-sync": "^1.4.10" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + } + }, "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, "readline-sync": { "version": "1.4.10", "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } } } } diff --git a/package.json b/package.json index 8e8b06f..ec48514 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "homepage": "https://github.com/joinpursuit/FSW-Text-Based-Adventure#readme", "dependencies": { + "chalk": "^4.1.0", "readline-sync": "^1.4.10" } } diff --git a/storyline.txt b/storyline.txt new file mode 100644 index 0000000..e4369aa --- /dev/null +++ b/storyline.txt @@ -0,0 +1,57 @@ +/* Game gist, You're an Uber driver with a magical secret. You read your tarot for the day. + It say's "You will meet someone that can kill you or bring you great fortune" + Do you want to drive tonight? Y/N + + If yes What is your magical secret, dont worry I wont tell aynyone. + A)Create fire - most powerfull attack , weak defense + b)Create water - even defense and attac + c)Manipulate earth - high defense, low attack + d)Make things invisible - high defense, no attack, can escape + + if no gameover + +1)Do you want to prepare food before leaving, or just buy food once you're outside? +A) Prepare = Make some sandwiches, grabs some snacks, fill up your water bottle. Fill your gas tank before starting. keeps car when being chased. +B) Eventually will get low on gas when being chased will lose car + +2)Where do you want to turn on the app and start your shift? +( Goals is to get a long trip) Do Math.random and perecentage? if below .5 then short trip, +a) Start where your car is parked. You have a 50/50 chance of getting a long or short trip with a small wait time. 50 percent chance +b) Start in a rich area where you most likely wait a while to get long distance trips. 75 percent chance +c) Start in a populated area where youre likely to get multiple short trips and make more money quicker 10 percent chance + +3)If short trip: you pick up what looks like a couple with their two cute kids. Thankfully they all have mask. +"Hi, for Angel?" +The man says yes and loudly tells the two kids to hurry up getting in. You put the radio on. 103.5ktu cause its more kid friendly +Looking in the passenger window expecatantly he ask, "Can I sit in the front?" +You tell him: +A) Sure, just keep the window open.- Once sitting he ask "Busy day?" +"Not really, but it's a beautiful day out here, hows your day going?" +He ends up coughing heavily , taking off his mask, saying man, "I cant breathe we these things on." +1)Do you tell him to put it on? yes/no +a)yes- You end up having a day of averegae trips, thinking of course the tarot was balogney, and up getting covid. +B)No, Uber made a rule for covid that no one can sit in the front - he angrily sits in the back with a kid on his lap. +His energy feels very off. But you can't pinpoint it, so you feel uneasy the whole ride. +You end up having a productive day of average trips, but think the tarot was balogney + +4)If long trip: +Looks like you got a long trip, says 1hr 33 mins. This is a great way to start your day! You happily drive to the pick up location. +A women with a powerful aura gets into your car. She's dressed to the nines and her perfume is lovely. + "Hi, for Jema?" + "Yes, Hi, how are you?" + "Good, good, and you? Any music you prefer?" + "No, play want you want." + "Cool, I'm listening to the real catch me if you can guy tell his story." + She chuckles, "Ah, I saw that movie with Leonadrio Decaprio, sounds good!" + +You notice she radiates a strong magical aura and it's starting to make you feel uneasy. +You wonder if your magic could fend her off is she tries to kill you, but quickly dismiss the thought. She was polite. +Her phone rings, so you lower your podcast. + +You hear her say, " Yes...no...I'm leaving...someone's after me?...How long?...Now that you mention it...I'll figure it out. Thank you! Bye!" +You put your podcast back up to act like you werent listening, but you hear her sigh deeply. + +Suddenly time slows down immensly. You see as every objects looks like it was stuck in jello. + + +So much */ \ No newline at end of file diff --git a/textBasedAdventure.js b/textBasedAdventure.js index d392b19..4e7bbc0 100644 --- a/textBasedAdventure.js +++ b/textBasedAdventure.js @@ -1,5 +1,77 @@ -const readline1 = require('readline-sync') +const rls = require('readline-sync') +const chalk = require('chalk') +const uberBlack = 0 +const uberXL = 0 +const uberX = 0 +let passengers = 0 +let money = 0 +let longTrips = 0 +let shortTrips = 0 +let waitTime = 0 +let luck = 0 +let music = 0 +let podcast = 0 +let noConvo = 0 +let convo = 0 -let nameInput = readline.question("Enter your name: ") -console.log(`Hello ${nameInput}! Welcome to my game.`) +let name = rls.question("Enter your name: ") + +//1 Initial Welcome + Directions, You're an Uber driver, trying to meet your quote for the day. Want to play yes or no? + +function startGame() { + console.log(`\nHi ${name}, in this game you need to make your daily quota as an Uber Driver.\n + It's a combination of skill and luck, but your decisions are key! \n + There will be 3 types of prompts: Y/N(Yes or No), type in, or select 0-3 from the list.\n + After each prompt you need to press enter.\n `) + if(rls.keyInYNStrict("\nThink you can make it?")) { + console.log(`\nGreat let's get on the road!\n`) + beginShift() + }else { + leaveGame() + } + +} + + +startGame() +//2 Choose what car youre driving uberbBack (long trips), uberXL(more short trips), uberX (equal long/short) +//3 Choose how many hours what hours you're working 8, 10, 12 (3 passengers total * hours less hours more luck) +//4 Choose where you're starting your app rich, populated, current (wait times) +function beginShift() { + + +} + +function leaveGame(){ + console.log(`\nGuess luck wasn't on your side. See you next time!\n`) + process.exit() + +} + +//5 random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) +//6 passenger one conversation (engage in conversation no conversation +1, conversation +2) +function firstPassenger(){ + +} + +//5 random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) +//6 passenger one conversation (engage in conversation no conversation +1, conversation +2) +function secondPassenger(){ + +} + +//5 random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) +//6 passenger one conversation (engage in conversation no conversation +1, conversation +2) +function thirdPassenger(){ + +} + +//whethere you get a long or short trip +function trips(){ + +} + +function quota(){ + +} From d025ef3d648b06ec3171a0628dcddac25e326539 Mon Sep 17 00:00:00 2001 From: Jasleen Villamil Date: Wed, 6 Jan 2021 08:58:07 -0500 Subject: [PATCH 2/3] save point where everything is functioning --- textBasedAdventure.js | 353 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 323 insertions(+), 30 deletions(-) diff --git a/textBasedAdventure.js b/textBasedAdventure.js index 4e7bbc0..265dd05 100644 --- a/textBasedAdventure.js +++ b/textBasedAdventure.js @@ -1,18 +1,21 @@ const rls = require('readline-sync') -const chalk = require('chalk') -const uberBlack = 0 -const uberXL = 0 -const uberX = 0 -let passengers = 0 +// const chalk = require('chalk') +// let introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?", +// let musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] +// let conversationOptions = ["start","wait","no conversation"] +// let dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] +// let endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] +// // let shortTripsCount = 0 +// let longTripsCount = 0 +// const shortTrip = 0 +// const longTrip = 0 +// // let trips = 0 +// let totalTrips = 0 let money = 0 -let longTrips = 0 -let shortTrips = 0 -let waitTime = 0 -let luck = 0 -let music = 0 -let podcast = 0 -let noConvo = 0 -let convo = 0 +let longTripsLuck = 0 +let shortTripsLuck = 0 +let trip = 0 + let name = rls.question("Enter your name: ") @@ -20,58 +23,348 @@ let name = rls.question("Enter your name: ") //1 Initial Welcome + Directions, You're an Uber driver, trying to meet your quote for the day. Want to play yes or no? function startGame() { - console.log(`\nHi ${name}, in this game you need to make your daily quota as an Uber Driver.\n + console.log(`\nHi ${name}, in this game you need to make your daily quota as an Uber Driver in a 12 hour shift.\n It's a combination of skill and luck, but your decisions are key! \n There will be 3 types of prompts: Y/N(Yes or No), type in, or select 0-3 from the list.\n After each prompt you need to press enter.\n `) if(rls.keyInYNStrict("\nThink you can make it?")) { console.log(`\nGreat let's get on the road!\n`) - beginShift() + chooseCar() + startApp() + firstPassenger() + secondPassenger() + }else { leaveGame() } } - startGame() + //2 Choose what car youre driving uberbBack (long trips), uberXL(more short trips), uberX (equal long/short) -//3 Choose how many hours what hours you're working 8, 10, 12 (3 passengers total * hours less hours more luck) -//4 Choose where you're starting your app rich, populated, current (wait times) -function beginShift() { +function chooseCar() { + console.log(`What car are you driving? Type in a number`) + let carOptions = ['Toyota Camry', 'Toyota Sienna','Cadillac XTS'] + let carChoice= rls.keyInSelect(carOptions) + + if (carOptions[carChoice] === 'Toyota Camry'){ + longTripsLuck = 5 + shortTripsLuck = 5 + moneyLuck = 5 + console.log("Ah, I see you're driving a Camry! You have an equal chance of long and short trips.") + + + + } else if (carOptions[carChoice] === 'Toyota Sienna'){ + longTripsLuck = 3 + shortTripsLuck = 7 + moneyLuck = 5 + console.log("Ah, I see you're driving a Sienna! You have a higher chance for short trips!") + + + + } else if (carOptions[carChoice] === 'Cadillac XTS'){ + longTripsLuck = 7 + shortTripsLuck = 3 + moneyLuck = 7 + console.log("Ah, I see you're driving a Cadillac! You have a higher chance for long trips!") + + + } else { + leaveGame() + } +} + +//4 Choose where you're starting your app rich, populated, current // how may trips you'll get for the day +function startApp(){ + let locationOption = ['Rich Area', 'Shopping District','Parking Spot'] + console.log("I see you're in you car now. Where do you turn on your app? Pick a number") + let startLocation = rls.keyInSelect(locationOption) + if (locationOption[startLocation] === 'Rich Area'){ + let trip = richAreaFunction() + // longTripsCount > shortTripsCount + + // longTripsCount = (longTripsLuck * (Math.random() * 10) * (getRandom(200,350))) + // shortTripsCount = (shortTripsLuck * (Math.random() * 2)) * (getRandom(50,150)) + // totalTrips = longTripsCount + shortTripsCount + // console.log('Starting from a rich area means you have a higher chance to start with a long trip, but longer wait time between trips') + + }else if (locationOption[startLocation] === 'Shopping District'){ + let trip = shoppingDistrictFunction() + + // longTripsCount = (longTripsLuck * (Math.random() * 6)) * (getRandom(200,350)) + // shortTripsCount = (shortTripsLuck * (Math.random() * 12)) * (getRandom(50,150)) + // totalTrips = longTripsCount + shortTripsCount + + } else if (locationOption[startLocation] === 'Parking Spot'){ + let trip = parkingSpotFunction() + + // longTripsCount = (longTripsLuck * (Math.random() * 6)) * (getRandom(200,350)) + // shortTripsCount = (shortTripsCount * (Math.random() * 6)) *(getRandom(50,150)) + // totalTrips = longTripsCount + shortTripsCount + + }else { + leaveGame() + } } -function leaveGame(){ - console.log(`\nGuess luck wasn't on your side. See you next time!\n`) - process.exit() +function richAreaFunction(trip, longTripsLuck, shortTripsLuck){{ + if ((longTripsLuck * 5) > (shortTripsLuck * 2)) { + return trip = 'long trip' + } else { + return trip = 'short trip' + } + } + + } + + + function shoppingDistrictFunction(trip,longTripsLuck, shortTripsLuck) { + if ((Math.random() * (longTripsLuck * 2)) > (Math.random() * (shortTripsLuck * 5))) { + return trip = 'long trip' + } else { + return trip = 'short trip' + } + + + } + + +function parkingSpotFunction(trip, longTripsLuck, shortTripsLuck){ + if ((Math.random() * (longTripsLuck * 3)) > (Math.random() * (shortTripsLuck * 5))) { + return trip = 'long trip' + } else { + return trip ='short trip' + } + } + +function getRandom(min,max) { + return Math.random() * (max - min) + min } -//5 random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) + +///3 Choose how many hours what hours you're working 8, 10, 12 (3 passengers total * hours less hours more luck) + + + + +//5 3 choice per passenger random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) //6 passenger one conversation (engage in conversation no conversation +1, conversation +2) +//while loops use to determine set of given answers +// let introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?", +// let musicOptions = ["play radio station", "shuffle your music","play science podcast", "play self-help podcast", "play specific choices from your music"] +// let conversationOptions = ["start conversation","wait to passenger starts conversation","no conversation"] +// let dialogueOptions = ["Talk about their day", "Talk about music", "Talk about podcast", "Ask about goals","Ask about Secrets","Say random silly fact"] +// let endTripOptions = ["Say nothing", "Thank you, hope you have a good day!", "Thanks for talking with me, hope you have a good day!", "Be safe"] function firstPassenger(){ - + if(trip === 'long trip') { + console.log(`"You're using autoaccept, and get a ding for your first passenger! It's 5 min away.\n + Upon arriving, you notice it looks like a a couple and their kids. + They open your back door. You ask, "Hi, for Angel?" + The man says yes and loudly tells the two kids to hurry up getting in. What do you do next? + Looking in the passenger window expecatantly he ask, "Can I sit in the front?" + What do you say to him?`) + introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?"] + musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] + conversationOptions = ["start","wait","no conversation"] + dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] + endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] + + passOne1 = rls.keyInSelect(introductionOptions) + passOne2 = rls.keyInSelect(conversationOptions) + passOne3 = rls.keyInSelect(dialogueOptions) + passOne4 = rls.keyInSelect(endTripOptions) + passOne5 = rls.keyInSelect(musicOptions) + + } else { + console.log(` Sure, just keep the window open.- Once sitting he ask "Busy day?" + "Not really, but it's a beautiful day out here, hows your day going?" + He ends up coughing heavily , taking off his mask, saying man, "I cant breathe we these things on." + + Do you tell him to put it on? yes/no + yes- You end up having a day of averegae trips, thinking of course the tarot was balogney, and up getting covid. + + No, Uber made a rule for covid that no one can sit in the front - he angrily sits in the back with a kid on his lap. + His energy feels very off. But you can't pinpoint it, so you feel uneasy the whole ride. + You end up having a productive day of average trips, but think the tarot was balogney`) + introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?"] + musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] + conversationOptions = ["start","wait","no conversation"] + dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] + endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] + + passOne1 = rls.keyInSelect(introductionOptions) + passOne2 = rls.keyInSelect(conversationOptions) + passOne3 = rls.keyInSelect(dialogueOptions) + passOne4 = rls.keyInSelect(endTripOptions) + passOne5 = rls.keyInSelect(musicOptions) +} } + -//5 random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) +//5 3 choices per passenger random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) //6 passenger one conversation (engage in conversation no conversation +1, conversation +2) +//for loops used to determine if this was a long or short trrip +// let introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?", +// let musicOptions = ["play radio station", "shuffle your music","play science podcast", "play self-help podcast", "play specific choices from your music"] +// let conversationOptions = ["start conversation","wait to passenger starts conversation","no conversation"] +// let dialogueOptions = ["Talk about their day", "Talk about music", "Talk about podcast", "Ask about goals","Ask about Secrets","Say random silly fact"] +// let endTripOptions = ["Say nothing", "Thank you, hope you have a good day!", "Thanks for talking with me, hope you have a good day!", "Be safe"] function secondPassenger(){ + console.log() + if(trip === 'short trip') { + console.log(`Looks like you got a short trip! + 3)If short trip: you pick up what looks like a couple with their two cute kids. Thankfully they all have mask. + "Hi, for Angel?" + The man says yes and loudly tells the two kids to hurry up getting in. You put the radio on. 103.5ktu cause its more kid friendly + Looking in the passenger window expecatantly he ask, "Can I sit in the front?" + You tell him: + A) Sure, just keep the window open.- Once sitting he ask "Busy day?" + "Not really, but it's a beautiful day out here, hows your day going?" + He ends up coughing heavily , taking off his mask, saying man, "I cant breathe we these things on." + 1)Do you tell him to put it on? yes/no + a)yes- You end up having a day of averegae trips, thinking of course the tarot was balogney, and up getting covid. + B)No, Uber made a rule for covid that no one can sit in the front - he angrily sits in the back with a kid on his lap. + His energy feels very off. But you can't pinpoint it, so you feel uneasy the whole ride. + You end up having a productive day of average trips, but think the tarot was balogney`) + introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?"] + musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] + conversationOptions = ["start","wait","no conversation"] + dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] + endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] + + passTwo1 = rls.keyInSelect(introductionOptions) + passTwo2 = rls.keyInSelect(conversationOptions) + passTwo3 = rls.keyInSelect(dialogueOptions) + PassTwo4 = rls.keyInSelect(endTripOptions) + passTwo5 = rls.keyInSelect(musicOptions) + money += 15 + + } else (trip === 'long trip') + console.log(`Looks like you got a long trip Looks like you got a long trip, says 1hr 33 mins. This is a great way to start your day! You happily drive to the pick up location. + A women with a powerful aura gets into your car. She's dressed to the nines and her perfume is lovely. + "Hi, for Jema?" + "Yes, Hi, how are you?" + "Good, good, and you? Any music you prefer?" + "No, play want you want." + "Cool, I'm listening to the real catch me if you can guy tell his story." + She chuckles, "Ah, I saw that movie with Leonadrio Decaprio, sounds good!" `) + introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?"] + musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] + conversationOptions = ["start","wait","no conversation"] + dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] + endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] + + passTwo1 = rls.keyInSelect(introductionOptions) + passTwo2 = rls.keyInSelect(conversationOptions) + passTwo3 = rls.keyInSelect(dialogueOptions) + passTwo4 = rls.keyInSelect(endTripOptions) + passTwo5 = rls.keyInSelect(musicOptions) + money += 45 -} -//5 random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) + } + + + + console.log(money) + + + + +//5 3 choice per passenger +//random long/short trip based on above^ Passenger one conversation (play music +2, play podcast +3, no music +1) //6 passenger one conversation (engage in conversation no conversation +1, conversation +2) +// let introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?", +// let musicOptions = ["play radio station", "shuffle your music","play science podcast", "play self-help podcast", "play specific choices from your music"] +// let conversationOptions = ["start conversation","wait to passenger starts conversation","no conversation"] +// let dialogueOptions = ["Talk about their day", "Talk about music", "Talk about podcast", "Ask about goals","Ask about Secrets","Say random silly fact"] +// let endTripOptions = ["Say nothing", "Thank you, hope you have a good day!", "Thanks for talking with me, hope you have a good day!", "Be safe"] function thirdPassenger(){ + if(trip === 'long trip') { + console.log(`"You're using autoaccept, and get a ding for your first passenger! It's 5 min away.\n + Upon arriving, you notice it looks like a a couple and their kids. + They open your back door. You ask, "Hi, for Angel?" + The man says yes and loudly tells the two kids to hurry up getting in. What do you do next? + Looking in the passenger window expecatantly he ask, "Can I sit in the front?" + What do you say to him?`) + introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?"] + musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] +conversationOptions = ["start","wait","no conversation"] + dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] + endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] + + passthree1 = rls.keyInSelect(introductionOptions, "Start conversation") + passthree2 = rls.keyInSelect(conversationOptions) + passthree3 = rls.keyInSelect(dialogueOptions) + passthree4 = rls.keyInSelect(endTripOptions) + passThree5 = rls.keyInSelect(musicOptions) + + + } else + introductionOptions = ["Hi", "for - passenger name?",'nothing', "What's Your name?"] + musicOptions = ["radio", " library","science podcast", "self-help podcast", "no music"] + conversationOptions = ["start","wait","no conversation"] + dialogueOptions = ["Their day", "Music", "Podcast", "Goals","Secrets", "Your day"] + endTripOptions = ["Say nothing", "Be polite", "Thank them for talking to you"] + + console.log(` Sure, just keep the window open.- Once`) + passThree1 = rls.keyInSelect(introductionOptions) + passThree2 = rls.keyInSelect(conversationOptions) + passThree3 = rls.keyInSelect(dialogueOptions) + passThree4 = rls.keyInSelect(endTripOptions) + passThree5 = rls.keyInSelect(musicOptions) + + + + } -} //whethere you get a long or short trip function trips(){ } -function quota(){ - +function quota(){ + while (money < 300) { + (totalTripCount *= moneyLuck) + money +} + + +} + +function gameOver(){ + console.log("Seems you didnt meet you quota!") + if(rls.keyInYNStrict("Would you like to try again?")){ + restartGame() + }else { + leaveGame() + } +} + +function leaveGame() { + console.log(`\nGuess luck wasn't on your side. See you next time!\n`) + process.exit() + } + +function restartGame(){ + passengers = 0 + money = 0 + longTrips = 0 + shortTrips = 0 + waitTime = 0 + luck = 0 + music = 0 + podcast = 0 + noConvo = 0 + convo = 0 + startGame() + +} + From 5e5d1a189fb1bdfb5479999f350f3cf639763c32 Mon Sep 17 00:00:00 2001 From: Jasleen Villamil Date: Wed, 6 Jan 2021 09:57:51 -0500 Subject: [PATCH 3/3] Able to start game, restart, and make 10 choices. Not complete. --- textBasedAdventure.js | 49 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/textBasedAdventure.js b/textBasedAdventure.js index 265dd05..28351ee 100644 --- a/textBasedAdventure.js +++ b/textBasedAdventure.js @@ -33,9 +33,11 @@ function startGame() { startApp() firstPassenger() secondPassenger() + thirdPassenger() + gameOver() }else { - leaveGame() + gameOver() } } @@ -325,25 +327,35 @@ conversationOptions = ["start","wait","no conversation"] //whethere you get a long or short trip -function trips(){ +// function trips(){ -} +// } + +// function quota(){ + +// } -function quota(){ - while (money < 300) { - (totalTripCount *= moneyLuck) - money -} -} function gameOver(){ + if (money < 300) { console.log("Seems you didnt meet you quota!") if(rls.keyInYNStrict("Would you like to try again?")){ restartGame() - }else { + }else leaveGame() + + }else + console.log("YOU MADE ITTTT, Yeahhh Yeaahhh!") leaveGame() +} + +function restartGame(){ + if(true){ + money = 0 + startGame() + + }else{ } } @@ -351,20 +363,7 @@ function leaveGame() { console.log(`\nGuess luck wasn't on your side. See you next time!\n`) process.exit() + } -function restartGame(){ - passengers = 0 - money = 0 - longTrips = 0 - shortTrips = 0 - waitTime = 0 - luck = 0 - music = 0 - podcast = 0 - noConvo = 0 - convo = 0 - startGame() - -} - +