Compare commits

..

No commits in common. "071ef528ea75adcab760869caea4f274630ba991" and "3c019e41b9a8b75ca82190cc2f22fd7af614a928" have entirely different histories.

2 changed files with 21 additions and 45 deletions

View File

@ -31,13 +31,13 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
AffiliationTag: data.AffiliationTag,
InventoryChanges: {},
Level: data.SacrificeLevel,
LevelIncrease: data.SacrificeLevel < 0 ? 1 : levelIncrease,
LevelIncrease: levelIncrease,
NewEpisodeReward: false
};
// Process sacrifices and rewards for every level we're reaching
const manifest = ExportSyndicates[data.AffiliationTag];
for (let level = oldLevel + Math.min(levelIncrease, 1); level <= data.SacrificeLevel; ++level) {
for (let level = oldLevel + levelIncrease; level <= data.SacrificeLevel; ++level) {
let sacrifice: ISyndicateSacrifice | undefined;
if (level == 0) {
sacrifice = manifest.initiationSacrifice;
@ -94,7 +94,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
}
// Commit
syndicate.Title = data.SacrificeLevel < 0 ? data.SacrificeLevel + 1 : data.SacrificeLevel;
syndicate.Title = data.SacrificeLevel;
await inventory.save();
response.json(res);

View File

@ -453,37 +453,13 @@ const pushWeeklyActs = (
}
};
const generateXpAmounts = (rng: SRng, stageCount: number, minXp: number, maxXp: number): number[] => {
const step = minXp < 1000 ? 1 : 10;
const totalDeciXp = rng.randomInt(minXp / step, maxXp / step);
const xpAmounts: number[] = [];
if (stageCount < 4) {
const perStage = Math.ceil(totalDeciXp / stageCount) * step;
for (let i = 0; i != stageCount; ++i) {
xpAmounts.push(perStage);
}
} else {
const perStage = Math.ceil(Math.round(totalDeciXp * 0.667) / (stageCount - 1)) * step;
for (let i = 0; i != stageCount - 1; ++i) {
xpAmounts.push(perStage);
}
xpAmounts.push(Math.ceil(totalDeciXp * 0.332) * step);
}
return xpAmounts;
};
// Test vectors:
//console.log(generateXpAmounts(new SRng(1337n), 5, 5000, 5000)); // [840, 840, 840, 840, 1660]
//console.log(generateXpAmounts(new SRng(1337n), 3, 40, 40)); // [14, 14, 14]
//console.log(generateXpAmounts(new SRng(1337n), 5, 150, 150)); // [25, 25, 25, 25, 50]
//console.log(generateXpAmounts(new SRng(1337n), 4, 10, 10)); // [2, 2, 2, 4]
//console.log(generateXpAmounts(new SRng(1337n), 4, 15, 15)); // [4, 4, 4, 5]
//console.log(generateXpAmounts(new SRng(1337n), 4, 20, 20)); // [5, 5, 5, 7]
export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[], bountyCycle: number): void => {
const table = String.fromCharCode(65 + (bountyCycle % 3));
const vaultTable = String.fromCharCode(65 + ((bountyCycle + 1) % 3));
const deimosDTable = String.fromCharCode(65 + (bountyCycle % 2));
// TODO: xpAmounts need to be calculated based on the jobType somehow?
const seed = new SRng(bountyCycle).randomInt(0, 100_000);
const bountyCycleStart = bountyCycle * 9000000;
const bountyCycleEnd = bountyCycleStart + 9000000;
@ -506,7 +482,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 0,
minEnemyLevel: 5,
maxEnemyLevel: 15,
xpAmounts: generateXpAmounts(rng, 3, 1000, 1500)
xpAmounts: [430, 430, 430]
},
{
jobType: rng.randomElement(eidolonJobs),
@ -514,7 +490,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 1,
minEnemyLevel: 10,
maxEnemyLevel: 30,
xpAmounts: generateXpAmounts(rng, 3, 1750, 2250)
xpAmounts: [620, 620, 620]
},
{
jobType: rng.randomElement(eidolonJobs),
@ -522,7 +498,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 2,
minEnemyLevel: 20,
maxEnemyLevel: 40,
xpAmounts: generateXpAmounts(rng, 4, 2500, 3000)
xpAmounts: [670, 670, 670, 990]
},
{
jobType: rng.randomElement(eidolonJobs),
@ -530,7 +506,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 3,
minEnemyLevel: 30,
maxEnemyLevel: 50,
xpAmounts: generateXpAmounts(rng, 5, 3250, 3750)
xpAmounts: [570, 570, 570, 570, 1110]
},
{
jobType: rng.randomElement(eidolonJobs),
@ -538,7 +514,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 5,
minEnemyLevel: 40,
maxEnemyLevel: 60,
xpAmounts: generateXpAmounts(rng, 5, 4000, 4500)
xpAmounts: [740, 740, 740, 740, 1450]
},
{
jobType: rng.randomElement(eidolonJobs),
@ -554,7 +530,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 0,
minEnemyLevel: 50,
maxEnemyLevel: 70,
xpAmounts: generateXpAmounts(rng, 5, 4500, 5000)
xpAmounts: [840, 840, 840, 840, 1650]
}
]
});
@ -578,7 +554,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 0,
minEnemyLevel: 5,
maxEnemyLevel: 15,
xpAmounts: generateXpAmounts(rng, 3, 1000, 1500)
xpAmounts: [340, 340, 340]
},
{
jobType: rng.randomElement(venusJobs),
@ -586,7 +562,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 1,
minEnemyLevel: 10,
maxEnemyLevel: 30,
xpAmounts: generateXpAmounts(rng, 3, 1750, 2250)
xpAmounts: [660, 660, 660]
},
{
jobType: rng.randomElement(venusJobs),
@ -594,7 +570,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 2,
minEnemyLevel: 20,
maxEnemyLevel: 40,
xpAmounts: generateXpAmounts(rng, 4, 2500, 3000)
xpAmounts: [610, 610, 610, 900]
},
{
jobType: rng.randomElement(venusJobs),
@ -602,7 +578,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 3,
minEnemyLevel: 30,
maxEnemyLevel: 50,
xpAmounts: generateXpAmounts(rng, 5, 3250, 3750)
xpAmounts: [600, 600, 600, 600, 1170]
},
{
jobType: rng.randomElement(venusJobs),
@ -610,7 +586,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 5,
minEnemyLevel: 40,
maxEnemyLevel: 60,
xpAmounts: generateXpAmounts(rng, 5, 4000, 4500)
xpAmounts: [690, 690, 690, 690, 1350]
},
{
jobType: rng.randomElement(venusJobs),
@ -626,7 +602,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 0,
minEnemyLevel: 50,
maxEnemyLevel: 70,
xpAmounts: generateXpAmounts(rng, 5, 4500, 5000)
xpAmounts: [780, 780, 780, 780, 1540]
}
]
});
@ -650,7 +626,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 0,
minEnemyLevel: 5,
maxEnemyLevel: 15,
xpAmounts: generateXpAmounts(rng, 3, 12, 18)
xpAmounts: [5, 5, 5]
},
{
jobType: rng.randomElement(microplanetJobs),
@ -658,7 +634,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 1,
minEnemyLevel: 15,
maxEnemyLevel: 25,
xpAmounts: generateXpAmounts(rng, 3, 24, 36)
xpAmounts: [12, 12, 12]
},
{
jobType: rng.randomElement(microplanetEndlessJobs),
@ -675,7 +651,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 2,
minEnemyLevel: 30,
maxEnemyLevel: 40,
xpAmounts: generateXpAmounts(rng, 4, 72, 88)
xpAmounts: [17, 17, 17, 25]
},
{
jobType: rng.randomElement(microplanetJobs),
@ -683,7 +659,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
masteryReq: 3,
minEnemyLevel: 40,
maxEnemyLevel: 60,
xpAmounts: generateXpAmounts(rng, 5, 115, 135)
xpAmounts: [22, 22, 22, 22, 43]
},
{
jobType: rng.randomElement(microplanetJobs),