mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +02:00
better naming functions
This commit is contained in:
parent
097f90a298
commit
4311cf648d
@ -753,7 +753,7 @@ export default class BattleScene extends SceneBase {
|
||||
* Finds the first {@linkcode Pokemon.isActive()} pokemon from the player that isn't also currently switching out
|
||||
* @returns Either the first {@linkcode PlayerPokemon} satisfying, or undefined if no player pokemon on the field satisfy
|
||||
*/
|
||||
getPlayerPokemonOnScreen(): PlayerPokemon | undefined {
|
||||
getNonSwitchedPlayerPokemon(): PlayerPokemon | undefined {
|
||||
return this.getPlayerField().find(p => p.isActive() && p.switchOutStatus === false);
|
||||
}
|
||||
|
||||
@ -778,7 +778,7 @@ export default class BattleScene extends SceneBase {
|
||||
* Finds the first {@linkcode Pokemon.isActive()} pokemon from the enemy that isn't also currently switching out
|
||||
* @returns Either the first {@linkcode EnemyPokemon} satisfying, or undefined if no player pokemon on the field satisfy
|
||||
*/
|
||||
getEnemyPokemonOnScreen(): EnemyPokemon | undefined {
|
||||
getNonSwitchedEnemyPokemon(): EnemyPokemon | undefined {
|
||||
return this.getEnemyField().find(p => p.isActive() && p.switchOutStatus === false);
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ class AnimTimedAddBgEvent extends AnimTimedBgEvent {
|
||||
moveAnim.bgSprite.setScale(1.25);
|
||||
moveAnim.bgSprite.setAlpha(this.opacity / 255);
|
||||
scene.field.add(moveAnim.bgSprite);
|
||||
const fieldPokemon = scene.getEnemyPokemonOnScreen() || scene.getPlayerPokemonOnScreen();
|
||||
const fieldPokemon = scene.getNonSwitchedEnemyPokemon() || scene.getNonSwitchedPlayerPokemon();
|
||||
if (fieldPokemon?.isOnField()) {
|
||||
scene.field.moveBelow(moveAnim.bgSprite as Phaser.GameObjects.GameObject, fieldPokemon);
|
||||
}
|
||||
@ -887,7 +887,7 @@ export abstract class BattleAnim {
|
||||
const setSpritePriority = (priority: integer) => {
|
||||
switch (priority) {
|
||||
case 0:
|
||||
scene.field.moveBelow(moveSprite as Phaser.GameObjects.GameObject, scene.getEnemyPokemonOnScreen() || scene.getPlayerPokemonOnScreen()!); // this bang is correct to ensure a GameObject is passed in as a second arg (as opposed to undefined)
|
||||
scene.field.moveBelow(moveSprite as Phaser.GameObjects.GameObject, scene.getNonSwitchedEnemyPokemon() || scene.getNonSwitchedPlayerPokemon()!); // this bang is correct to ensure a GameObject is passed in as a second arg (as opposed to undefined)
|
||||
break;
|
||||
case 1:
|
||||
scene.field.moveTo(moveSprite, scene.field.getAll().length - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user