pokerogue/src/test/utils/TextInterceptor.ts
flx-sta 7582eefabc
[Bug] Fix final boss 2nd phase transition on status effect damage (#3226)
* fix final-boss phase change on status-effect dmg

- move final-boss 2nd phase check into battle-scene.
- call method at the end of damage phase
- call method at the end of PostTurnStatusEffect phase

* improve ui.getHandler types

* WIP: final_boss.test.ts

* add "should spawn Eternatus on wave 200 in END biome" test

* add more final_boss tests

couldn't cover the form change due to lack of support from current test framework
2024-07-29 23:51:56 -04:00

23 lines
620 B
TypeScript

export default class TextInterceptor {
private scene;
public logs = [];
constructor(scene) {
this.scene = scene;
scene.messageWrapper = this;
}
showText(text: string, delay?: integer, callback?: Function, callbackDelay?: integer, prompt?: boolean, promptDelay?: integer): void {
console.log(text);
this.logs.push(text);
}
showDialogue(text: string, name: string, delay?: integer, callback?: Function, callbackDelay?: integer, promptDelay?: integer): void {
console.log(name, text);
this.logs.push(name, text);
}
getLatestMessage(): string {
return this.logs.pop();
}
}