mirror of
				https://github.com/pagefaultgames/pokerogue.git
				synced 2025-11-04 02:11:19 +01:00 
			
		
		
		
	* 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>
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
 | 
						|
import { BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT } from "#app/data/mystery-encounters/mystery-encounters";
 | 
						|
import { isNullOrUndefined } from "#app/utils";
 | 
						|
import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
 | 
						|
 | 
						|
export class SeenEncounterData {
 | 
						|
  type: MysteryEncounterType;
 | 
						|
  tier: MysteryEncounterTier;
 | 
						|
  waveIndex: number;
 | 
						|
  selectedOption: number;
 | 
						|
 | 
						|
  constructor(type: MysteryEncounterType, tier: MysteryEncounterTier, waveIndex: number, selectedOption?: number) {
 | 
						|
    this.type = type;
 | 
						|
    this.tier = tier;
 | 
						|
    this.waveIndex = waveIndex;
 | 
						|
    this.selectedOption = selectedOption ?? -1;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
export interface QueuedEncounter {
 | 
						|
  type: MysteryEncounterType;
 | 
						|
  spawnPercent: number; // Out of 100
 | 
						|
}
 | 
						|
 | 
						|
export class MysteryEncounterSaveData {
 | 
						|
  encounteredEvents: SeenEncounterData[] = [];
 | 
						|
  encounterSpawnChance: number = BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT;
 | 
						|
  queuedEncounters: QueuedEncounter[] = [];
 | 
						|
 | 
						|
  constructor(data?: MysteryEncounterSaveData) {
 | 
						|
    if (!isNullOrUndefined(data)) {
 | 
						|
      Object.assign(this, data);
 | 
						|
    }
 | 
						|
 | 
						|
    this.encounteredEvents = this.encounteredEvents ?? [];
 | 
						|
    this.queuedEncounters = this.queuedEncounters ?? [];
 | 
						|
  }
 | 
						|
}
 |