Stashing changes for later
This commit is contained in:
parent
49f93574af
commit
8871c644fb
5 changed files with 116 additions and 21 deletions
|
|
@ -10,6 +10,8 @@ module.exports = {
|
||||||
checkLose,
|
checkLose,
|
||||||
calcLocation,
|
calcLocation,
|
||||||
calcEncounter,
|
calcEncounter,
|
||||||
|
travelScreen,
|
||||||
|
checkPOI,
|
||||||
}
|
}
|
||||||
|
|
||||||
function eatFood() {
|
function eatFood() {
|
||||||
|
|
@ -89,6 +91,9 @@ function calcLocation() { // Calculates your location in the world using locatio
|
||||||
variables.location = variables.location+3;
|
variables.location = variables.location+3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (variables.location > 300) {
|
||||||
|
variables.location = 300;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rundown on how I did this:
|
// Rundown on how I did this:
|
||||||
|
|
@ -141,4 +146,71 @@ function calcEncounter() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPOI() {
|
||||||
|
if (variables.location < 300) {
|
||||||
|
if (variables.location >= (poi.pois[poi.poiCounter].location)-3 && variables.location <= poi.pois[poi.poiCounter].location)
|
||||||
|
}
|
||||||
|
if (variables.locationA > 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (variables.locationB > 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var travelFrame = 0;
|
||||||
|
function travelScreen() {
|
||||||
|
if (travelFrame < 0 || travelFrame > 1) {
|
||||||
|
travelFrame = 0;
|
||||||
|
} else if (travelFrame == 0) {
|
||||||
|
console.clear();
|
||||||
|
console.log("┌──────────────────────────────────────┐");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ ◜─◝ │");
|
||||||
|
console.log("│ ◟_◞ │");
|
||||||
|
console.log("│ /║\\ │");
|
||||||
|
console.log("│ \\V/ │");
|
||||||
|
console.log("│ / \\ │");
|
||||||
|
console.log("│ ▁\\ ▔╹ │");
|
||||||
|
console.log("│======================================│");
|
||||||
|
console.log("│ . . - . . - . . . - │");
|
||||||
|
console.log("│ - . . . . . . - . .│");
|
||||||
|
console.log("└──────────────────────────────────────┘");
|
||||||
|
console.log("Press [ENTER] to open Pip-Boy");
|
||||||
|
console.log("Current Health: "+variables.health);
|
||||||
|
console.log("Food Amt: "+variables.food);
|
||||||
|
console.log("Distance to next POI: ");
|
||||||
|
travelFrame++
|
||||||
|
} else {
|
||||||
|
console.clear();
|
||||||
|
console.log("┌──────────────────────────────────────┐");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ │");
|
||||||
|
console.log("│ ◜─◝ │");
|
||||||
|
console.log("│ ◟_◞ │");
|
||||||
|
console.log("│ /║\\ │");
|
||||||
|
console.log("│ \\V/ │");
|
||||||
|
console.log("│ \\ │");
|
||||||
|
console.log("│ ▁│▔╹ │");
|
||||||
|
console.log("│======================================│");
|
||||||
|
console.log("│ - . - . . . - . - . │");
|
||||||
|
console.log("│ - . . - . . . - .│");
|
||||||
|
console.log("└──────────────────────────────────────┘");
|
||||||
|
console.log("Press [ENTER] to open Pip-Boy");
|
||||||
|
console.log("Current Health: "+variables.health);
|
||||||
|
console.log("Food Amt: "+variables.food);
|
||||||
|
console.log("Distance to next POI: ");
|
||||||
|
travelFrame--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function haltTravelScreen() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -13,19 +13,16 @@ console.log(" / ' / / /
|
||||||
console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-");
|
console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-");
|
||||||
console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / ");
|
console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / ");
|
||||||
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___");
|
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___");
|
||||||
console.log("Credits: Bethesda Game Studio");
|
console.log("Credits: Bethesda Game Studio\n")
|
||||||
variables.sleep(1000);
|
variables.sleep(1000);
|
||||||
|
|
||||||
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");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
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");
|
||||||
let mainMenuInput = variables.userInput("Enter: ")
|
let mainMenuInput = variables.userInput("Enter: ")
|
||||||
switch(mainMenuInput) {
|
switch(mainMenuInput) {
|
||||||
case "1":
|
case "1":
|
||||||
|
|
@ -40,8 +37,7 @@ while(true) {
|
||||||
variables.sleep(1000);
|
variables.sleep(1000);
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
let testarr = [1,2,3,4]
|
game.travelScreen();
|
||||||
console.log(testarr[testarr.length - 1]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -64,8 +60,10 @@ function startGame() { // So far what I have is filler and testing, feel free to
|
||||||
for (variables.location = 0; variables.location <= 255; variables.location++) {
|
for (variables.location = 0; variables.location <= 255; variables.location++) {
|
||||||
game.calcLocation();
|
game.calcLocation();
|
||||||
game.calcEncounter();
|
game.calcEncounter();
|
||||||
|
game.checkPOI();
|
||||||
game.calcSickPoints();
|
game.calcSickPoints();
|
||||||
game.eatFood();
|
game.eatFood();
|
||||||
game.checkLose();
|
game.checkLose();
|
||||||
|
game.travelScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
const variables = require("./variables.js");
|
const variables = require("./variables.js");
|
||||||
const combat = requre("./combat.js");
|
const combat = require("./combat.js");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
encounterMenuMaker,
|
encounterMenuMaker,
|
||||||
initializeEncounter,
|
initializeEncounter,
|
||||||
|
poiCounter,
|
||||||
|
pois,
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeEncounter(reqFaction, diffWeighting, fight, flee, forceFaction){
|
function initializeEncounter(reqFaction, diffWeighting, fight, flee, forceFaction){
|
||||||
|
|
@ -34,7 +36,7 @@ function initializeEncounter(reqFaction, diffWeighting, fight, flee, forceFactio
|
||||||
combat.initCombat(encounter);
|
combat.initCombat(encounter);
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
if (variables.reputation{reqFaction} < 4) {
|
if (variables.reputation.reqFaction < 4) {
|
||||||
if (variables.randomNumber(1,100) < 40){
|
if (variables.randomNumber(1,100) < 40){
|
||||||
console.log("You tried to flee... but they noticed you.");
|
console.log("You tried to flee... but they noticed you.");
|
||||||
combat.initCombat(encounter);
|
combat.initCombat(encounter);
|
||||||
|
|
@ -217,4 +219,31 @@ function encounterMenuMaker(reqFactionEMM, diffWeightingEMM, forceOptEMM){
|
||||||
encountered.push(encounterDiffOne[faction][variables.randomNumber(0, encounterDiffOne[faction].length - 1)])
|
encountered.push(encounterDiffOne[faction][variables.randomNumber(0, encounterDiffOne[faction].length - 1)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var poiCounter = 0;
|
||||||
|
var pois = [
|
||||||
|
{name: "Whitespring Bunker", location: 25, path: 0},
|
||||||
|
{name: "BOS Bunker Gamma", location: 100, path: 0},
|
||||||
|
{name: "BOS Bunker Delta", location: 125, path: 0},
|
||||||
|
{name: "BOS Bunker Epsilon", location: 175, path: 0},
|
||||||
|
{name: "Vault 0", location: 200, path: 0},
|
||||||
|
{name: "Tibbets Prison", location: 250, path: 0},
|
||||||
|
{name: "Flagstaff", location: 275, path: 0},
|
||||||
|
{name: "New Vegas", location: 300, path: 0},
|
||||||
|
{name: "Mojave Outpost", location: 5, path: 1},
|
||||||
|
{name: "Necropolis", location: 10, path: 1},
|
||||||
|
{name: "The Hub", location: 15, path: 1},
|
||||||
|
{name: "Lost Hills", location: 20, path: 1},
|
||||||
|
{name: "Mariposa MB", location: 30, path: 1},
|
||||||
|
{name: "San Franciso", location: 35, path: 1},
|
||||||
|
{name: "Camp Navarro", location: 45, path: 1},
|
||||||
|
{name: "Canyon Wreckage", location: 5, path: 2},
|
||||||
|
{name: "Hopeville & Ashton", location: 15, path: 2},
|
||||||
|
{name: "The Sierra Madre", location: 25, path: 2},
|
||||||
|
{name: "Shady Sands", location: 35, path: 2},
|
||||||
|
{name: "New Reno", location: 55, path: 2},
|
||||||
|
{name: "Redding", location: 75, path: 2},
|
||||||
|
{name: "Eureka", location: 85, path: 2},
|
||||||
|
{name: "Camp Navarro", location: 100, path: 2},
|
||||||
|
]
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
// Halt travel screen and menu.
|
|
||||||
const variables = require("./variables.js");
|
|
||||||
|
|
@ -52,6 +52,8 @@ var isSick = false;
|
||||||
var sickPoints = 0; // If you accumulate 50 sick points you lose
|
var sickPoints = 0; // If you accumulate 50 sick points you lose
|
||||||
var sickSeverity = 0; // 3 levls, starting at 1
|
var sickSeverity = 0; // 3 levls, starting at 1
|
||||||
|
|
||||||
|
var sleepVar = 0; // Placeholder variable that allows sleep() to run a command without changing/printing somthing
|
||||||
|
|
||||||
/*
|
/*
|
||||||
1 - Villified - Will attack you at all POIs and encounters
|
1 - Villified - Will attack you at all POIs and encounters
|
||||||
2 - Hated - Will only attack you in major POIs
|
2 - Hated - Will only attack you in major POIs
|
||||||
|
|
@ -84,10 +86,6 @@ var lootTables = [[],[],[],[],[]] // Only small things like food and ammo, 5 Loo
|
||||||
|
|
||||||
var daysSinceScav = 0; // Days since your last scavenge, you must wait 15 days before scavenging again.
|
var daysSinceScav = 0; // Days since your last scavenge, you must wait 15 days before scavenging again.
|
||||||
|
|
||||||
function sleep(time) { // Waits the inputed amt of miliseconds before proceeding
|
|
||||||
setTimeout(() => {}, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
function userInput(question) { // Basic user input functions, takes in the question to be asked.
|
function userInput(question) { // Basic user input functions, takes in the question to be asked.
|
||||||
let answer = readline.question(question);
|
let answer = readline.question(question);
|
||||||
return(answer);
|
return(answer);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue