mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Use early return in Pokemon#isOffsetBySubstitute
This commit is contained in:
parent
19575820cc
commit
1318dd5225
@ -1292,16 +1292,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
*/
|
*/
|
||||||
isOffsetBySubstitute(): boolean {
|
isOffsetBySubstitute(): boolean {
|
||||||
const substitute = this.getTag(SubstituteTag);
|
const substitute = this.getTag(SubstituteTag);
|
||||||
if (substitute) {
|
if (!substitute || substitute.sprite === undefined) {
|
||||||
if (substitute.sprite === undefined) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// During the Pokemon's MoveEffect phase, the offset is removed to put the Pokemon "in focus"
|
|
||||||
const currentPhase = globalScene.getCurrentPhase();
|
|
||||||
return !(currentPhase?.is("MoveEffectPhase") && currentPhase.getPokemon() === this);
|
|
||||||
}
|
}
|
||||||
return false;
|
// During the Pokemon's MoveEffect phase, the offset is removed to put the Pokemon "in focus"
|
||||||
|
const currentPhase = globalScene.getCurrentPhase();
|
||||||
|
return !(currentPhase?.is("MoveEffectPhase") && currentPhase.getPokemon() === this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** If this Pokemon has a Substitute on the field, removes its sprite from the field. */
|
/** If this Pokemon has a Substitute on the field, removes its sprite from the field. */
|
||||||
|
Loading…
Reference in New Issue
Block a user