Add more logic for trainers (WiP) and various changes
Add WiP logic for trainer Pokemon pools and biome trainer pools; add more music tracks; fix issue with implementation of Mimic move
This commit is contained in:
1 parent
5d5c8318fd
commit
6d73d71608
66 files changed
+4313
-191
No files matched your search
+517
-36
@@ -4,6 +4,7 @@ import { Type } from './type';
|
||||
import * as Utils from '../utils';
|
||||
|
||||
import beautify from 'json-beautify';
|
||||
import { TrainerType } from "./trainer-type";
|
||||
|
||||
export enum Biome {
|
||||
TOWN,
|
||||
@@ -101,15 +102,23 @@ export interface SpeciesTree {
|
||||
[key: integer]: Species[]
|
||||
}
|
||||
|
||||
export interface BiomeTierPools {
|
||||
export interface BiomeTierPokemonPools {
|
||||
[key: integer]: Array<Species | SpeciesTree>
|
||||
}
|
||||
|
||||
export interface BiomePools {
|
||||
[key: integer]: BiomeTierPools
|
||||
export interface BiomePokemonPools {
|
||||
[key: integer]: BiomeTierPokemonPools
|
||||
}
|
||||
|
||||
export const biomePools: BiomePools = {
|
||||
export interface BiomeTierTrainerPools {
|
||||
[key: integer]: TrainerType[]
|
||||
}
|
||||
|
||||
export interface BiomeTrainerPools {
|
||||
[key: integer]: BiomeTierTrainerPools
|
||||
}
|
||||
|
||||
export const biomePokemonPools: BiomePokemonPools = {
|
||||
[Biome.TOWN]: {
|
||||
[BiomePoolTier.COMMON]: [
|
||||
{ 1: [ Species.CATERPIE ], 7: [ Species.METAPOD ] },
|
||||
@@ -357,11 +366,10 @@ export const biomePools: BiomePools = {
|
||||
{ 1: [ Species.STARYU ], 20: [ Species.STARMIE ] },
|
||||
{ 1: [ Species.MAGIKARP ], 20: [ Species.GYARADOS ] },
|
||||
{ 1: [ Species.WAILMER ], 40: [ Species.WAILORD ] },
|
||||
{ 1: [ Species.PANPOUR ], 20: [ Species.SIMIPOUR ] },
|
||||
{ 1: [ Species.TIRTOUGA ], 37: [ Species.CARRACOSTA ] }
|
||||
{ 1: [ Species.PANPOUR ], 20: [ Species.SIMIPOUR ] }
|
||||
],
|
||||
[BiomePoolTier.RARE]: [ Species.LAPRAS, { 1: [ Species.PIPLUP ], 16: [ Species.PRINPLUP ], 36: [ Species.EMPOLEON ] } ],
|
||||
[BiomePoolTier.SUPER_RARE]: [ Species.KINGDRA ],
|
||||
[BiomePoolTier.SUPER_RARE]: [ Species.KINGDRA, { 1: [ Species.TIRTOUGA ], 37: [ Species.CARRACOSTA ] } ],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [ Species.TENTACRUEL, Species.PELIPPER, Species.SHARPEDO, Species.FLOATZEL, Species.LUMINEON, Species.SIMIPOUR ],
|
||||
[BiomePoolTier.BOSS_RARE]: [ Species.KINGDRA, Species.EMPOLEON ],
|
||||
@@ -399,15 +407,14 @@ export const biomePools: BiomePools = {
|
||||
{ 1: [ Species.KRABBY ], 28: [ Species.KINGLER ] },
|
||||
{ 1: [ Species.STARYU ], 20: [ Species.STARMIE ] },
|
||||
{ 1: [ Species.CORPHISH ], 30: [ Species.CRAWDAUNT ] },
|
||||
{ 1: [ Species.DWEBBLE ], 34: [ Species.CRUSTLE ] },
|
||||
{ 1: [ Species.TIRTOUGA ], 37: [ Species.CARRACOSTA ] }
|
||||
{ 1: [ Species.DWEBBLE ], 34: [ Species.CRUSTLE ] }
|
||||
],
|
||||
[BiomePoolTier.UNCOMMON]: [ { 1: [ Species.BURMY ], 20: [ Species.WORMADAM ] } ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [ { 1: [ Species.TIRTOUGA ], 37: [ Species.CARRACOSTA ] } ],
|
||||
[BiomePoolTier.ULTRA_RARE]: [ Species.KELDEO ],
|
||||
[BiomePoolTier.BOSS]: [ Species.CLOYSTER, Species.KINGLER, Species.STARMIE, Species.CRAWDAUNT, Species.WORMADAM, Species.CRUSTLE, Species.CARRACOSTA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [ Species.CLOYSTER, Species.KINGLER, Species.STARMIE, Species.CRAWDAUNT, Species.WORMADAM, Species.CRUSTLE ],
|
||||
[BiomePoolTier.BOSS_RARE]: [ Species.CARRACOSTA ],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [ Species.KELDEO ],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
@@ -467,6 +474,7 @@ export const biomePools: BiomePools = {
|
||||
{ 1: [ Species.CRANIDOS ], 30: [ Species.RAMPARDOS ] },
|
||||
{ 1: [ Species.SHIELDON ], 30: [ Species.BASTIODON ] },
|
||||
{ 1: [ Species.GIBLE ], 24: [ Species.GABITE ], 48: [ Species.GARCHOMP ] },
|
||||
Species.ARCHEOPS,
|
||||
{ 1: [ Species.AXEW ], 38: [ Species.FRAXURE ] }
|
||||
],
|
||||
[BiomePoolTier.ULTRA_RARE]: [ Species.TORNADUS ],
|
||||
@@ -731,6 +739,306 @@ export const biomePools: BiomePools = {
|
||||
}
|
||||
};
|
||||
|
||||
export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[Biome.TOWN]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.YOUNGSTER ],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.PLAINS]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.TWINS ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER, TrainerType.CYCLIST ],
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.GRASS]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BREEDER ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ],
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.TALL_GRASS]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER, TrainerType.BREEDER, TrainerType.RANGER ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.CITY]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BAKER, TrainerType.OFFICER ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.BREEDER ],
|
||||
[BiomePoolTier.RARE]: [ TrainerType.ARTIST ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.FOREST]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.RANGER ],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.SEA]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.SWIMMER ],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.SWAMP]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ],
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.BEACH]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.FISHERMAN, TrainerType.PARASOL_LADY ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER, TrainerType.BREEDER ],
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.LAKE]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BREEDER, TrainerType.FISHERMAN ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ],
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.SEABED]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.MOUNTAIN]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.BLACK_BELT, TrainerType.HIKER ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.BADLANDS]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.HIKER ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.CAVE]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BACKPACKER, TrainerType.HIKER ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER, TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.DESERT]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.SCIENTIST ],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.ICE_CAVE]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.MEADOW]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER, TrainerType.BREEDER ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.POWER_PLANT]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.VOLCANO]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.GRAVEYARD]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.PSYCHIC ],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.DOJO]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.FACTORY]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.RUINS]: {
|
||||
[BiomePoolTier.COMMON]: [ TrainerType.PSYCHIC, TrainerType.SCIENTIST ],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER, TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.WASTELAND]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.ABYSS]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [ TrainerType.ACE_TRAINER ],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.SPACE]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
},
|
||||
[Biome.END]: {
|
||||
[BiomePoolTier.COMMON]: [],
|
||||
[BiomePoolTier.UNCOMMON]: [],
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
}
|
||||
};
|
||||
|
||||
{
|
||||
const pokemonBiomes = [
|
||||
[ Species.BULBASAUR, Type.GRASS, Type.POISON, [
|
||||
@@ -3422,14 +3730,14 @@ export const biomePools: BiomePools = {
|
||||
]
|
||||
],
|
||||
[ Species.TIRTOUGA, Type.WATER, Type.ROCK, [
|
||||
[ Biome.BEACH, BiomePoolTier.COMMON ],
|
||||
[ Biome.SEA, BiomePoolTier.UNCOMMON ]
|
||||
[ Biome.SEA, BiomePoolTier.SUPER_RARE ],
|
||||
[ Biome.BEACH, BiomePoolTier.SUPER_RARE ]
|
||||
]
|
||||
],
|
||||
[ Species.CARRACOSTA, Type.WATER, Type.ROCK, [
|
||||
[ Biome.BEACH, BiomePoolTier.COMMON ],
|
||||
[ Biome.BEACH, BiomePoolTier.BOSS ],
|
||||
[ Biome.SEA, BiomePoolTier.UNCOMMON ]
|
||||
[ Biome.SEA, BiomePoolTier.SUPER_RARE ],
|
||||
[ Biome.BEACH, BiomePoolTier.SUPER_RARE ],
|
||||
[ Biome.BEACH, BiomePoolTier.BOSS_RARE ]
|
||||
]
|
||||
],
|
||||
[ Species.ARCHEN, Type.ROCK, Type.FLYING, [
|
||||
@@ -3437,6 +3745,7 @@ export const biomePools: BiomePools = {
|
||||
]
|
||||
],
|
||||
[ Species.ARCHEOPS, Type.ROCK, Type.FLYING, [
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.SUPER_RARE ],
|
||||
[ Biome.RUINS, BiomePoolTier.SUPER_RARE ],
|
||||
[ Biome.RUINS, BiomePoolTier.BOSS_RARE ]
|
||||
]
|
||||
@@ -3827,11 +4136,154 @@ export const biomePools: BiomePools = {
|
||||
]
|
||||
];
|
||||
|
||||
for (let biome of Utils.getEnumValues(Biome)) {
|
||||
biomePools[biome] = {};
|
||||
const trainerBiomes = [
|
||||
[ TrainerType.ACE_TRAINER, [
|
||||
[ Biome.PLAINS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.GRASS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.TALL_GRASS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.SWAMP, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.BEACH, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.LAKE, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.BADLANDS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.CAVE, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.MEADOW, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.RUINS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.ABYSS, BiomePoolTier.UNCOMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.ARTIST, [
|
||||
[ Biome.CITY, BiomePoolTier.RARE ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BACKERS, [] ],
|
||||
[ TrainerType.BACKPACKER, [
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.COMMON ],
|
||||
[ Biome.CAVE, BiomePoolTier.COMMON ],
|
||||
[ Biome.BADLANDS, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BAKER, [
|
||||
[ Biome.CITY, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BEAUTY, [] ],
|
||||
[ TrainerType.BIKER, [] ],
|
||||
[ TrainerType.BLACK_BELT, [
|
||||
[ Biome.DOJO, BiomePoolTier.COMMON ],
|
||||
[ Biome.PLAINS, BiomePoolTier.RARE ],
|
||||
[ Biome.GRASS, BiomePoolTier.RARE ],
|
||||
[ Biome.SWAMP, BiomePoolTier.RARE ],
|
||||
[ Biome.BEACH, BiomePoolTier.RARE ],
|
||||
[ Biome.LAKE, BiomePoolTier.RARE ],
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.COMMON ],
|
||||
[ Biome.CAVE, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.RUINS, BiomePoolTier.UNCOMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BREEDER, [
|
||||
[ Biome.PLAINS, BiomePoolTier.COMMON ],
|
||||
[ Biome.GRASS, BiomePoolTier.COMMON ],
|
||||
[ Biome.TALL_GRASS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.CITY, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.BEACH, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.LAKE, BiomePoolTier.COMMON ],
|
||||
[ Biome.MEADOW, BiomePoolTier.UNCOMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CLERK, [] ],
|
||||
[ TrainerType.CYCLIST, [
|
||||
[ Biome.PLAINS, BiomePoolTier.UNCOMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.DANCER, [] ],
|
||||
[ TrainerType.DEPOT_AGENT, [] ],
|
||||
[ TrainerType.DOCTOR, [] ],
|
||||
[ TrainerType.FISHERMAN, [
|
||||
[ Biome.LAKE, BiomePoolTier.COMMON ],
|
||||
[ Biome.BEACH, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.RICH, [] ],
|
||||
[ TrainerType.GUITARIST, [] ],
|
||||
[ TrainerType.HARLEQUIN, [] ],
|
||||
[ TrainerType.HIKER, [
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.COMMON ],
|
||||
[ Biome.CAVE, BiomePoolTier.COMMON ],
|
||||
[ Biome.BADLANDS, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.HOOLIGANS, [] ],
|
||||
[ TrainerType.HOOPSTER, [] ],
|
||||
[ TrainerType.INFIELDER, [] ],
|
||||
[ TrainerType.JANITOR, [] ],
|
||||
[ TrainerType.LINEBACKER, [] ],
|
||||
[ TrainerType.MAID, [] ],
|
||||
[ TrainerType.MUSICIAN, [] ],
|
||||
[ TrainerType.NURSE, [] ],
|
||||
[ TrainerType.NURSERY_AIDE, [] ],
|
||||
[ TrainerType.OFFICER, [
|
||||
[ Biome.CITY, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.PARASOL_LADY, [
|
||||
[ Biome.BEACH, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.PILOT, [] ],
|
||||
[ TrainerType.POKEFAN, [] ],
|
||||
[ TrainerType.PRESCHOOLER, [] ],
|
||||
[ TrainerType.PSYCHIC, [
|
||||
[ Biome.GRAVEYARD, BiomePoolTier.COMMON ],
|
||||
[ Biome.RUINS, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.RANGER, [
|
||||
[ Biome.TALL_GRASS, BiomePoolTier.UNCOMMON ],
|
||||
[ Biome.FOREST, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.RICH_KID, [] ],
|
||||
[ TrainerType.ROUGHNECK, [] ],
|
||||
[ TrainerType.SCIENTIST, [
|
||||
[ Biome.DESERT, BiomePoolTier.COMMON ],
|
||||
[ Biome.RUINS, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.SMASHER, [] ],
|
||||
[ TrainerType.SNOW_WORKER, [
|
||||
[ Biome.ICE_CAVE ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.STRIKER, [] ],
|
||||
[ TrainerType.STUDENT, [] ],
|
||||
[ TrainerType.SWIMMER, [
|
||||
[ Biome.SEA, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.TWINS, [
|
||||
[ Biome.PLAINS, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.VETERAN, [] ],
|
||||
[ TrainerType.WAITER, [] ],
|
||||
[ TrainerType.WORKER, [] ],
|
||||
[ TrainerType.YOUNGSTER, [
|
||||
[ Biome.TOWN, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.RIVAL, [] ],
|
||||
[ TrainerType.CYNTHIA, [] ]
|
||||
]
|
||||
|
||||
for (let tier of Utils.getEnumValues(BiomePoolTier))
|
||||
biomePools[biome][tier] = [];
|
||||
for (let biome of Utils.getEnumValues(Biome)) {
|
||||
biomePokemonPools[biome] = {};
|
||||
biomeTrainerPools[biome] = {};
|
||||
|
||||
for (let tier of Utils.getEnumValues(BiomePoolTier)) {
|
||||
biomePokemonPools[biome][tier] = [];
|
||||
biomeTrainerPools[biome][tier] = [];
|
||||
}
|
||||
}
|
||||
|
||||
for (let pb of pokemonBiomes) {
|
||||
@@ -3846,10 +4298,10 @@ export const biomePools: BiomePools = {
|
||||
const biome = b[0];
|
||||
const tier = b[1];
|
||||
|
||||
if (!biomePools.hasOwnProperty(biome) || !biomePools[biome].hasOwnProperty(tier))
|
||||
if (!biomePokemonPools.hasOwnProperty(biome) || !biomePokemonPools[biome].hasOwnProperty(tier))
|
||||
continue;
|
||||
|
||||
const biomeTierPool = biomePools[biome][tier];
|
||||
const biomeTierPool = biomePokemonPools[biome][tier];
|
||||
|
||||
let treeIndex = -1;
|
||||
let arrayIndex = 0;
|
||||
@@ -3881,10 +4333,10 @@ export const biomePools: BiomePools = {
|
||||
}
|
||||
}
|
||||
|
||||
for (let b of Object.keys(biomePools)) {
|
||||
for (let t of Object.keys(biomePools[b])) {
|
||||
for (let b of Object.keys(biomePokemonPools)) {
|
||||
for (let t of Object.keys(biomePokemonPools[b])) {
|
||||
const tier = parseInt(t) as BiomePoolTier;
|
||||
const biomeTierPool = biomePools[b][t];
|
||||
const biomeTierPool = biomePokemonPools[b][t];
|
||||
for (let e = 0; e < biomeTierPool.length; e++) {
|
||||
const entry = biomeTierPool[e];
|
||||
if (entry.length === 1)
|
||||
@@ -3908,20 +4360,39 @@ export const biomePools: BiomePools = {
|
||||
}
|
||||
}
|
||||
|
||||
function outputPools() {
|
||||
const output = {};
|
||||
for (let tb of trainerBiomes) {
|
||||
const trainerType = tb[0] as TrainerType;
|
||||
const biomeEntries = tb[1] as BiomePoolTier[][];
|
||||
|
||||
for (let b of Object.keys(biomePools)) {
|
||||
for (let b of biomeEntries) {
|
||||
const biome = b[0];
|
||||
const tier = b[1];
|
||||
|
||||
if (!biomeTrainerPools.hasOwnProperty(biome) || !biomeTrainerPools[biome].hasOwnProperty(tier))
|
||||
continue;
|
||||
|
||||
const biomeTierPool = biomeTrainerPools[biome][tier];
|
||||
biomeTierPool.push(trainerType);
|
||||
}
|
||||
}
|
||||
|
||||
function outputPools() {
|
||||
const pokemonOutput = {};
|
||||
const trainerOutput = {};
|
||||
|
||||
for (let b of Object.keys(biomePokemonPools)) {
|
||||
const biome = Biome[b];
|
||||
output[biome] = {};
|
||||
for (let t of Object.keys(biomePools[b])) {
|
||||
pokemonOutput[biome] = {};
|
||||
trainerOutput[biome] = {};
|
||||
|
||||
for (let t of Object.keys(biomePokemonPools[b])) {
|
||||
const tier = BiomePoolTier[t];
|
||||
|
||||
output[biome][tier] = [];
|
||||
pokemonOutput[biome][tier] = [];
|
||||
|
||||
for (let f of biomePools[b][t]) {
|
||||
for (let f of biomePokemonPools[b][t]) {
|
||||
if (typeof f === 'number')
|
||||
output[biome][tier].push(Species[f]);
|
||||
pokemonOutput[biome][tier].push(Species[f]);
|
||||
else {
|
||||
const tree = {};
|
||||
|
||||
@@ -3929,13 +4400,23 @@ export const biomePools: BiomePools = {
|
||||
tree[l] = f[l].map(s => Species[s]);
|
||||
}
|
||||
|
||||
output[biome][tier].push(tree);
|
||||
pokemonOutput[biome][tier].push(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let t of Object.keys(biomeTrainerPools[b])) {
|
||||
const tier = BiomePoolTier[t];
|
||||
|
||||
trainerOutput[biome][tier] = [];
|
||||
|
||||
for (let f of biomeTrainerPools[b][t])
|
||||
trainerOutput[biome][tier].push(TrainerType[f]);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(beautify(output, null, 2, 180).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:(?:\{ )?"\d+": \[ )?)"(.*?)"/g, '$1Species.$2').replace(/"(\d+)": /g, '$1: ').replace(/( )"(.*?)"/g, '$1[BiomePoolTier.$2]').replace(/( )"(.*?)"/g, '$1[Biome.$2]'));
|
||||
console.log(beautify(pokemonOutput, null, 2, 180).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:(?:\{ )?"\d+": \[ )?)"(.*?)"/g, '$1Species.$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]'));
|
||||
}
|
||||
|
||||
outputPools();
|
||||
|
||||
+41
-30
@@ -1990,6 +1990,46 @@ export class RandomMoveAttr extends OverrideMoveEffectAttr {
|
||||
}
|
||||
}
|
||||
|
||||
const lastMoveCopiableCondition = (user: Pokemon, target: Pokemon, move: Move) => {
|
||||
const copiableMove = user.scene.currentBattle.lastMove;
|
||||
|
||||
if (!copiableMove)
|
||||
return false;
|
||||
|
||||
if (allMoves[copiableMove].getAttrs(ChargeAttr).length)
|
||||
return false;
|
||||
|
||||
// TODO: Add last turn of Bide
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
export class CopyMoveAttr extends OverrideMoveEffectAttr {
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const lastMove = user.scene.currentBattle.lastMove;
|
||||
|
||||
const moveTargets = getMoveTargets(user, lastMove);
|
||||
if (!moveTargets.targets.length)
|
||||
return false;
|
||||
|
||||
const targets = moveTargets.multiple || moveTargets.targets.length === 1
|
||||
? moveTargets.targets
|
||||
: moveTargets.targets.indexOf(target.getBattlerIndex()) > -1
|
||||
? [ target.getBattlerIndex() ]
|
||||
: [ moveTargets.targets[Utils.randInt(moveTargets.targets.length)] ];
|
||||
user.getMoveQueue().push({ move: lastMove, targets: targets, ignorePP: true });
|
||||
|
||||
user.scene.unshiftPhase(new MovePhase(user.scene, user as PlayerPokemon, targets, new PokemonMove(lastMove, 0, 0, true), true));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getCondition(): MoveCondition {
|
||||
return lastMoveCopiableCondition;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Review this
|
||||
const targetMoveCopiableCondition = (user: Pokemon, target: Pokemon, move: Move) => {
|
||||
const targetMoves = target.getMoveHistory().filter(m => !m.virtual);
|
||||
if (!targetMoves.length)
|
||||
@@ -2000,7 +2040,7 @@ const targetMoveCopiableCondition = (user: Pokemon, target: Pokemon, move: Move)
|
||||
if (!copiableMove.move)
|
||||
return false;
|
||||
|
||||
if (allMoves[copiableMove.move].getAttrs(ChargeAttr) && copiableMove.result === MoveResult.OTHER)
|
||||
if (allMoves[copiableMove.move].getAttrs(ChargeAttr).length && copiableMove.result === MoveResult.OTHER)
|
||||
return false;
|
||||
|
||||
// TODO: Add last turn of Bide
|
||||
@@ -2008,35 +2048,6 @@ const targetMoveCopiableCondition = (user: Pokemon, target: Pokemon, move: Move)
|
||||
return true;
|
||||
};
|
||||
|
||||
export class CopyMoveAttr extends OverrideMoveEffectAttr {
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const targetMoves = target.getMoveHistory().filter(m => !m.virtual);
|
||||
if (!targetMoves.length)
|
||||
return false;
|
||||
|
||||
const copiedMove = targetMoves[0];
|
||||
|
||||
const moveTargets = getMoveTargets(user, copiedMove.move);
|
||||
if (!moveTargets.targets.length)
|
||||
return false;
|
||||
|
||||
const targets = moveTargets.multiple || moveTargets.targets.length === 1
|
||||
? moveTargets.targets
|
||||
: moveTargets.targets.indexOf(target.getBattlerIndex()) > -1
|
||||
? [ target.getBattlerIndex() ]
|
||||
: [ moveTargets.targets[Utils.randInt(moveTargets.targets.length)] ];
|
||||
user.getMoveQueue().push({ move: copiedMove.move, targets: targets, ignorePP: true });
|
||||
|
||||
user.scene.unshiftPhase(new MovePhase(user.scene, user as PlayerPokemon, targets, new PokemonMove(copiedMove.move, 0, 0, true), true));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getCondition(): MoveCondition {
|
||||
return targetMoveCopiableCondition;
|
||||
}
|
||||
}
|
||||
|
||||
export class MovesetCopyMoveAttr extends OverrideMoveEffectAttr {
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const targetMoves = target.getMoveHistory().filter(m => !m.virtual);
|
||||
|
||||
@@ -5,6 +5,7 @@ import { SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } fro
|
||||
import { Species } from './species';
|
||||
import { Type } from './type';
|
||||
import * as Utils from '../utils';
|
||||
import { TrainerType, trainerConfigs } from './trainer-type';
|
||||
|
||||
export function getPokemonSpecies(species: Species): PokemonSpecies {
|
||||
if (species >= Species.XERNEAS)
|
||||
@@ -12,6 +13,8 @@ export function getPokemonSpecies(species: Species): PokemonSpecies {
|
||||
return allSpecies[species - 1];
|
||||
}
|
||||
|
||||
export type PokemonSpeciesFilter = (species: PokemonSpecies) => boolean;
|
||||
|
||||
export abstract class PokemonSpeciesForm {
|
||||
public speciesId: Species;
|
||||
public formIndex: integer;
|
||||
@@ -272,7 +275,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
|
||||
|
||||
for (let weight of evolutionPool.keys()) {
|
||||
if (randValue < weight)
|
||||
return evolutionPool.get(weight);
|
||||
return getPokemonSpecies(evolutionPool.get(weight)).getSpeciesForLevel(level, true);
|
||||
}
|
||||
|
||||
return this.speciesId;
|
||||
@@ -344,7 +347,7 @@ class PokemonForm extends PokemonSpeciesForm {
|
||||
}
|
||||
}
|
||||
|
||||
export const allSpecies = [];
|
||||
export const allSpecies: PokemonSpecies[] = [];
|
||||
|
||||
export function initSpecies() {
|
||||
allSpecies.push(
|
||||
@@ -1102,4 +1105,17 @@ export function initSpecies() {
|
||||
new PokemonSpecies(Species.YVELTAL, "Yveltal", 6, false, true, false, "Destruction Pokémon", Type.DARK, Type.FLYING, 5.8, 203, Abilities.DARK_AURA, Abilities.NONE, Abilities.NONE, 680, 126, 131, 95, 131, 98, 99, 45, 0, 306, GrowthRate.SLOW, "Undiscovered", null, null, 120, false),
|
||||
new PokemonSpecies(Species.ETERNATUS, 'Eternatus', 8, false, true, false, 'Gigantic Pokemon', Type.POISON, Type.DRAGON, 20, 950, Abilities.PRESSURE, Abilities.NONE, Abilities.NONE, 690, 140, 85, 95, 145, 95, 130, 255, 0, 345, GrowthRate.SLOW, "Undiscovered", null, null, 120, false, false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove
|
||||
/*{
|
||||
setTimeout(() => {
|
||||
for (let tc of Object.keys(trainerConfigs)) {
|
||||
console.log(TrainerType[tc], !trainerConfigs[tc].speciesFilter ? 'all' : [...new Set(allSpecies.slice(0, -1).filter(trainerConfigs[tc].speciesFilter).map(s => {
|
||||
while (pokemonPrevolutions.hasOwnProperty(s.speciesId))
|
||||
s = getPokemonSpecies(pokemonPrevolutions[s.speciesId]);
|
||||
return s;
|
||||
}))].map(s => s.name));
|
||||
}
|
||||
}, 1000);
|
||||
}*/
|
||||
+136
-59
@@ -1,5 +1,11 @@
|
||||
import BattleScene from "../battle-scene";
|
||||
import * as Utils from "../utils";
|
||||
import { Moves } from "./move";
|
||||
import { pokemonLevelMoves } from "./pokemon-level-moves";
|
||||
import { PokemonSpeciesFilter } from "./pokemon-species";
|
||||
import { Species } from "./species";
|
||||
import { tmSpecies } from "./tms";
|
||||
import { Type } from "./type";
|
||||
|
||||
export enum TrainerType {
|
||||
ACE_TRAINER = 1,
|
||||
@@ -7,10 +13,9 @@ export enum TrainerType {
|
||||
BACKERS,
|
||||
BACKPACKER,
|
||||
BAKER,
|
||||
BATTLE_GIRL,
|
||||
BEAUTY,
|
||||
BIKER,
|
||||
BLACKBELT,
|
||||
BLACK_BELT,
|
||||
BREEDER,
|
||||
CLERK,
|
||||
CYCLIST,
|
||||
@@ -18,7 +23,6 @@ export enum TrainerType {
|
||||
DEPOT_AGENT,
|
||||
DOCTOR,
|
||||
FISHERMAN,
|
||||
GENTLEMAN,
|
||||
GUITARIST,
|
||||
HARLEQUIN,
|
||||
HIKER,
|
||||
@@ -26,8 +30,6 @@ export enum TrainerType {
|
||||
HOOPSTER,
|
||||
INFIELDER,
|
||||
JANITOR,
|
||||
LADY,
|
||||
LASS,
|
||||
LINEBACKER,
|
||||
MAID,
|
||||
MUSICIAN,
|
||||
@@ -40,12 +42,12 @@ export enum TrainerType {
|
||||
PRESCHOOLER,
|
||||
PSYCHIC,
|
||||
RANGER,
|
||||
RICH_BOY,
|
||||
RICH,
|
||||
RICH_KID,
|
||||
ROUGHNECK,
|
||||
SCIENTIST,
|
||||
SMASHER,
|
||||
SNOW_WORKER,
|
||||
SOCIALITE,
|
||||
STRIKER,
|
||||
STUDENT,
|
||||
SWIMMER,
|
||||
@@ -54,16 +56,45 @@ export enum TrainerType {
|
||||
WAITER,
|
||||
WORKER,
|
||||
YOUNGSTER,
|
||||
RIVAL,
|
||||
CYNTHIA
|
||||
}
|
||||
|
||||
export enum TrainerPartyType {
|
||||
DEFAULT,
|
||||
BALANCED,
|
||||
REPEATED
|
||||
}
|
||||
|
||||
export enum TrainerPoolTier {
|
||||
COMMON,
|
||||
UNCOMMON,
|
||||
RARE,
|
||||
SUPER_RARE,
|
||||
ULTRA_RARE
|
||||
};
|
||||
|
||||
export interface TrainerTierPools {
|
||||
[key: integer]: Species[]
|
||||
}
|
||||
|
||||
export class TrainerConfig {
|
||||
public trainerType: TrainerType;
|
||||
public name: string;
|
||||
public nameFemale: string;
|
||||
public hasGenders: boolean = false;
|
||||
public isDouble: boolean = false;
|
||||
public partyType: TrainerPartyType = TrainerPartyType.DEFAULT;
|
||||
public encounterBgm: string;
|
||||
public femaleEncounterBgm: string;
|
||||
public speciesPools: TrainerTierPools;
|
||||
public speciesFilter: PokemonSpeciesFilter;
|
||||
|
||||
constructor(trainerType: TrainerType) {
|
||||
constructor(trainerType: TrainerType, allowLegendaries?: boolean) {
|
||||
this.trainerType = trainerType;
|
||||
this.name = Utils.toPokemonUpperCase(TrainerType[this.trainerType].toString().replace(/\_/g, ' '));
|
||||
this.encounterBgm = this.name.toLowerCase();
|
||||
this.speciesFilter = species => allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical);
|
||||
}
|
||||
|
||||
public getKey(female?: boolean): string {
|
||||
@@ -73,8 +104,16 @@ export class TrainerConfig {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public setHasGenders(): TrainerConfig {
|
||||
public setName(name: string): TrainerConfig {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig {
|
||||
this.hasGenders = true;
|
||||
this.nameFemale = nameFemale;
|
||||
if (femaleEncounterBgm)
|
||||
this.femaleEncounterBgm = typeof femaleEncounterBgm === 'number' ? TrainerType[femaleEncounterBgm].toString().replace(/\_/g, ' ').toLowerCase() : femaleEncounterBgm;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -83,8 +122,39 @@ export class TrainerConfig {
|
||||
return this;
|
||||
}
|
||||
|
||||
public getName(): string {
|
||||
return Utils.toPokemonUpperCase(TrainerType[this.trainerType].toString().replace(/\_/g, ' '));
|
||||
public setEncounterBgm(encounterBgm: TrainerType | string): TrainerConfig {
|
||||
this.encounterBgm = typeof encounterBgm === 'number' ? TrainerType[encounterBgm].toString().replace(/\_/g, ' ').toLowerCase() : encounterBgm;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setPartyType(partyType: TrainerPartyType): TrainerConfig {
|
||||
this.partyType = partyType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setSpeciesPools(speciesPools: TrainerTierPools | Species[]): TrainerConfig {
|
||||
this.speciesPools = (Array.isArray(speciesPools) ? speciesPools : { [TrainerPoolTier.COMMON]: speciesPools }) as unknown as TrainerTierPools;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setSpeciesFilter(speciesFilter: PokemonSpeciesFilter, allowLegendaries?: boolean): TrainerConfig {
|
||||
const baseFilter = this.speciesFilter;
|
||||
this.speciesFilter = allowLegendaries ? speciesFilter : species => speciesFilter(species) && baseFilter(species);
|
||||
return this;
|
||||
}
|
||||
|
||||
public getName(female?: boolean): string {
|
||||
let ret = this.name;
|
||||
|
||||
if (this.hasGenders) {
|
||||
if (this.nameFemale) {
|
||||
if (female)
|
||||
return this.nameFemale;
|
||||
} else
|
||||
ret += !female ? '♂' : '♀';
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public genPartySize(): integer {
|
||||
@@ -122,58 +192,65 @@ interface TrainerConfigs {
|
||||
[key: integer]: TrainerConfig
|
||||
}
|
||||
|
||||
export const trainerConfigs: TrainerConfigs = {
|
||||
[TrainerType.ACE_TRAINER]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.ARTIST]: new TrainerConfig(++t),
|
||||
[TrainerType.BACKERS]: new TrainerConfig(++t).setHasGenders().setDouble(),
|
||||
[TrainerType.BACKPACKER]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.BAKER]: new TrainerConfig(++t),
|
||||
[TrainerType.BATTLE_GIRL]: new TrainerConfig(++t),
|
||||
[TrainerType.BEAUTY]: new TrainerConfig(++t),
|
||||
[TrainerType.BIKER]: new TrainerConfig(++t),
|
||||
[TrainerType.BLACKBELT]: new TrainerConfig(++t),
|
||||
[TrainerType.BREEDER]: new TrainerConfig(++t).setHasGenders().setDouble(),
|
||||
export const trainerConfigs: TrainerConfigs = {
|
||||
[TrainerType.ACE_TRAINER]: new TrainerConfig(++t).setHasGenders().setPartyType(TrainerPartyType.BALANCED),
|
||||
[TrainerType.ARTIST]: new TrainerConfig(++t).setEncounterBgm(TrainerType.RICH).setSpeciesPools([ Species.SMEARGLE ]),
|
||||
[TrainerType.BACKERS]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setDouble(),
|
||||
[TrainerType.BACKPACKER]: new TrainerConfig(++t).setHasGenders().setSpeciesFilter(s => s.isOfType(Type.FLYING) || s.isOfType(Type.ROCK)),
|
||||
[TrainerType.BAKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.GRASS) || s.isOfType(Type.FIRE)),
|
||||
[TrainerType.BEAUTY]: new TrainerConfig(++t).setEncounterBgm(TrainerType.PARASOL_LADY),
|
||||
[TrainerType.BIKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.POISON)),
|
||||
[TrainerType.BLACK_BELT]: new TrainerConfig(++t).setHasGenders('Battle Girl', TrainerType.PSYCHIC).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.FIGHTING)),
|
||||
[TrainerType.BREEDER]: new TrainerConfig(++t).setHasGenders().setDouble().setEncounterBgm(TrainerType.POKEFAN),
|
||||
[TrainerType.CLERK]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.CYCLIST]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.DANCER]: new TrainerConfig(++t),
|
||||
[TrainerType.DEPOT_AGENT]: new TrainerConfig(++t),
|
||||
[TrainerType.DOCTOR]: new TrainerConfig(++t),
|
||||
[TrainerType.FISHERMAN]: new TrainerConfig(++t),
|
||||
[TrainerType.GENTLEMAN]: new TrainerConfig(++t),
|
||||
[TrainerType.GUITARIST]: new TrainerConfig(++t),
|
||||
[TrainerType.HARLEQUIN]: new TrainerConfig(++t),
|
||||
[TrainerType.HIKER]: new TrainerConfig(++t),
|
||||
[TrainerType.HOOLIGANS]: new TrainerConfig(++t).setDouble(),
|
||||
[TrainerType.HOOPSTER]: new TrainerConfig(++t),
|
||||
[TrainerType.INFIELDER]: new TrainerConfig(++t),
|
||||
[TrainerType.JANITOR]: new TrainerConfig(++t),
|
||||
[TrainerType.LADY]: new TrainerConfig(++t),
|
||||
[TrainerType.LASS]: new TrainerConfig(++t),
|
||||
[TrainerType.LINEBACKER]: new TrainerConfig(++t),
|
||||
[TrainerType.MAID]: new TrainerConfig(++t),
|
||||
[TrainerType.MUSICIAN]: new TrainerConfig(++t),
|
||||
[TrainerType.NURSE]: new TrainerConfig(++t),
|
||||
[TrainerType.NURSERY_AIDE]: new TrainerConfig(++t),
|
||||
[TrainerType.OFFICER]: new TrainerConfig(++t),
|
||||
[TrainerType.PARASOL_LADY]: new TrainerConfig(++t),
|
||||
[TrainerType.PILOT]: new TrainerConfig(++t),
|
||||
[TrainerType.CYCLIST]: new TrainerConfig(++t).setHasGenders().setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.QUICK_ATTACK)),
|
||||
[TrainerType.DANCER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.DEPOT_AGENT]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.DOCTOR]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.FISHERMAN]: new TrainerConfig(++t).setEncounterBgm(TrainerType.BACKPACKER).setSpeciesPools({
|
||||
[TrainerPoolTier.COMMON]: [ Species.TENTACOOL, Species.MAGIKARP, Species.GOLDEEN, Species.STARYU, Species.REMORAID ],
|
||||
[TrainerPoolTier.UNCOMMON]: [ Species.POLIWAG, Species.SHELLDER, Species.KRABBY, Species.HORSEA, Species.CARVANHA, Species.BARBOACH, Species.CORPHISH, Species.FINNEON, Species.TYMPOLE, Species.BASCULIN, Species.FRILLISH ],
|
||||
[TrainerPoolTier.RARE]: [ Species.CHINCHOU, Species.CORSOLA, Species.WAILMER, Species.CLAMPERL, Species.LUVDISC, Species.MANTYKE, Species.ALOMOMOLA ],
|
||||
[TrainerPoolTier.SUPER_RARE]: [ Species.LAPRAS, Species.FEEBAS, Species.RELICANTH ]
|
||||
}),
|
||||
[TrainerType.GUITARIST]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.ELECTRIC)),
|
||||
[TrainerType.HARLEQUIN]: new TrainerConfig(++t).setEncounterBgm(TrainerType.PSYCHIC).setSpeciesFilter(s => tmSpecies[Moves.TRICK_ROOM].indexOf(s.speciesId) > -1),
|
||||
[TrainerType.HIKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.BACKPACKER).setSpeciesFilter(s => s.isOfType(Type.GROUND) || s.isOfType(Type.ROCK)),
|
||||
[TrainerType.HOOLIGANS]: new TrainerConfig(++t).setDouble().setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.POISON) || s.isOfType(Type.DARK)),
|
||||
[TrainerType.HOOPSTER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.INFIELDER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.JANITOR]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.LINEBACKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.MAID]: new TrainerConfig(++t).setEncounterBgm(TrainerType.RICH).setSpeciesFilter(s => s.eggType1 === 'Field' || s.eggType2 === 'Field'),
|
||||
[TrainerType.MUSICIAN]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.SING)),
|
||||
[TrainerType.NURSE]: new TrainerConfig(++t).setEncounterBgm('lass').setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.CHARM) || !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.HEAL_PULSE)),
|
||||
[TrainerType.NURSERY_AIDE]: new TrainerConfig(++t).setEncounterBgm('lass'),
|
||||
[TrainerType.OFFICER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesPools([ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.HOUNDOUR, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP ]),
|
||||
[TrainerType.PARASOL_LADY]: new TrainerConfig(++t).setSpeciesFilter(s => s.isOfType(Type.WATER)),
|
||||
[TrainerType.PILOT]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => tmSpecies[Moves.FLY].indexOf(s.speciesId) > -1),
|
||||
[TrainerType.POKEFAN]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.PRESCHOOLER]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.PRESCHOOLER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders(undefined, 'lass'),
|
||||
[TrainerType.PSYCHIC]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.RANGER]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.RICH_BOY]: new TrainerConfig(++t),
|
||||
[TrainerType.ROUGHNECK]: new TrainerConfig(++t),
|
||||
[TrainerType.SCIENTIST]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.SMASHER]: new TrainerConfig(++t),
|
||||
[TrainerType.SNOW_WORKER]: new TrainerConfig(++t),
|
||||
[TrainerType.SOCIALITE]: new TrainerConfig(++t),
|
||||
[TrainerType.STRIKER]: new TrainerConfig(++t),
|
||||
[TrainerType.RANGER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.BACKPACKER).setHasGenders(),
|
||||
[TrainerType.RICH]: new TrainerConfig(++t).setName('Gentleman').setHasGenders().setSpeciesFilter(s => s.eggType1 === 'Field' || s.eggType2 === 'Field'),
|
||||
[TrainerType.RICH_KID]: new TrainerConfig(++t).setName('Rich Boy').setHasGenders('Lady').setEncounterBgm(TrainerType.RICH),
|
||||
[TrainerType.ROUGHNECK]: new TrainerConfig(++t).setSpeciesFilter(s => s.isOfType(Type.DARK)),
|
||||
[TrainerType.SCIENTIST]: new TrainerConfig(++t).setHasGenders().setSpeciesPools({
|
||||
[TrainerPoolTier.COMMON]: [ Species.MAGNEMITE, Species.GRIMER, Species.DROWZEE, Species.VOLTORB, Species.KOFFING ],
|
||||
[TrainerPoolTier.UNCOMMON]: [ Species.KLINK ],
|
||||
[TrainerPoolTier.RARE ]: [ Species.ABRA, Species.PORYGON ],
|
||||
[TrainerPoolTier.SUPER_RARE ]: [ Species.OMANYTE, Species.KABUTO, Species.AERODACTYL, Species.LILEEP, Species.ANORITH, Species.CRANIDOS, Species.SHIELDON, Species.TIRTOUGA, Species.ARCHEN ]
|
||||
}),
|
||||
[TrainerType.SMASHER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.SNOW_WORKER]: new TrainerConfig(++t).setName('Worker').setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.ICE) || s.isOfType(Type.STEEL)),
|
||||
[TrainerType.STRIKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.STUDENT]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.SWIMMER]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.SWIMMER]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.PARASOL_LADY).setSpeciesFilter(s => s.isOfType(Type.WATER)),
|
||||
[TrainerType.TWINS]: new TrainerConfig(++t).setDouble(),
|
||||
[TrainerType.VETERAN]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.WAITER]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.WORKER]: new TrainerConfig(++t),
|
||||
[TrainerType.YOUNGSTER]: new TrainerConfig(++t),
|
||||
[TrainerType.VETERAN]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.RICH),
|
||||
[TrainerType.WAITER]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.WORKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.ROCK) || s.isOfType(Type.STEEL)),
|
||||
[TrainerType.YOUNGSTER]: new TrainerConfig(++t).setHasGenders('Lass', 'lass').setEncounterBgm(TrainerType.YOUNGSTER),
|
||||
[TrainerType.RIVAL]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.CYNTHIA]: new TrainerConfig(++t),
|
||||
}
|
||||
Reference in new issue
Block a user