Added comments for "poiscreens" and "encounters"

files
This commit is contained in:
Caroline Foy 2025-04-28 12:11:00 -05:00
parent 77cb3f4613
commit 1179fb5afc
2 changed files with 22 additions and 0 deletions

View file

@ -5,10 +5,16 @@ import './variables.js';
//5-50 abominations, 51-200 MWBOS, 201-255 legion, a5-a40 NCR, b0-b30 abomination, b40-b80 abomination, b90+ NCR, b80-b90 enclave
//HLE = high level encounter, this is a filter that determines if the player can get, as the name implies, high level encounters
//This function, which is called whenever the player moves, runs a quick calculation to determine if the player encounters
//an enemy. If they do encounter an enemy, the function uses the player's location to determine which enemy they encounter.
//The farther the player goes, the more likely they are to encounter a high-level enemy. Enemies scale in health and damage with
//the player's level.
export function naturalEncounter(location){
var HLE = false;
var encounter = false;
var encounterLuck = randomNumber(1, 100);
//Checks if the player gets an encounter, and what enemy pool the encounter comes from.
if(location > 250){
HLE = true;
}
@ -48,6 +54,7 @@ export function naturalEncounter(location){
}
}
//Draws the enemy/encounter from an array of different possible encounters.
if(encounter != false){
switch(encounter){
case "abomination":
@ -133,6 +140,8 @@ export function naturalEncounter(location){
}
};
//Used for when we need to ensure that the player encounters an enemy somewhere. Also used for combat testing.
//Function takes in the faction of the enemy, and if the enemy can be/has to be a high level encounter.
export function forcedEncounter(HLE, faction, forcedHLE){
var HLEDeterminant = randomNumber(1, 2)
if((HLE == true && HLEDeterminant == 1) || forcedHLE == true){
@ -172,6 +181,7 @@ export function forcedEncounter(HLE, faction, forcedHLE){
}
}
//A list of arrays with every possible enemy encounter, as well as their stats and equipment.
var raiderEncounters = [
{name: "Raider Aspirant", faction: "raider", minLevel: 1, maxLevel: 15, health: 10, weapon: equipmentList[2], armor: equipmentList[10]},
{name: "Raider", faction: "raider", minLevel: 15, maxLevel: 25, health: 10, weapon: equipmentList[2], armor: equipmentList[10]},