Filter repeatable explore quest map exits per side
This commit is contained in:
parent
29573c1418
commit
34628561ce
@ -731,9 +731,7 @@ export class RepeatableQuestGenerator
|
|||||||
if (requiresSpecificExtract)
|
if (requiresSpecificExtract)
|
||||||
{
|
{
|
||||||
// Filter by whitelist, it's also possible that the field "PassageRequirement" does not exist (e.g. Shoreline)
|
// Filter by whitelist, it's also possible that the field "PassageRequirement" does not exist (e.g. Shoreline)
|
||||||
// Scav exits are not listed at all in locations.base currently. If that changes at some point, additional filtering will be required
|
const mapExits = this.getLocationExitsForSide(locationKey, repeatableConfig.side);
|
||||||
const mapExits =
|
|
||||||
(this.databaseServer.getTables().locations[locationKey.toLowerCase()].base as ILocationBase).exits;
|
|
||||||
|
|
||||||
// Only get exits that have a greater than 0% chance to spawn
|
// Only get exits that have a greater than 0% chance to spawn
|
||||||
const exitPool = mapExits.filter(exit => exit.Chance > 0);
|
const exitPool = mapExits.filter(exit => exit.Chance > 0);
|
||||||
@ -760,6 +758,34 @@ export class RepeatableQuestGenerator
|
|||||||
return quest;
|
return quest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter a maps exits to just those for the desired side
|
||||||
|
* @param locationKey Map id (e.g. factory4_day)
|
||||||
|
* @param playerSide Scav/Bear
|
||||||
|
* @returns Array of Exit objects
|
||||||
|
*/
|
||||||
|
protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[]
|
||||||
|
{
|
||||||
|
const mapBase = this.databaseServer.getTables().locations[locationKey.toLowerCase()].base as ILocationBase;
|
||||||
|
|
||||||
|
const infilPointsOfSameSide = new Set();
|
||||||
|
for (const spawnPoint of mapBase.SpawnPointParams)
|
||||||
|
{
|
||||||
|
// Same side
|
||||||
|
if (spawnPoint.Sides.includes(playerSide)
|
||||||
|
|| spawnPoint.Sides.includes("All"))
|
||||||
|
{
|
||||||
|
// Has specific start location
|
||||||
|
if (spawnPoint.Infiltration.length > 0)
|
||||||
|
{
|
||||||
|
infilPointsOfSameSide.add(spawnPoint.Infiltration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mapBase.exits.filter(exit => Array.from(infilPointsOfSameSide).includes(exit.EntryPoints));
|
||||||
|
}
|
||||||
|
|
||||||
protected generatePickupQuest(
|
protected generatePickupQuest(
|
||||||
pmcLevel: number,
|
pmcLevel: number,
|
||||||
traderId: string,
|
traderId: string,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user