From 324679c4a6a90a14648bd3aebc71ee2f97aabe0a Mon Sep 17 00:00:00 2001 From: Raktbastr Date: Mon, 21 Apr 2025 19:23:23 -0500 Subject: [PATCH] More achievements and fixed sleep. --- files/functions.js | 19 ++++++++++++++----- files/main.js | 7 +++---- files/shops.js | 1 + files/variables.js | 30 +++++++++++++++++++++++++++--- 4 files changed, 45 insertions(+), 12 deletions(-) mode change 100644 => 100755 files/functions.js mode change 100644 => 100755 files/main.js diff --git a/files/functions.js b/files/functions.js old mode 100644 new mode 100755 index 9780f00..fb0745b --- a/files/functions.js +++ b/files/functions.js @@ -91,13 +91,22 @@ export function calcLocation() { } } +var osPlat = os.platform(); export async function sleep(time) { - try { - await execPromise(`sleep ${time}`); - } catch (error) { - console.error("Error executing sleep command:", error); + if (osPlat === 'win32') { + try { + await execPromise(`powershell sleep ${time}`); + } catch (error) { + console.error("Error executing sleep command:", error); + } + } else { + try { + await execPromise(`sleep ${time}`); + } catch (error) { + console.error("Error executing sleep command:", error); + } } -} +} function death() { let random = randomNumber(1,3); diff --git a/files/main.js b/files/main.js old mode 100644 new mode 100755 index 95e9c06..6e8ff11 --- a/files/main.js +++ b/files/main.js @@ -1,8 +1,7 @@ // Program is started from here, runs functions from other files. -import { userInput, calcLocation, radPointsCalc, healthCapCalc, checkLose, sleep, randomNumber } from './functions.js'; -import { pois, poiCounter } from './poiscreens.js'; -import { name, prewarmoney, variableChange } from './variables.js'; +import { userInput, sleep, disableRawMode, } from './functions.js'; import { forcedEncounter, naturalEncounter } from './encounters.js'; +import { ravenRockStore } from './shops.js'; disableRawMode(); @@ -15,7 +14,7 @@ console.log(" / / ) / / / ) / / / o / / ) / ) console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___"); console.log("Credits: Bethesda Game Studio \n"); -sleep(5); +await sleep(5); console.log("What would you like to do?"); console.log("--------------------------"); diff --git a/files/shops.js b/files/shops.js index 03f27fa..8b4c4b0 100644 --- a/files/shops.js +++ b/files/shops.js @@ -50,6 +50,7 @@ export function ravenRockStore() { rrInv[itemNum].amount -= itemAmt; console.log("You bought " + itemAmt + " " + rrInv[itemNum].name + "(s)."); console.log("You have " + preWarMoney + " pre-war money left."); + inventory.push(rrInv[itemNum]); console.log("Press enter to continue..."); userInput("[Enter]"); } diff --git a/files/variables.js b/files/variables.js index e75c1c5..bd82154 100644 --- a/files/variables.js +++ b/files/variables.js @@ -79,9 +79,33 @@ global.equipmentList = [ // Equipment: weapons, armor, tools // 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: "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 {name: "Centurion Armor", description: "A set of Centurion armor, made for you", type: "armor", value: "5", unit: "dr",cost: 25, weight: 25}, {name: "NCR Ranger Armor" , description: "A set of NCR Ranger armor, standard issue", type: "armor", value: "5", unit: "dr",cost: 30, weight: 30}, -]; \ No newline at end of file +]; + +global.achievements = [ + // POI/Faction Destroy + {name: "Dishonorable Discharge", description: "Deactivate MODUS at the Whitespring", unlocked: false}, + {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: "Revenge", description: "Destroy Shady Sands or all NCR cities (depending on path)", unlocked: false}, + {name: "", 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: "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}, + + // Faction Rep + + // +] \ No newline at end of file