diff --git a/files/deathscreens.js b/files/deathscreens.js new file mode 100644 index 0000000..15729f3 --- /dev/null +++ b/files/deathscreens.js @@ -0,0 +1,29 @@ +// Deathscreens, they should be the fallout 1 screens + +module.exports = { + deathScreen, + timeDeath +}; + +function deathScreen() { + let random = Math.random(1,3); + if (random = 1) { death1(); } + if (random = 2) { death2(); } + if (random = 3) { death3(); } +} + +function death1() { + +} + +function death2() { + +} + +function death3() { + +} + +function timeDeath() { // The death screen for passing the time limit + +} \ No newline at end of file diff --git a/files/main.js b/files/main.js index 8a86dcc..21f7c4c 100644 --- a/files/main.js +++ b/files/main.js @@ -1,14 +1,13 @@ // Program is started from here, runs functions from other files. -const huntingGame = require("./huntinggame.js"); const variables = require("./variables.js"); console.clear(); console.log("__________________________________________________________________________________________________________________________________"); -console.log("    _____                                          _                                                    ____                      "); -console.log("    /    '         /   /                           /                                                    /    )                   /"); -console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-"); -console.log("  /        /   ) /   /   /   ) /   /  /   o      /      /   ) /   ) /___) (_ ` /   ) / /  ) /___)     /    |   /   ) /   ) /   /  "); -console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___"); +console.log(" _____ _ ____ "); +console.log(" / ' / / / / ) /"); +console.log("---/__-------__---/---/----__---------_/_---------/-------__----__----__---__----__---_--_----__-------/___ /----__----__----__-/-"); +console.log(" / / ) / / / ) / / / o / / ) / ) /___) (_ ` / ) / / ) /___) / | / ) / ) / / "); +console.log("_/________(___(_/___/___(___/_(___(__(_ __o_____/____/_(___/_/___/_(___ _(__)_(___/_/_/__/_(___ _____/_____|__(___/_(___(_(___/___"); console.log("Credits: Bethesda Game Studio") variables.sleep(1000); diff --git a/files/map.js b/files/map.js new file mode 100644 index 0000000..1a03627 --- /dev/null +++ b/files/map.js @@ -0,0 +1 @@ +// Map Screen \ No newline at end of file diff --git a/files/variables.js b/files/variables.js index 4e58476..7e6271d 100644 --- a/files/variables.js +++ b/files/variables.js @@ -1,11 +1,31 @@ // Holds the global variables, functions, and math operations such as the day counter and food eaten.. +const death = require("./deathscreens"); module.exports = { - sleep + day, + location, + ammo, + food, + foodAmt, + health, + travelSpeed, + isRadiated, + radSeverity, + isSick, + sickSeverity, + inventory, + eatfood, + calcLocation, + calcSickPoints, + scavenge, + sleep, + checkLose, }; var day = 0; // Should we add a definite end? 365 Days? +var location = 0; // Location in the world, 0 is Control Station Enclave, 200 is Raven rock. + var ammo = 0; // No cap :) var food = 0; // Max: 200 @@ -27,8 +47,9 @@ var inventory = []; // Max of 5 items var lootTables = [[],[],[],[],[]] // 5 Loot tables per scavenge score, 3 items in each, first is best function eatfood() { + if (food == 0) { health - 20 } if (isSick == true) { food = food-((travelSpeed*foodAmt)+sickSeverity); } - else { food = food-(travelSpeed*3); } + else { food = food-(travelSpeed*foodAmt); } health = health+(5*foodAmt); } @@ -67,3 +88,35 @@ function sleep(time) { setTimeout(() => {}, time); } +function checkLose() { + if (health <= 0 || sickPoints >= 50) { + deathScreen(); + } + if (day >= 365) { + timeDeath(); + } +} + +function calcLocation() { // 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; + } else { + location++; + } + } + if (travelSpeed == 2) { + if (isSick == true) { + location = location+1.5; + } else { + location = location+2; + } + } + if (travelSpeed == 3) { + if (isSick == true) { + location = location+2.25; + } else { + location = location+3; + } + } +} \ No newline at end of file