mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-20 20:15:50 +02:00
- remove any `.js` extension imports - remove unncessary dynamic imports of `modifier.ts` file. The file was being imported statically & dynamically. Made it pure static - increase vite chunk-size warning limit Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import BattleScene from "#app/battle-scene";
|
|
import { trainerConfigs } from "#app/data/trainer-config";
|
|
import { TrainerType } from "#app/enums/trainer-type";
|
|
import { BattlePhase } from "./battle-phase";
|
|
import { TestMessagePhase } from "./test-message-phase";
|
|
|
|
export class TrainerMessageTestPhase extends BattlePhase {
|
|
private trainerTypes: TrainerType[];
|
|
|
|
constructor(scene: BattleScene, ...trainerTypes: TrainerType[]) {
|
|
super(scene);
|
|
|
|
this.trainerTypes = trainerTypes;
|
|
}
|
|
|
|
start() {
|
|
super.start();
|
|
|
|
const testMessages: string[] = [];
|
|
|
|
for (const t of Object.keys(trainerConfigs)) {
|
|
const type = parseInt(t);
|
|
if (this.trainerTypes.length && !this.trainerTypes.find(tt => tt === type as TrainerType)) {
|
|
continue;
|
|
}
|
|
const config = trainerConfigs[type];
|
|
[config.encounterMessages, config.femaleEncounterMessages, config.victoryMessages, config.femaleVictoryMessages, config.defeatMessages, config.femaleDefeatMessages]
|
|
.map(messages => {
|
|
if (messages?.length) {
|
|
testMessages.push(...messages);
|
|
}
|
|
});
|
|
}
|
|
|
|
for (const message of testMessages) {
|
|
this.scene.pushPhase(new TestMessagePhase(this.scene, message));
|
|
}
|
|
|
|
this.end();
|
|
}
|
|
}
|