game master extracts V2

by yairamon

HTML

<div id="output">
data
</div>

JavaScript

src = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-game-master/master/versions/latest/V2_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.
       	
//        debugger;
        
        str = ""; // "var baseStats = {";
        for (i= 0; i < data.template.length ; i++) 
        {
        
        
         item = data.template[i];
         if (item.data.pokemon === undefined) continue;
        
        
        idNumber = item.templateId.replace(/V0+(\d+).*/, "$1");
        
  	//      debugger;
         thisPokemon = item.data.pokemon.uniqueId;
	  	

         if (thisPokemon == lastPokemon)  // skipping forms
          	continue;
    
  //  if (i> 5000) continue;
       
//  	 console.log(i + " " + thisPokemon)
       
         lastPokemon = thisPokemon;
        
        	evs = "n/a";        
         
 //        if (thisPokemon === "JYNX")
 //        		debugger;
        
        
         if (item.data.pokemon.evolutionBranch != null)
          evs = JSON.stringify(item.data.pokemon.evolutionBranch);
          
         


    const camelize = (s) => {
  if (typeof s !== 'string') return ''
     return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
	}
  
  const norm = (s) => {
  	camelized = camelize(s); 
    if (camelized === "Nidoran_female")
    	return "Nidoran F";
    if (camelized === "Nidoran_male")
    	return "Nidoran M";

    if (camelized === "Porygon_z")
    	return "Poyrgon-Z.";

    if (camelized === "Mr_rime")
    	return "Mr. Rime";
    if (camelized === "Mr_mime")
    	return "Mr. Mime";
    if (camelized === "Mime_jr")
    	return "Mime Jr.";

    if (camelized === "Ho_oh")
    	return "Ho-oh";

    return camelized;
  }


	candyType = item.data.pokemon.familyId.replace("FAMILY_", "");
 ...