Fix issues with regex patterns for processing Pokemon pools

pull/14/head
Flashfyre 2023-12-30 01:11:34 -05:00
parent 75dd38eff8
commit 22a5f6599d
1 changed files with 32 additions and 37 deletions

View File

@ -150,18 +150,15 @@ export interface BiomeTrainerPools {
export const biomePokemonPools: BiomePokemonPools = { export const biomePokemonPools: BiomePokemonPools = {
[Biome.TOWN]: { [Biome.TOWN]: {
[BiomePoolTier.COMMON]: { [BiomePoolTier.COMMON]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [ { 1: [ Species.CATERPIE ], 7: [ Species.METAPOD ] } ],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [ { 1: [ Species.CATERPIE ], 7: [ Species.METAPOD ] } ],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [ { 1: [ Species.WEEDLE ], 7: [ Species.KAKUNA ] } ],
[TimeOfDay.NIGHT]: [ Species.SPINARAK ], [TimeOfDay.NIGHT]: [ { 1: [ Species.WEEDLE ], 7: [ Species.KAKUNA ] }, Species.HOOTHOOT, Species.SPINARAK ],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
{ 1: [ Species.CATERPIE ], 7: [ Species.METAPOD ] },
{ 1: [ Species.WEEDLE ], 7: [ Species.KAKUNA ] },
Species.PIDGEY, Species.PIDGEY,
Species.RATTATA, Species.RATTATA,
Species.SPEAROW, Species.SPEAROW,
Species.SENTRET, Species.SENTRET,
Species.HOOTHOOT,
Species.LEDYBA, Species.LEDYBA,
Species.HOPPIP, Species.HOPPIP,
Species.SUNKERN, Species.SUNKERN,
@ -188,10 +185,9 @@ export const biomePokemonPools: BiomePokemonPools = {
[BiomePoolTier.UNCOMMON]: { [BiomePoolTier.UNCOMMON]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [],
[TimeOfDay.DUSK]: [ Species.SPINARAK ], [TimeOfDay.DUSK]: [ Species.EKANS, Species.SPINARAK ],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [ Species.EKANS ],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
Species.EKANS,
Species.NIDORAN_F, Species.NIDORAN_F,
Species.NIDORAN_M, Species.NIDORAN_M,
Species.ODDISH, Species.ODDISH,
@ -364,19 +360,16 @@ export const biomePokemonPools: BiomePokemonPools = {
}, },
[Biome.FOREST]: { [Biome.FOREST]: {
[BiomePoolTier.COMMON]: { [BiomePoolTier.COMMON]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [ Species.BUTTERFREE ],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [ Species.BUTTERFREE ],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [ Species.BEEDRILL ],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [ Species.BEEDRILL, Species.DUSTOX ],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
Species.BUTTERFREE,
Species.BEEDRILL,
{ 1: [ Species.VENONAT ], 31: [ Species.VENOMOTH ] }, { 1: [ Species.VENONAT ], 31: [ Species.VENOMOTH ] },
{ 1: [ Species.BELLSPROUT ], 21: [ Species.WEEPINBELL ] }, { 1: [ Species.BELLSPROUT ], 21: [ Species.WEEPINBELL ] },
{ 1: [ Species.SPINARAK ], 22: [ Species.ARIADOS ] }, { 1: [ Species.SPINARAK ], 22: [ Species.ARIADOS ] },
{ 1: [ Species.PINECO ], 31: [ Species.FORRETRESS ] }, { 1: [ Species.PINECO ], 31: [ Species.FORRETRESS ] },
Species.BEAUTIFLY, Species.BEAUTIFLY,
Species.DUSTOX,
{ 1: [ Species.SEEDOT ], 14: [ Species.NUZLEAF ] }, { 1: [ Species.SEEDOT ], 14: [ Species.NUZLEAF ] },
{ 1: [ Species.SHROOMISH ], 23: [ Species.BRELOOM ] }, { 1: [ Species.SHROOMISH ], 23: [ Species.BRELOOM ] },
{ 1: [ Species.COMBEE ], 21: [ Species.VESPIQUEN ] }, { 1: [ Species.COMBEE ], 21: [ Species.VESPIQUEN ] },
@ -390,10 +383,9 @@ export const biomePokemonPools: BiomePokemonPools = {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [ { 1: [ Species.HOOTHOOT ], 20: [ Species.NOCTOWL ] } ],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
{ 1: [ Species.EKANS ], 22: [ Species.ARBOK ] }, { 1: [ Species.EKANS ], 22: [ Species.ARBOK ] },
{ 1: [ Species.HOOTHOOT ], 20: [ Species.NOCTOWL ] },
{ 1: [ Species.TEDDIURSA ], 30: [ Species.URSARING ] }, { 1: [ Species.TEDDIURSA ], 30: [ Species.URSARING ] },
Species.ROSELIA, Species.ROSELIA,
{ 1: [ Species.BURMY ], 20: [ Species.MOTHIM, Species.WORMADAM ] }, { 1: [ Species.BURMY ], 20: [ Species.MOTHIM, Species.WORMADAM ] },
@ -404,15 +396,14 @@ export const biomePokemonPools: BiomePokemonPools = {
] ]
}, },
[BiomePoolTier.RARE]: { [BiomePoolTier.RARE]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [ Species.STANTLER ],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [ Species.STANTLER ],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
Species.EXEGGCUTE, Species.EXEGGCUTE,
Species.SCYTHER, Species.SCYTHER,
Species.HERACROSS, Species.HERACROSS,
Species.STANTLER,
{ 1: [ Species.TREECKO ], 16: [ Species.GROVYLE ], 36: [ Species.SCEPTILE ] }, { 1: [ Species.TREECKO ], 16: [ Species.GROVYLE ], 36: [ Species.SCEPTILE ] },
Species.TROPIUS, Species.TROPIUS,
Species.KARRABLAST, Species.KARRABLAST,
@ -427,11 +418,10 @@ export const biomePokemonPools: BiomePokemonPools = {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [ Species.NOCTOWL ],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
Species.VENOMOTH, Species.VENOMOTH,
Species.VICTREEBEL, Species.VICTREEBEL,
Species.NOCTOWL,
Species.ARIADOS, Species.ARIADOS,
Species.FORRETRESS, Species.FORRETRESS,
Species.BEAUTIFLY, Species.BEAUTIFLY,
@ -448,7 +438,13 @@ export const biomePokemonPools: BiomePokemonPools = {
Species.ORBEETLE Species.ORBEETLE
] ]
}, },
[BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.HERACROSS, Species.STANTLER, Species.SCEPTILE, Species.ESCAVALIER, Species.ACCELGOR, Species.DURANT, Species.CHESNAUGHT, Species.DECIDUEYE, Species.LYCANROC ] }, [BiomePoolTier.BOSS_RARE]: {
[TimeOfDay.DAWN]: [ Species.STANTLER ],
[TimeOfDay.DAY]: [ Species.STANTLER ],
[TimeOfDay.DUSK]: [],
[TimeOfDay.NIGHT]: [],
[TimeOfDay.ALL]: [ Species.HERACROSS, Species.SCEPTILE, Species.ESCAVALIER, Species.ACCELGOR, Species.DURANT, Species.CHESNAUGHT, Species.DECIDUEYE, Species.LYCANROC ]
},
[BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.KARTANA ] }, [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.KARTANA ] },
[BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.CALYREX ] } [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.CALYREX ] }
}, },
@ -503,10 +499,9 @@ export const biomePokemonPools: BiomePokemonPools = {
[BiomePoolTier.COMMON]: { [BiomePoolTier.COMMON]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [ { 1: [ Species.EKANS ], 22: [ Species.ARBOK ] } ],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [ { 1: [ Species.EKANS ], 22: [ Species.ARBOK ] } ],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
{ 1: [ Species.EKANS ], 22: [ Species.ARBOK ] },
{ 1: [ Species.POLIWAG ], 25: [ Species.POLIWHIRL ] }, { 1: [ Species.POLIWAG ], 25: [ Species.POLIWHIRL ] },
{ 1: [ Species.WOOPER ], 20: [ Species.QUAGSIRE ] }, { 1: [ Species.WOOPER ], 20: [ Species.QUAGSIRE ] },
{ 1: [ Species.LOTAD ], 14: [ Species.LOMBRE ] }, { 1: [ Species.LOTAD ], 14: [ Species.LOMBRE ] },
@ -516,8 +511,8 @@ export const biomePokemonPools: BiomePokemonPools = {
] ]
}, },
[BiomePoolTier.UNCOMMON]: { [BiomePoolTier.UNCOMMON]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [ { 1: [ Species.EKANS ], 22: [ Species.ARBOK ] } ],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [ { 1: [ Species.EKANS ], 22: [ Species.ARBOK ] } ],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [],
[TimeOfDay.ALL]: [ [TimeOfDay.ALL]: [
@ -547,9 +542,9 @@ export const biomePokemonPools: BiomePokemonPools = {
[BiomePoolTier.BOSS]: { [BiomePoolTier.BOSS]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [],
[TimeOfDay.DUSK]: [], [TimeOfDay.DUSK]: [ Species.ARBOK ],
[TimeOfDay.NIGHT]: [], [TimeOfDay.NIGHT]: [ Species.ARBOK ],
[TimeOfDay.ALL]: [ Species.ARBOK, Species.POLIWRATH, Species.QUAGSIRE, Species.LUDICOLO, Species.SWALOT, Species.WHISCASH, Species.GASTRODON, Species.SEISMITOAD, Species.STUNFISK, Species.TOXAPEX ] [TimeOfDay.ALL]: [ Species.POLIWRATH, Species.QUAGSIRE, Species.LUDICOLO, Species.SWALOT, Species.WHISCASH, Species.GASTRODON, Species.SEISMITOAD, Species.STUNFISK, Species.TOXAPEX ]
}, },
[BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.FERALIGATR, Species.POLITOED, Species.SWAMPERT ] }, [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.FERALIGATR, Species.POLITOED, Species.SWAMPERT ] },
[BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.AZELF, Species.NAGANADEL, Species.GALAR_SLOWBRO, Species.GALAR_SLOWKING, Species.GALAR_STUNFISK, Species.HISUI_GOODRA ] }, [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.AZELF, Species.NAGANADEL, Species.GALAR_SLOWBRO, Species.GALAR_SLOWKING, Species.GALAR_STUNFISK, Species.HISUI_GOODRA ] },
@ -1517,7 +1512,7 @@ export const biomePokemonPools: BiomePokemonPools = {
Species.EISCUE Species.EISCUE
] ]
}, },
[BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.STANTLER ] }, [BiomePoolTier.UNCOMMON]: { [TimeOfDay.DAWN]: [ Species.STANTLER ], [TimeOfDay.DAY]: [ Species.STANTLER ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] },
[BiomePoolTier.RARE]: { [BiomePoolTier.RARE]: {
[TimeOfDay.DAWN]: [], [TimeOfDay.DAWN]: [],
[TimeOfDay.DAY]: [], [TimeOfDay.DAY]: [],
@ -1539,7 +1534,7 @@ export const biomePokemonPools: BiomePokemonPools = {
[TimeOfDay.ALL]: [ { 1: [ Species.GALAR_MR_MIME ], 42: [ Species.MR_RIME ] }, Species.ARCTOZOLT, Species.HISUI_SNEASEL, { 1: [ Species.HISUI_ZORUA ], 30: [ Species.HISUI_ZOROARK ] } ] [TimeOfDay.ALL]: [ { 1: [ Species.GALAR_MR_MIME ], 42: [ Species.MR_RIME ] }, Species.ARCTOZOLT, Species.HISUI_SNEASEL, { 1: [ Species.HISUI_ZORUA ], 30: [ Species.HISUI_ZOROARK ] } ]
}, },
[BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.GLASTRIER, Species.GALAR_ARTICUNO ] }, [BiomePoolTier.ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.GLASTRIER, Species.GALAR_ARTICUNO ] },
[BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.ABOMASNOW, Species.FROSMOTH, Species.WYRDEER, Species.URSALUNA ] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [ Species.WYRDEER ], [TimeOfDay.DAY]: [ Species.WYRDEER ], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.ABOMASNOW, Species.FROSMOTH, Species.URSALUNA ] },
[BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.ARCTOZOLT, Species.ALOLA_SANDSLASH, Species.ALOLA_NINETALES ] }, [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.ARCTOZOLT, Species.ALOLA_SANDSLASH, Species.ALOLA_NINETALES ] },
[BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.MR_RIME, Species.GLASTRIER, Species.SNEASLER, Species.GALAR_DARMANITAN, Species.HISUI_ZOROARK ] }, [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.MR_RIME, Species.GLASTRIER, Species.SNEASLER, Species.GALAR_DARMANITAN, Species.HISUI_ZOROARK ] },
[BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.ZACIAN, Species.CALYREX, Species.GALAR_ARTICUNO ] } [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [ Species.ZACIAN, Species.CALYREX, Species.GALAR_ARTICUNO ] }
@ -7484,7 +7479,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
} }
} }
console.log(beautify(pokemonOutput, null, 2, 180).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:(?:\{ )?"\d+": \[ )?)"(.*?)"(?= |,|\n)/g, '$1Species.$2').replace(/"(\d+)": /g, '$1: ').replace(/((?: )|(?:(?!\n) "(?:.*?)": \{) |\[\], )"(.*?)"/g, '$1[TimeOfDay.$2]').replace(/( )"(.*?)"/g, '$1[BiomePoolTier.$2]').replace(/( )"(.*?)"/g, '$1[Biome.$2]')); console.log(beautify(pokemonOutput, null, 2, 180).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:"\w+": \[ |(?:\{ )?"\d+": \[ )?)"(\w+)"(?= |,|\n)/g, '$1Species.$2').replace(/"(\d+)": /g, '$1: ').replace(/((?: )|(?:(?!\n) "(?:.*?)": \{) |\[(?: .*? )?\], )"(\w+)"/g, '$1[TimeOfDay.$2]').replace(/( )"(.*?)"/g, '$1[BiomePoolTier.$2]').replace(/( )"(.*?)"/g, '$1[Biome.$2]'));
console.log(beautify(trainerOutput, null, 2, 120).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:(?:\{ )?"\d+": \[ )?)"(.*?)"/g, '$1TrainerType.$2').replace(/"(\d+)": /g, '$1: ').replace(/( )"(.*?)"/g, '$1[BiomePoolTier.$2]').replace(/( )"(.*?)"/g, '$1[Biome.$2]')); console.log(beautify(trainerOutput, null, 2, 120).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:(?:\{ )?"\d+": \[ )?)"(.*?)"/g, '$1TrainerType.$2').replace(/"(\d+)": /g, '$1: ').replace(/( )"(.*?)"/g, '$1[BiomePoolTier.$2]').replace(/( )"(.*?)"/g, '$1[Biome.$2]'));
} }