doshidak / showdex

Pokémon Showdown extension that harnesses the power of parabolic calculus to strategically extract your opponents' Elo.
GNU Affero General Public License v3.0
104 stars 18 forks source link

Icicle Crash is missing in Weavile's learnset #69

Closed doshidak closed 1 year ago

doshidak commented 1 year ago

Reported by: sh0shin

Icicle Crash seems to be missing in Weavile's learnset. Teambuilder has no apparent issue pulling this data, so may have to relook how Showdown pulls the learnsets (via BattleTeambuilderTable) in the Teambuilder's code.

doshidak commented 1 year ago

Aha, found the problem.

The way Showdown's Teambuilder pulls Icicle Crash is not through Weavile (where it doesn't exist, as previously discovered), but through its previous evolution as Sneasel, where Icicle Crash is defined as BattleTeambuilderTable.learnsets.sneasel.iciclecrash.

Specifically, the Teambuilder calls upon the DexSearch class, which eventually calls the protected canLearn() class function. canLearn() seems to perform a while loop to obtain all of the learnsets of the current Pokémon and any of its other formes' learnsets via:

const next = lsetSpecies.battleOnly || lsetSpecies.changesFrom || lsetSpecies.prevo;

In the case of Weavile, Sneasel is defined in the prevo property.

Fix is to perform a similar loop to make sure we got everything in getPokemonLearnset().


Also, kinda solved the mystery of p, q, and g markers in BattleTeambuilderTable.learnsets:

For these markers to apply, the battle format must include one of the following:

As for what the letters mean, no idea. My best guess is that g is for Galar, but can't really wrap my head around what p (Gen 6: XY/ORAS) and q (Gen 7: SM/LGPE) stand for.