From cc6aaedc32579cd043731c7d8fcd5f931cdced00 Mon Sep 17 00:00:00 2001 From: Raktbastr Date: Fri, 21 Feb 2025 14:34:50 -0600 Subject: [PATCH] Add other files and some variables/functions. --- TODO.md | 1 + files/huntinggame.js | 1 + files/main.js | 1 + files/poiscreens.js | 1 + files/rivercrossing.js | 1 + files/stoptravelmenu.js | 1 + files/variables.js | 60 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 66 insertions(+) create mode 100644 files/huntinggame.js create mode 100644 files/main.js create mode 100644 files/poiscreens.js create mode 100644 files/rivercrossing.js create mode 100644 files/stoptravelmenu.js create mode 100644 files/variables.js diff --git a/TODO.md b/TODO.md index 27cd6fa..2aa66ea 100644 --- a/TODO.md +++ b/TODO.md @@ -13,6 +13,7 @@ * Trading * Movement/Time (day counter that multiplies stats by certain amt) * POI Chosing based on location in world (NCR bases in Cali, Legion in CO, BOS in Midwest) +* Hunting minigame (only if we can make the terminal blankout and not just add lines) ## Misc * Credit Bethesda if needed \ No newline at end of file diff --git a/files/huntinggame.js b/files/huntinggame.js new file mode 100644 index 0000000..446270c --- /dev/null +++ b/files/huntinggame.js @@ -0,0 +1 @@ +// Hunting Game, if we even decide to do it. \ No newline at end of file diff --git a/files/main.js b/files/main.js new file mode 100644 index 0000000..a0d4802 --- /dev/null +++ b/files/main.js @@ -0,0 +1 @@ +// Program is started from here, runs functions from other files. \ No newline at end of file diff --git a/files/poiscreens.js b/files/poiscreens.js new file mode 100644 index 0000000..18515d5 --- /dev/null +++ b/files/poiscreens.js @@ -0,0 +1 @@ +// Holds the screens for every POI including thier menus. \ No newline at end of file diff --git a/files/rivercrossing.js b/files/rivercrossing.js new file mode 100644 index 0000000..8c13059 --- /dev/null +++ b/files/rivercrossing.js @@ -0,0 +1 @@ +// River crossing screens and options. \ No newline at end of file diff --git a/files/stoptravelmenu.js b/files/stoptravelmenu.js new file mode 100644 index 0000000..8412d50 --- /dev/null +++ b/files/stoptravelmenu.js @@ -0,0 +1 @@ +// Halt travel screen and menu. \ No newline at end of file diff --git a/files/variables.js b/files/variables.js new file mode 100644 index 0000000..eba3511 --- /dev/null +++ b/files/variables.js @@ -0,0 +1,60 @@ +// Holds the global variables, functions, and math operations such as the day counter and food eaten.. + +var day = 0; // Should we add a definite end? 365 Days? + +var ammo = 0; // No cap :) + +var food = 0; // Max: 200 +var foodAmt = 0; // Amt of food eaten per day, 3 levels, starting at 1 + +var health = 0; // Max: 100 + +var travelSpeed = 0; // 3 levels, starting at 1 + +var isRadiated = false; +var radSeverity = 0; // 3 levels, starting at 1 + +var isSick = false; +var sickPoints = 0; // If you accumulate 50 sick points you lose +var sickSeverity = 0; // 3 levls, starting at 1 + +var inventory = []; // Max of 5 items + +var lootTables = [[],[],[],[],[]] // 5 Loot tables per scavenge score, 3 items in each, first is best + +function eatfood() { + if (isSick == true) { food = food-((travelSpeed*foodAmt)+sickSeverity); } + else { food = food-(travelSpeed*3); } + health = health+(5*foodAmt); +} + +function calcSickPoints() { + if (isSick = true) { + sickPoints = sickPoints+((sickSeverity-(0.5*foodAmt))+(0.5*(travelSpeed+radSeverity))); + } +} + +function scavenge() { + let luck = Math.random(1,100); + if (luck <= 20) { + let group = 0; + let random = Math.random(lootTables[group][0], lootTables[group][3]); + inventory.push(random); + } else if (luck <= 40) { + let group = 1; + let random = Math.random(lootTables[group][0], lootTables[group][3]); + inventory.push(random); + } else if (luck <= 60) { + let group = 2; + let random = Math.random(lootTables[group][0], lootTables[group][3]); + inventory.push(random); + } else if (luck <= 80) { + let group = 3; + let random = Math.random(lootTables[group][0], lootTables[group][3]); + inventory.push(random); + } else if (luck <= 100) { + let group = 4; + let random = Math.random(lootTables[group][0], lootTables[group][3]); + inventory.push(random); + } +} \ No newline at end of file