Created
June 12, 2021 05:50
-
-
Save Hidden50/63f86e3899a51a5510c9277e822d4bfa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ranks = "S+, S+/A-, S, S-, A+, A, A-, B+, B, B-, C+, C, C-, D+, D, D-, E+, E, E-, F+, F, F-".split(", ").reverse(); | |
return app.pokeTypes.map( type => [ | |
type, | |
Object.values(app.moveData) | |
.filter( move => move.type === type && move.power ) | |
.map( move => [move.name, move.tierlistRank] ) | |
.sort( ([,leftRank], [,rightRank]) => ranks.indexOf(rightRank) - ranks.indexOf(leftRank) ) | |
]).map( | |
([type, [[firstName, firstRank], ...otherMoves]]) => [type, firstRank, [firstName, firstRank], ...otherMoves] | |
).map( | |
([type, bestRank, ...moves]) => [type, bestRank, ...moves.map( ([name, rank]) => `${name} (${rank})` )] | |
).sort( | |
([,leftRank], [,rightRank]) => ranks.indexOf(rightRank) - ranks.indexOf(leftRank) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment