mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 05:52:17 +02:00
Fixed void return issues + ran biome again
This commit is contained in:
parent
5a8ebe9cd7
commit
f6b73e0c8c
@ -4428,14 +4428,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
// biome-ignore lint: there are a ton of issues..
|
||||
faintCry(callback: Function): void {
|
||||
if (this.fusionSpecies && this.getSpeciesForm() !== this.getFusionSpeciesForm()) {
|
||||
return this.fusionFaintCry(callback);
|
||||
this.fusionFaintCry(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
const key = this.species.getCryKey(this.formIndex);
|
||||
let rate = 0.85;
|
||||
const cry = globalScene.playSound(key, { rate: rate }) as AnySound;
|
||||
if (!cry || globalScene.fieldVolume === 0) {
|
||||
return callback();
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
const sprite = this.getSprite();
|
||||
const tintSprite = this.getTintSprite();
|
||||
@ -4503,7 +4505,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
rate: rate,
|
||||
}) as AnySound;
|
||||
if (!cry || !fusionCry || globalScene.fieldVolume === 0) {
|
||||
return callback();
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
fusionCry.stop();
|
||||
duration = Math.min(duration, fusionCry.totalDuration * 1000);
|
||||
|
@ -153,7 +153,8 @@ export class MovePhase extends BattlePhase {
|
||||
this.showMoveText();
|
||||
this.showFailedText();
|
||||
}
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
this.pokemon.turnData.acted = true;
|
||||
@ -325,7 +326,8 @@ export class MovePhase extends BattlePhase {
|
||||
if (fail) {
|
||||
this.showMoveText();
|
||||
this.showFailedText();
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,8 @@ export class PokemonAnimPhase extends BattlePhase {
|
||||
private doSubstituteAddAnim(): void {
|
||||
const substitute = this.pokemon.getTag(SubstituteTag);
|
||||
if (isNullOrUndefined(substitute)) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const getSprite = () => {
|
||||
@ -116,12 +117,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
||||
|
||||
private doSubstitutePreMoveAnim(): void {
|
||||
if (this.fieldAssets.length !== 1) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const subSprite = this.fieldAssets[0];
|
||||
if (subSprite === undefined) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
globalScene.tweens.add({
|
||||
@ -145,12 +148,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
||||
|
||||
private doSubstitutePostMoveAnim(): void {
|
||||
if (this.fieldAssets.length !== 1) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const subSprite = this.fieldAssets[0];
|
||||
if (subSprite === undefined) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
globalScene.tweens.add({
|
||||
@ -174,12 +179,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
||||
|
||||
private doSubstituteRemoveAnim(): void {
|
||||
if (this.fieldAssets.length !== 1) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const subSprite = this.fieldAssets[0];
|
||||
if (subSprite === undefined) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const getSprite = () => {
|
||||
@ -244,12 +251,14 @@ export class PokemonAnimPhase extends BattlePhase {
|
||||
|
||||
private doCommanderApplyAnim(): void {
|
||||
if (!globalScene.currentBattle?.double) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
const dondozo = this.pokemon.getAlly();
|
||||
|
||||
if (dondozo?.species?.speciesId !== SpeciesId.DONDOZO) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const tatsugiriX = this.pokemon.x + this.pokemon.getSprite().x;
|
||||
@ -329,7 +338,8 @@ export class PokemonAnimPhase extends BattlePhase {
|
||||
const tatsugiri = this.pokemon.getAlly();
|
||||
if (isNullOrUndefined(tatsugiri)) {
|
||||
console.warn("Aborting COMMANDER_REMOVE anim: Tatsugiri is undefined");
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const tatsuSprite = globalScene.addPokemonSprite(
|
||||
|
@ -29,7 +29,8 @@ export class PokemonTransformPhase extends PokemonPhase {
|
||||
const target = globalScene.getField(true).find(p => p.getBattlerIndex() === this.targetIndex);
|
||||
|
||||
if (!target) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
user.summonData.speciesForm = target.getSpeciesForm();
|
||||
|
@ -31,7 +31,8 @@ export class QuietFormChangePhase extends BattlePhase {
|
||||
super.start();
|
||||
|
||||
if (this.pokemon.formIndex === this.pokemon.species.forms.findIndex(f => f.formKey === this.formChange.formKey)) {
|
||||
return this.end();
|
||||
this.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const preName = getPokemonNameWithAffix(this.pokemon);
|
||||
|
Loading…
Reference in New Issue
Block a user