From d837a5747204b843a8256be2506561b9e2ca5647 Mon Sep 17 00:00:00 2001 From: Raktbastr Date: Sun, 27 Apr 2025 16:09:07 -0500 Subject: [PATCH] Fixed issues... Again --- files/main.js | 5 ++- files/poiscreens.js | 2 +- files/variables.js | 91 +++++++++++++++++++++++---------------------- 3 files changed, 50 insertions(+), 48 deletions(-) diff --git a/files/main.js b/files/main.js index 5651d5e..29b7bf7 100755 --- a/files/main.js +++ b/files/main.js @@ -1,5 +1,5 @@ // Program is started from here, runs functions from other files. -import { userInput, sleep, disableRawMode, walkPathMain, randomNumber, removeDuplicates } from './functions.js'; +import { userInput, sleep, disableRawMode, walkPathMain, randomNumber } from './functions.js'; import { forcedEncounter, naturalEncounter } from './encounters.js'; import { ravenRockStore } from './shops.js'; @@ -42,8 +42,9 @@ switch(mainMenuInput) { break; case "5": var thing1 = [1,2,3,4,5,6,7,8,9]; - var thing2 = [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]); diff --git a/files/poiscreens.js b/files/poiscreens.js index a8d737a..6c16851 100644 --- a/files/poiscreens.js +++ b/files/poiscreens.js @@ -2,7 +2,7 @@ import { userInput, pauseScreen, enableRawMode, disableRawMode, sleep } from "./functions.js"; import './variables.js'; -import { whitespringStore, genericBOSStore, trader, eurekaStore, newVegasStore, vaultZeroStore } from "./shops.js"; +import { whitespringStore, trader, eurekaStore, newVegasStore, vaultZeroStore } from "./shops.js"; export function checkPOI() { if (path == 0) { diff --git a/files/variables.js b/files/variables.js index a9b3bd1..965dfdf 100644 --- a/files/variables.js +++ b/files/variables.js @@ -1,49 +1,6 @@ // Now holds only variables -// Player Currency -global.preWarMoney = 0; // Used with enclave vendors -global.caps = 0; // Used with all other vendors - -// Player Stats -global.healthCap = 0; // Maximum health, raises each level -global.health = 0; // Players current HP -global.food = 0; // Amount of food player has -global.isRadiated = false; -global.radSeverity = 0; // Modifies healthCapCalc. 3 Levels -global.radPoints = 0; // If the player reaches 100 rad points the game ends -global.xpPerLevel = 10; // Amount of XP needed per level. Raises 50% each level -global.level = 0; // Level of player. Modifies enemy scaling -global.inventory = [ // Inventory of player, holds all items - // Supplies: chems, aid - [], - // Equipment: weapons, armor, tools - [ - equipmentList[27], - equipmentList[24], - ] -] -global.equippedWeapon = equipmentList[27]; -global.equippedArmor = equipmentList[24]; - -// Game Mechanics -global.walkRate = 0; // Units the player walks per day, affects foodRateCalc and radPointsCalc -global.foodRate = 0; // Amount of food player eats per day, affects radPointsCalc - -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 - -global.daysSinceScav = 0; // Days since player last scavenged. Must be >= 15 to scavenge again. - -global.name = "placeholder"; // Player name, changed when the game starts - -global.testDeath = false; // Used to test death, set to true to kill player - +// Items 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}, @@ -138,4 +95,48 @@ global.achievements = [ {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"}, -] \ No newline at end of file +] + +// Player Currency +global.preWarMoney = 0; // Used with enclave vendors +global.caps = 0; // Used with all other vendors + +// Player Stats +global.healthCap = 0; // Maximum health, raises each level +global.health = 0; // Players current HP +global.food = 0; // Amount of food player has +global.isRadiated = false; +global.radSeverity = 0; // Modifies healthCapCalc. 3 Levels +global.radPoints = 0; // If the player reaches 100 rad points the game ends +global.xpPerLevel = 10; // Amount of XP needed per level. Raises 50% each level +global.level = 0; // Level of player. Modifies enemy scaling +global.inventory = [ // Inventory of player, holds all items + // Supplies: chems, aid + [], + // Equipment: weapons, armor, tools + [ + equipmentList[27], + equipmentList[24], + ] +] +global.equippedWeapon = equipmentList[27]; +global.equippedArmor = equipmentList[24]; + +// Game Mechanics +global.walkRate = 0; // Units the player walks per day, affects foodRateCalc and radPointsCalc +global.foodRate = 0; // Amount of food player eats per day, affects radPointsCalc + +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 + +global.daysSinceScav = 0; // Days since player last scavenged. Must be >= 15 to scavenge again. + +global.name = "placeholder"; // Player name, changed when the game starts + +global.testDeath = false; // Used to test death, set to true to kill player \ No newline at end of file