mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Improve logic for choosing an exit inside generateExplorationQuest()
This commit is contained in:
parent
628a3f71d8
commit
92e600e906
@ -722,14 +722,21 @@ export class RepeatableQuestGenerator
|
|||||||
// Scav exits are not listed at all in locations.base currently. If that changes at some point, additional filtering will be required
|
// Scav exits are not listed at all in locations.base currently. If that changes at some point, additional filtering will be required
|
||||||
const mapExits =
|
const mapExits =
|
||||||
(this.databaseServer.getTables().locations[locationKey.toLowerCase()].base as ILocationBase).exits;
|
(this.databaseServer.getTables().locations[locationKey.toLowerCase()].base as ILocationBase).exits;
|
||||||
const possibleExists = mapExits.filter((x) =>
|
|
||||||
(!("PassageRequirement" in x)
|
// Only get exits that have a greater than 0% chance to spawn
|
||||||
|
const exitPool = mapExits.filter(exit => exit.Chance > 0);
|
||||||
|
const possibleExits = exitPool.filter((exit) =>
|
||||||
|
(!("PassageRequirement" in exit)
|
||||||
|| repeatableConfig.questConfig.Exploration.specificExits.passageRequirementWhitelist.includes(
|
|| repeatableConfig.questConfig.Exploration.specificExits.passageRequirementWhitelist.includes(
|
||||||
x.PassageRequirement,
|
exit.PassageRequirement
|
||||||
)) && x.Chance > 0
|
))
|
||||||
);
|
);
|
||||||
const exit = this.randomUtil.drawRandomFromList(possibleExists, 1)[0];
|
|
||||||
const exitCondition = this.generateExplorationExitCondition(exit);
|
// Choose one of the exits we filtered above
|
||||||
|
const chosenExit = this.randomUtil.drawRandomFromList(possibleExits, 1)[0];
|
||||||
|
|
||||||
|
// Create a quest condition to leave raid via chosen exit
|
||||||
|
const exitCondition = this.generateExplorationExitCondition(chosenExit);
|
||||||
quest.conditions.AvailableForFinish[0].counter.conditions.push(exitCondition);
|
quest.conditions.AvailableForFinish[0].counter.conditions.push(exitCondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +225,7 @@ export interface Props
|
|||||||
|
|
||||||
export interface Exit
|
export interface Exit
|
||||||
{
|
{
|
||||||
|
/** % Chance out of 100 exit will appear in raid */
|
||||||
Chance: number;
|
Chance: number;
|
||||||
Count: number;
|
Count: number;
|
||||||
EntryPoints: string;
|
EntryPoints: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user