diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/Module_One_Individual_Project_The_Flame_Of_Ragnarok.js b/Module_One_Individual_Project_The_Flame_Of_Ragnarok.js new file mode 100644 index 0000000..d3b7065 --- /dev/null +++ b/Module_One_Individual_Project_The_Flame_Of_Ragnarok.js @@ -0,0 +1,470 @@ +const readline = require('readline-sync'); + +const chalk = require('chalk'); + +const figlet = require('figlet') + +let armor +let merchant +let mixedPotions +let advice +let cavePathLeftOrRight + +console.log(chalk.redBright(figlet.textSync('THE FLAME ' + ' OF' + ' RAGNAROK', { + font: 'Fire Font-k', + horizontalLayout: 'default', + verticalLayout: 'default', + width: 60, + whitespaceBreak: true +}))) + +let nameInput = readline.question(chalk.bold.yellowBright("Enter your name: ")); + +console.log(chalk.bold.red(`Hello ` + chalk.bold.yellowBright(nameInput) + `! ` + `Welcome to The Flame Of Ragnarok.`)); +console.log(chalk.green("In this adventure you will explore the caves of Asgard!!")); +console.log(chalk.green("Be wary of your actions Young God or they might be you last!!")); +console.log(chalk.blueBright("Also if come across " + chalk.bold.greenBright("Loki ") + "remember he is the Trickster God and just loves mayhem and mischief!!!")) +console.log(chalk.green("In your exploration you will need to find " + chalk.bold.yellowBright("Gungnir ") + "the spear of Odin himself inorder to stop Ragnarok!!!!")) + +const startGame = () => { + console.log(chalk.red.bold("Welcome " + chalk.bold.yellowBright(nameInput) + "!")) + + let answer = readline.keyInYN(chalk.red('Would you like to start your adventure? \n')) + if (answer){ + console.log(chalk.green("Let's Begin!")) + console.log(chalk.green("This will be an epic adventure ") + chalk.bold.yellowBright(nameInput) + chalk.green(", may the odds be your favor!!!")) + console.log(chalk.green("Good luck!!!! \n")) + runOrFly() + } + else{ + quitGame() + } + } + +function runOrFly(){ + console.log(chalk.green("You wake up in the Castle of Asgard. \n")) + console.log(chalk.green("You just got word that Thor, The God of Thunder himself wants to speak to you about a very important quest! \n")) + console.log(chalk.green("He is waiting for you in Thrudheim. Would you like to run or fly?")) + let ability + while(ability !== "run" && ability !== "fly"){ + ability = readline.question("Please choose run or fly \n") + if(ability === "run"){ + chooseArmorInCastle() + } + else if(ability === "fly"){ + chooseArmorThorOffers() + } + else{ + console.log(chalk.redBright("Invalid choice, Please choose run or fly! \n")) + runOrFly() + } + } +} + +function chooseArmorInCastle(){ + console.log(chalk.green("Before heading to Thrudheim, you see a few armor sets that are element based: Fire, Earth, Water, Thunder, & Steel \n")) +armor = readline.question("Which armor would you like to wear? (Choose only the Element) \n") +chooseArmor(armor) + +thrudheimCaves() +} + +function chooseArmorThorOffers(){ + console.log(chalk.green("After hearing that the mighty Thor has summoned you,")) + console.log(chalk.green("You decided that flying would be fastest getting to him.... \n")) + console.log(chalk.green("You are stopped half way in your flight by no other than Thor himself.... \n")) + console.log(chalk.bold.yellowBright(nameInput) + chalk.green(" what's taking you so long he asks? I asked to speak with you over an hour ago!! \n")) + console.log(chalk.green("Also where is your armor?!?!?!?! You know that God needs their armor without it can be very dangerous!! \n")) + console.log(chalk.green("Luckily I brought a few armor sets with me just in case they are element based: Fire, Earth, Water, Thunder, & Steel \n")) + armor = readline.question("Which armor would you like to wear? (Choose only the Element) \n") + + chooseArmor(armor) + + thrudheimCaves() +} + +function thrudheimCaves(){ +console.log(chalk.green("After a few minutes you have reached The Thrudheim Caves \n")) +console.log(chalk.green("Thor stops and seems confused and says ") + chalk.bold.yellowBright(nameInput) + chalk.green(" these four paths weren't here before, \n")) +console.log(chalk.green("You see ") + chalk.bold.yellowBright(nameInput) + chalk.green(" why I called you here now? It's my brother Loki he is up to his no good deeds again.... \n")) +console.log(chalk.green("And it seems like this time he has gone too far!!! \n")) +console.log(chalk.bold.yellowBright(nameInput) + chalk.green(" It's up to you to stop him or Ragnarok will spread throughout Asgard and then to the rest of the multi-verse!!! \n")) +console.log(chalk.green("He will be in the Cave of Time find him and stop him Young God!!!!!! \n")) +let path = readline.question("Which of the four paths would you like to take: path (1), path (2), path (3), or path (4); (Choose a number) \n") +if(path === "1"){ + goingThroughPathOne() +} +else if(path === "2"){ + goingThroughPathTwo() +} +else if(path === "3"){ + goingThroughPathThree(armor) +} +else if(path === "4"){ + goingThroughPathFour() +} +else{ + console.log(chalk.redBright("Invalid Entry, Remember it's number... Please try again \n")) + thrudheimCaves() +} +} + +function goingThroughPathOne(){ + console.log(chalk.green("You decided to take the first path. \n")) + console.log(chalk.green("While walking along the path you notice that there is a vendor selling goods. \n")) + console.log(chalk.green("Hoping that he has something to help you along your journey you carefully approach. \n")) + merchant = readline.question("Would you like to buy: Health Potions, Vitality Potions, or Stamina Potions? \n") + salesMerchant(merchant) +} + +function goingThroughPathTwo(){ + console.log(chalk.green("You decided to take the second path. \n")) + console.log(chalk.green("While walking along the path you notice that there is a vendor selling goods. \n")) + console.log(chalk.green("Hoping that he has something to help you along your journey you carefully approach. \n")) + merchant = readline.question("Would you like to buy: Health Potions, Vitality Potions, or Stamina Potions? \n") + salesMerchant(merchant) +} + +function goingThroughPathThree(armor){ + console.log(chalk.green("You decided to take the third path. \n")) + console.log(chalk.green("While walking through this path all of a sudden you hear a loud sinister laugh!!!")) + console.log(chalk.green("Oh no it's Loki!! He brings down the boulder right on top of you!! \n")) + + setTimeout(() => {console.log(chalk.redBright("He then disappears thinking that he won and nothing can stop him now! \n"))}, 3000) + setTimeout(() => {console.log(chalk.redBright("What he didn't realize is that you have the element " + armor + " armor!! \n"))}, 5000) + setTimeout(() => {console.log(chalk.redBright("It will take much more than a mere boulder to stop you " + nameInput + "!!! \n"))}, 7000) + setTimeout(() => {console.log(chalk.redBright("Now that the coast is clear you carry on ready for anything!! \n"))}, 9000) + setTimeout(() => {caveOfTime()}, 13000) + +} + +function goingThroughPathFour(){ + console.log(chalk.green("You decided to take the fourth path. \n")) + console.log(chalk.green("While walking along the path you notice that there is a vendor selling goods. \n")) + console.log(chalk.green("Hoping that he has something to help you along your journey you carefully approach. \n")) + merchant = readline.question("Would you like to buy: Health Potions, Vitality Potions, or Stamina Potions? \n") + salesMerchant(merchant) +} + +function healthPotion(advice){ + console.log(chalk.green("You chose the Health Potion that is a very wise choice!! \n")) + + merchantAdvice(advice) + } + +function vitalityPotion(advice){ + console.log(chalk.green("You chose the Vitality Potion that is a very wise choice!! \n")) + + merchantAdvice(advice) + } + +function staminaPotion(advice){ + console.log(chalk.green("You chose the Stamina Potion that is a very wise choice!! \n")) + + merchantAdvice(advice) +} + +function caveOfTime(){ + console.log(chalk.green("After a few minutes you reach the Cave of Time!! \n")) + console.log(chalk.bold.yellowBright(nameInput) + chalk.green(" wait I need to tell you something...")) + console.log(chalk.green("'Thor flew down' ") + chalk.bold.yellowBright(nameInput) + chalk.green(" you need to becareful inside the Cave of Time, Loki will be up to no good!!! \n")) + console.log(chalk.green("Once you go inside there will be four pathways one of them will lead you to Gungnir,")) + console.log(chalk.green("That is the Spear of Odin himself, we will need it to stop Ragnarok and save the multi-verse good luck ") + chalk.yellowBright(nameInput) + chalk.red("!!! \n")) + let cavePath = readline.question("You have entered the Cave of Time and you have found the four paths Thor was talking about, which path route will you take: route(1), route(2), route(3), or route(4). Please choose a number. \n") + if (cavePath === "1"){ + routePathOne() + } + else if (cavePath === "2"){ + routePathTwo() + } + else if (cavePath === "3"){ + routePathThree() + } + else if (cavePath === "4"){ + routePathFour() + } + else{ + console.log(chalk.redBright("Invalid Entry, Remember it's number... Please try again \n")) + caveOfTime() + } +} + +function routePathOne(){ + console.log(chalk.green("You decided to take the first path...")) + console.log(chalk.green("You walk deep into the cave and it seems like that it goes on forever....")) + console.log(chalk.green("After sometime and what seemed like an eternity later, you take a step and fall into the Hole of Eternal Darkness. \n")) + setTimeout(() => { console.log(chalk.cyanBright(".")); }, 2000) + setTimeout(() => { console.log(chalk.cyanBright("..")); }, 6000) + setTimeout(() => { console.log(chalk.cyanBright("...")); }, 8000) + setTimeout(() => { console.log(chalk.cyanBright("....")); }, 10000) + setTimeout(() => { console.log(chalk.cyanBright(".....")); }, 12000) + setTimeout(() => { let fall = readline.question("What would you like to do: quit or restart? \n") + if (fall === "quit"){ + quitGame() +} +else if(fall === "restart"){ + restartGame() +} +else{ + console.log(chalk.redBright("Invalid response please select either: quit or restart, and try again!! \n")) + routePathOne() +} +}, 14000) +} + +function routePathTwo(){ + console.log(chalk.green("You decided to take the second path...")) + console.log(chalk.green("You walk deep into the cave and just you thought this is taking a long time... \n")) + cavePathLeftOrRight = readline.question("Deep inside The Cave of Time you come across another two paths that Thor never mentioned: A path to the (Right) and a path to the (Left), which would you like to choose? \n") + cave(cavePathLeftOrRight) +} + +function routePathThree(){ + console.log(chalk.green("You decided to take the third path...")) + console.log(chalk.green("You walk deep into the cave and it seems like that it goes on forever....")) + setTimeout(() => { console.log(chalk.cyanBright("After a while Loki appeared... you shouldn't be here this will be your downfall!!")); }, 6000) + setTimeout(() => { console.log(chalk.cyanBright("He suddenly disappears and The Bifrost sweeps you away!!")); }, 10000) + setTimeout(() => { let sweep = readline.question("What would you like to do: quit or restart? \n") + if (sweep === "quit"){ + quitGame() +} +else if(sweep === "restart"){ + restartGame() +} +else{ + console.log(chalk.redBright("Invalid response please select either: quit or restart, and try again!! \n")) + routePathThree() +} +}, 16000) +} + +function routePathFour(){ + console.log(chalk.green("You decided to take the fourth path...")) + console.log(chalk.green("You walk deep into the cave and just you thought this is taking a long time... \n")) + cavePathLeftOrRight = readline.question("Deep inside The Cave of Time you come across another two paths that Thor never mentioned: A path to the (Right) and a path to the (Left), which would you like to choose? \n") + cave(cavePathLeftOrRight) +} + +function cavePathRight(){ + console.log(chalk.green("You see a glowing light coming from deep in the cave...")) + console.log(chalk.green("You get excited and hurry torwards that light! \n")) + console.log(chalk.green("When you reach the light you meet the old wizard and he says ") + chalk.bold.yellowBright(nameInput) + chalk.green(" in order to get what you need,")) + console.log(chalk.green("You need to play a game I'm going to give you five treasure chests, only one has what you need while the others don't. \n")) + if (readline.keyInYN('Would you like to play? \n')){ + let index = readline.question('Which chest would you like to chose? Please choose one: Chest 1, Chest 2, Chest 3, Chest 4, or Chest 5. \n' ); + if (index === 'Chest 1'){ + console.log(chalk.green("Wow gold and lots of it!! It's a shame that's not what you need")) + console.log(chalk.magenta("Please try again!! \n")) + cavePathRight() + } + else if(index === 'Chest 2'){ + console.log(chalk.yellowBright("It's Gungnir!!! Congrats!!!! Now it's time to stop Loki!!!!! \n")) + finalShowDown() + } + else if(index === 'Chest 3'){ + console.log(chalk.green("It's Thors hammer!! To bad that's not what you need")) + console.log(chalk.magenta("Please try again!! \n")) + cavePathRight() + } + else if(index === 'Chest 4'){ + console.log(chalk.green("It's a feast of food, it looks so good it's making you hungry!!")) + console.log(chalk.magenta("Please try again!! \n")) + cavePathRight() + } + else if(index === 'Chest 5'){ + console.log(chalk.green("An empty chest?! Looks like this wizard has a sense of humor!!!")) + console.log(chalk.magenta("Please try again!! \n")) + cavePathRight() + } + else{ + console.log(chalk.magenta("He's a tricky wizard, Please try again Remember to Type 'Chest' with the number!! \n")) + cavePathRight() + } +} + } + +function cavePathLeft(){ + console.log(chalk.green("You are starting to grow weary and tired you didn't expect that the Cave of Time would be this big... \n")) + console.log(chalk.green("You start to question your decision and wonder if you should give up..... \n")) + setTimeout(() => { console.log(chalk.cyanBright("Well what did you expect you are in the Cave of Time after all, A Voice Echoed From the Distance!!!!! \n")); }, 7000) + setTimeout(() => { console.log(chalk.cyanBright("I am just an old wizard trying to help don't get frightened Young God")); }, 10000) + setTimeout(() => { console.log(chalk.cyanBright("I will transport you over to the correct cave!!!!! \n")); }, 13000) + setTimeout(() => { cavePathRight(); }, 16000) +} + +function finalShowDown(){ + setTimeout(() => { console.log(chalk.cyanBright("Just like that old wizard transported you outside The Cave of Time!!!!! \n")); }, 5000) + setTimeout(() => { console.log(chalk.cyanBright("Congrats!!!! ") + chalk.bold.yellowBright(nameInput) + chalk.cyanBright(" I knew you can do it said Thor, by the way that old wizard is my father Odin himself!! \n")); }, 7000) + setTimeout(() => { console.log(chalk.cyanBright("He wanted to make sure you are worthy, he has done something similar to me in the past as well! \n")); }, 11000) + setTimeout(() => { console.log(chalk.cyanBright("Now that you have Gungnir you have to throw it in the Flame of Ragnarok while I take care of my brother Loki... \n")); }, 15000) + setTimeout(() => { if(readline.keyInYN("Are you ready to stop Ragnarok? \n")){ + console.log(chalk.yellowBright("With all your might during the epic fight between Thor and Loki..")) + console.log(chalk.yellowBright("You threw Gungnir into the Flame of Ragnarok and saved the multiverse...")) + console.log(chalk.green("Congratulations ") + chalk.bold.yellowBright(nameInput) + chalk.green(" You beat the game!!!")) + restartGame() + } + else { + console.log(chalk.magenta("You get caught in the crossfire between Thor and Loki!!!")) + console.log(chalk.magenta("The Staff of Odin flies from your hand, but you're not going to give up.")) + console.log(chalk.magenta("With every ounce of energy you have left you get up and start looking for Gungnir.... \n")) + finalThrowItsAllOrNothing() + } + }, 19000) +} + +function finalThrowItsAllOrNothing () { + console.log(chalk.green("After what seemed like an eternity you finally find Gungnir... \n")) + console.log(chalk.green("Asgard looks like a dead planet now due to Loki's actions, it was once a very beautiful place!!! \n")) + setTimeout(() => { console.log(chalk.cyanBright("It is now or never!! You take Gungnir and throw it with all your might right in the center of The Flame of Ragnarok!!! \n"))}, 8000) + setTimeout(() => { console.log(chalk.cyanBright("Congratulations " + chalk.bold.yellowBright(nameInput) + " You saved the multiverse and beat the game!!!! \n")); }, 14000) + setTimeout(() => { restartGame(); }, 17000) +} + + + +function chooseArmor(armor){ + if(armor === "Fire"){ + console.log(chalk.green("Wow you chose the Fire Armor! You feel like an unstoppable Inferno!! \n" )) + console.log(chalk.green("You now head to Thrudheim together with Thor \n")) + } + else if(armor === "Earth"){ + console.log(chalk.green("Wow you chose the Earth Armor! You feel like Mother Nature will always protect you!! \n")) + console.log(chalk.green("You now head to Thrudheim together with Thor \n")) + } + else if(armor === "Water"){ + console.log(chalk.green("Wow you chose the Water Armor! You feel calm and focused, Just like the calm before the storm!! \n ")) + console.log(chalk.green("You now head to Thrudheim together with Thor \n")) + } + else if(armor === "Thunder"){ + console.log(chalk.green("Wow you chose the Thunder Armor! You feel powerful just like a Thunder storm or even Thor himself!! \n")) + console.log(chalk.green("You now head to Thrudheim together with Thor \n")) + } + else if(armor === "Steel"){ + console.log(chalk.green("Wow you chose the Steel Armor! You feel invincible, just like an indestructible force!! \n")) + console.log(chalk.green("You now head to Thrudheim together with Thor \n")) + } + else{ + console.log(chalk.redBright("Invalid Choice, Remember that you can only choose the elements and Pay close attention to how the element is written, Please try again... \n")) + if (chooseArmorInCastle){ + chooseArmorInCastle() + }else{ + chooseArmorThorOffers() + } +} +} + +function salesMerchant(merchant){ + if (merchant === "Health Potions"){ + healthPotion() + } + else if (merchant === "Vitality Potions"){ + vitalityPotion() + } + else if(merchant === "Stamina Potions"){ + staminaPotion() + } + else{ + console.log(chalk.redBright("Wrong entry please choose one of the following Health Potions, Vitality Potions, or Stamina Potions and try again. \n")) + if(goingThroughPathOne){ + goingThroughPathOne() + } + else if (goingThroughPathTwo){ + goingThroughPathTwo() + } + else{ + goingThroughPathFour() + } + } +} + +function potionMix(mixedPotions){ + if (mixedPotions === "Rest"){ + console.log(chalk.green("You rested for a bit and then drank the Health Potion. \n")) + console.log(chalk.green("You then carried on the path feeling full of energy, it was hard but you got the feeling that it's only the begining. \n")) + caveOfTime() + } + else if (mixedPotions === "Carry On"){ + console.log(chalk.green("You then carried on the path feeling full of energy. \n")) + console.log(chalk.green("It was a long and hard path but you got the feeling that it's only the begining, but so far you have managed to overcome every obstacle!! \n")) + caveOfTime() + } + else if (mixedPotions === "Quit"){ + console.log(chalk.red("It's a shame that you decided not to continue your adventure Young God... \n")) + console.log(chalk.red("Until next time remember that the fate of the multi-verse is in your hands!! \n")) + quitGame() + } + else { + console.log(chalk.red("Invalid choice, Please remember to choose one of the options and Spell it exactly how you see it!!! Please choose the path again!!")) + thrudheimCaves() + } +} + +function merchantAdvice(_advice){ + console.log(chalk.green("I would recommend that you use it wisely.. \n")) + console.log(chalk.green("Now that you have everything you need, you need to decide what you want to do to continue your path. \n")) + mixedPotions = readline.question("Would you like to: Rest, Carry On, or Quit? \n") + potionMix(mixedPotions) + +} + +function cave(cavePathLeftOrRight){ + if (cavePathLeftOrRight === "Right"){ + console.log("You entered the right path of the cave..") + cavePathRight() + } + else if (cavePathLeftOrRight === "Left"){ + console.log("You entered the left path of the cave..") + cavePathLeft() + } + else{ + console.log(chalk.redBright("Invalid Entry Please choose: Right or Left, try again!")) + if(routePathTwo){ + routePathTwo() + } + else{ + routePathFour() + } + } +} + + + + + +const restartGame = () => { + if(readline.keyInYN("Would you like to play again? \n")){ + runOrFly() + } + else{ + quitGame() + } + } + + const quitGame = () => { + console.log(chalk.redBright("Goodbye! Until we meet again!!")) + console.log(chalk.redBright("And remember that Asgard is where it's people are not the where the land is Young God!!!")) + process.exit() + } + + + + + + + + + + + + + + + + + + + + + + +startGame() \ No newline at end of file diff --git a/README.md b/README.md index f0a4dd4..0b1f45f 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ let yourVariableHere = readline.question("Enter your name: ") Replace the link below with the link to your Trello project: -[Trello](https://trello.com/b/vbKtMOKj/text-based-adventure-project-plan) +[Trello](https://trello.com/b/MCXVQYyr/text-based-adventure-project-plan) ## Rubric diff --git a/package-lock.json b/package-lock.json index 4e5e2be..e4351a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,286 @@ { "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", + "chalklet": "^1.0.0", + "figlet": "^1.5.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/chalklet": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chalklet/-/chalklet-1.0.0.tgz", + "integrity": "sha512-4+QgYsN7LGFGEBgTa5su3Fx1F5q5ERKJI7qhdsJGHC2cgXY4h3qCsivX4x7hlcYHdJmwEuPVMBSiEyqNBEdHZQ==", + "dependencies": { + "chalk": "^2.4.1", + "figlet": "^1.2.1" + } + }, + "node_modules/chalklet/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalklet/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalklet/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalklet/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/chalklet/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/chalklet/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "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/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/figlet": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.0.tgz", + "integrity": "sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww==", + "engines": { + "node": ">= 0.4.0" + } + }, + "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" + } + }, + "chalklet": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chalklet/-/chalklet-1.0.0.tgz", + "integrity": "sha512-4+QgYsN7LGFGEBgTa5su3Fx1F5q5ERKJI7qhdsJGHC2cgXY4h3qCsivX4x7hlcYHdJmwEuPVMBSiEyqNBEdHZQ==", + "requires": { + "chalk": "^2.4.1", + "figlet": "^1.2.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.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==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "figlet": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.0.tgz", + "integrity": "sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww==" + }, + "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..4cefe01 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,9 @@ }, "homepage": "https://github.com/joinpursuit/FSW-Text-Based-Adventure#readme", "dependencies": { + "chalk": "^4.1.0", + "chalklet": "^1.0.0", + "figlet": "^1.5.0", "readline-sync": "^1.4.10" } } diff --git a/textBasedAdventure.js b/textBasedAdventure.js deleted file mode 100644 index d392b19..0000000 --- a/textBasedAdventure.js +++ /dev/null @@ -1,5 +0,0 @@ -const readline1 = require('readline-sync') - -let nameInput = readline.question("Enter your name: ") - -console.log(`Hello ${nameInput}! Welcome to my game.`)