game master extracts...
by yairamon
HTML
<div id="output">
data
</div>
JavaScript
src = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-game-master/master/versions/latest/GAME_MASTER.json"
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var data = JSON.parse(this.responseText);
var lastPokemon = null; // to skip repetition for shadow forms etc.
str = ""; // "var baseStats = {";
for (i= 0; i < data.itemTemplates.length ; i++)
{
item = data.itemTemplates[i];
if (item.pokemonSettings === undefined) continue;
thisPokemon = item.pokemonSettings.pokemonId;
if (thisPokemon == lastPokemon)
continue;
lastPokemon = thisPokemon;
evs = "n/a";
if (thisPokemon === "JYNX")
debugger;
if (item.pokemonSettings.evolutionBranch != null)
evs = JSON.stringify(item.pokemonSettings.evolutionBranch);
const camelize = (s) => {
if (typeof s !== 'string') return ''
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
}
candy = item.pokemonSettings.familyId.replace("FAMILY_", "");
evs = camelize(candy);
/*
evs = camelize(thisPokemon);
*/
str += evs + "<br>"
;
// '[ ' + item.pokemonSettings.stats.baseAttack +
// ', ' + item.pokemonSettings.stats.baseDefense +
// ', ' + item.pokemonSettings.stats.baseStamina + '], ';
}
document.getElementById("output").innerHTML = str;
}
};
xmlhttp.open("GET", src, true);
xmlhttp.send();