Checks if Pokemon is Ghost type when determining if it is trapped
parent
9cfc09f673
commit
9ca01fc3b8
|
@ -2259,13 +2259,17 @@ export class CheckTrappedAbAttr extends AbAttr {
|
||||||
super(false);
|
super(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
|
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, otherPokemon: Pokemon[], args: any[]): boolean | Promise<boolean> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ArenaTrapAbAttr extends CheckTrappedAbAttr {
|
export class ArenaTrapAbAttr extends CheckTrappedAbAttr {
|
||||||
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, args: any[]): boolean {
|
applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, otherPokemon: Pokemon[], args: any[]): boolean {
|
||||||
|
if (otherPokemon[0].getTypes().includes(Type.GHOST)){
|
||||||
|
trapped.value = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
trapped.value = true;
|
trapped.value = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1783,7 +1783,7 @@ export class CommandPhase extends FieldPhase {
|
||||||
const trapped = new Utils.BooleanHolder(false);
|
const trapped = new Utils.BooleanHolder(false);
|
||||||
const batonPass = isSwitch && args[0] as boolean;
|
const batonPass = isSwitch && args[0] as boolean;
|
||||||
if (!batonPass)
|
if (!batonPass)
|
||||||
enemyField.forEach(enemyPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trapped));
|
enemyField.forEach(enemyPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trapped, playerPokemon));
|
||||||
if (batonPass || (!trapTag && !trapped.value)) {
|
if (batonPass || (!trapTag && !trapped.value)) {
|
||||||
this.scene.currentBattle.turnCommands[this.fieldIndex] = isSwitch
|
this.scene.currentBattle.turnCommands[this.fieldIndex] = isSwitch
|
||||||
? { command: Command.POKEMON, cursor: cursor, args: args }
|
? { command: Command.POKEMON, cursor: cursor, args: args }
|
||||||
|
@ -1881,7 +1881,7 @@ export class EnemyCommandPhase extends FieldPhase {
|
||||||
|
|
||||||
const trapTag = enemyPokemon.findTag(t => t instanceof TrappedTag) as TrappedTag;
|
const trapTag = enemyPokemon.findTag(t => t instanceof TrappedTag) as TrappedTag;
|
||||||
const trapped = new Utils.BooleanHolder(false);
|
const trapped = new Utils.BooleanHolder(false);
|
||||||
opponents.forEach(playerPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, playerPokemon, trapped));
|
opponents.forEach(playerPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, playerPokemon, trapped, enemyPokemon));
|
||||||
if (!trapTag && !trapped.value) {
|
if (!trapTag && !trapped.value) {
|
||||||
const partyMemberScores = trainer.getPartyMemberMatchupScores(enemyPokemon.trainerSlot, true);
|
const partyMemberScores = trainer.getPartyMemberMatchupScores(enemyPokemon.trainerSlot, true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue