Blacklist required items from reward pool for repeatable 'completion' quests,
e.g. , fetch 5 kek tapes, get rewarded 3 kek tapes
This commit is contained in:
parent
ad95b227dd
commit
8b0eaad0c3
@ -449,8 +449,6 @@ export class RepeatableQuestGenerator {
|
|||||||
const levelsConfig = repeatableConfig.rewardScaling.levels;
|
const levelsConfig = repeatableConfig.rewardScaling.levels;
|
||||||
const roublesConfig = repeatableConfig.rewardScaling.roubles;
|
const roublesConfig = repeatableConfig.rewardScaling.roubles;
|
||||||
|
|
||||||
const distinctItemsToRetrieveCount = this.randomUtil.getInt(1, completionConfig.uniqueItemCount);
|
|
||||||
|
|
||||||
const quest = this.generateRepeatableTemplate("Completion", traderId, repeatableConfig.side);
|
const quest = this.generateRepeatableTemplate("Completion", traderId, repeatableConfig.side);
|
||||||
|
|
||||||
// Filter the items.json items to items the player must retrieve to complete quest: shouldn't be a quest item or "non-existant"
|
// Filter the items.json items to items the player must retrieve to complete quest: shouldn't be a quest item or "non-existant"
|
||||||
@ -519,6 +517,8 @@ export class RepeatableQuestGenerator {
|
|||||||
let isAmmo = 0;
|
let isAmmo = 0;
|
||||||
|
|
||||||
// Store the indexes of items we are asking player to provide
|
// Store the indexes of items we are asking player to provide
|
||||||
|
const distinctItemsToRetrieveCount = this.randomUtil.getInt(1, completionConfig.uniqueItemCount);
|
||||||
|
const chosenRequirementItemsTpls = [];
|
||||||
const usedItemIndexes = new Set();
|
const usedItemIndexes = new Set();
|
||||||
for (let i = 0; i < distinctItemsToRetrieveCount; i++) {
|
for (let i = 0; i < distinctItemsToRetrieveCount; i++) {
|
||||||
let chosenItemIndex = this.randomUtil.randInt(itemSelection.length);
|
let chosenItemIndex = this.randomUtil.randInt(itemSelection.length);
|
||||||
@ -573,6 +573,7 @@ export class RepeatableQuestGenerator {
|
|||||||
roublesBudget -= value * itemUnitPrice;
|
roublesBudget -= value * itemUnitPrice;
|
||||||
|
|
||||||
// Push a CompletionCondition with the item and the amount of the item
|
// Push a CompletionCondition with the item and the amount of the item
|
||||||
|
chosenRequirementItemsTpls.push(itemSelected[0]);
|
||||||
quest.conditions.AvailableForFinish.push(this.generateCompletionAvailableForFinish(itemSelected[0], value));
|
quest.conditions.AvailableForFinish.push(this.generateCompletionAvailableForFinish(itemSelected[0], value));
|
||||||
|
|
||||||
if (roublesBudget > 0) {
|
if (roublesBudget > 0) {
|
||||||
@ -594,6 +595,7 @@ export class RepeatableQuestGenerator {
|
|||||||
traderId,
|
traderId,
|
||||||
repeatableConfig,
|
repeatableConfig,
|
||||||
completionConfig,
|
completionConfig,
|
||||||
|
chosenRequirementItemsTpls,
|
||||||
);
|
);
|
||||||
|
|
||||||
return quest;
|
return quest;
|
||||||
|
Loading…
Reference in New Issue
Block a user