Expanded pmcConfig.maxBackpackLootTotalRub
to work per PMC level
non-PMC backpack loot is no longer limited to 150,000 roubles
This commit is contained in:
parent
9df2c90285
commit
24cd94abd3
@ -718,7 +718,29 @@
|
|||||||
"min": 1,
|
"min": 1,
|
||||||
"max": 1
|
"max": 1
|
||||||
},
|
},
|
||||||
"maxBackpackLootTotalRub": 150000,
|
"maxBackpackLootTotalRub": [
|
||||||
|
{
|
||||||
|
"min": 1,
|
||||||
|
"max": 15,
|
||||||
|
"value": 100000
|
||||||
|
},{
|
||||||
|
"min": 16,
|
||||||
|
"max": 35,
|
||||||
|
"value": 250000
|
||||||
|
},{
|
||||||
|
"min": 36,
|
||||||
|
"max": 45,
|
||||||
|
"value": 450000
|
||||||
|
},{
|
||||||
|
"min": 46,
|
||||||
|
"max": 64,
|
||||||
|
"value": 750000
|
||||||
|
},{
|
||||||
|
"min": 65,
|
||||||
|
"max": 100,
|
||||||
|
"value": 2500000
|
||||||
|
}
|
||||||
|
],
|
||||||
"maxPocketLootTotalRub": 50000,
|
"maxPocketLootTotalRub": 50000,
|
||||||
"maxVestLootTotalRub": 50000,
|
"maxVestLootTotalRub": 50000,
|
||||||
"convertIntoPmcChance": {
|
"convertIntoPmcChance": {
|
||||||
|
@ -260,6 +260,7 @@ export class BotLootGenerator {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const backpackLootRoubleTotal = this.getBackpackRoubleTotalByLevel(botLevel, isPmc);
|
||||||
this.addLootFromPool(
|
this.addLootFromPool(
|
||||||
this.botLootCacheService.getLootFromCache(botRole, isPmc, LootCacheType.BACKPACK, botJsonTemplate),
|
this.botLootCacheService.getLootFromCache(botRole, isPmc, LootCacheType.BACKPACK, botJsonTemplate),
|
||||||
[EquipmentSlots.BACKPACK],
|
[EquipmentSlots.BACKPACK],
|
||||||
@ -267,7 +268,7 @@ export class BotLootGenerator {
|
|||||||
botInventory,
|
botInventory,
|
||||||
botRole,
|
botRole,
|
||||||
botItemLimits,
|
botItemLimits,
|
||||||
this.pmcConfig.maxBackpackLootTotalRub,
|
backpackLootRoubleTotal,
|
||||||
isPmc,
|
isPmc,
|
||||||
containersIdFull,
|
containersIdFull,
|
||||||
);
|
);
|
||||||
@ -320,6 +321,24 @@ export class BotLootGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the rouble cost total for loot in a bots backpack by the bots levl
|
||||||
|
* Will return 0 for non PMCs
|
||||||
|
* @param botLevel Bots level
|
||||||
|
* @param isPmc Is the bot a PMC
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
protected getBackpackRoubleTotalByLevel(botLevel: number, isPmc: boolean): number {
|
||||||
|
if (isPmc) {
|
||||||
|
const matchingValue = this.pmcConfig.maxBackpackLootTotalRub.find(
|
||||||
|
(minMaxValue) => botLevel >= minMaxValue.min && botLevel <= minMaxValue.max,
|
||||||
|
);
|
||||||
|
return matchingValue.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an array of the containers a bot has on them (pockets/backpack/vest)
|
* Get an array of the containers a bot has on them (pockets/backpack/vest)
|
||||||
* @param botInventory Bot to check
|
* @param botInventory Bot to check
|
||||||
|
@ -32,7 +32,7 @@ export interface IPmcConfig extends IBaseConfig {
|
|||||||
bearType: string;
|
bearType: string;
|
||||||
/** What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear */
|
/** What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear */
|
||||||
pmcType: Record<string, Record<string, Record<string, number>>>;
|
pmcType: Record<string, Record<string, Record<string, number>>>;
|
||||||
maxBackpackLootTotalRub: number;
|
maxBackpackLootTotalRub: MinMaxLootValue[];
|
||||||
maxPocketLootTotalRub: number;
|
maxPocketLootTotalRub: number;
|
||||||
maxVestLootTotalRub: number;
|
maxVestLootTotalRub: number;
|
||||||
/** Percentage chance a bot from a wave is converted into a PMC, key = bot wildspawn tpye (assault/exusec), value: min+max chance to be converted */
|
/** Percentage chance a bot from a wave is converted into a PMC, key = bot wildspawn tpye (assault/exusec), value: min+max chance to be converted */
|
||||||
@ -60,3 +60,7 @@ export interface SlotLootSettings {
|
|||||||
whitelist: string[];
|
whitelist: string[];
|
||||||
blacklist: string[];
|
blacklist: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MinMaxLootValue extends MinMax {
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user