@@ -25,21 +25,21 @@ export function getBiomeName(biome: Biome | -1) {
25
25
return i18next . t ( `biome:${ Biome [ biome ] . toUpperCase ( ) } ` ) ;
26
26
}
27
27
}
28
- type BiomeLink = ( Biome | [ Biome , integer ] ) [ ] ;
28
+
29
29
interface BiomeLinks {
30
- [ key : integer ] : BiomeLink
30
+ [ key : integer ] : Biome | ( Biome | [ Biome , integer ] ) [ ]
31
31
}
32
32
33
33
interface BiomeDepths {
34
34
[ key : integer ] : [ integer , integer ]
35
35
}
36
36
37
37
export const biomeLinks : BiomeLinks = {
38
- [ Biome . TOWN ] : [ Biome . PLAINS ] ,
38
+ [ Biome . TOWN ] : Biome . PLAINS ,
39
39
[ Biome . PLAINS ] : [ Biome . GRASS , Biome . METROPOLIS , Biome . LAKE ] ,
40
- [ Biome . GRASS ] : [ Biome . TALL_GRASS ] ,
40
+ [ Biome . GRASS ] : Biome . TALL_GRASS ,
41
41
[ Biome . TALL_GRASS ] : [ Biome . FOREST , Biome . CAVE ] ,
42
- [ Biome . SLUM ] : [ Biome . CONSTRUCTION_SITE ] ,
42
+ [ Biome . SLUM ] : Biome . CONSTRUCTION_SITE ,
43
43
[ Biome . FOREST ] : [ Biome . JUNGLE , Biome . MEADOW ] ,
44
44
[ Biome . SEA ] : [ Biome . SEABED , Biome . ICE_CAVE ] ,
45
45
[ Biome . SWAMP ] : [ Biome . GRAVEYARD , Biome . TALL_GRASS ] ,
@@ -49,26 +49,26 @@ export const biomeLinks: BiomeLinks = {
49
49
[ Biome . MOUNTAIN ] : [ Biome . VOLCANO , [ Biome . WASTELAND , 3 ] ] ,
50
50
[ Biome . BADLANDS ] : [ Biome . DESERT , Biome . MOUNTAIN ] ,
51
51
[ Biome . CAVE ] : [ Biome . BADLANDS , Biome . LAKE ] ,
52
- [ Biome . DESERT ] : [ Biome . RUINS ] ,
53
- [ Biome . ICE_CAVE ] : [ Biome . SNOWY_FOREST ] ,
52
+ [ Biome . DESERT ] : Biome . RUINS ,
53
+ [ Biome . ICE_CAVE ] : Biome . SNOWY_FOREST ,
54
54
[ Biome . MEADOW ] : [ Biome . PLAINS , [ Biome . FAIRY_CAVE , 2 ] ] ,
55
- [ Biome . POWER_PLANT ] : [ Biome . FACTORY ] ,
55
+ [ Biome . POWER_PLANT ] : Biome . FACTORY ,
56
56
[ Biome . VOLCANO ] : [ Biome . BEACH , [ Biome . ICE_CAVE , 4 ] ] ,
57
- [ Biome . GRAVEYARD ] : [ Biome . ABYSS ] ,
57
+ [ Biome . GRAVEYARD ] : Biome . ABYSS ,
58
58
[ Biome . DOJO ] : [ Biome . PLAINS , [ Biome . TEMPLE , 3 ] ] ,
59
59
[ Biome . FACTORY ] : [ Biome . PLAINS , [ Biome . LABORATORY , 4 ] ] ,
60
60
[ Biome . RUINS ] : [ Biome . FOREST ] ,
61
- [ Biome . WASTELAND ] : [ Biome . BADLANDS ] ,
61
+ [ Biome . WASTELAND ] : Biome . BADLANDS ,
62
62
[ Biome . ABYSS ] : [ Biome . CAVE , [ Biome . SPACE , 3 ] , [ Biome . WASTELAND , 3 ] ] ,
63
- [ Biome . SPACE ] : [ Biome . RUINS ] ,
63
+ [ Biome . SPACE ] : Biome . RUINS ,
64
64
[ Biome . CONSTRUCTION_SITE ] : [ Biome . DOJO , Biome . POWER_PLANT ] ,
65
65
[ Biome . JUNGLE ] : [ Biome . TEMPLE ] ,
66
66
[ Biome . FAIRY_CAVE ] : [ Biome . ICE_CAVE , [ Biome . SPACE , 3 ] ] ,
67
67
[ Biome . TEMPLE ] : [ Biome . SWAMP , [ Biome . RUINS , 3 ] ] ,
68
- [ Biome . METROPOLIS ] : [ Biome . SLUM ] ,
68
+ [ Biome . METROPOLIS ] : Biome . SLUM ,
69
69
[ Biome . SNOWY_FOREST ] : [ Biome . FOREST , Biome . LAKE , Biome . MOUNTAIN ] ,
70
- [ Biome . ISLAND ] : [ Biome . SEA ] ,
71
- [ Biome . LABORATORY ] : [ Biome . CONSTRUCTION_SITE ]
70
+ [ Biome . ISLAND ] : Biome . SEA ,
71
+ [ Biome . LABORATORY ] : Biome . CONSTRUCTION_SITE
72
72
} ;
73
73
74
74
export const biomeDepths : BiomeDepths = { } ;
@@ -87,12 +87,20 @@ export enum BiomePoolTier {
87
87
88
88
export const uncatchableSpecies : Species [ ] = [ ] ;
89
89
90
+ export interface SpeciesTree {
91
+ [ key : integer ] : Species [ ]
92
+ }
93
+
90
94
export interface PokemonPools {
91
- [ key : integer ] : ( Species | Record < number , Species [ ] > ) [ ]
95
+ [ key : integer ] : ( Species | SpeciesTree ) [ ]
96
+ }
97
+
98
+ export interface BiomeTierPokemonPools {
99
+ [ key : integer ] : PokemonPools
92
100
}
93
101
94
102
export interface BiomePokemonPools {
95
- [ key : integer ] : Record < number , PokemonPools >
103
+ [ key : integer ] : BiomeTierPokemonPools
96
104
}
97
105
98
106
export interface BiomeTierTrainerPools {
@@ -7657,9 +7665,16 @@ export function initBiomes() {
7657
7665
biomeDepths [ Biome . TOWN ] = [ 0 , 1 ] ;
7658
7666
7659
7667
const traverseBiome = ( biome : Biome , depth : integer ) => {
7660
- for ( const linkedBiomeEntry of biomeLinks [ biome ] ) {
7661
- const linkedBiome = ! Array . isArray ( linkedBiomeEntry ) ? linkedBiomeEntry as Biome : linkedBiomeEntry [ 0 ] ;
7662
- const biomeChance = ! Array . isArray ( linkedBiomeEntry ) ? 1 : linkedBiomeEntry [ 1 ] ;
7668
+ const linkedBiomes : ( Biome | [ Biome , integer ] ) [ ] = Array . isArray ( biomeLinks [ biome ] )
7669
+ ? biomeLinks [ biome ] as ( Biome | [ Biome , integer ] ) [ ]
7670
+ : [ biomeLinks [ biome ] as Biome ] ;
7671
+ for ( const linkedBiomeEntry of linkedBiomes ) {
7672
+ const linkedBiome = ! Array . isArray ( linkedBiomeEntry )
7673
+ ? linkedBiomeEntry as Biome
7674
+ : linkedBiomeEntry [ 0 ] ;
7675
+ const biomeChance = ! Array . isArray ( linkedBiomeEntry )
7676
+ ? 1
7677
+ : linkedBiomeEntry [ 1 ] ;
7663
7678
if ( ! biomeDepths . hasOwnProperty ( linkedBiome ) || biomeChance < biomeDepths [ linkedBiome ] [ 1 ] || ( depth < biomeDepths [ linkedBiome ] [ 0 ] && biomeChance === biomeDepths [ linkedBiome ] [ 1 ] ) ) {
7664
7679
biomeDepths [ linkedBiome ] = [ depth + 1 , biomeChance ] ;
7665
7680
traverseBiome ( linkedBiome , depth + 1 ) ;
0 commit comments