Shops, encounters, poi menus, items, and some other stuff. Poi dialogue and combat left!
This commit is contained in:
parent
22975aff26
commit
8485d7d800
6 changed files with 371 additions and 142 deletions
|
|
@ -28,7 +28,6 @@ export function randomNumber(min, max) { // Takes in two parameters, min and max
|
|||
return randNum;
|
||||
}
|
||||
|
||||
|
||||
// Used for game
|
||||
export function healthCapCalc() { // Calculates HP cap given current radPoints
|
||||
healthCap = healthCap-radPoints;
|
||||
|
|
@ -85,24 +84,24 @@ export function calcLocation() {
|
|||
}
|
||||
if (walkRate == 2) {
|
||||
if (path == 0) {
|
||||
location * 2;
|
||||
location + 2;
|
||||
}
|
||||
if (path == 1) {
|
||||
locationA * 2;
|
||||
locationA + 2;
|
||||
}
|
||||
if (path == 2) {
|
||||
locationB * 2;
|
||||
locationB + 2;
|
||||
}
|
||||
}
|
||||
if (walkRate == 3) {
|
||||
if (path == 0) {
|
||||
location * 3;
|
||||
location + 3;
|
||||
}
|
||||
if (path == 1) {
|
||||
locationA * 3;
|
||||
locationA + 3;
|
||||
}
|
||||
if (path == 2) {
|
||||
locationB * 3;
|
||||
locationB + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -174,7 +173,7 @@ function death3(dc) {
|
|||
function death4(dc) {
|
||||
console.clear();
|
||||
sleep(2);
|
||||
console.log("You have been killed, therefore you are DEAD...\n\n");
|
||||
console.log("You have been killed, therefore you are dead...\n\n");
|
||||
console.log(" \\|/");
|
||||
console.log(" _/\\___<0> | ");
|
||||
console.log("-------------------------------\n\n");
|
||||
|
|
@ -226,10 +225,10 @@ export function travelScreen() {
|
|||
console.log("│ . . - . . - . . . - │");
|
||||
console.log("│ - . . . . . . - . .│");
|
||||
console.log("└──────────────────────────────────────┘");
|
||||
console.log("Press [ENTER] to open Pip-Boy");
|
||||
console.log("Press [SPACE] to open Pip-Boy");
|
||||
console.log("Current Health: "+health);
|
||||
console.log("Food Amt: "+food);
|
||||
console.log("Distance to next POI: ");
|
||||
console.log("Distance to next POI: " + pois[poiCounter].location-location);
|
||||
travelFrame++
|
||||
} else if (travelFrame == 1) {
|
||||
console.clear();
|
||||
|
|
@ -248,10 +247,10 @@ export function travelScreen() {
|
|||
console.log("│ - . - . . . - . - . │");
|
||||
console.log("│ - . . - . . . - .│");
|
||||
console.log("└──────────────────────────────────────┘");
|
||||
console.log("Press [ENTER] to open Pip-Boy");
|
||||
console.log("Press [SPACE] to open Pip-Boy");
|
||||
console.log("Current Health: "+health);
|
||||
console.log("Food Amt: "+food);
|
||||
console.log("Distance to next POI: ");
|
||||
console.log("Distance to next POI: " + pois[poiCounter].location-location);
|
||||
travelFrame++
|
||||
} else if (travelFrame == 2) {
|
||||
console.clear();
|
||||
|
|
@ -270,10 +269,10 @@ export function travelScreen() {
|
|||
console.log("│ - . - . . . - . - . │");
|
||||
console.log("│ - . . - . . . - .│");
|
||||
console.log("└──────────────────────────────────────┘");
|
||||
console.log("Press [ENTER] to open Pip-Boy");
|
||||
console.log("Press [SPACE] to open Pip-Boy");
|
||||
console.log("Current Health: "+health);
|
||||
console.log("Food Amt: "+food);
|
||||
console.log("Distance to next POI: ");
|
||||
console.log("Distance to next POI: " + pois[poiCounter].location-location);
|
||||
travelFrame++
|
||||
} else if (travelFrame == 3) {
|
||||
console.clear();
|
||||
|
|
@ -292,10 +291,10 @@ export function travelScreen() {
|
|||
console.log("│ - . - . . . - . - . │");
|
||||
console.log("│ - . . - . . . - .│");
|
||||
console.log("└──────────────────────────────────────┘");
|
||||
console.log("Press [ENTER] to open Pip-Boy");
|
||||
console.log("Press [SPACE] to open Pip-Boy");
|
||||
console.log("Current Health: "+health);
|
||||
console.log("Food Amt: "+food);
|
||||
console.log("Distance to next POI: ");
|
||||
console.log("Distance to next POI: " + pois[poiCounter].location-location);
|
||||
travelFrame=0;
|
||||
}
|
||||
}
|
||||
|
|
@ -360,7 +359,7 @@ export function pauseScreen() {
|
|||
console.log ("3) View Distances");
|
||||
console.log ("4) View Stats");
|
||||
console.log ("5) Scavenge");
|
||||
console.log ("6) Test Death");
|
||||
console.log ("6) Change Speed/Food Rate");
|
||||
let pauseInput = userInput("Enter: ");
|
||||
switch(pauseInput) {
|
||||
case "1":
|
||||
|
|
@ -371,7 +370,6 @@ export function pauseScreen() {
|
|||
break;
|
||||
case "3":
|
||||
console.clear();
|
||||
console.log("Current Location: "+location);
|
||||
if (path == 0) {
|
||||
console.log("Current Path: Main");
|
||||
}
|
||||
|
|
@ -396,7 +394,7 @@ export function pauseScreen() {
|
|||
console.log(pois[i].name+" - "+visited[i]);
|
||||
}
|
||||
if (pois[i].visited == false) {
|
||||
console.log("??? "+pois[i].location-location+" location points away");
|
||||
console.log("??? "+pois[i].location-locationA+" location points away");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -406,7 +404,7 @@ export function pauseScreen() {
|
|||
console.log(pois[i].name+" - "+visited[i]);
|
||||
}
|
||||
if (pois[i].visited == false) {
|
||||
console.log("??? "+pois[i].location-location+" location points away");
|
||||
console.log("??? "+pois[i].location-locationB+" location points away");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -424,7 +422,7 @@ export function pauseScreen() {
|
|||
console.log("Walk Rate: "+walkRate);
|
||||
console.log("Food Amt: "+food);
|
||||
console.log("Food Rate: "+foodRate);
|
||||
console.log("Current Location: "+location);
|
||||
console.log("Distance to next POI: " + pois[poiCounter].location-location);
|
||||
console.log("Current Path: "+path);
|
||||
userInput("\n[Press Enter to return]");
|
||||
break;
|
||||
|
|
@ -432,7 +430,38 @@ export function pauseScreen() {
|
|||
scavenge();
|
||||
break;
|
||||
case "6":
|
||||
testDeath = true;
|
||||
console.clear();
|
||||
console.log("Current Walk Rate: "+walkRate);
|
||||
console.log("Current Food Rate: "+foodRate);
|
||||
console.log("---------------------------");
|
||||
console.log("What would you like to change?");
|
||||
console.log("---------------------------");
|
||||
console.log("1) Walk Rate");
|
||||
console.log("2) Food Rate");
|
||||
let rateInput = userInput("Enter: ");
|
||||
switch(rateInput) {
|
||||
case "1":
|
||||
console.log("Current Walk Rate: "+walkRate);
|
||||
let walkRateInput = userInput("Enter new Walk Rate (1-3): ");
|
||||
if (walkRateInput >= 1 && walkRateInput <= 3) {
|
||||
walkRate = walkRateInput;
|
||||
} else {
|
||||
console.log("Invalid input. Walk Rate not changed.");
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
console.log("Current Food Rate: "+foodRate);
|
||||
let foodRateInput = userInput("Enter new Food Rate (1-3): ");
|
||||
if (foodRateInput >= 1 && foodRateInput <= 3) {
|
||||
foodRate = foodRateInput;
|
||||
} else {
|
||||
console.log("Invalid input. Food Rate not changed.");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.log("Invalid input. No changes made.");
|
||||
}
|
||||
userInput("\n[Press Enter to return]");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue