89 lines
3.8 KiB
JavaScript
Executable file
89 lines
3.8 KiB
JavaScript
Executable file
// Program is started from here, runs functions from other files.
|
|
import { userInput, sleep, disableRawMode, walkPathMain, randomNumber } from './functions.js';
|
|
import { forcedEncounter, naturalEncounter } from './encounters.js';
|
|
import { ravenRockStore } from './shops.js';
|
|
|
|
|
|
disableRawMode();
|
|
console.clear();
|
|
console.log("__________________________________________________________________________________________________________________________________");
|
|
console.log(" _____ _ ____ ");
|
|
console.log(" / ' / / / / ) /");
|
|
console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-");
|
|
console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / ");
|
|
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___\n\n");
|
|
await sleep(1);
|
|
|
|
console.log("What would you like to do?");
|
|
console.log("--------------------------");
|
|
console.log("1) Start new game");
|
|
console.log("2) Learn How to play");
|
|
console.log("3) Quit Game");
|
|
console.log("4) Credits\n");
|
|
|
|
var mainMenuInput = userInput("Enter: ");
|
|
|
|
switch(mainMenuInput) {
|
|
case "1":
|
|
startGame();
|
|
break;
|
|
case "2":
|
|
console.log("Follow the link below for a game manual.")
|
|
console.log("[ENTER LINK HERE]")
|
|
break;
|
|
case "3":
|
|
console.log("Quitting Game...");
|
|
await sleep(1);
|
|
exit(0);
|
|
case "4":
|
|
console.log("Credits:");
|
|
console.log("Bethesda Game Studios - The Fallout IP and related characters/lore");
|
|
console.log("Readline-sync - NPM package used for async collection of user input");
|
|
break;
|
|
case "5":
|
|
var thing1 = [1,2,3,4,5,6,7,8,9];
|
|
var thing2 = [];
|
|
var thing3 = [];
|
|
thing2 = thing1
|
|
while (thing3.length < 6) {
|
|
let randomPick = randomNumber(1,thing2.length);
|
|
thing3.push(thing2[randomPick]);
|
|
thing2.pop(randomPick);
|
|
}
|
|
console.log(thing2);
|
|
break;
|
|
}
|
|
|
|
function startGame() { // So far what I have is filler and testing, feel free to change.
|
|
console.clear();
|
|
name = userInput("What is your name? ");
|
|
console.log(name+" Is now your name...")
|
|
console.clear();
|
|
console.log("Intro:");
|
|
console.log("You are an ordinary loyal Enclave Soldier working at Raven Rock. \nYou are typing away at your terminal, entering reports of recovered materials when a message flashes on it");
|
|
console.log("|||||||")
|
|
console.log("|| Enclave Intranet Messager");
|
|
console.log("|||||||")
|
|
console.log("|| Message From: potus");
|
|
console.log("|||||||\n\n")
|
|
console.log("Dear "+name+",\n\n This is a direct order from the Enclave High Command. \nIgnore all previous directives. Proceed to Camp Navarro immediately. \nSeek safe passage through the Brotherhood and NCR territories. \nDo not disclose your mission to anyone but Enclave Personel with \nsecurity clearance 5 or higher. Reqisition supplies before departure. \nYou have been given 1 YEAR to complete this mission or face discharge.\n\n Signed, President John Henry Eden\n\n");
|
|
|
|
userInput("[Enter to open shop]");
|
|
console.clear();
|
|
|
|
preWarMoney = 500;
|
|
caps = 0;
|
|
level = 1;
|
|
health = 100;
|
|
healthCap = 100;
|
|
walkRate = 1;
|
|
foodRate = 1;
|
|
food = 0;
|
|
radPoints = 0;
|
|
path = 0;
|
|
location = 0;
|
|
locationA = 0;
|
|
locationB = 0;
|
|
ravenRockStore();
|
|
walkPathMain(0);
|
|
}
|