This commit is contained in:
parent
2e8c612f93
commit
0be7cfbfa3
@ -37,7 +37,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
||||
reward?: {
|
||||
type: string;
|
||||
count?: number; // default 1
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const needProcess: _HandleItem[] = [];
|
||||
@ -45,7 +45,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
||||
if (!syndicate.Initiated) {
|
||||
needProcess.push({
|
||||
sacrifice: manifest.initiationSacrifice,
|
||||
reward: manifest.initiationReward ? { type: manifest.initiationReward } : undefined,
|
||||
reward: manifest.initiationReward ? { type: manifest.initiationReward } : undefined
|
||||
});
|
||||
syndicate.Initiated = true;
|
||||
}
|
||||
@ -55,7 +55,9 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
||||
newLevel = res.Level = data.SacrificeLevel;
|
||||
res.LevelIncrease = data.SacrificeLevel - oldLevel;
|
||||
} else {
|
||||
titles.filter(x => x.level > oldLevel && x.minStanding <= currentStanding).forEach(x => {
|
||||
titles
|
||||
.filter(x => x.level > oldLevel && x.minStanding <= currentStanding)
|
||||
.forEach(x => {
|
||||
if (x.level > newLevel) newLevel = x.level;
|
||||
const item: _HandleItem = {};
|
||||
if (x.sacrifice) {
|
||||
@ -69,7 +71,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
||||
if (item.sacrifice || item.reward) {
|
||||
needProcess.push(item);
|
||||
}
|
||||
})
|
||||
});
|
||||
res.Level = newLevel;
|
||||
res.LevelIncrease = newLevel - oldLevel;
|
||||
}
|
||||
@ -102,12 +104,14 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
||||
if (isNightwave) {
|
||||
res.NewEpisodeReward = needProcess.length > 0;
|
||||
} else {
|
||||
manifest.favours.filter(x => x.rankUpReward && x.requiredLevel <= newLevel).forEach(x => {
|
||||
manifest.favours
|
||||
.filter(x => x.rankUpReward && x.requiredLevel <= newLevel)
|
||||
.forEach(x => {
|
||||
syndicate.FreeFavorsEarned ??= [];
|
||||
if (!syndicate.FreeFavorsEarned.includes(x.requiredLevel)) {
|
||||
syndicate.FreeFavorsEarned.push(x.requiredLevel);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
syndicate.Title = newLevel;
|
||||
await inventory.save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user