Finished Achievements. Needs implimentation.
This commit is contained in:
parent
324679c4a6
commit
22975aff26
6 changed files with 762 additions and 116 deletions
|
|
@ -1,30 +0,0 @@
|
|||
// Deathscreens, they should be the fallout 1 screens
|
||||
const variables = require("./variables.js");
|
||||
|
||||
module.exports = {
|
||||
deathScreen,
|
||||
timeDeath
|
||||
};
|
||||
|
||||
function deathScreen() {
|
||||
let random = variables.randomNumber(1,3);
|
||||
if (random = 1) { death1(); }
|
||||
if (random = 2) { death2(); }
|
||||
if (random = 3) { death3(); }
|
||||
}
|
||||
|
||||
function death1() {
|
||||
console.log("")
|
||||
}
|
||||
|
||||
function death2() {
|
||||
|
||||
}
|
||||
|
||||
function death3() {
|
||||
|
||||
}
|
||||
|
||||
function timeDeath() { // The death screen for passing the time limit
|
||||
console.log("")
|
||||
}
|
||||
|
|
@ -8,11 +8,12 @@ const execPromise = promisify(exec);
|
|||
import './variables.js';
|
||||
import { inventoryMenuM } from './inventory.js';
|
||||
import { checkPOI } from './poiscreens.js';
|
||||
import './poiscreens.js';
|
||||
import os from 'os';
|
||||
import { exit } from 'process';
|
||||
|
||||
global.isRawModeEnabled = false; // Track whether raw mode is enabled
|
||||
|
||||
|
||||
|
||||
// Used for basic functions, not game specific
|
||||
export function userInput(question) { // Basic user input functions, takes in the question to be asked.
|
||||
let answer = readlineSync.question(question);
|
||||
|
|
@ -49,43 +50,58 @@ export function eatFood() { // Calculates food amount after a day of eating
|
|||
}
|
||||
|
||||
export function checkLose() { // Checks to see if any lose conditions have been met
|
||||
if (health <= 0 || radPoints >= 100) {
|
||||
death();
|
||||
if (health <= 0 && food <= 0) {
|
||||
death("Starvation");
|
||||
}
|
||||
if (radPoints >= 100) {
|
||||
death("Radiation Poisoning");
|
||||
}
|
||||
if (health <= 0 && incombat == true) {
|
||||
death("Combat Injury");
|
||||
}
|
||||
if (health <= 0) {
|
||||
death("Injury");
|
||||
}
|
||||
if (day >= 365) {
|
||||
timeDeath();
|
||||
}
|
||||
if (testDeath == true) {
|
||||
death("Test Death");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function calcLocation() {
|
||||
if (walkRate == 1) {
|
||||
if (path = 0) {
|
||||
if (path == 0) {
|
||||
location++;
|
||||
}
|
||||
if (path = 1) {
|
||||
if (path == 1) {
|
||||
locationA++;
|
||||
}
|
||||
if (path = 2) {
|
||||
if (path == 2) {
|
||||
locationB++;
|
||||
}
|
||||
}
|
||||
if (walkRate == 2) {
|
||||
if (path = 0) {
|
||||
if (path == 0) {
|
||||
location * 2;
|
||||
}
|
||||
if (path = 1) {
|
||||
if (path == 1) {
|
||||
locationA * 2;
|
||||
}
|
||||
if (path = 2) {
|
||||
if (path == 2) {
|
||||
locationB * 2;
|
||||
}
|
||||
}
|
||||
if (walkRate == 3) {
|
||||
if (path = 0) {
|
||||
if (path == 0) {
|
||||
location * 3;
|
||||
}
|
||||
if (path = 1) {
|
||||
if (path == 1) {
|
||||
locationA * 3;
|
||||
}
|
||||
if (path = 2) {
|
||||
if (path == 2) {
|
||||
locationB * 3;
|
||||
}
|
||||
}
|
||||
|
|
@ -108,23 +124,64 @@ export async function sleep(time) {
|
|||
}
|
||||
}
|
||||
|
||||
function death() {
|
||||
let random = randomNumber(1,3);
|
||||
if (random = 1) { death1(); }
|
||||
if (random = 2) { death2(); }
|
||||
if (random = 3) { death3(); }
|
||||
function death(deathCause) {
|
||||
let random = randomNumber(1,100);
|
||||
if (random >= 1 && random <= 33) { death1(deathCause); }
|
||||
if (random >= 34 && random <= 66) { death2(deathCause); }
|
||||
if (random >= 67 && random <= 99) { death3(deathCause); }
|
||||
if (random == 100) { death4(deathCause); }
|
||||
}
|
||||
|
||||
function death1() {
|
||||
console.log("")
|
||||
function death1(dc) {
|
||||
console.clear();
|
||||
sleep(2);
|
||||
console.log("Your bones wither away in the wasteland...\n\n");
|
||||
console.log(" \\|/");
|
||||
console.log(" _/\\___<0> | ");
|
||||
console.log("-------------------------------\n\n");
|
||||
console.log("You have died of "+dc+"...");
|
||||
console.log("Thanks for playing!\n\n");
|
||||
sleep(5);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
function death2() {
|
||||
|
||||
function death2(dc) {
|
||||
console.clear();
|
||||
sleep(2);
|
||||
console.log("The Enclave suffers in the wake of your defeat...\n\n");
|
||||
console.log(" \\|/");
|
||||
console.log(" _/\\___<0> | ");
|
||||
console.log("-------------------------------\n\n");
|
||||
console.log("You have died of "+dc+"...");
|
||||
console.log("Thanks for playing!\n\n");
|
||||
sleep(5);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
function death3() {
|
||||
function death3(dc) {
|
||||
console.clear();
|
||||
sleep(2);
|
||||
console.log("Not even the radscorpions are interested in your corpse...\n\n");
|
||||
console.log(" \\|/");
|
||||
console.log(" _/\\___<0> | ");
|
||||
console.log("-------------------------------\n\n");
|
||||
console.log("You have died of "+dc+"...");
|
||||
console.log("Thanks for playing!\n\n");
|
||||
sleep(5);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
function death4(dc) {
|
||||
console.clear();
|
||||
sleep(2);
|
||||
console.log("You have been killed, therefore you are DEAD...\n\n");
|
||||
console.log(" \\|/");
|
||||
console.log(" _/\\___<0> | ");
|
||||
console.log("-------------------------------\n\n");
|
||||
console.log("You have died of "+dc+"...");
|
||||
console.log("Thanks for playing!\n\n");
|
||||
sleep(5);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
function timeDeath() { // The death screen for passing the time limit
|
||||
|
|
@ -243,7 +300,7 @@ export function travelScreen() {
|
|||
}
|
||||
}
|
||||
|
||||
export async function walkPathA() {
|
||||
export async function walkPathMain() {
|
||||
enableRawMode();
|
||||
if (paused) {
|
||||
disableRawMode();
|
||||
|
|
@ -262,8 +319,9 @@ export async function walkPathA() {
|
|||
travelScreen();
|
||||
checkPOI();
|
||||
eatFood();
|
||||
//await sleep(0.5);
|
||||
walkPathA();
|
||||
day++
|
||||
await sleep(0.5);
|
||||
walkPathMain();
|
||||
}
|
||||
|
||||
process.stdin.resume();
|
||||
|
|
@ -302,6 +360,7 @@ export function pauseScreen() {
|
|||
console.log ("3) View Distances");
|
||||
console.log ("4) View Stats");
|
||||
console.log ("5) Scavenge");
|
||||
console.log ("6) Test Death");
|
||||
let pauseInput = userInput("Enter: ");
|
||||
switch(pauseInput) {
|
||||
case "1":
|
||||
|
|
@ -328,7 +387,7 @@ export function pauseScreen() {
|
|||
console.log(pois[i].name+" - "+visited[i]);
|
||||
}
|
||||
if (pois[i].visited == false) {
|
||||
console.log("??? "+pois[i].location-location+" location points away");
|
||||
console.log("??? - "+pois[i].location-location+" location points away");
|
||||
}
|
||||
}
|
||||
if (path == 1) {
|
||||
|
|
@ -372,5 +431,8 @@ export function pauseScreen() {
|
|||
case "5":
|
||||
scavenge();
|
||||
break;
|
||||
case "6":
|
||||
testDeath = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// Program is started from here, runs functions from other files.
|
||||
import { userInput, sleep, disableRawMode, } from './functions.js';
|
||||
import { userInput, sleep, disableRawMode, walkPathMain } from './functions.js';
|
||||
import { forcedEncounter, naturalEncounter } from './encounters.js';
|
||||
import { ravenRockStore } from './shops.js';
|
||||
|
||||
|
|
@ -11,17 +11,17 @@ console.log(" _____ _
|
|||
console.log(" / ' / / / / ) /");
|
||||
console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-");
|
||||
console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / ");
|
||||
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___");
|
||||
console.log("Credits: Bethesda Game Studio \n");
|
||||
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___\n\n");
|
||||
|
||||
await sleep(5);
|
||||
|
||||
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) Dev stuff for testing\n");
|
||||
console.log("4) Credits\n");
|
||||
|
||||
var mainMenuInput = userInput("Enter: ");
|
||||
|
||||
|
|
@ -38,14 +38,9 @@ switch(mainMenuInput) {
|
|||
await sleep(1);
|
||||
break;
|
||||
case "4":
|
||||
for(var a = 0; a < 10; a++){
|
||||
var test = naturalEncounter(25);
|
||||
if(test != false){
|
||||
console.log(test.name);
|
||||
} else {
|
||||
console.log("failed encounter");
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -80,5 +75,5 @@ function startGame() { // So far what I have is filler and testing, feel free to
|
|||
locationA = 0;
|
||||
locationB = 0;
|
||||
ravenRockStore();
|
||||
walkPathA(0);
|
||||
walkPathMain(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
// Holds poi code, seperate from encounters.js
|
||||
|
||||
import { userInput, pauseScreen } from "./functions.js";
|
||||
import { userInput, pauseScreen, enableRawMode, disableRawMode, sleep } from "./functions.js";
|
||||
import './variables.js';
|
||||
import { whitespringStore, genericBOSStore, trader, eurekaStore, newVegasStore, vaultZeroStore } from "./shops.js";
|
||||
|
||||
export function checkPOI() {
|
||||
if (path == 0) {
|
||||
|
|
@ -119,120 +120,623 @@ global.pois = [
|
|||
]
|
||||
|
||||
function whitespring() {
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at the Whitespring Bunker.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("2) Attempt to trade (Whitespring Mall)");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let whitespringInput = userInput("Enter: ");
|
||||
switch(whitespringInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("A robotic voice greets you.");
|
||||
console.log("MODUS Dialogue here...")
|
||||
sleep(1);
|
||||
console.log("You enter the bunker where a robotic voice greets you.\n\n");
|
||||
sleep(3);
|
||||
console.log("MODUS: Welcome, soldier. Might I ask what brings you here, or who?");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": I am "+name+". I was ordered here by President Eden. Im passing though on my way to...\n*You stop yourself before answering*\nWait, who are you anyway?");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log("MODUS: I am MODUS, the... acting head of this bunker.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": So I assume your of top level clearance?");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log("MODUS: Yes, and no need to tell me where your going. By my limited knoledge id assume they tasked you with retrieval from Navarro, of what im not sure of though.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": Me either, ill get the info when im there.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log("MODUS: Not unusual for the Enclave, nor Eden from what I hear.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": They told me this place would be empty, but its not.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log("MODUS: The original inhabitants are long gone, and they never bothered to check when passing though. They no nothing of my existance. As for the people topside... they are gone too.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": What happened, its a hellscape apart from the Whitespring.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log("MODUS: The scorched plague ravaged the wastes, but was stopped by dwellers from Vault 76. The area was reinhabited, but bigger threats drove the people out again. When the Responders lost for the second time, everyone left.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": Well then, is there anything for me here before I leave?");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log("MODUS: The Resort is taken care of by robots, the vendortrons may still be active. As for here... the dwellers turned generals ran me out.");
|
||||
userInput(" \n[Enter to continue]\n")
|
||||
console.log(name+": I guess Ill be on my way then. Goodbye.")
|
||||
userInput("[Enter to exit conversation]")
|
||||
break;
|
||||
case "2":
|
||||
whitespringStore();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function bosGamma() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at the BOS Bunker Gamma.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Gamma Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
genericBOSStore();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function bosDelta() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at the BOS Bunker Delta.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Delta Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
genericBOSStore();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function bosEpsilon() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at the BOS Bunker Epsilon.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Epsilon Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
genericBOSStore();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function vault0() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at Vault 0.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("VT0 Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
vaultZeroStore();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function tibbets() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at Tibbets Prison.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Tibbets Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function flagstaff() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at Flagstaff.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("3) Attempt to trade");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Flagstaff Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
case "3":
|
||||
flagstaffStore();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function newVegas() {
|
||||
// The below is placeholder, once we add proper code delete this
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at New Vegas.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("3) Continue");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Vegas Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "3":
|
||||
newVegasStore();
|
||||
break;
|
||||
case "4":
|
||||
console.clear();
|
||||
console.log("Ahead lies 2 routes to Navarro.");
|
||||
console.log("The northern route passes through the Divide before going north through the mountains.\nIt offers a longer path with fewer possible enimies, but those you face will not back down.")
|
||||
console.log("The southern route goes through the heart of the NCR along I-15.\nIt is shorter and more pleasant, however without proper reputation your many stops may become worrisome.")
|
||||
sleep(1);
|
||||
console.log("The northern route passes through the Divide before going north through the mountains. It offers a longer path with fewer possible enimies, but those you face will not back down.")
|
||||
console.log("The southern route goes through the heart of the NCR along I-15. It is shorter and more pleasant, however without proper reputation your many stops may become worrisome.")
|
||||
var pathChoice = userInput("Which path would you like to follow, Northern or Southern? ");
|
||||
if (pathChoice.toLowerCase == "northern") {
|
||||
path = 2;
|
||||
break;
|
||||
}
|
||||
if (pathChoice.toLowerCase == "southern") {
|
||||
path = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mojaveOutpost() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at the Mojave Outpost.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Outpost Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function necropolis() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at Necropolis.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Necropolis Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function hub() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at The Hub.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Hub Dialogue here... (make it possible to find hubbologists")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function lostHills() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
sleep(1);
|
||||
console.log("You have arrived at Lost Hills.");
|
||||
sleep(1);
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("LH Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function mariposa() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at Mariposa Military Base.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Mariposa Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sanFrancisco() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at San Francisco.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Redding Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
trader();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function canyonWreck() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at Redding.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Open your PIP-Boy");
|
||||
console.log("3) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Redding Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function hopeville() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at Hopeville.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Hopeville Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
trader();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sierraMadre() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at The Sierra Madre.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Madre Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "3":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function shadySands() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at Shady Sands.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Shady Sands Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
trader();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function newReno() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at New Reno.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Reno Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
trader();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function redding() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at Redding.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Redding Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
trader();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function eureka() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
console.log("You have arrived at Eureka.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Explore");
|
||||
console.log("2) Attempt to trade");
|
||||
console.log("3) Open your PIP-Boy");
|
||||
console.log("4) Leave");
|
||||
let poiInput = userInput("Enter: ");
|
||||
switch(poiInput) {
|
||||
case "1":
|
||||
console.clear();
|
||||
console.log("Eureka Dialogue here...")
|
||||
break;
|
||||
case "2":
|
||||
eurekaStore();
|
||||
break;
|
||||
case "3":
|
||||
pauseScreen();
|
||||
break;
|
||||
case "4":
|
||||
enableRawMode();
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function navarro() {
|
||||
|
||||
disableRawMode();
|
||||
console.clear();
|
||||
enableRawMode();
|
||||
}
|
||||
104
files/shops.js
104
files/shops.js
|
|
@ -65,7 +65,7 @@ export function ravenRockStore() {
|
|||
}
|
||||
}
|
||||
|
||||
function vaultZeroStore() {
|
||||
export function vaultZeroStore() {
|
||||
while (true) {
|
||||
console.clear();
|
||||
console.log("Brotherhood of Steel Requisition System - Vault 0");
|
||||
|
|
@ -109,7 +109,7 @@ function vaultZeroStore() {
|
|||
}
|
||||
}
|
||||
|
||||
function newVegasStore() {
|
||||
export function newVegasStore() {
|
||||
while (true) {
|
||||
console.clear();
|
||||
console.log("Welcome to New Vegas. Selection pulls from Gunrunners, Mick & Ralph's, and Followers of the Apocalypse.");
|
||||
|
|
@ -154,7 +154,7 @@ function newVegasStore() {
|
|||
}
|
||||
}
|
||||
|
||||
function eurekaStore() {
|
||||
export function eurekaStore() {
|
||||
while (true) {
|
||||
console.clear();
|
||||
console.log("Welcome to Eureka. Selection pulls from local traders and willing Enclave Veterans.");
|
||||
|
|
@ -198,7 +198,7 @@ function eurekaStore() {
|
|||
}
|
||||
}
|
||||
|
||||
function trader() { // Picks a selection of items from a global trader inventory, used for misc area shops
|
||||
export function trader() { // Picks a selection of items from a global trader inventory, used for misc area shops
|
||||
var tempTraderInv = [];
|
||||
for (var a = 0; a <= 2; a++) {
|
||||
let randomPick = randomNumber()
|
||||
|
|
@ -250,3 +250,99 @@ function trader() { // Picks a selection of items from a global trader inventory
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function genericBOSStore(poiName) { // Picks a selection of items from a global trader inventory, used for misc area shops
|
||||
var tempTraderInv = [];
|
||||
for (var a = 0; a <= 2; a++) {
|
||||
let randomPick = randomNumber()
|
||||
tempTraderInv.push(traderInv[1]);
|
||||
console.log(randomPick);
|
||||
}
|
||||
console.log(tempTraderInv);
|
||||
|
||||
while (true) {
|
||||
console.clear();
|
||||
console.log("Brotherhood of Steel Requisition System - "+poiName);
|
||||
console.log("Name | Price (Caps) | Amount in stock");
|
||||
console.log("-----------------------------------------------------");
|
||||
for (var i = 0; i < Inv.length; i++) {
|
||||
console.log(i+"). " + rrInv[i].item + " | " + rrInv[i].price + " | " + rrInv[i].amount);
|
||||
}
|
||||
console.log("-----------------------------------------------------");
|
||||
console.log("You have " + preWarMoney + " pre-war money.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Buy supplies");
|
||||
console.log("2) Leave shop");
|
||||
var rrInput = userInput("Enter: ");
|
||||
switch(rrInput) {
|
||||
case "1":
|
||||
console.log("What would you like to buy?");
|
||||
let itemNum = userInput("Enter item number: ");
|
||||
let itemAmt = userInput("Enter amount: ");
|
||||
if (itemAmt > rrInv[itemNum].amount) {
|
||||
console.log("Not enough stock.");
|
||||
break;
|
||||
} else if (itemAmt * rrInv[itemNum].price > preWarMoney) {
|
||||
console.log("Not enough money.");
|
||||
break;
|
||||
} else {
|
||||
preWarMoney -= itemAmt * rrInv[itemNum].price;
|
||||
rrInv[itemNum].amount -= itemAmt;
|
||||
console.log("You bought " + itemAmt + " " + rrInv[itemNum].item + "(s).");
|
||||
console.log("You have " + preWarMoney + " pre-war money left.");
|
||||
console.log("Press enter to continue...");
|
||||
userInput("[Enter]");
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
console.log("Leaving shop...");
|
||||
return true;
|
||||
default:
|
||||
console.log("Invalid input, try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function whitespringStore() {
|
||||
while (true) {
|
||||
console.clear();
|
||||
console.log("Welcome to the Whitespring Mall. Selection pulls from all vendors.")
|
||||
console.log("Name | Price (Caps) | Amount in stock");
|
||||
console.log("-----------------------------------------------------");
|
||||
for (var i = 0; i < vt0InvInv.length; i++) {
|
||||
console.log(i+"). " + vt0InvInv[i].item + " | " + vtInv[i].price + " | " + vtInv[i].amount);
|
||||
}
|
||||
console.log("-----------------------------------------------------");
|
||||
console.log("You have " + caps + " caps.");
|
||||
console.log("What would you like to do?");
|
||||
console.log("1) Buy supplies");
|
||||
console.log("2) Leave shop");
|
||||
var vt0Input = userInput("Enter: ");
|
||||
switch(vt0Input) {
|
||||
case "1":
|
||||
console.log("What would you like to buy?");
|
||||
let itemNum = userInput("Enter item number: ");
|
||||
let itemAmt = userInput("Enter amount: ");
|
||||
if (itemAmt > vt0Inv[itemNum].amount) {
|
||||
console.log("Not enough stock.");
|
||||
break;
|
||||
} else if (itemAmt * vt0Inv[itemNum].price > caps) {
|
||||
console.log("Not enough money.");
|
||||
break;
|
||||
} else {
|
||||
caps -= itemAmt * vt0Inv[itemNum].price;
|
||||
rrInv[itemNum].amount -= itemAmt;
|
||||
console.log("You bought " + itemAmt + " " + vt0Inv[itemNum].item + "(s).");
|
||||
console.log("You have " + caps + " caps left.");
|
||||
console.log("Press enter to continue...");
|
||||
userInput("[Enter]");
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
console.log("Leaving shop...");
|
||||
return true;
|
||||
default:
|
||||
console.log("Invalid input, try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ global.path = 0; // Path player is currently on, 0 = Main, 1 = A, 2 = B
|
|||
global.location = 0; // Location on main path, 0-255 = main, 500-1000 = A, 1500-2000 = B
|
||||
global.locationA = 0; // Location on path A
|
||||
global.locationB = 0; // Location on path B
|
||||
global.day = 0; // Current day of the game, if you reach 365 the game ends
|
||||
|
||||
global.reputation = {mwbos: 4, legion: 4, ncr: 2, bos: 1, enclave: 10, abomination: 0, raider: 0}
|
||||
// Rep for each faction. Number between 0(worst) and 10(best), 5 is neutral
|
||||
|
|
@ -36,6 +37,8 @@ global.daysSinceScav = 0; // Days since player last scavenged. Must be >= 15 to
|
|||
|
||||
global.name = "placeholder"; // Player name, changed when the game starts
|
||||
|
||||
global.testDeath = false; // Used to test death, set to true to kill player
|
||||
|
||||
global.supplyList = [ // Supplies: chems, aid
|
||||
{name: "Food", description: "Misc foods", cost: 1, weight: 0},
|
||||
{name: "Stimpak", description: "A Stimpak syringe, heals 25 HP", cost: 5, weight: 0.5},
|
||||
|
|
@ -78,7 +81,7 @@ global.equipmentList = [ // Equipment: weapons, armor, tools
|
|||
{name: "T-51 Power Armor", description: "T-51 Power Armor, excellent protection from ballistic damage.", type: "parmor", resistances: {balistic: 50, slash: 50, laser: 30, plasma: 30}, unit: "dt", cost: 5, weight: 5},
|
||||
|
||||
// Special Armor
|
||||
{name: "Recon Under Armor", description: "A set of recon armor, for use in Power Armor", type: "uarmor", value: "5", unit: "dr",cost: 20, weight: 20},
|
||||
{name: "Chinese Stealth Suit", description: "Chinese Stealth Suit, +25% Chance to skip encounter if worn", type: "uarmor", value: "5", unit: "dr",cost: 20, weight: 20},
|
||||
{name: "Excavator Power Armor", description: "Excavator Power Armor, +25% Chance to find extra loot", type: "parmor", resistances: {balistic: 5, slash: 5, laser: 5, plasma: 5}, unit: "dt", cost: 5, weight: 5},
|
||||
|
||||
// Even MORE Specialer Armor
|
||||
|
|
@ -92,20 +95,36 @@ global.achievements = [
|
|||
{name: "Force of Habit", description: "Destroy the Midwest BoS", unlocked: false},
|
||||
{name: "Profligate", description: "Destroy Flagstaff", unlocked: false},
|
||||
{name: "Fold", description: "Kill Mr.House, possibly dooming New Vegas", unlocked: false},
|
||||
{name: "Rockets Red Glare", description: "Activate the Hopeville nuk.", unlocked: false},
|
||||
{name: "Rockets Red Glare", description: "Activate the Hopeville nuke.", unlocked: false},
|
||||
{name: "Revenge", description: "Destroy Shady Sands or all NCR cities (depending on path)", unlocked: false},
|
||||
{name: "", description: "Destroy Eureka", unlocked: false},
|
||||
{name: "Eureka!", description: "Destroy Eureka", unlocked: false},
|
||||
{name: "Pit Stop", description: "Destroy Lost Hills", unlocked: false},
|
||||
|
||||
// Secrets
|
||||
{name: "", description: "Find the Excavator Power Armor", unlocked: false},
|
||||
{name: "Ash Heap Native", description: "Find the Excavator Power Armor", unlocked: false},
|
||||
{name: "Commie Scum", description: "Find the Chinese Stealth Suit", unlocked: false},
|
||||
{name: "Bots on Parade", description: "Reactivate the Calculator", unlocked: false},
|
||||
{name: "7 Karat Run", description: "Find the Platnium Chip", unlocked: false},
|
||||
{name: "What in the Goddamn!?", description: "Shoot and kill Benny in the Tops Casino", unlocked: false},
|
||||
{name: "A chore, like any other", description: "Defeat the Malpais Legate, winning the Battle of Hoover Dam", unlocked: false},
|
||||
{name: "Vault-Tec Loyalist", description: "Destory Shady Sands with the Hopeville nuke", unlocked: false},
|
||||
{name: "For Auld Lang Syne", description: "Meet the Enclave Remnants in New Vegas"},
|
||||
{name: "High Roller", description: "Win a game of slots"},
|
||||
|
||||
// Power Armor
|
||||
{name: "Rocket 69", description: "Apply the Jetpack upgrade to your T-60 Power Armor"},
|
||||
{name: "Overgrown", description: "Apply the Strangle Heart upgrade to your Ultracite Power Armor"},
|
||||
{name: "Gannon Would Be Proud", description: "Apply the Tesla upgrade to your APA Mk.I"},
|
||||
|
||||
{name: "All that Glitters", description: "Discover the T-65 Power Armor"},
|
||||
{name: "Iconic", description: "Discover the T-51 Power Armor"},
|
||||
{name: "510 Years Old", description: "Discover the APA Mk.II"},
|
||||
|
||||
// Faction Rep
|
||||
|
||||
//
|
||||
{name: "Golden Branch", description: "Become Idolized within the NCR"},
|
||||
{name: "Frumentari", description: "Become Idolized within the Legion"},
|
||||
{name: "Double Agent", description: "Become Idolized within the Lost Hills Brotherhood"},
|
||||
{name: "Medal of Freedom", description: "Become Idolized within the Enclave"},
|
||||
{name: "Presidential Suite", description: "Become Idolized within New Vegas"},
|
||||
{name: "Uneasy Alliance", description: "Become Idolized within the Midwest Brotherhood"},
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue