Members
effects :Object.<number, MoveEffect>
A dictionary of move effects, indexed by ID.
- Object.<number, MoveEffect>
itemByNameIndex :Map.<string, Item>
Gets a Map of items indexed by their name.
- Map.<string, Item>
items :Object.<number, Item>
A dictionary of items, indexed by ID.
- Object.<number, Item>
list_alolan :Array.<number>
Gets a list of Alolan Pokemon species IDs.
- Array.<number>
list_event :Array.<number>
Gets a list of Event Pokemon species IDs.
- Array.<number>
list_galarian :Array.<number>
Gets a list of Galarian Pokemon species IDs.
- Array.<number>
list_hisuian :Array.<number>
Gets a list of Hisuian Pokemon species IDs.
- Array.<number>
list_legendary :Array.<number>
Gets a list of Legendary Pokemon species IDs.
- Array.<number>
list_mega :Array.<number>
Gets a list of Mega Evolution Pokemon species IDs.
- Array.<number>
list_mythical :Array.<number>
Gets a list of Mythical Pokemon species IDs.
- Array.<number>
list_paradox :Array.<number>
Gets a list of Paradox Pokemon species IDs.
- Array.<number>
list_ub :Array.<number>
Gets a list of Ultra Beast Pokemon species IDs.
- Array.<number>
moveByNameIndex :Map.<string, Move>
Gets a Map of moves indexed by their name.
- Map.<string, Move>
moves :Object.<number, Move>
A dictionary of moves, indexed by ID.
- Object.<number, Move>
pokemon :Object.<number, Species>
A dictionary of Pokemon species, indexed by ID.
- Object.<number, Species>
speciesByDexNumberIndex :Map.<number, Array.<Species>>
Gets a Map of species indexed by their dex number.
- Map.<number, Array.<Species>>
speciesByNameIndex :Map.<string, Array.<Species>>
Gets a Map of species indexed by their name.
- Map.<string, Array.<Species>>
speciesIdByMoveIndex :Map.<number, Array.<number>>
Gets a Map of species IDs indexed by move ID.
- Map.<number, Array.<number>>
speciesIdByRegionIndex :Map.<string, Array.<number>>
Gets a Map of species IDs indexed by Pokemon region.
- Map.<string, Array.<number>>
species_id_by_type_index :Record.<string, Array.<number>>
Gets a dictionary of species IDs indexed by Pokemon type.
- Record.<string, Array.<number>>
Methods
allItems() → {Array.<Item>}
Gets a list of all items.
A list of all items.
- Type:
- Array.<Item>
allPokemon() → {Array.<Species>}
Gets a list of all Pokemon species.
A list of all Pokemon species.
- Type:
- Array.<Species>
allSpeciesByName(name) → {Array.<Species>}
Gets a list of all species with the given name.
Name | Type | Description |
---|---|---|
name | string | The name of the Pokemon species. |
A list of Pokemon species.
- Type:
- Array.<Species>
allSpeciesByNumber(number) → {Array.<Species>}
Gets a list of all species with the given dex number.
Name | Type | Description |
---|---|---|
number | number | The dex number. |
A list of Pokemon species.
- Type:
- Array.<Species>
checkinitialized()
Checks if the DataManager has been initialized.
If the DataManager is not initialized.
- Type
- Error
findSpeciesByNumber(number) → {Species|null}
Finds a species by its dex number.
Name | Type | Description |
---|---|---|
number | number | The dex number. |
The Pokemon species with the given dex number, or null if not found.
- Type:
- Species |
null
itemByName(name) → {Item|null}
Finds an item by its name.
Name | Type | Description |
---|---|---|
name | string | The name of the item. |
The item with the given name, or null if not found.
- Type:
- Item |
null
itemByNumber(number) → {Item|null}
Finds an item by its ID.
Name | Type | Description |
---|---|---|
number | number | The ID of the item. |
The item with the given ID, or null if not found.
- Type:
- Item |
null
listMove(moveName) → {Array.<number>}
Gets a list of Pokemon species IDs that can learn a given move.
Name | Type | Description |
---|---|---|
moveName | string | The name of the move. |
A list of Pokemon species IDs.
- Type:
- Array.<number>
listRegion(region) → {Array.<number>}
Gets a list of Pokemon species IDs for a given region.
Name | Type | Description |
---|---|---|
region | string | The name of the region. |
A list of Pokemon species IDs.
- Type:
- Array.<number>
moveByName(name) → {Move|null}
Finds a move by its name.
Name | Type | Description |
---|---|---|
name | string | The name of the move. |
The move with the given name, or null if not found.
- Type:
- Move |
null
moveByNumber(number) → {Move|null}
Finds a move by its ID.
Name | Type | Description |
---|---|---|
number | number | The ID of the move. |
The move with the given ID, or null if not found.
- Type:
- Move |
null
randomSpawn(rarityopt) → {Species}
Returns a random Pokemon species.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rarity | string | <optional> | 'normal' | The rarity of the Pokemon to spawn. Can be 'normal', 'mythical', 'legendary', or 'ultra_beast'. |
A random Pokemon species.
- Type:
- Species
randomSpawnPokemon(rarityopt) → {PokemonBase}
Returns a random Pokemon.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rarity | string | <optional> | 'normal' | The rarity of the Pokemon to spawn. Can be 'normal', 'mythical', 'legendary', or 'ultra_beast'. |
A random Pokemon instance.
- Type:
- PokemonBase
speciesByName(name) → {Species|null}
Finds a species by its name.
Name | Type | Description |
---|---|---|
name | string | The name of the Pokemon species. |
The Pokemon species with the given name, or null if not found.
- Type:
- Species |
null
weightedRandomChoice(weights) → {number}
Chooses a random element from a list of weights using weighted random selection.
Name | Type | Description |
---|---|---|
weights | Array.<number> | A list of weights. |
The index of the chosen element.
- Type:
- number