0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 08:50:43 -05:00

Split maxExtracts into additional maxExtractsWithSpecificExit for repeatable quests

This commit is contained in:
Dev 2023-11-18 12:32:03 +00:00
parent fa1e15897a
commit 79cb201b82
3 changed files with 14 additions and 7 deletions

View File

@ -262,7 +262,8 @@
], ],
"questConfig": { "questConfig": {
"Exploration": { "Exploration": {
"maxExtracts": 3, "maxExtracts": 5,
"maxExtractsWithSpecificExit": 3,
"possibleSkillRewards": ["Endurance", "Strength", "Vitality"], "possibleSkillRewards": ["Endurance", "Strength", "Vitality"],
"specificExits": { "specificExits": {
"probability": 0.25, "probability": 0.25,
@ -901,7 +902,8 @@
"questConfig": { "questConfig": {
"Exploration": { "Exploration": {
"possibleSkillRewards": ["Endurance", "Strength", "Vitality"], "possibleSkillRewards": ["Endurance", "Strength", "Vitality"],
"maxExtracts": 10, "maxExtracts": 25,
"maxExtractsWithSpecificExit": 12,
"specificExits": { "specificExits": {
"probability": 0.4, "probability": 0.4,
"passageRequirementWhitelist": [ "passageRequirementWhitelist": [
@ -1522,7 +1524,8 @@
"questConfig": { "questConfig": {
"Exploration": { "Exploration": {
"possibleSkillRewards": ["Endurance", "Strength", "Vitality"], "possibleSkillRewards": ["Endurance", "Strength", "Vitality"],
"maxExtracts": 3, "maxExtracts": 4,
"maxExtractsWithSpecificExit": 2,
"specificExits": { "specificExits": {
"probability": 0.25, "probability": 0.25,
"passageRequirementWhitelist": [ "passageRequirementWhitelist": [

View File

@ -680,6 +680,7 @@ export class RepeatableQuestGenerator
): IExploration ): IExploration
{ {
const explorationConfig = repeatableConfig.questConfig.Exploration; const explorationConfig = repeatableConfig.questConfig.Exploration;
const requiresSpecificExtract = Math.random() < repeatableConfig.questConfig.Exploration.specificExits.probability;
if (Object.keys(questTypePool.pool.Exploration.locations).length === 0) if (Object.keys(questTypePool.pool.Exploration.locations).length === 0)
{ {
@ -696,7 +697,8 @@ export class RepeatableQuestGenerator
// remove the location from the available pool // remove the location from the available pool
delete questTypePool.pool.Exploration.locations[locationKey]; delete questTypePool.pool.Exploration.locations[locationKey];
const numExtracts = this.randomUtil.randInt(1, explorationConfig.maxExtracts + 1); // Different max extract count when specific extract needed
const numExtracts = this.randomUtil.randInt(1, requiresSpecificExtract ? explorationConfig.maxExtractsWithSpecificExit : explorationConfig.maxExtracts + 1);
const quest = this.generateRepeatableTemplate("Exploration", traderId, repeatableConfig.side) as IExploration; const quest = this.generateRepeatableTemplate("Exploration", traderId, repeatableConfig.side) as IExploration;
@ -715,7 +717,8 @@ export class RepeatableQuestGenerator
quest.conditions.AvailableForFinish[0]._props.id = this.objectId.generate(); quest.conditions.AvailableForFinish[0]._props.id = this.objectId.generate();
quest.location = this.getQuestLocationByMapId(locationKey); quest.location = this.getQuestLocationByMapId(locationKey);
if (Math.random() < repeatableConfig.questConfig.Exploration.specificExits.probability)
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 // Scav exits are not listed at all in locations.base currently. If that changes at some point, additional filtering will be required

View File

@ -89,8 +89,9 @@ export interface IRepeatableQuestTypesConfig
export interface IExploration extends IBaseQuestConfig export interface IExploration extends IBaseQuestConfig
{ {
maxExtracts: number; maxExtracts: number
specificExits: ISpecificExits; maxExtractsWithSpecificExit: number
specificExits: ISpecificExits
} }
export interface ISpecificExits export interface ISpecificExits