prototype gorilla tactics impl

pull/668/head
pixelizedgaming 2024-05-08 20:05:50 -07:00
parent b5888b5472
commit 545681ee41
6 changed files with 1728 additions and 3775 deletions

5449
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -995,6 +995,8 @@ export class LowHpMoveTypePowerBoostAbAttr extends MoveTypePowerBoostAbAttr {
}
}
export class FieldVariableMovePowerAbAttr extends AbAttr {
applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean {
//const power = args[0] as Utils.NumberHolder;
@ -1147,6 +1149,21 @@ 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;
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;
@ -1180,6 +1197,8 @@ export class PostDefendStealHeldItemAbAttr extends PostDefendAbAttr {
}
}
export class PostVictoryAbAttr extends AbAttr {
applyPostVictory(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise<boolean> {
return false;
@ -3464,7 +3483,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

@ -3119,6 +3119,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;
@ -3197,7 +3198,7 @@ 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

@ -35,6 +35,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

@ -14,14 +14,14 @@ export const STARTING_MONEY_OVERRIDE = 0;
export const WEATHER_OVERRIDE = WeatherType.NONE;
export const DOUBLE_BATTLE_OVERRIDE = false;
export const ABILITY_OVERRIDE = Abilities.NONE;
export const ABILITY_OVERRIDE = Abilities.GORILLA_TACTICS;
export const PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
export const MOVE_OVERRIDE = Moves.NONE;
export const MOVE_OVERRIDE_2 = Moves.NONE;
export const OPP_SPECIES_OVERRIDE = 0;
export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
export const OPP_MOVE_OVERRIDE = Moves.NONE;
export const OPP_MOVE_OVERRIDE = Moves.DISABLE;
export const OPP_MOVE_OVERRIDE_2 = Moves.NONE;
export const OPP_SHINY_OVERRIDE = false;

View File

@ -1702,16 +1702,26 @@ export class CommandPhase extends FieldPhase {
const move = playerPokemon.getMoveset()[cursor];
this.scene.ui.setMode(Mode.MESSAGE);
// Decides between a Disabled, Not Implemented, or No PP translation message
// 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 || playerPokemon.summonData.choicedMove === playerPokemon.summonData.disabledMove){
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 {
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:
@ -2195,6 +2205,8 @@ export class MovePhase extends BattlePhase {
if (!this.canMove()) {
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();
}