pokerogue/src/phases/party-exp-phase.ts
NightKev 0107b1d47e
[Refactor] Create global scene variable (#4766)
* Replace various `scene` pass-arounds with global scene variable

* Modify tests

* Add scene back to `fade[in|out]()` calls

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

* Fix Bug Superfan ME test

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

* Re-enable fixed test

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

* Rename `gScene` to `globalScene`

* Move `globalScene` to its own file to fix import/async issues

* Fix `SelectModifierPhase` tests

* Fix ME tests by removing `scene` from `expect()`s

* Resolve merge issues

* Remove tsdocs referencing `scene` params

Remove missed instances of `.scene`

* Remove unnecessary `globalScene` usage in `loading-scene.ts`

* Fix merge conflicts

* Attempt to fix circular import issue

* Found the source of the import issue

* Fix merge issues

---------

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2025-01-12 15:33:05 -08:00

32 lines
963 B
TypeScript

import { globalScene } from "#app/global-scene";
import { Phase } from "#app/phase";
/**
* Provides EXP to the player's party *without* doing any Pokemon defeated checks or queueing extraneous post-battle phases
* Intended to be used as a more 1-off phase to provide exp to the party (such as during MEs), rather than cleanup a battle entirely
*/
export class PartyExpPhase extends Phase {
expValue: number;
useWaveIndexMultiplier?: boolean;
pokemonParticipantIds?: Set<number>;
constructor(expValue: number, useWaveIndexMultiplier?: boolean, pokemonParticipantIds?: Set<number>) {
super();
this.expValue = expValue;
this.useWaveIndexMultiplier = useWaveIndexMultiplier;
this.pokemonParticipantIds = pokemonParticipantIds;
}
/**
* Gives EXP to the party
*/
start() {
super.start();
globalScene.applyPartyExp(this.expValue, false, this.useWaveIndexMultiplier, this.pokemonParticipantIds);
this.end();
}
}