Storing an override

When a Pokémon is captured or KOed, if the config allows for onCapture or onKo, respectively, the species, form, and level (as modified by the levelMod and constrained by the levelModMaxRange from the config) get stored in a new PokemonProperties against the player who did the capturing/koing, and the context in which the Pokémon spawned (fishing or player spawner (”wild spawning”) at the moment). This only happens if the Pokémon in question matches against the chainingBlacklist/chainingWhitelist.

Overriding a spawn

When the player fishes up a Pokémon or a Pokémon spawns in the wild off of them, we check to see if there’s a stored override for that player in that context. If there is, we check to make sure the Pokémon that would have spawned matches against the overrideBlacklist/overrideWhitelist. We then check if the player passes a roll; the value of the roll is given by initialChance plus the sum of the points property. By default, the initialChance is 1.0, giving us a 100% chance to replace the next spawn. From there, we swap out the properties and remember the level mod that we’re at so far so we can limit it for the next roll.