pull/668/merge
pixelizedgaming 2024-05-15 16:27:06 -05:00 committed by GitHub
commit 2c049fb08b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 1734 additions and 3777 deletions

5449
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1216,6 +1216,24 @@ export class PostAttackApplyBattlerTagAbAttr extends PostAttackAbAttr {
}
}
export class PostAttackLockMoveAbAttr extends PostAttackAbAttr {
private condition: PokemonAttackCondition;
constructor(condition: PokemonAttackCondition) {
super();
this.condition = condition;
}
applyPostAttack(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (!this.condition(pokemon, attacker, move.getMove())) return false;
console.log(`locked in the move: ${allMoves[pokemon.summonData.choicedMove].name}!`)
if (!(move.moveId === Moves.MIMIC || move.moveId === Moves.TRANSFORM)){
pokemon.summonData.choicedMove = move.moveId;
pokemon.scene.queueMessage(getPokemonMessage(pokemon ,` is locked into ${allMoves[pokemon.summonData.choicedMove].name}!`));
}
return true;
}
}
export class PostDefendStealHeldItemAbAttr extends PostDefendAbAttr {
private condition: PokemonDefendCondition;
@ -3649,7 +3667,10 @@ export function initAbilities() {
.bypassFaint()
.partial(),
new Ability(Abilities.GORILLA_TACTICS, 8)
.unimplemented(),
.attr(MovePowerBoostAbAttr, (user, target, move) => move.category === MoveCategory.PHYSICAL, 1.5)
.attr(PostAttackLockMoveAbAttr, (user, target, move) => user.summonData.choicedMove === Moves.NONE)
.ignorable()
.partial(),
new Ability(Abilities.NEUTRALIZING_GAS, 8)
.attr(SuppressFieldAbilitiesAbAttr)
.attr(UncopiableAbilityAbAttr)

View File

@ -3973,6 +3973,7 @@ export class MovesetCopyMoveAttr extends OverrideMoveEffectAttr {
user.summonData.moveset = user.getMoveset().slice(0);
user.summonData.moveset[thisMoveIndex] = new PokemonMove(copiedMove.id, 0, 0);
user.summonData.choicedMove = user.summonData.choicedMove === move.id ? copiedMove.id : user.summonData.choicedMove;
user.scene.queueMessage(getPokemonMessage(user, ` copied\n${copiedMove.name}!`));

View File

@ -3316,6 +3316,7 @@ export class PokemonSummonData {
public moveQueue: QueuedMove[] = [];
public disabledMove: Moves = Moves.NONE;
public disabledTurns: integer = 0;
public choicedMove: Moves = Moves.NONE;
public tags: BattlerTag[] = [];
public abilitySuppressed: boolean = false;
@ -3395,8 +3396,9 @@ export class PokemonMove {
}
isUsable(pokemon: Pokemon, ignorePp?: boolean): boolean {
if (this.moveId && pokemon.summonData?.disabledMove === 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

@ -37,6 +37,7 @@ export const battle: SimpleTranslationEntries = {
"moveNotImplemented": "{{moveName}} is not yet implemented and cannot be selected.",
"moveNoPP": "There's no PP left for\nthis move!",
"moveDisabled": "{{moveName}} is disabled!",
"moveChoiced": "{{pokemonName}} is locked into {{moveName}}!",
"noPokeballForce": "An unseen force\nprevents using Poké Balls.",
"noPokeballTrainer": "You can't catch\nanother trainer's Pokémon!",
"noPokeballMulti": "You can only throw a Poké Ball\nwhen there is one Pokémon remaining!",

View File

@ -1720,19 +1720,32 @@ export class CommandPhase extends FieldPhase {
success = true;
}
else if (cursor < playerPokemon.getMoveset().length) {
const move = playerPokemon.getMoveset()[cursor];
this.scene.ui.setMode(Mode.MESSAGE);
// Decides between a Disabled, Not Implemented, or No PP translation 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' :
playerPokemon.summonData.choicedMove !== Moves.NONE ? 'battle:moveChoiced' :
move.getName().endsWith(' (N)') ? 'battle:moveNotImplemented' : 'battle:moveNoPP';
const moveName = move.getName().replace(' (N)', ''); // Trims off the indicator
this.scene.ui.showText(i18next.t(errorMessage, { moveName: moveName }), null, () => {
this.scene.ui.clearText();
this.scene.ui.setMode(Mode.FIGHT, this.fieldIndex);
}, null, true);
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);
}, null, true);
}
}
break;
case Command.BALL:
@ -2224,9 +2237,11 @@ export class MovePhase extends BattlePhase {
console.log(Moves[this.move.moveId]);
if (!this.canMove()) {
if (!this.canMove() && (this.move.moveId !== Moves.STRUGGLE)) { // 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)
this.scene.queueMessage(getPokemonMessage(this.pokemon ,` is locked into ${allMoves[this.pokemon.summonData.choicedMove].name}!`));
return this.end();
}