Stashing changes for later

This commit is contained in:
Raktbastr 2025-03-30 18:52:44 -05:00
parent 49f93574af
commit 8871c644fb
5 changed files with 116 additions and 21 deletions

View file

@ -10,6 +10,8 @@ module.exports = {
checkLose,
calcLocation,
calcEncounter,
travelScreen,
checkPOI,
}
function eatFood() {
@ -89,6 +91,9 @@ function calcLocation() { // Calculates your location in the world using locatio
variables.location = variables.location+3;
}
}
if (variables.location > 300) {
variables.location = 300;
}
}
// 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() {
}

View file

@ -13,19 +13,16 @@ console.log(" / ' / / /
console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-");
console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / ");
console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___");
console.log("Credits: Bethesda Game Studio");
console.log("Credits: Bethesda Game Studio\n")
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) {
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: ")
switch(mainMenuInput) {
case "1":
@ -40,8 +37,7 @@ while(true) {
variables.sleep(1000);
break;
case "4":
let testarr = [1,2,3,4]
console.log(testarr[testarr.length - 1]);
game.travelScreen();
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++) {
game.calcLocation();
game.calcEncounter();
game.checkPOI();
game.calcSickPoints();
game.eatFood();
game.checkLose();
game.travelScreen();
}
}

View file

@ -1,9 +1,11 @@
const variables = require("./variables.js");
const combat = requre("./combat.js");
const combat = require("./combat.js");
module.exports = {
encounterMenuMaker,
initializeEncounter,
poiCounter,
pois,
}
function initializeEncounter(reqFaction, diffWeighting, fight, flee, forceFaction){
@ -34,7 +36,7 @@ function initializeEncounter(reqFaction, diffWeighting, fight, flee, forceFactio
combat.initCombat(encounter);
break;
case "3":
if (variables.reputation{reqFaction} < 4) {
if (variables.reputation.reqFaction < 4) {
if (variables.randomNumber(1,100) < 40){
console.log("You tried to flee... but they noticed you.");
combat.initCombat(encounter);
@ -217,4 +219,31 @@ function encounterMenuMaker(reqFactionEMM, diffWeightingEMM, forceOptEMM){
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},
]

View file

@ -1,2 +0,0 @@
// Halt travel screen and menu.
const variables = require("./variables.js");

View file

@ -52,6 +52,8 @@ var isSick = false;
var sickPoints = 0; // If you accumulate 50 sick points you lose
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
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.
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.
let answer = readline.question(question);
return(answer);