Move E4/Champion minimum BST values to consts

This commit is contained in:
NightKev 2024-09-29 19:45:27 -07:00
parent 6189572c57
commit 412c6dc4e8

View File

@ -18,6 +18,9 @@ import {Species} from "#enums/species";
import {TrainerType} from "#enums/trainer-type";
import {Gender} from "./gender";
const ELITE_FOUR_MINIMUM_BST = 460;
const CHAMPION_MINIMUM_BST = 508;
export enum TrainerPoolTier {
COMMON,
UNCOMMON,
@ -860,10 +863,10 @@ export class TrainerConfig {
// Set species filter and specialty types if provided, otherwise filter by base total.
if (specialtyTypes.length) {
this.setSpeciesFilter(p => specialtyTypes.some(t => p.isOfType(t)) && p.baseTotal >= 450);
this.setSpeciesFilter(p => specialtyTypes.some(t => p.isOfType(t)) && p.baseTotal >= ELITE_FOUR_MINIMUM_BST);
this.setSpecialtyTypes(...specialtyTypes);
} else {
this.setSpeciesFilter(p => p.baseTotal >= 460);
this.setSpeciesFilter(p => p.baseTotal >= ELITE_FOUR_MINIMUM_BST);
}
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
@ -914,7 +917,7 @@ export class TrainerConfig {
});
// Set species filter to only include species with a base total of 508 or higher.
this.setSpeciesFilter(p => p.baseTotal >= 508);
this.setSpeciesFilter(p => p.baseTotal >= CHAMPION_MINIMUM_BST);
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
const nameForCall = this.name.toLowerCase().replace(/\s/g, "_");