patched the interaction between gorilla tactics

and disable
pull/668/head
pixelizedgaming 2024-05-08 22:02:13 -07:00
parent ebfc298246
commit 267d153a5a
2 changed files with 8 additions and 4 deletions

View File

@ -3205,8 +3205,9 @@ export class PokemonMove {
}
isUsable(pokemon: Pokemon, ignorePp?: boolean): boolean {
if (this.moveId && (pokemon.summonData?.disabledMove === this.moveId || (pokemon.summonData?.choicedMove !== Moves.NONE && pokemon.summonData?.choicedMove !== this.moveId)))
if (this.moveId && (pokemon.summonData?.disabledMove === this.moveId || (pokemon.summonData?.choicedMove !== Moves.NONE && pokemon.summonData?.choicedMove !== this.moveId))){
return false;
}
return (ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1) && !this.getMove().name.endsWith(' (N)');
}

View File

@ -1699,9 +1699,11 @@ export class CommandPhase extends FieldPhase {
success = true;
}
else if (cursor < playerPokemon.getMoveset().length) {
const move = playerPokemon.getMoveset()[cursor];
this.scene.ui.setMode(Mode.MESSAGE);
console.log(`${move.getName()} did not work`)
// Decides between a Disabled, Choice Locked, Not Implemented, or No PP translation message
const errorMessage =
playerPokemon.summonData.disabledMove === move.moveId ? 'battle:moveDisabled' :
@ -1709,14 +1711,15 @@ export class CommandPhase extends FieldPhase {
move.getName().endsWith(' (N)') ? 'battle:moveNotImplemented' : 'battle:moveNoPP';
const moveName = move.getName().replace(' (N)', ''); // Trims off the indicator
if (playerPokemon.summonData.choicedMove === Moves.NONE || playerPokemon.summonData.choicedMove === playerPokemon.summonData.disabledMove){
if (playerPokemon.summonData.choicedMove === Moves.NONE){
console.log("error message for everything else");
this.scene.ui.showText(i18next.t(errorMessage, { moveName: moveName }), null, () => {
this.scene.ui.clearText();
this.scene.ui.setMode(Mode.FIGHT, this.fieldIndex);
}, null, true);
}
else {
console.log("error message for choice lock move");
this.scene.ui.showText(i18next.t(errorMessage, { pokemonName: playerPokemon.name, moveName: allMoves[playerPokemon.summonData.choicedMove].name }), null, () => {
this.scene.ui.clearText();
this.scene.ui.setMode(Mode.FIGHT, this.fieldIndex);
@ -2202,7 +2205,7 @@ export class MovePhase extends BattlePhase {
console.log(Moves[this.move.moveId]);
if (!this.canMove()) {
if (!this.canMove() && (this.pokemon.summonData.disabledMove !== this.pokemon.summonData.choicedMove)) { // patch for choice item - disable interaction
if (this.move.moveId && this.pokemon.summonData.disabledMove === this.move.moveId)
this.scene.queueMessage(`${this.move.getName()} is disabled!`);
if (this.move.moveId && this.pokemon.summonData.choicedMove !== Moves.NONE && this.pokemon.summonData.choicedMove !== this.move.moveId)