Fixed sleep function issue and writing to global variables.

This commit is contained in:
Raktbastr 2025-04-06 09:28:09 -05:00
parent dbd27cfa7d
commit fdd58af63e
4 changed files with 37 additions and 31 deletions

View file

@ -1,19 +1,19 @@
// Now holds only variables
// Player Currency
export var prewarmoney = 0; // Used with enclave vendors
export var caps = 0; // Used with all other vendors
global.prewarmoney = 0; // Used with enclave vendors
global.caps = 0; // Used with all other vendors
// Player Stats
export var healthCap = 0; // Maximum health, raises each level
export var health = 0; // Players current HP
export var food = 0; // Amount of food player has
export var isRadiated = false;
export var radSeverity = 0; // Modifies healthCapCalc. 3 Levels
export var radPoints = 0; // If the player reaches 100 rad points the game ends
export var xpPerLevel = 10; // Amount of XP needed per level. Raises 50% each level
export var level = 0; // Level of player. Modifies enemy scaling
export var inventory = [ // Inventory of player, holds all items
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
@ -21,20 +21,20 @@ export var inventory = [ // Inventory of player, holds all items
]
// Game Mechanics
export var walkRate = 0; // Units the player walks per day, affects foodRateCalc and radPointsCalc
export var foodRate = 0; // Amount of food player eats per day, affects radPointsCalc
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
export var path = 0; // Path player is currently on, 0 = Main, 1 = A, 2 = B
export var location = 0; // Location on main path, 0-255 = main, 500-1000 = A, 1500-2000 = B
export var locationA = 0; // Location on path A
export var locationB =0; // Location on path B
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
export var reputation = {mwbos: 4, legion: 4, ncr: 2, bos: 1, enclave: 10, abomination: 0, raider: 0}
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
export var daysSinceScav = 0; // Days since player last scavenged. Must be >= 15 to scavenge again.
global.daysSinceScav = 0; // Days since player last scavenged. Must be >= 15 to scavenge again.
export var name = "placeholder"; // Player name, changed when the game starts
global.name = "placeholder"; // Player name, changed when the game starts
export function variableChange(variable, operation, value) {
switch(operation) {