Add command cancelling and 2nd battler move memory
This commit is contained in:
1 parent
83c70889fc
commit
eab6d082fd
4 files changed
+51
-16
No files matched your search
+16
-1
@@ -973,7 +973,7 @@ export class CommandPhase extends FieldPhase {
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.showText(`${move.getName()} is disabled!`, null, () => {
|
||||
this.scene.ui.clearText();
|
||||
this.scene.ui.setMode(Mode.FIGHT);
|
||||
this.scene.ui.setMode(Mode.FIGHT, this.fieldIndex);
|
||||
}, null, true);
|
||||
}
|
||||
}
|
||||
@@ -1044,6 +1044,21 @@ export class CommandPhase extends FieldPhase {
|
||||
return success;
|
||||
}
|
||||
|
||||
cancel() {
|
||||
if (this.fieldIndex) {
|
||||
const lastCommand = this.scene.currentBattle.turnCommands[0];
|
||||
if (lastCommand.command === Command.BALL)
|
||||
this.scene.currentBattle.turnPokeballCounts[lastCommand.cursor]++;
|
||||
this.scene.unshiftPhase(new CommandPhase(this.scene, 0));
|
||||
this.scene.unshiftPhase(new CommandPhase(this.scene, 1));
|
||||
this.end();
|
||||
}
|
||||
}
|
||||
|
||||
getFieldIndex(): integer {
|
||||
return this.fieldIndex;
|
||||
}
|
||||
|
||||
getPokemon(): PlayerPokemon {
|
||||
return this.scene.getPlayerField()[this.fieldIndex];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user