Refactor of ammo reward calculaton for daily quests
No longer give random value between config min and stack max size (mods that adjust max stack size were causing very broken behaviour) Ammo stack size is now chosen based on rouble budget for reward, capped at a count of 100 Adjust config min stack size to be 5, this still achieves goal of preventing single stack ammos like grenades but allows inclusion of ammos like patron_12x70_buckshot
This commit is contained in:
parent
7950bef43e
commit
cc916ff419
@ -807,7 +807,7 @@
|
||||
},
|
||||
"rewardBaseTypeBlacklist": ["543be5e94bdc2df1348b4568", "5b3f15d486f77432d0509248", "59f32c3b86f77472a31742f0", "59f32bb586f774757e1e8442"],
|
||||
"rewardBlacklist": ["627bce33f21bc425b06ab967"],
|
||||
"rewardAmmoStackMinSize": 20
|
||||
"rewardAmmoStackMinSize": 5
|
||||
}, {
|
||||
"id": "618035d38012292db3081bf0",
|
||||
"name": "Weekly",
|
||||
@ -1544,7 +1544,7 @@
|
||||
},
|
||||
"rewardBaseTypeBlacklist": ["543be5e94bdc2df1348b4568", "5b3f15d486f77432d0509248", "59f32c3b86f77472a31742f0", "59f32bb586f774757e1e8442"],
|
||||
"rewardBlacklist": ["627bce33f21bc425b06ab967"],
|
||||
"rewardAmmoStackMinSize": 15
|
||||
"rewardAmmoStackMinSize": 5
|
||||
}, {
|
||||
"id": "62825ef60e88d037dc1eb426",
|
||||
"name": "Daily_Savage",
|
||||
@ -1903,7 +1903,7 @@
|
||||
},
|
||||
"rewardBaseTypeBlacklist": ["543be5e94bdc2df1348b4568", "5b3f15d486f77432d0509248"],
|
||||
"rewardBlacklist": ["627bce33f21bc425b06ab967"],
|
||||
"rewardAmmoStackMinSize": 15
|
||||
"rewardAmmoStackMinSize": 5
|
||||
}
|
||||
],
|
||||
"locationIdMap": {
|
||||
|
@ -937,11 +937,19 @@ export class RepeatableQuestGenerator
|
||||
continue;
|
||||
}
|
||||
|
||||
// Randomise the cartridge count returned
|
||||
rewardItemStackCount = this.randomUtil.randInt(
|
||||
repeatableConfig.rewardAmmoStackMinSize,
|
||||
itemSelected._props.StackMaxSize,
|
||||
);
|
||||
// The budget for this ammo stack
|
||||
const stackRoubleBudget = roublesBudget / rewardNumItems;
|
||||
|
||||
const singleCartridgePrice = this.handbookHelper.getTemplatePrice(itemSelected._id);
|
||||
|
||||
// Get a stack size of ammo that fits budget
|
||||
const stackSizeThatFitsBudget = Math.round(stackRoubleBudget / singleCartridgePrice);
|
||||
|
||||
// Get itemDbs max stack size for ammo - dont go above 100 (some mods mess around with stack sizes)
|
||||
const stackMaxCount = Math.min(itemSelected._props.StackMaxSize, 100);
|
||||
|
||||
// Choose smallest between stack max and budget fitting size
|
||||
rewardItemStackCount = Math.min(stackSizeThatFitsBudget, stackMaxCount);
|
||||
}
|
||||
|
||||
// 25% chance to double reward stack (item should be stackable and not weapon)
|
||||
|
Loading…
x
Reference in New Issue
Block a user