Added labs to pmc conversion system
This commit is contained in:
parent
12c602b578
commit
a477b0b584
@ -778,30 +778,12 @@
|
||||
"assault": {
|
||||
"min": 10,
|
||||
"max": 15
|
||||
},
|
||||
"cursedassault": {
|
||||
"min": 15,
|
||||
"max": 30
|
||||
},
|
||||
}
|
||||
},
|
||||
"laboratory":{
|
||||
"pmcbot": {
|
||||
"min": 5,
|
||||
"max": 10
|
||||
},
|
||||
"exusec": {
|
||||
"min": 5,
|
||||
"min": 1,
|
||||
"max": 5
|
||||
},
|
||||
"arenafighter": {
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"arenafighterevent": {
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"crazyassaultevent": {
|
||||
"min": 0,
|
||||
"max": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -397,7 +397,11 @@ export class BotController {
|
||||
const botConvertRateMinMax = this.getPmcConversionMinMaxForLocation(requestedBot.Role, raidSettings?.location);
|
||||
if (botConvertRateMinMax) {
|
||||
// Should bot become PMC
|
||||
const convertToPmc = this.botHelper.rollChanceToBePmc(requestedBot.Role, botConvertRateMinMax);
|
||||
const convertToPmc = this.botHelper.rollChanceToBePmc(
|
||||
requestedBot.Role,
|
||||
botConvertRateMinMax,
|
||||
raidSettings?.location,
|
||||
);
|
||||
if (convertToPmc) {
|
||||
botGenerationDetails.isPmc = true;
|
||||
botGenerationDetails.role = this.botHelper.getRandomizedPmcRole();
|
||||
|
@ -92,13 +92,22 @@ export class BotHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean {
|
||||
public rollChanceToBePmc(role: string, botConvertMinMax: MinMax, location: string): boolean {
|
||||
return (
|
||||
role.toLowerCase() in this.pmcConfig.convertIntoPmcChance &&
|
||||
role.toLowerCase() in this.getPmcConversionValuesForLocation(location) &&
|
||||
this.randomUtil.getChance100(this.randomUtil.getInt(botConvertMinMax.min, botConvertMinMax.max))
|
||||
);
|
||||
}
|
||||
|
||||
protected getPmcConversionValuesForLocation(location: string) {
|
||||
const result = this.pmcConfig.convertIntoPmcChance[location.toLowerCase()];
|
||||
if (!result) {
|
||||
this.pmcConfig.convertIntoPmcChance.default;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* is the provided role a PMC, case-agnostic
|
||||
* @param botRole Role to check
|
||||
|
Loading…
Reference in New Issue
Block a user