Update documentation

This commit is contained in:
Dean 2025-09-20 18:10:49 -07:00
parent ce8bc325f6
commit ab58381c50
6 changed files with 14 additions and 13 deletions

View File

@ -3081,7 +3081,7 @@ export class PostSummonUserFieldRemoveStatusEffectAbAttr extends PostSummonAbAtt
return;
}
for (const p of pokemon.getAlliedField()) {
for (const p of pokemon.getAlliesGenerator()) {
if (p.status && this.statusEffect.includes(p.status.effect)) {
globalScene.phaseManager.queueMessage(getStatusEffectHealText(p.status.effect, getPokemonNameWithAffix(p)));
p.resetStatus(false);

View File

@ -1280,7 +1280,7 @@ class TailwindTag extends SerializableArenaTag {
);
}
for (const pokemon of source.getAlliedField()) {
for (const pokemon of source.getAlliesGenerator()) {
// Apply the CHARGED tag to party members with the WIND_POWER ability
// TODO: This should not be handled here
if (pokemon.hasAbility(AbilityId.WIND_POWER) && !pokemon.getTag(BattlerTagType.CHARGED)) {

View File

@ -860,7 +860,7 @@ export abstract class Move implements Localizable {
aura.apply({pokemon: source, simulated, opponent: target, move: this, power});
}
for (const p of source.getAlliedField()) {
for (const p of source.getAlliesGenerator()) {
applyAbAttrs("UserFieldMoveTypePowerBoostAbAttr", {pokemon: p, opponent: target, move: this, simulated, power});
}

View File

@ -2465,7 +2465,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
}
if (!cancelledHolder.value) {
for (const p of this.getAlliedField()) {
for (const p of this.getAlliesGenerator()) {
applyAbAttrs("FieldPriorityMoveImmunityAbAttr", {
pokemon: p,
opponent: source,
@ -3233,7 +3233,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
}
/**
* Returns the pokemon that oppose this one and are active
* Returns the pokemon that oppose this one and are active in non-speed order
*
* @param onField - whether to also check if the pokemon is currently on the field (defaults to true)
*/
@ -3243,6 +3243,9 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
);
}
/**
* @returns A generator of pokemon that oppose this one in speed order
*/
public getOpponentsGenerator(): Generator<Pokemon, number> {
return inSpeedOrder(this.isPlayer() ? ArenaTagSide.ENEMY : ArenaTagSide.PLAYER);
}
@ -3256,11 +3259,9 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
}
/**
* Gets the Pokémon on the allied field.
*
* @returns An generator of Pokémon on the allied field in speed order.
*/
getAlliedField(): Generator<Pokemon, number> {
getAlliesGenerator(): Generator<Pokemon, number> {
return inSpeedOrder(this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY);
}
@ -4025,7 +4026,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
const cancelled = new BooleanHolder(false);
applyAbAttrs("BattlerTagImmunityAbAttr", { pokemon: this, tag: stubTag, cancelled, simulated: true });
for (const pokemon of this.getAlliedField()) {
for (const pokemon of this.getAlliesGenerator()) {
applyAbAttrs("UserFieldBattlerTagImmunityAbAttr", {
pokemon,
tag: stubTag,
@ -4067,7 +4068,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
return false;
}
for (const pokemon of this.getAlliedField()) {
for (const pokemon of this.getAlliesGenerator()) {
applyAbAttrs("UserFieldBattlerTagImmunityAbAttr", { pokemon, tag: newTag, cancelled, target: this });
if (cancelled.value) {
return false;
@ -4785,7 +4786,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
return false;
}
for (const pokemon of this.getAlliedField()) {
for (const pokemon of this.getAlliesGenerator()) {
applyAbAttrs("UserFieldStatusEffectImmunityAbAttr", {
pokemon,
effect,

View File

@ -1915,7 +1915,7 @@ export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
// Remove the Pokemon's FAINT status
pokemon.resetStatus(true, false, true, false);
for (const p of pokemon.getAlliedField()) {
for (const p of pokemon.getAlliesGenerator()) {
applyAbAttrs("CommanderAbAttr", { pokemon: p });
}
return true;

View File

@ -39,7 +39,7 @@ export class PostSummonPhase extends PokemonPhase {
) {
pokemon.lapseTag(BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON);
}
for (const p of pokemon.getAlliedField()) {
for (const p of pokemon.getAlliesGenerator()) {
applyAbAttrs("CommanderAbAttr", { pokemon: p });
}