返回提交历史
Modified
src/services/missionInventoryUpdateService.ts
+110
-13
XFEstudio/SpaceNinjaServer
feat: nightmare mode rewards for pre-U19 (#3678)
Fixes #3579 ; tested on steam manifest 5378301586494814297, Second Dream, and 1764044531028780660, Shadows of the Dead (this one did not need the patch, rewards are generated client-side and are not validated, avoiding this code path altogether). Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3678 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: blinkie <blankneue@proton.me> Co-committed-by: blinkie <blankneue@proton.me>
958648ad
代码差异
1 个文件
+110
-13
@@ -2314,20 +2314,117 @@ function getRandomMissionDrops(
2314
2314
}
2315
2315
2316
2316
if (RewardInfo.nightmareMode) {
2317
const deck = ExportRewards["/Lotus/Types/Game/MissionDecks/NightmareModeRewards"];
2318
let rotation = 0;
2319
2320
if (region.missionType == "MT_RESCUE" && RewardInfo.rewardTier) {
2321
rotation = RewardInfo.rewardTier;
2322
} else if ([6, 7, 8, 10, 11].includes(region.systemIndex)) {
2323
rotation = 2;
2324
} else if ([4, 9, 12, 14, 15, 16, 17, 18].includes(region.systemIndex)) {
2325
rotation = 1;
2326
}
2317
// Pre-U19 nightmare mode used a single combined pool without A/B/C rotations
2318
// In U19, Chilling Reload, Drifting Contact, and Streamlined Form were added
2319
// and the rewards were split into A/B/C pools
2320
if (account.BuildLabel && version_compare(account.BuildLabel, "2016.10.27.13.03") < 0) {
2321
// In U19, they still had A/B/C probabilities, taken from wiki; all in one pool
2322
const preU19Pool: IReward[] = [
2323
// 8.431%
2324
{
2325
type: "/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/IceStormMod",
2326
itemCount: 1,
2327
probability: 0.08431
2328
}, // Ice Storm
2329
{
2330
type: "/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/StunningSpeedMod",
2331
itemCount: 1,
2332
probability: 0.08431
2333
}, // Stunning Speed
2334
{
2335
type: "/Lotus/StoreItems/Upgrades/Mods/Pistol/DualStat/GrinderMod",
2336
itemCount: 1,
2337
probability: 0.08431
2338
}, // Lethal Torrent
2339
{
2340
type: "/Lotus/StoreItems/Upgrades/Mods/Rifle/DualStat/WildfireMod",
2341
itemCount: 1,
2342
probability: 0.08431
2343
}, // Wildfire
2344
{
2345
type: "/Lotus/StoreItems/Upgrades/Mods/Rifle/DualStat/ShredMod",
2346
itemCount: 1,
2347
probability: 0.08431
2348
}, // Shred
2349
{
2350
type: "/Lotus/StoreItems/Upgrades/Mods/Shotgun/DualStat/AcceleratedBlastMod",
2351
itemCount: 1,
2352
probability: 0.08431
2353
}, // Accelerated Blast
2354
{
2355
type: "/Lotus/StoreItems/Upgrades/Mods/Warframe/DualStat/VigorMod",
2356
itemCount: 1,
2357
probability: 0.08431
2358
}, // Vigor
2359
{
2360
type: "/Lotus/StoreItems/Upgrades/Mods/Melee/DualStat/FocusEnergyMod",
2361
itemCount: 1,
2362
probability: 0.08431
2363
}, // Focus Energy
2364
{
2365
type: "/Lotus/StoreItems/Upgrades/Mods/Shotgun/DualStat/ReloadSpeedPunchThroughMod",
2366
itemCount: 1,
2367
probability: 0.08431
2368
}, // Seeking Fury
2369
// 5.527%
2370
{
2371
type: "/Lotus/StoreItems/Upgrades/Mods/Warframe/DualStat/ConstitutionMod",
2372
itemCount: 1,
2373
probability: 0.05527
2374
}, // Constitution
2375
{
2376
type: "/Lotus/StoreItems/Upgrades/Mods/Warframe/DualStat/FortitudeMod",
2377
itemCount: 1,
2378
probability: 0.05527
2379
}, // Fortitude
2380
{
2381
type: "/Lotus/StoreItems/Upgrades/Mods/Melee/DualStat/RendingStrikeMod",
2382
itemCount: 1,
2383
probability: 0.05527
2384
}, // Rending Strike
2385
{
2386
type: "/Lotus/StoreItems/Upgrades/Mods/Sentinel/SentinelLootRadarEnemyRadarMod",
2387
itemCount: 1,
2388
probability: 0.05527
2389
}, // Animal Instinct
2390
// 0.671%
2391
{
2392
type: "/Lotus/StoreItems/Upgrades/Mods/Rifle/DualStat/HammerShotMod",
2393
itemCount: 1,
2394
probability: 0.00671
2395
}, // Hammer Shot
2396
{
2397
type: "/Lotus/StoreItems/Upgrades/Mods/Shotgun/DualStat/BlazeMod",
2398
itemCount: 1,
2399
probability: 0.00671
2400
}, // Blaze
2401
{
2402
type: "/Lotus/StoreItems/Upgrades/Mods/Warframe/DualStat/RunSpeedArmorMod",
2403
itemCount: 1,
2404
probability: 0.00671
2405
} // Armored Agility
2406
];
2407
const drop = getRandomRewardByChance(preU19Pool);
2408
if (drop) {
2409
drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
2410
}
2411
} else {
2412
// U19+: A/B/C pool structure with rotations
2413
const deck = ExportRewards["/Lotus/Types/Game/MissionDecks/NightmareModeRewards"];
2414
let rotation = 0;
2415
2416
if (region.missionType == "MT_RESCUE" && RewardInfo.rewardTier) {
2417
rotation = RewardInfo.rewardTier;
2418
} else if ([6, 7, 8, 10, 11].includes(region.systemIndex)) {
2419
rotation = 2;
2420
} else if ([4, 9, 12, 14, 15, 16, 17, 18].includes(region.systemIndex)) {
2421
rotation = 1;
2422
}
2327
2423
2328
const drop = getRandomRewardByChance(deck[rotation]);
2329
if (drop) {
2330
drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
2424
const drop = getRandomRewardByChance(deck[rotation]);
2425
if (drop) {
2426
drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
2427
}
2331
2428
}
2332
2429
}
2333
2430