Simplified function to throw balls in tests

This commit is contained in:
Wlowscha 2025-02-03 19:07:14 +01:00
parent cbc933c884
commit 5130eddf1f
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -459,19 +459,19 @@ export default class GameManager {
}); });
} }
doThrowPokeball(ballIndex: number) { /**
* Select the BALL option from the command menu, then press Action; in the BALL
* menu, select a pokéball type and press Action again to throw it.
* @param ballIndex the index of the pokeball to throw
*/
public doThrowPokeball(ballIndex: number) {
this.onNextPrompt("CommandPhase", Mode.COMMAND, () => { this.onNextPrompt("CommandPhase", Mode.COMMAND, () => {
(this.scene.ui.getHandler() as CommandUiHandler).setCursor(1); (this.scene.ui.getHandler() as CommandUiHandler).setCursor(1);
(this.scene.ui.getHandler() as CommandUiHandler).processInput(Button.ACTION); (this.scene.ui.getHandler() as CommandUiHandler).processInput(Button.ACTION);
}); });
this.doSelectPokeball(ballIndex);
}
doSelectPokeball(ballIndex: number) {
this.onNextPrompt("CommandPhase", Mode.BALL, () => { this.onNextPrompt("CommandPhase", Mode.BALL, () => {
const ballHandler = this.scene.ui.getHandler() as BallUiHandler; const ballHandler = this.scene.ui.getHandler() as BallUiHandler;
ballHandler.setCursor(ballIndex); ballHandler.setCursor(ballIndex);
ballHandler.processInput(Button.ACTION); // select ball and throw ballHandler.processInput(Button.ACTION); // select ball and throw
}); });