I kinda forgot what I did here.

This commit is contained in:
Raktbastr 2025-02-25 17:36:33 -06:00
parent e413a5dea4
commit 25efc4f9f9
4 changed files with 29 additions and 10 deletions

View file

@ -24,6 +24,7 @@ module.exports = { // Lets variables and functions be used in other files
sleep,
checkLose,
userInput,
randomNumber
};
var name = '';
@ -34,7 +35,9 @@ var caps = 0; // Used everywhere
var day = 0; // Should we add a definite end? 365 Days?
var location = 0; // Location in the world, 0 is Raven Rock, 200 is CTE.
var location = 0; // Location in the world, 0 is Raven Rock, 255 is New Vegas
var locationA = 0; // Location on path A,
var locationB = 0; // Location on path B, 225 is Navarro
var ammo = 0; // Used in encounters and hunting, No cap :)
@ -107,8 +110,7 @@ function checkLose() { // Checks to see if any lose conditions have been met
}
}
function calcLocation() { // Calculates your location in the world using location points.
// You move your move speed per day, but 3/4 of it if you are sick
function calcLocation() { // Calculates your location in the world using location points, You move your move speed per day, but 3/4 of it if you are sick
if (travelSpeed == 1) {
if (isSick == true) {
location = location+0.75;
@ -135,4 +137,12 @@ function calcLocation() { // Calculates your location in the world using locatio
function userInput(question) { // Basic user input functions, takes in the question to be asked.
let answer = readline.question(question);
return(answer);
}
function randomNumber(min, max) { // Takes in two parameters, min and max, and returns a random number between those boundries.
while (true) {
var randNum = Math.floor(Math.random() * (max+1))
if (randNum >= min) { break; }
}
return randNum;
}