Last active
August 29, 2016 11:53
-
-
Save BraisGabin/42ed1f2be736831323eb3cafcd4cdafd to your computer and use it in GitHub Desktop.
[Pokémon GO] Simple script to get a table with all the CP Multipliers
This file contains 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
public class CPM { | |
public static void main(String[] args) { | |
// Extracted from: | |
// https://www.reddit.com/r/pokemongodev/comments/4t59t1/decoded_game_master_protobuf_file_v01_all_pokemon/d5f2y91 | |
float[] cpm = { | |
0.094f, 0.16639787f, 0.21573247f, 0.25572005f, 0.29024988f, | |
0.3210876f, 0.34921268f, 0.37523559f, 0.39956728f, 0.42250001f, | |
0.44310755f, 0.46279839f, 0.48168495f, 0.49985844f, 0.51739395f, | |
0.53435433f, 0.55079269f, 0.56675452f, 0.58227891f, 0.59740001f, | |
0.61215729f, 0.62656713f, 0.64065295f, 0.65443563f, 0.667934f, | |
0.68116492f, 0.69414365f, 0.70688421f, 0.71939909f, 0.7317f, | |
0.73776948f, 0.74378943f, 0.74976104f, 0.75568551f, 0.76156384f, | |
0.76739717f, 0.7731865f, 0.77893275f, 0.78463697f, 0.79030001f, | |
}; | |
StringBuilder builder = new StringBuilder(); | |
builder.append("{\n"); | |
for (int i = 0; i < cpm.length - 1; i++) { | |
builder | |
.append(cpm[i]) | |
.append("f, // lvl ") | |
.append(i + 1) | |
.append("\n") | |
.append((float) Math.sqrt((cpm[i] * cpm[i] + cpm[i + 1] * cpm[i + 1]) / 2f)) | |
.append("f, // lvl ") | |
.append(i + 1) | |
.append(".5\n"); | |
} | |
builder.append(cpm[39]) | |
.append("f, // lvl 40\n") | |
.append("}"); | |
System.out.println(builder.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment