From 0d0d74b10f03b7109be3b0bf1b91137b9f36b1a5 Mon Sep 17 00:00:00 2001 From: nahojjjen Date: Sun, 28 Oct 2018 16:56:41 +0100 Subject: [PATCH 01/51] Adds integers.xml generator and moves pokebattler generator --- .../ApplicationDatabaseUpdater.java | 420 ++++++++++++++++++ .../ApplicationDatabaseUpdaterPoke.java | 12 + .../JsonStruct/AvatarCustomization.java | 121 +++++ .../JsonStruct/BadgeSettings.java | 55 +++ .../gameMasterParser/JsonStruct/Camera.java | 54 +++ .../gameMasterParser/JsonStruct/Camera_.java | 176 ++++++++ .../JsonStruct/DailyQuest.java | 54 +++ .../JsonStruct/Encounter.java | 186 ++++++++ .../JsonStruct/EvolutionBranch.java | 32 ++ .../gameMasterParser/JsonStruct/Food.java | 55 +++ .../gameMasterParser/JsonStruct/Form.java | 32 ++ .../JsonStruct/FormSettings.java | 33 ++ .../FriendshipMilestoneSettings.java | 77 ++++ .../gameMasterParser/JsonStruct/Gender.java | 43 ++ .../JsonStruct/GenderSettings.java | 32 ++ .../JsonStruct/GymBadgeSettings.java | 88 ++++ .../gameMasterParser/JsonStruct/GymLevel.java | 44 ++ .../JsonStruct/IapCategoryDisplay.java | 65 +++ .../JsonStruct/IapItemDisplay.java | 65 +++ .../JsonStruct/IapSettings.java | 55 +++ .../JsonStruct/ItemSettings.java | 65 +++ .../JsonStruct/ItemTemplate.java | 263 +++++++++++ .../JsonStruct/LuckyPokemonSettings.java | 21 + .../JsonStruct/MoveSequenceSettings.java | 22 + .../JsonStruct/PlayerLevel.java | 77 ++++ .../gameMasterParser/JsonStruct/PogoJson.java | 33 ++ .../JsonStruct/PokemonScaleSettings.java | 43 ++ .../JsonStruct/PokemonSettings.java | 365 +++++++++++++++ .../JsonStruct/PokemonUpgrades.java | 55 +++ .../JsonStruct/QuestSettings.java | 32 ++ .../gameMasterParser/JsonStruct/Stats.java | 43 ++ .../JsonStruct/TypeEffective.java | 33 ++ .../JsonStruct/WeatherAffinities.java | 33 ++ .../JsonStruct/WeatherBonusSettings.java | 76 ++++ .../pokebattler}/MovesetFetchUtil.java | 6 +- .../thirdparty/pokebattler/PokemonId.java | 0 .../com/kamron/pogoiv/utils/DevMethods.java | 104 ----- 37 files changed, 2862 insertions(+), 108 deletions(-) create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java create mode 100644 app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java rename app/src/{test/java/com/kamron/pogoiv/thirdparty => main/java/com/kamron/pogoiv/devMethods/thirdparty/pokebattler}/MovesetFetchUtil.java (98%) rename app/src/main/java/com/kamron/pogoiv/{ => devMethods}/thirdparty/pokebattler/PokemonId.java (100%) delete mode 100644 app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java new file mode 100644 index 000000000..f76de4529 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java @@ -0,0 +1,420 @@ +package com.kamron.pogoiv.devMethods.gameMasterParser; + +import android.os.Build; +import android.support.annotation.RequiresApi; + +import com.google.gson.Gson; +import com.google.gson.stream.JsonReader; +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.Form; +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.FormSettings; +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.ItemTemplate; +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.PogoJson; +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.PokemonSettings; + +import java.io.*; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +public class ApplicationDatabaseUpdater { + + public static void main(String args[]) throws InvalidObjectException { + + List items = getDataFromGamemasterJson(); + + Pattern pokedexRegex = Pattern.compile(".*FORMS_V([0-9]{4})_.*"); + HashMap formsByPokedex = new HashMap<>(); + ArrayList pokemonWithMultipleForms = new ArrayList<>(); + HashMap> pokemonFormsByName = new HashMap<>(); + + for (ItemTemplate item : items) { + if (item.getPokemonSettings() != null) { + PokemonSettings poke = item.getPokemonSettings(); + poke.setTemplateID(item.getTemplateId()); + HashMap formHash; + if (pokemonFormsByName.containsKey(poke.getPokemonId())) { + formHash = pokemonFormsByName.get(poke.getPokemonId()); + } else { + formHash = new HashMap<>(); + pokemonFormsByName.put(poke.getPokemonId(), formHash); + } + formHash.put(poke.getForm(), poke); + } + if (item.getFormSettings() != null) { + FormSettings form = item.getFormSettings(); + Matcher m = pokedexRegex.matcher(item.getTemplateId()); + if (m.matches()) { + formsByPokedex.put(Integer.parseInt(m.group(1)), form); + if (form.getForms() != null && form.getForms().size() > 1) { + // Multiple forms; handle with special care + pokemonWithMultipleForms.add(form); + } + } else { + throw new InvalidObjectException(null); + } + } + } + + printIntegersXml(formsByPokedex, pokemonWithMultipleForms, pokemonFormsByName); + printFormsXml(pokemonWithMultipleForms, pokemonFormsByName); + printTypeDifferencesSuggestions(pokemonWithMultipleForms, pokemonFormsByName, formsByPokedex); + } + + private static void printTypeDifferencesSuggestions(ArrayList pokemonWithMultipleForms, HashMap> pokemonFormsByName, HashMap formsByPokedex) { + System.out.println("Here's type difference suggestions to allow GoIV to differentiate between pokemon forms:\n"); + + for (FormSettings formSetting : pokemonWithMultipleForms) { + HashMap formHash = pokemonFormsByName.get(formSetting.getPokemon()); + + HashMap typeCounter = new HashMap<>(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + formHash.forEach((s, pokemonSettings) -> + { + int count = typeCounter.containsKey(pokemonSettings.getType()) ? typeCounter.get(pokemonSettings.getType()) : 0; + typeCounter.put(pokemonSettings.getType(), count + 1); + int count2 = typeCounter.containsKey(pokemonSettings.getType2()) ? typeCounter.get(pokemonSettings.getType2()) : 0; + typeCounter.put(pokemonSettings.getType2(), count2 + 1); + + } + ); + } + + final boolean[] hasUnique = {false}; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + typeCounter.forEach((s, integer) -> { + if (integer == 1) { + System.out.println(s + " is unique for " + formSetting.getPokemon() + getDexIDOf(formSetting.getPokemon(), formsByPokedex)); + hasUnique[0] = true; + } + }); + } + if (hasUnique[0] == false) { + System.out.println(formSetting.getPokemon() + " has no unique typing. :(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((("); + } + + } + } + + @RequiresApi(api = Build.VERSION_CODES.N) private static int getDexIDOf(String pokemon, HashMap formsByPokedex) { + + final int[] returner = {-1}; + formsByPokedex.forEach((integer, formSettings) -> + { + if (formSettings.getPokemon().equals(pokemon)) { + returner[0] = integer - 1; + } + }); + if (returner[0] == -1) { + + throw new Error("should be able to find pokemon"); + } + return returner[0]; + } + + /** + * Reads the GAME_MASTER.json located in the project root directory, and returns a List containing all the data contained in the Json. + * + * @return + */ + private static List getDataFromGamemasterJson() { + URL url = null; + try { + url = new URL("https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-game-master/master/versions/latest/GAME_MASTER.json"); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + InputStreamReader reader = null; + try { + reader = new InputStreamReader(url.openStream()); + } catch (IOException e) { + e.printStackTrace(); + } + PogoJson data = new Gson().fromJson(reader, PogoJson.class); + + return data.getItemTemplates(); + } + + /** + * Prints out the contents that should be in Integers.xml + * + * @param formsByPokedex + * @param pokemonWithMultipleForms + * @param pokemonFormsByName + */ + private static void printIntegersXml(HashMap formsByPokedex, ArrayList pokemonWithMultipleForms, HashMap> pokemonFormsByName) { + StringBuilder stringBuilder = new StringBuilder(); + + stringBuilder.append("\n" + + "\n"); + + // Output attack value of default form for each pokedex entry (no forms considered) + stringBuilder.append("\n"); + int maxPokedex = Collections.max(formsByPokedex.keySet()); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + PokemonSettings poke = formHash.get(null); + stringBuilder.append(" " + poke.getStats().getBaseAttack() + " \n"); + } + } + stringBuilder.append(" \n"); + + // Output defense value of default form for each pokedex entry (no forms considered) + stringBuilder.append("\n"); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + PokemonSettings poke = formHash.get(null); + stringBuilder.append(" " + poke.getStats().getBaseDefense() + " \n"); + } + } + stringBuilder.append(" \n"); + + // Output stamina value of default form for each pokedex entry (no forms considered) + stringBuilder.append("\n"); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + PokemonSettings poke = formHash.get(null); + stringBuilder.append(" " + poke.getStats().getBaseStamina() + " \n"); + } + } + stringBuilder.append(" \n"); + + // Output parent evolution information for each pokedex entry (no forms considered) + stringBuilder.append("\n"); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + PokemonSettings poke = formHash.get(null); + int parentPokedex = -1; + if (poke.getParentPokemonId() != null) { + for (Map.Entry entry : formsByPokedex.entrySet()) { + if (entry.getValue().getPokemon().equals(poke.getParentPokemonId())) { + parentPokedex = entry.getKey(); + parentPokedex -= 1; // Changing from pokedex number to array index; this may not work if there are gaps + break; + } + } + } + stringBuilder.append(" " + parentPokedex + " \n"); + } + } + stringBuilder.append(" \n"); + + // Output candy evolution cost of default form for each pokedex entry (no forms considered) + stringBuilder.append("\n"); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + PokemonSettings poke = formHash.get(null); + Integer evolveCandy = null; + + if (form.getPokemon().contains("TURTWIG")){ + System.out.println(); + } + //todo fix better - niantic changed how they store evolve candy cost from gen3+, you get it from evolutionbranch .getcandycost + //This implementation assumes that all evolution branches have the same evolution cost. + + + if (poke.getEvolutionBranch() != null) { + evolveCandy = poke.getEvolutionBranch().get(0).getCandyCost(); + } + if (evolveCandy == null){ + poke.getCandyToEvolve(); + } + + if (evolveCandy == null) { + evolveCandy = -1; + } + + stringBuilder.append(" " + evolveCandy + " \n"); + } + } + stringBuilder.append(" \n"); + + + // Output candy name for each pokedex entry (no forms considered) + stringBuilder.append("\n"); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + PokemonSettings poke = formHash.get(null); + + String familyName = poke.getFamilyId().replace("FAMILY_", ""); + int familyPokedex = -1; + for (Map.Entry entry : formsByPokedex.entrySet()) { + if (entry.getValue().getPokemon().equals(familyName)) { + familyPokedex = entry.getKey(); + familyPokedex -= 1; // Changing from pokedex number to array index; this may not work if there are gaps + break; + } + } + stringBuilder.append(" " + familyPokedex + " \n"); + } + } + stringBuilder.append(" \n"); + + // Output index into forms data of each pokedex entry + stringBuilder.append("\n"); + for (int i = 0; i <= maxPokedex; i++) { + if (formsByPokedex.containsKey(i)) { + FormSettings form = formsByPokedex.get(i); + int multiIndex = pokemonWithMultipleForms.indexOf(form); + stringBuilder.append(" " + multiIndex + " \n"); + } + } + + stringBuilder.append(" \n"); + stringBuilder.append("\n"); + + //System.out.println(stringBuilder); + writeFile("integers.xml", stringBuilder.toString()); + } + + /** + * Prints out all the contents that should be in forms.xml + * + * @param pokemonWithMultipleForms + * @param pokemonFormsByName + */ + private static void printFormsXml(ArrayList pokemonWithMultipleForms, HashMap> pokemonFormsByName) { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("\n" + + "\n"); + + // Output the number of forms for each multi-form pokemon + stringBuilder.append("\n"); + for (FormSettings form : pokemonWithMultipleForms) { + + stringBuilder.append(" " + form.getForms().size() + " \n"); + + } + stringBuilder.append(" \n"); + + // Output the form name of each form for each multi-form pokemon + stringBuilder.append("\n"); + for (FormSettings form : pokemonWithMultipleForms) { + stringBuilder.append(" \n"); + for (Form subform : form.getForms()) { + stringBuilder.append(" " + formName(subform.getForm(), form.getPokemon()) + "\n"); + + + } + } + + stringBuilder.append(" \n"); + + // Output the attack value of each form for each multi-form pokemon + stringBuilder.append("\n"); + for (FormSettings form : pokemonWithMultipleForms) { + + stringBuilder.append(" \n"); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + for (Form subform : form.getForms()) { + PokemonSettings poke = formHash.get(subform.getForm()); + int value = -1; // Default value should be ignored by GoIV since it won't yield a match + if (poke != null) { + value = poke.getStats().getBaseAttack(); + } + stringBuilder.append(" " + value + " \n"); + } + } + + stringBuilder.append(" \n"); + + // Output the defense value of each form for each multi-form pokemon + stringBuilder.append("\n"); + for (FormSettings form : pokemonWithMultipleForms) { + stringBuilder.append(" \n"); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + for (Form subform : form.getForms()) { + + PokemonSettings poke = formHash.get(subform.getForm()); + int value = -1; // Default value should be ignored by GoIV since it won't yield a match + if (poke != null) { + value = poke.getStats().getBaseDefense(); + } + stringBuilder.append(" " + value + " \n"); + + + } + } + + stringBuilder.append(" \n"); + + // Output the attack value of each form for each multi-form pokemon + stringBuilder.append("\n"); + for (FormSettings form : pokemonWithMultipleForms) { + stringBuilder.append(" \n"); + HashMap formHash = pokemonFormsByName.get(form.getPokemon()); + for (Form subform : form.getForms()) { + PokemonSettings poke = formHash.get(subform.getForm()); + int value = -1; // Default value should be ignored by GoIV since it won't yield a match + if (poke != null) { + value = poke.getStats().getBaseStamina(); + } + stringBuilder.append(" " + value + " \n"); + } + } + + stringBuilder.append(" \n"); + + stringBuilder.append("\n"); + + //System.out.println(stringBuilder); + writeFile("forms.xml", stringBuilder.toString()); + } + + /** + * Converts a string like 'RAICHU_ALOLAN' to 'Alolan Form', or 'ARCEUS_DARK' to 'Dark Form'. + * + * @param form + * @param pokemon + * @return + */ + private static String formName(String form, String pokemon) { + String simpleName = form.substring(pokemon.length() + 1); // Skip past pokemon name and underscore + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + return titleCase(simpleName) + " Form"; + } + throw new Error("Run the generator with a higher java version"); + } + + /** + * Converts text such as "THIS IS annoyingly WEIRd CapitaLIZATION" to "This Is Annoyingly Weird Capitalization" - capitalizing each word. + * + * @param str + * @return + */ + private static String titleCase(String str) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + return Arrays.stream(str.toLowerCase().split("[ _]")).map(word -> Character.toTitleCase(word.charAt(0)) + word.substring(1)).collect(Collectors.joining(" ")); + } + throw new Error("Run the generator with a higher java version"); + } + + private static void writeFile(String fileName, String content) { + try (Writer writer = new BufferedWriter(new OutputStreamWriter( + new FileOutputStream(fileName), "utf-8"))) { + writer.write(content); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java new file mode 100644 index 000000000..09f2a1817 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java @@ -0,0 +1,12 @@ +package com.kamron.pogoiv.devMethods.gameMasterParser; + +public class ApplicationDatabaseUpdaterPoke { + + String name ; + String id; + + public ApplicationDatabaseUpdaterPoke(String name, String id) { + this.name = name; + this.id = id; + } +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java new file mode 100644 index 000000000..2b2f8df6f --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java @@ -0,0 +1,121 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class AvatarCustomization { + + @SerializedName("enabled") + @Expose + private Boolean enabled; + @SerializedName("avatarType") + @Expose + private String avatarType; + @SerializedName("slot") + @Expose + private List slot = null; + @SerializedName("bundleName") + @Expose + private String bundleName; + @SerializedName("assetName") + @Expose + private String assetName; + @SerializedName("groupName") + @Expose + private String groupName; + @SerializedName("sortOrder") + @Expose + private Integer sortOrder; + @SerializedName("unlockType") + @Expose + private String unlockType; + @SerializedName("iapSku") + @Expose + private String iapSku; + @SerializedName("iconName") + @Expose + private String iconName; + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getAvatarType() { + return avatarType; + } + + public void setAvatarType(String avatarType) { + this.avatarType = avatarType; + } + + public List getSlot() { + return slot; + } + + public void setSlot(List slot) { + this.slot = slot; + } + + public String getBundleName() { + return bundleName; + } + + public void setBundleName(String bundleName) { + this.bundleName = bundleName; + } + + public String getAssetName() { + return assetName; + } + + public void setAssetName(String assetName) { + this.assetName = assetName; + } + + public String getGroupName() { + return groupName; + } + + public void setGroupName(String groupName) { + this.groupName = groupName; + } + + public Integer getSortOrder() { + return sortOrder; + } + + public void setSortOrder(Integer sortOrder) { + this.sortOrder = sortOrder; + } + + public String getUnlockType() { + return unlockType; + } + + public void setUnlockType(String unlockType) { + this.unlockType = unlockType; + } + + public String getIapSku() { + return iapSku; + } + + public void setIapSku(String iapSku) { + this.iapSku = iapSku; + } + + public String getIconName() { + return iconName; + } + + public void setIconName(String iconName) { + this.iconName = iconName; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java new file mode 100644 index 000000000..64fc05260 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java @@ -0,0 +1,55 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class BadgeSettings { + + @SerializedName("badgeType") + @Expose + private String badgeType; + @SerializedName("badgeRank") + @Expose + private Integer badgeRank; + @SerializedName("targets") + @Expose + private List targets = null; + @SerializedName("eventBadge") + @Expose + private Boolean eventBadge; + + public String getBadgeType() { + return badgeType; + } + + public void setBadgeType(String badgeType) { + this.badgeType = badgeType; + } + + public Integer getBadgeRank() { + return badgeRank; + } + + public void setBadgeRank(Integer badgeRank) { + this.badgeRank = badgeRank; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } + + public Boolean getEventBadge() { + return eventBadge; + } + + public void setEventBadge(Boolean eventBadge) { + this.eventBadge = eventBadge; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java new file mode 100644 index 000000000..54822b79c --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java @@ -0,0 +1,54 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Camera { + + @SerializedName("diskRadiusM") + @Expose + private Double diskRadiusM; + @SerializedName("cylinderRadiusM") + @Expose + private Double cylinderRadiusM; + @SerializedName("cylinderHeightM") + @Expose + private Double cylinderHeightM; + @SerializedName("shoulderModeScale") + @Expose + private Double shoulderModeScale; + + public Double getDiskRadiusM() { + return diskRadiusM; + } + + public void setDiskRadiusM(Double diskRadiusM) { + this.diskRadiusM = diskRadiusM; + } + + public Double getCylinderRadiusM() { + return cylinderRadiusM; + } + + public void setCylinderRadiusM(Double cylinderRadiusM) { + this.cylinderRadiusM = cylinderRadiusM; + } + + public Double getCylinderHeightM() { + return cylinderHeightM; + } + + public void setCylinderHeightM(Double cylinderHeightM) { + this.cylinderHeightM = cylinderHeightM; + } + + public Double getShoulderModeScale() { + return shoulderModeScale; + } + + public void setShoulderModeScale(Double shoulderModeScale) { + this.shoulderModeScale = shoulderModeScale; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java new file mode 100644 index 000000000..dda43052e --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java @@ -0,0 +1,176 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Camera_ { + + @SerializedName("interpolation") + @Expose + private List interpolation = null; + @SerializedName("targetType") + @Expose + private List targetType = null; + @SerializedName("easeInSpeed") + @Expose + private List easeInSpeed = null; + @SerializedName("easeOutSpeed") + @Expose + private List easeOutSpeed = null; + @SerializedName("durationSeconds") + @Expose + private List durationSeconds = null; + @SerializedName("waitSeconds") + @Expose + private List waitSeconds = null; + @SerializedName("transitionSeconds") + @Expose + private List transitionSeconds = null; + @SerializedName("angleDegree") + @Expose + private List angleDegree = null; + @SerializedName("angleOffsetDegree") + @Expose + private List angleOffsetDegree = null; + @SerializedName("pitchDegree") + @Expose + private List pitchDegree = null; + @SerializedName("pitchOffsetDegree") + @Expose + private List pitchOffsetDegree = null; + @SerializedName("rollDegree") + @Expose + private List rollDegree = null; + @SerializedName("distanceMeters") + @Expose + private List distanceMeters = null; + @SerializedName("heightPercent") + @Expose + private List heightPercent = null; + @SerializedName("vertCtrRatio") + @Expose + private List vertCtrRatio = null; + + public List getInterpolation() { + return interpolation; + } + + public void setInterpolation(List interpolation) { + this.interpolation = interpolation; + } + + public List getTargetType() { + return targetType; + } + + public void setTargetType(List targetType) { + this.targetType = targetType; + } + + public List getEaseInSpeed() { + return easeInSpeed; + } + + public void setEaseInSpeed(List easeInSpeed) { + this.easeInSpeed = easeInSpeed; + } + + public List getEaseOutSpeed() { + return easeOutSpeed; + } + + public void setEaseOutSpeed(List easeOutSpeed) { + this.easeOutSpeed = easeOutSpeed; + } + + public List getDurationSeconds() { + return durationSeconds; + } + + public void setDurationSeconds(List durationSeconds) { + this.durationSeconds = durationSeconds; + } + + public List getWaitSeconds() { + return waitSeconds; + } + + public void setWaitSeconds(List waitSeconds) { + this.waitSeconds = waitSeconds; + } + + public List getTransitionSeconds() { + return transitionSeconds; + } + + public void setTransitionSeconds(List transitionSeconds) { + this.transitionSeconds = transitionSeconds; + } + + public List getAngleDegree() { + return angleDegree; + } + + public void setAngleDegree(List angleDegree) { + this.angleDegree = angleDegree; + } + + public List getAngleOffsetDegree() { + return angleOffsetDegree; + } + + public void setAngleOffsetDegree(List angleOffsetDegree) { + this.angleOffsetDegree = angleOffsetDegree; + } + + public List getPitchDegree() { + return pitchDegree; + } + + public void setPitchDegree(List pitchDegree) { + this.pitchDegree = pitchDegree; + } + + public List getPitchOffsetDegree() { + return pitchOffsetDegree; + } + + public void setPitchOffsetDegree(List pitchOffsetDegree) { + this.pitchOffsetDegree = pitchOffsetDegree; + } + + public List getRollDegree() { + return rollDegree; + } + + public void setRollDegree(List rollDegree) { + this.rollDegree = rollDegree; + } + + public List getDistanceMeters() { + return distanceMeters; + } + + public void setDistanceMeters(List distanceMeters) { + this.distanceMeters = distanceMeters; + } + + public List getHeightPercent() { + return heightPercent; + } + + public void setHeightPercent(List heightPercent) { + this.heightPercent = heightPercent; + } + + public List getVertCtrRatio() { + return vertCtrRatio; + } + + public void setVertCtrRatio(List vertCtrRatio) { + this.vertCtrRatio = vertCtrRatio; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java new file mode 100644 index 000000000..5aaa05383 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java @@ -0,0 +1,54 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class DailyQuest { + + @SerializedName("bucketsPerDay") + @Expose + private Integer bucketsPerDay; + @SerializedName("streakLength") + @Expose + private Integer streakLength; + @SerializedName("bonusMultiplier") + @Expose + private Double bonusMultiplier; + @SerializedName("streakBonusMultiplier") + @Expose + private Double streakBonusMultiplier; + + public Integer getBucketsPerDay() { + return bucketsPerDay; + } + + public void setBucketsPerDay(Integer bucketsPerDay) { + this.bucketsPerDay = bucketsPerDay; + } + + public Integer getStreakLength() { + return streakLength; + } + + public void setStreakLength(Integer streakLength) { + this.streakLength = streakLength; + } + + public Double getBonusMultiplier() { + return bonusMultiplier; + } + + public void setBonusMultiplier(Double bonusMultiplier) { + this.bonusMultiplier = bonusMultiplier; + } + + public Double getStreakBonusMultiplier() { + return streakBonusMultiplier; + } + + public void setStreakBonusMultiplier(Double streakBonusMultiplier) { + this.streakBonusMultiplier = streakBonusMultiplier; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java new file mode 100644 index 000000000..eb5aa991a --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java @@ -0,0 +1,186 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Encounter { + + @SerializedName("baseCaptureRate") + @Expose + private Double baseCaptureRate; + @SerializedName("baseFleeRate") + @Expose + private Double baseFleeRate; + @SerializedName("collisionRadiusM") + @Expose + private Double collisionRadiusM; + @SerializedName("collisionHeightM") + @Expose + private Double collisionHeightM; + @SerializedName("collisionHeadRadiusM") + @Expose + private Double collisionHeadRadiusM; + @SerializedName("movementType") + @Expose + private String movementType; + @SerializedName("movementTimerS") + @Expose + private Double movementTimerS; + @SerializedName("jumpTimeS") + @Expose + private Double jumpTimeS; + @SerializedName("attackTimerS") + @Expose + private Double attackTimerS; + @SerializedName("attackProbability") + @Expose + private Double attackProbability; + @SerializedName("dodgeProbability") + @Expose + private Double dodgeProbability; + @SerializedName("dodgeDurationS") + @Expose + private Double dodgeDurationS; + @SerializedName("dodgeDistance") + @Expose + private Double dodgeDistance; + @SerializedName("cameraDistance") + @Expose + private Double cameraDistance; + @SerializedName("minPokemonActionFrequencyS") + @Expose + private Double minPokemonActionFrequencyS; + @SerializedName("maxPokemonActionFrequencyS") + @Expose + private Double maxPokemonActionFrequencyS; + + public Double getBaseCaptureRate() { + return baseCaptureRate; + } + + public void setBaseCaptureRate(Double baseCaptureRate) { + this.baseCaptureRate = baseCaptureRate; + } + + public Double getBaseFleeRate() { + return baseFleeRate; + } + + public void setBaseFleeRate(Double baseFleeRate) { + this.baseFleeRate = baseFleeRate; + } + + public Double getCollisionRadiusM() { + return collisionRadiusM; + } + + public void setCollisionRadiusM(Double collisionRadiusM) { + this.collisionRadiusM = collisionRadiusM; + } + + public Double getCollisionHeightM() { + return collisionHeightM; + } + + public void setCollisionHeightM(Double collisionHeightM) { + this.collisionHeightM = collisionHeightM; + } + + public Double getCollisionHeadRadiusM() { + return collisionHeadRadiusM; + } + + public void setCollisionHeadRadiusM(Double collisionHeadRadiusM) { + this.collisionHeadRadiusM = collisionHeadRadiusM; + } + + public String getMovementType() { + return movementType; + } + + public void setMovementType(String movementType) { + this.movementType = movementType; + } + + public Double getMovementTimerS() { + return movementTimerS; + } + + public void setMovementTimerS(Double movementTimerS) { + this.movementTimerS = movementTimerS; + } + + public Double getJumpTimeS() { + return jumpTimeS; + } + + public void setJumpTimeS(Double jumpTimeS) { + this.jumpTimeS = jumpTimeS; + } + + public Double getAttackTimerS() { + return attackTimerS; + } + + public void setAttackTimerS(Double attackTimerS) { + this.attackTimerS = attackTimerS; + } + + public Double getAttackProbability() { + return attackProbability; + } + + public void setAttackProbability(Double attackProbability) { + this.attackProbability = attackProbability; + } + + public Double getDodgeProbability() { + return dodgeProbability; + } + + public void setDodgeProbability(Double dodgeProbability) { + this.dodgeProbability = dodgeProbability; + } + + public Double getDodgeDurationS() { + return dodgeDurationS; + } + + public void setDodgeDurationS(Double dodgeDurationS) { + this.dodgeDurationS = dodgeDurationS; + } + + public Double getDodgeDistance() { + return dodgeDistance; + } + + public void setDodgeDistance(Double dodgeDistance) { + this.dodgeDistance = dodgeDistance; + } + + public Double getCameraDistance() { + return cameraDistance; + } + + public void setCameraDistance(Double cameraDistance) { + this.cameraDistance = cameraDistance; + } + + public Double getMinPokemonActionFrequencyS() { + return minPokemonActionFrequencyS; + } + + public void setMinPokemonActionFrequencyS(Double minPokemonActionFrequencyS) { + this.minPokemonActionFrequencyS = minPokemonActionFrequencyS; + } + + public Double getMaxPokemonActionFrequencyS() { + return maxPokemonActionFrequencyS; + } + + public void setMaxPokemonActionFrequencyS(Double maxPokemonActionFrequencyS) { + this.maxPokemonActionFrequencyS = maxPokemonActionFrequencyS; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java new file mode 100644 index 000000000..3d0085b2d --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java @@ -0,0 +1,32 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class EvolutionBranch { + + @SerializedName("evolution") + @Expose + private String evolution; + @SerializedName("candyCost") + @Expose + private Integer candyCost; + + public String getEvolution() { + return evolution; + } + + public void setEvolution(String evolution) { + this.evolution = evolution; + } + + public Integer getCandyCost() { + return candyCost; + } + + public void setCandyCost(Integer candyCost) { + this.candyCost = candyCost; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java new file mode 100644 index 000000000..1b0e85fee --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java @@ -0,0 +1,55 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Food { + + @SerializedName("itemEffect") + @Expose + private List itemEffect = null; + @SerializedName("itemEffectPercent") + @Expose + private List itemEffectPercent = null; + @SerializedName("growthPercent") + @Expose + private Double growthPercent; + @SerializedName("berryMultiplier") + @Expose + private Double berryMultiplier; + + public List getItemEffect() { + return itemEffect; + } + + public void setItemEffect(List itemEffect) { + this.itemEffect = itemEffect; + } + + public List getItemEffectPercent() { + return itemEffectPercent; + } + + public void setItemEffectPercent(List itemEffectPercent) { + this.itemEffectPercent = itemEffectPercent; + } + + public Double getGrowthPercent() { + return growthPercent; + } + + public void setGrowthPercent(Double growthPercent) { + this.growthPercent = growthPercent; + } + + public Double getBerryMultiplier() { + return berryMultiplier; + } + + public void setBerryMultiplier(Double berryMultiplier) { + this.berryMultiplier = berryMultiplier; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java new file mode 100644 index 000000000..9b6e1fc57 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java @@ -0,0 +1,32 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Form { + + @SerializedName("form") + @Expose + private String form; + @SerializedName("assetBundleValue") + @Expose + private Integer assetBundleValue; + + public String getForm() { + return form; + } + + public void setForm(String form) { + this.form = form; + } + + public Integer getAssetBundleValue() { + return assetBundleValue; + } + + public void setAssetBundleValue(Integer assetBundleValue) { + this.assetBundleValue = assetBundleValue; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java new file mode 100644 index 000000000..6b2c640ca --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java @@ -0,0 +1,33 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class FormSettings { + + @SerializedName("pokemon") + @Expose + private String pokemon; + @SerializedName("forms") + @Expose + private List
forms = null; + + public String getPokemon() { + return pokemon; + } + + public void setPokemon(String pokemon) { + this.pokemon = pokemon; + } + + public List getForms() { + return forms; + } + + public void setForms(List forms) { + this.forms = forms; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java new file mode 100644 index 000000000..160322285 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java @@ -0,0 +1,77 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class FriendshipMilestoneSettings { + + @SerializedName("milestoneXpReward") + @Expose + private Integer milestoneXpReward; + @SerializedName("attackBonusPercentage") + @Expose + private Double attackBonusPercentage; + @SerializedName("unlockedTrading") + @Expose + private List unlockedTrading = null; + @SerializedName("minPointsToReach") + @Expose + private Integer minPointsToReach; + @SerializedName("raidBallBonus") + @Expose + private Integer raidBallBonus; + @SerializedName("tradingDiscount") + @Expose + private Double tradingDiscount; + + public Integer getMilestoneXpReward() { + return milestoneXpReward; + } + + public void setMilestoneXpReward(Integer milestoneXpReward) { + this.milestoneXpReward = milestoneXpReward; + } + + public Double getAttackBonusPercentage() { + return attackBonusPercentage; + } + + public void setAttackBonusPercentage(Double attackBonusPercentage) { + this.attackBonusPercentage = attackBonusPercentage; + } + + public List getUnlockedTrading() { + return unlockedTrading; + } + + public void setUnlockedTrading(List unlockedTrading) { + this.unlockedTrading = unlockedTrading; + } + + public Integer getMinPointsToReach() { + return minPointsToReach; + } + + public void setMinPointsToReach(Integer minPointsToReach) { + this.minPointsToReach = minPointsToReach; + } + + public Integer getRaidBallBonus() { + return raidBallBonus; + } + + public void setRaidBallBonus(Integer raidBallBonus) { + this.raidBallBonus = raidBallBonus; + } + + public Double getTradingDiscount() { + return tradingDiscount; + } + + public void setTradingDiscount(Double tradingDiscount) { + this.tradingDiscount = tradingDiscount; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java new file mode 100644 index 000000000..d112032e1 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java @@ -0,0 +1,43 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Gender { + + @SerializedName("malePercent") + @Expose + private Double malePercent; + @SerializedName("femalePercent") + @Expose + private Double femalePercent; + @SerializedName("genderlessPercent") + @Expose + private Double genderlessPercent; + + public Double getMalePercent() { + return malePercent; + } + + public void setMalePercent(Double malePercent) { + this.malePercent = malePercent; + } + + public Double getFemalePercent() { + return femalePercent; + } + + public void setFemalePercent(Double femalePercent) { + this.femalePercent = femalePercent; + } + + public Double getGenderlessPercent() { + return genderlessPercent; + } + + public void setGenderlessPercent(Double genderlessPercent) { + this.genderlessPercent = genderlessPercent; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java new file mode 100644 index 000000000..35c3c4f29 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java @@ -0,0 +1,32 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class GenderSettings { + + @SerializedName("pokemon") + @Expose + private String pokemon; + @SerializedName("gender") + @Expose + private Gender gender; + + public String getPokemon() { + return pokemon; + } + + public void setPokemon(String pokemon) { + this.pokemon = pokemon; + } + + public Gender getGender() { + return gender; + } + + public void setGender(Gender gender) { + this.gender = gender; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java new file mode 100644 index 000000000..444b1b01e --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java @@ -0,0 +1,88 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class GymBadgeSettings { + + @SerializedName("target") + @Expose + private List target = null; + @SerializedName("battleWinningScorePerDefenderCp") + @Expose + private Double battleWinningScorePerDefenderCp; + @SerializedName("gymDefendingScorePerMinute") + @Expose + private Double gymDefendingScorePerMinute; + @SerializedName("berryFeedingScore") + @Expose + private Integer berryFeedingScore; + @SerializedName("pokemonDeployScore") + @Expose + private Integer pokemonDeployScore; + @SerializedName("raidBattleWinningScore") + @Expose + private Integer raidBattleWinningScore; + @SerializedName("loseAllBattlesScore") + @Expose + private Integer loseAllBattlesScore; + + public List getTarget() { + return target; + } + + public void setTarget(List target) { + this.target = target; + } + + public Double getBattleWinningScorePerDefenderCp() { + return battleWinningScorePerDefenderCp; + } + + public void setBattleWinningScorePerDefenderCp(Double battleWinningScorePerDefenderCp) { + this.battleWinningScorePerDefenderCp = battleWinningScorePerDefenderCp; + } + + public Double getGymDefendingScorePerMinute() { + return gymDefendingScorePerMinute; + } + + public void setGymDefendingScorePerMinute(Double gymDefendingScorePerMinute) { + this.gymDefendingScorePerMinute = gymDefendingScorePerMinute; + } + + public Integer getBerryFeedingScore() { + return berryFeedingScore; + } + + public void setBerryFeedingScore(Integer berryFeedingScore) { + this.berryFeedingScore = berryFeedingScore; + } + + public Integer getPokemonDeployScore() { + return pokemonDeployScore; + } + + public void setPokemonDeployScore(Integer pokemonDeployScore) { + this.pokemonDeployScore = pokemonDeployScore; + } + + public Integer getRaidBattleWinningScore() { + return raidBattleWinningScore; + } + + public void setRaidBattleWinningScore(Integer raidBattleWinningScore) { + this.raidBattleWinningScore = raidBattleWinningScore; + } + + public Integer getLoseAllBattlesScore() { + return loseAllBattlesScore; + } + + public void setLoseAllBattlesScore(Integer loseAllBattlesScore) { + this.loseAllBattlesScore = loseAllBattlesScore; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java new file mode 100644 index 000000000..84c78d463 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java @@ -0,0 +1,44 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class GymLevel { + + @SerializedName("requiredExperience") + @Expose + private List requiredExperience = null; + @SerializedName("leaderSlots") + @Expose + private List leaderSlots = null; + @SerializedName("trainerSlots") + @Expose + private List trainerSlots = null; + + public List getRequiredExperience() { + return requiredExperience; + } + + public void setRequiredExperience(List requiredExperience) { + this.requiredExperience = requiredExperience; + } + + public List getLeaderSlots() { + return leaderSlots; + } + + public void setLeaderSlots(List leaderSlots) { + this.leaderSlots = leaderSlots; + } + + public List getTrainerSlots() { + return trainerSlots; + } + + public void setTrainerSlots(List trainerSlots) { + this.trainerSlots = trainerSlots; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java new file mode 100644 index 000000000..5781dd2bd --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java @@ -0,0 +1,65 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class IapCategoryDisplay { + + @SerializedName("category") + @Expose + private String category; + @SerializedName("sortOrder") + @Expose + private Integer sortOrder; + @SerializedName("bannerEnabled") + @Expose + private Boolean bannerEnabled; + @SerializedName("imageUrl") + @Expose + private String imageUrl; + @SerializedName("description") + @Expose + private String description; + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Integer getSortOrder() { + return sortOrder; + } + + public void setSortOrder(Integer sortOrder) { + this.sortOrder = sortOrder; + } + + public Boolean getBannerEnabled() { + return bannerEnabled; + } + + public void setBannerEnabled(Boolean bannerEnabled) { + this.bannerEnabled = bannerEnabled; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java new file mode 100644 index 000000000..dfd1a02a2 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java @@ -0,0 +1,65 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class IapItemDisplay { + + @SerializedName("sku") + @Expose + private String sku; + @SerializedName("category") + @Expose + private String category; + @SerializedName("sortOrder") + @Expose + private Integer sortOrder; + @SerializedName("sale") + @Expose + private Boolean sale; + @SerializedName("hidden") + @Expose + private Boolean hidden; + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Integer getSortOrder() { + return sortOrder; + } + + public void setSortOrder(Integer sortOrder) { + this.sortOrder = sortOrder; + } + + public Boolean getSale() { + return sale; + } + + public void setSale(Boolean sale) { + this.sale = sale; + } + + public Boolean getHidden() { + return hidden; + } + + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java new file mode 100644 index 000000000..c86960566 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java @@ -0,0 +1,55 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class IapSettings { + + @SerializedName("dailyDefenderBonusPerPokemon") + @Expose + private List dailyDefenderBonusPerPokemon = null; + @SerializedName("dailyDefenderBonusMaxDefenders") + @Expose + private Integer dailyDefenderBonusMaxDefenders; + @SerializedName("dailyDefenderBonusCurrency") + @Expose + private List dailyDefenderBonusCurrency = null; + @SerializedName("minTimeBetweenClaimsMs") + @Expose + private String minTimeBetweenClaimsMs; + + public List getDailyDefenderBonusPerPokemon() { + return dailyDefenderBonusPerPokemon; + } + + public void setDailyDefenderBonusPerPokemon(List dailyDefenderBonusPerPokemon) { + this.dailyDefenderBonusPerPokemon = dailyDefenderBonusPerPokemon; + } + + public Integer getDailyDefenderBonusMaxDefenders() { + return dailyDefenderBonusMaxDefenders; + } + + public void setDailyDefenderBonusMaxDefenders(Integer dailyDefenderBonusMaxDefenders) { + this.dailyDefenderBonusMaxDefenders = dailyDefenderBonusMaxDefenders; + } + + public List getDailyDefenderBonusCurrency() { + return dailyDefenderBonusCurrency; + } + + public void setDailyDefenderBonusCurrency(List dailyDefenderBonusCurrency) { + this.dailyDefenderBonusCurrency = dailyDefenderBonusCurrency; + } + + public String getMinTimeBetweenClaimsMs() { + return minTimeBetweenClaimsMs; + } + + public void setMinTimeBetweenClaimsMs(String minTimeBetweenClaimsMs) { + this.minTimeBetweenClaimsMs = minTimeBetweenClaimsMs; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java new file mode 100644 index 000000000..a32391c3d --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java @@ -0,0 +1,65 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class ItemSettings { + + @SerializedName("itemId") + @Expose + private String itemId; + @SerializedName("itemType") + @Expose + private String itemType; + @SerializedName("category") + @Expose + private String category; + @SerializedName("dropTrainerLevel") + @Expose + private Integer dropTrainerLevel; + @SerializedName("food") + @Expose + private Food food; + + public String getItemId() { + return itemId; + } + + public void setItemId(String itemId) { + this.itemId = itemId; + } + + public String getItemType() { + return itemType; + } + + public void setItemType(String itemType) { + this.itemType = itemType; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Integer getDropTrainerLevel() { + return dropTrainerLevel; + } + + public void setDropTrainerLevel(Integer dropTrainerLevel) { + this.dropTrainerLevel = dropTrainerLevel; + } + + public Food getFood() { + return food; + } + + public void setFood(Food food) { + this.food = food; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java new file mode 100644 index 000000000..f2a126c44 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java @@ -0,0 +1,263 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class ItemTemplate { + + @SerializedName("templateId") + @Expose + private String templateId; + @SerializedName("avatarCustomization") + @Expose + private AvatarCustomization avatarCustomization; + @SerializedName("badgeSettings") + @Expose + private BadgeSettings badgeSettings; + @SerializedName("formSettings") + @Expose + private FormSettings formSettings; + @SerializedName("friendshipMilestoneSettings") + @Expose + private FriendshipMilestoneSettings friendshipMilestoneSettings; + @SerializedName("gymBadgeSettings") + @Expose + private GymBadgeSettings gymBadgeSettings; + @SerializedName("gymLevel") + @Expose + private GymLevel gymLevel; + @SerializedName("iapCategoryDisplay") + @Expose + private IapCategoryDisplay iapCategoryDisplay; + @SerializedName("iapSettings") + @Expose + private IapSettings iapSettings; + @SerializedName("itemSettings") + @Expose + private ItemSettings itemSettings; + @SerializedName("luckyPokemonSettings") + @Expose + private LuckyPokemonSettings luckyPokemonSettings; + @SerializedName("playerLevel") + @Expose + private PlayerLevel playerLevel; + @SerializedName("pokemonScaleSettings") + @Expose + private PokemonScaleSettings pokemonScaleSettings; + @SerializedName("typeEffective") + @Expose + private TypeEffective typeEffective; + @SerializedName("pokemonUpgrades") + @Expose + private PokemonUpgrades pokemonUpgrades; + @SerializedName("questSettings") + @Expose + private QuestSettings questSettings; + @SerializedName("genderSettings") + @Expose + private GenderSettings genderSettings; + @SerializedName("pokemonSettings") + @Expose + private PokemonSettings pokemonSettings; + @SerializedName("weatherAffinities") + @Expose + private WeatherAffinities weatherAffinities; + @SerializedName("weatherBonusSettings") + @Expose + private WeatherBonusSettings weatherBonusSettings; + @SerializedName("iapItemDisplay") + @Expose + private IapItemDisplay iapItemDisplay; + @SerializedName("camera") + @Expose + private Camera_ camera; + @SerializedName("moveSequenceSettings") + @Expose + private MoveSequenceSettings moveSequenceSettings; + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public AvatarCustomization getAvatarCustomization() { + return avatarCustomization; + } + + public void setAvatarCustomization(AvatarCustomization avatarCustomization) { + this.avatarCustomization = avatarCustomization; + } + + public BadgeSettings getBadgeSettings() { + return badgeSettings; + } + + public void setBadgeSettings(BadgeSettings badgeSettings) { + this.badgeSettings = badgeSettings; + } + + public FormSettings getFormSettings() { + return formSettings; + } + + public void setFormSettings(FormSettings formSettings) { + this.formSettings = formSettings; + } + + public FriendshipMilestoneSettings getFriendshipMilestoneSettings() { + return friendshipMilestoneSettings; + } + + public void setFriendshipMilestoneSettings(FriendshipMilestoneSettings friendshipMilestoneSettings) { + this.friendshipMilestoneSettings = friendshipMilestoneSettings; + } + + public GymBadgeSettings getGymBadgeSettings() { + return gymBadgeSettings; + } + + public void setGymBadgeSettings(GymBadgeSettings gymBadgeSettings) { + this.gymBadgeSettings = gymBadgeSettings; + } + + public GymLevel getGymLevel() { + return gymLevel; + } + + public void setGymLevel(GymLevel gymLevel) { + this.gymLevel = gymLevel; + } + + public IapCategoryDisplay getIapCategoryDisplay() { + return iapCategoryDisplay; + } + + public void setIapCategoryDisplay(IapCategoryDisplay iapCategoryDisplay) { + this.iapCategoryDisplay = iapCategoryDisplay; + } + + public IapSettings getIapSettings() { + return iapSettings; + } + + public void setIapSettings(IapSettings iapSettings) { + this.iapSettings = iapSettings; + } + + public ItemSettings getItemSettings() { + return itemSettings; + } + + public void setItemSettings(ItemSettings itemSettings) { + this.itemSettings = itemSettings; + } + + public LuckyPokemonSettings getLuckyPokemonSettings() { + return luckyPokemonSettings; + } + + public void setLuckyPokemonSettings(LuckyPokemonSettings luckyPokemonSettings) { + this.luckyPokemonSettings = luckyPokemonSettings; + } + + public PlayerLevel getPlayerLevel() { + return playerLevel; + } + + public void setPlayerLevel(PlayerLevel playerLevel) { + this.playerLevel = playerLevel; + } + + public PokemonScaleSettings getPokemonScaleSettings() { + return pokemonScaleSettings; + } + + public void setPokemonScaleSettings(PokemonScaleSettings pokemonScaleSettings) { + this.pokemonScaleSettings = pokemonScaleSettings; + } + + public TypeEffective getTypeEffective() { + return typeEffective; + } + + public void setTypeEffective(TypeEffective typeEffective) { + this.typeEffective = typeEffective; + } + + public PokemonUpgrades getPokemonUpgrades() { + return pokemonUpgrades; + } + + public void setPokemonUpgrades(PokemonUpgrades pokemonUpgrades) { + this.pokemonUpgrades = pokemonUpgrades; + } + + public QuestSettings getQuestSettings() { + return questSettings; + } + + public void setQuestSettings(QuestSettings questSettings) { + this.questSettings = questSettings; + } + + public GenderSettings getGenderSettings() { + return genderSettings; + } + + public void setGenderSettings(GenderSettings genderSettings) { + this.genderSettings = genderSettings; + } + + public PokemonSettings getPokemonSettings() { + return pokemonSettings; + } + + public void setPokemonSettings(PokemonSettings pokemonSettings) { + this.pokemonSettings = pokemonSettings; + } + + public WeatherAffinities getWeatherAffinities() { + return weatherAffinities; + } + + public void setWeatherAffinities(WeatherAffinities weatherAffinities) { + this.weatherAffinities = weatherAffinities; + } + + public WeatherBonusSettings getWeatherBonusSettings() { + return weatherBonusSettings; + } + + public void setWeatherBonusSettings(WeatherBonusSettings weatherBonusSettings) { + this.weatherBonusSettings = weatherBonusSettings; + } + + public IapItemDisplay getIapItemDisplay() { + return iapItemDisplay; + } + + public void setIapItemDisplay(IapItemDisplay iapItemDisplay) { + this.iapItemDisplay = iapItemDisplay; + } + + public Camera_ getCamera() { + return camera; + } + + public void setCamera(Camera_ camera) { + this.camera = camera; + } + + public MoveSequenceSettings getMoveSequenceSettings() { + return moveSequenceSettings; + } + + public void setMoveSequenceSettings(MoveSequenceSettings moveSequenceSettings) { + this.moveSequenceSettings = moveSequenceSettings; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java new file mode 100644 index 000000000..4bfc2b5c7 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java @@ -0,0 +1,21 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class LuckyPokemonSettings { + + @SerializedName("powerUpStardustDiscountPercent") + @Expose + private Double powerUpStardustDiscountPercent; + + public Double getPowerUpStardustDiscountPercent() { + return powerUpStardustDiscountPercent; + } + + public void setPowerUpStardustDiscountPercent(Double powerUpStardustDiscountPercent) { + this.powerUpStardustDiscountPercent = powerUpStardustDiscountPercent; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java new file mode 100644 index 000000000..506448fcb --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java @@ -0,0 +1,22 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class MoveSequenceSettings { + + @SerializedName("sequence") + @Expose + private List sequence = null; + + public List getSequence() { + return sequence; + } + + public void setSequence(List sequence) { + this.sequence = sequence; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java new file mode 100644 index 000000000..b0515f3c1 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java @@ -0,0 +1,77 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class PlayerLevel { + + @SerializedName("rankNum") + @Expose + private List rankNum = null; + @SerializedName("requiredExperience") + @Expose + private List requiredExperience = null; + @SerializedName("cpMultiplier") + @Expose + private List cpMultiplier = null; + @SerializedName("maxEggPlayerLevel") + @Expose + private Integer maxEggPlayerLevel; + @SerializedName("maxEncounterPlayerLevel") + @Expose + private Integer maxEncounterPlayerLevel; + @SerializedName("maxQuestEncounterPlayerLevel") + @Expose + private Integer maxQuestEncounterPlayerLevel; + + public List getRankNum() { + return rankNum; + } + + public void setRankNum(List rankNum) { + this.rankNum = rankNum; + } + + public List getRequiredExperience() { + return requiredExperience; + } + + public void setRequiredExperience(List requiredExperience) { + this.requiredExperience = requiredExperience; + } + + public List getCpMultiplier() { + return cpMultiplier; + } + + public void setCpMultiplier(List cpMultiplier) { + this.cpMultiplier = cpMultiplier; + } + + public Integer getMaxEggPlayerLevel() { + return maxEggPlayerLevel; + } + + public void setMaxEggPlayerLevel(Integer maxEggPlayerLevel) { + this.maxEggPlayerLevel = maxEggPlayerLevel; + } + + public Integer getMaxEncounterPlayerLevel() { + return maxEncounterPlayerLevel; + } + + public void setMaxEncounterPlayerLevel(Integer maxEncounterPlayerLevel) { + this.maxEncounterPlayerLevel = maxEncounterPlayerLevel; + } + + public Integer getMaxQuestEncounterPlayerLevel() { + return maxQuestEncounterPlayerLevel; + } + + public void setMaxQuestEncounterPlayerLevel(Integer maxQuestEncounterPlayerLevel) { + this.maxQuestEncounterPlayerLevel = maxQuestEncounterPlayerLevel; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java new file mode 100644 index 000000000..db5a3bec6 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java @@ -0,0 +1,33 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class PogoJson { + + @SerializedName("itemTemplates") + @Expose + private List itemTemplates = null; + @SerializedName("timestampMs") + @Expose + private String timestampMs; + + public List getItemTemplates() { + return itemTemplates; + } + + public void setItemTemplates(List itemTemplates) { + this.itemTemplates = itemTemplates; + } + + public String getTimestampMs() { + return timestampMs; + } + + public void setTimestampMs(String timestampMs) { + this.timestampMs = timestampMs; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java new file mode 100644 index 000000000..c2d4f261a --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java @@ -0,0 +1,43 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class PokemonScaleSettings { + + @SerializedName("pokemonScaleMode") + @Expose + private String pokemonScaleMode; + @SerializedName("minHeight") + @Expose + private Double minHeight; + @SerializedName("maxHeight") + @Expose + private Double maxHeight; + + public String getPokemonScaleMode() { + return pokemonScaleMode; + } + + public void setPokemonScaleMode(String pokemonScaleMode) { + this.pokemonScaleMode = pokemonScaleMode; + } + + public Double getMinHeight() { + return minHeight; + } + + public void setMinHeight(Double minHeight) { + this.minHeight = minHeight; + } + + public Double getMaxHeight() { + return maxHeight; + } + + public void setMaxHeight(Double maxHeight) { + this.maxHeight = maxHeight; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java new file mode 100644 index 000000000..b68c50dd0 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java @@ -0,0 +1,365 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class PokemonSettings { + + public String getTemplateID() { + return templateID; + } + + public void setTemplateID(String templateID) { + this.templateID = templateID; + } + + private String templateID; + + @SerializedName("pokemonId") + @Expose + private String pokemonId; + @SerializedName("modelScale") + @Expose + private Double modelScale; + @SerializedName("type") + @Expose + private String type; + @SerializedName("type2") + @Expose + private String type2; + @SerializedName("camera") + @Expose + private Camera camera; + @SerializedName("encounter") + @Expose + private Encounter encounter; + @SerializedName("stats") + @Expose + private Stats stats; + @SerializedName("quickMoves") + @Expose + private List quickMoves = null; + @SerializedName("cinematicMoves") + @Expose + private List cinematicMoves = null; + @SerializedName("animationTime") + @Expose + private List animationTime = null; + @SerializedName("evolutionIds") + @Expose + private List evolutionIds = null; + @SerializedName("evolutionPips") + @Expose + private Integer evolutionPips; + @SerializedName("pokedexHeightM") + @Expose + private Double pokedexHeightM; + @SerializedName("pokedexWeightKg") + @Expose + private Double pokedexWeightKg; + @SerializedName("heightStdDev") + @Expose + private Double heightStdDev; + @SerializedName("weightStdDev") + @Expose + private Double weightStdDev; + @SerializedName("familyId") + @Expose + private String familyId; + @SerializedName("candyToEvolve") + @Expose + private Integer candyToEvolve; + @SerializedName("kmBuddyDistance") + @Expose + private Double kmBuddyDistance; + @SerializedName("modelHeight") + @Expose + private Double modelHeight; + @SerializedName("evolutionBranch") + @Expose + private List evolutionBranch = null; + @SerializedName("modelScaleV2") + @Expose + private Double modelScaleV2; + @SerializedName("buddyOffsetMale") + @Expose + private List buddyOffsetMale = null; + @SerializedName("buddyOffsetFemale") + @Expose + private List buddyOffsetFemale = null; + @SerializedName("buddyScale") + @Expose + private Double buddyScale; + @SerializedName("buddyPortraitOffset") + @Expose + private List buddyPortraitOffset = null; + @SerializedName("isTransferable") + @Expose + private Boolean isTransferable; + @SerializedName("isDeployable") + @Expose + private Boolean isDeployable; + @SerializedName("rarity") + @Expose + private String rarity; + @SerializedName("form") + @Expose + private String form; + + + @SerializedName("parentPokemonId") + @Expose + private String parentPokemonId; + + public String getParentPokemonId() { + return parentPokemonId; + } + + public void setParentPokemonId(String parentPokemonId) { + this.parentPokemonId = parentPokemonId; + } + + public String getPokemonId() { + + return pokemonId; + } + + public void setPokemonId(String pokemonId) { + this.pokemonId = pokemonId; + } + + public Double getModelScale() { + return modelScale; + } + + public void setModelScale(Double modelScale) { + this.modelScale = modelScale; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getType2() { + return type2; + } + + public void setType2(String type2) { + this.type2 = type2; + } + + public Camera getCamera() { + return camera; + } + + public void setCamera(Camera camera) { + this.camera = camera; + } + + public Encounter getEncounter() { + return encounter; + } + + public void setEncounter(Encounter encounter) { + this.encounter = encounter; + } + + public Stats getStats() { + return stats; + } + + public void setStats(Stats stats) { + this.stats = stats; + } + + public List getQuickMoves() { + return quickMoves; + } + + public void setQuickMoves(List quickMoves) { + this.quickMoves = quickMoves; + } + + public List getCinematicMoves() { + return cinematicMoves; + } + + public void setCinematicMoves(List cinematicMoves) { + this.cinematicMoves = cinematicMoves; + } + + public List getAnimationTime() { + return animationTime; + } + + public void setAnimationTime(List animationTime) { + this.animationTime = animationTime; + } + + public List getEvolutionIds() { + return evolutionIds; + } + + public void setEvolutionIds(List evolutionIds) { + this.evolutionIds = evolutionIds; + } + + public Integer getEvolutionPips() { + return evolutionPips; + } + + public void setEvolutionPips(Integer evolutionPips) { + this.evolutionPips = evolutionPips; + } + + public Double getPokedexHeightM() { + return pokedexHeightM; + } + + public void setPokedexHeightM(Double pokedexHeightM) { + this.pokedexHeightM = pokedexHeightM; + } + + public Double getPokedexWeightKg() { + return pokedexWeightKg; + } + + public void setPokedexWeightKg(Double pokedexWeightKg) { + this.pokedexWeightKg = pokedexWeightKg; + } + + public Double getHeightStdDev() { + return heightStdDev; + } + + public void setHeightStdDev(Double heightStdDev) { + this.heightStdDev = heightStdDev; + } + + public Double getWeightStdDev() { + return weightStdDev; + } + + public void setWeightStdDev(Double weightStdDev) { + this.weightStdDev = weightStdDev; + } + + public String getFamilyId() { + return familyId; + } + + public void setFamilyId(String familyId) { + this.familyId = familyId; + } + + public Integer getCandyToEvolve() { + return candyToEvolve; + } + + public void setCandyToEvolve(Integer candyToEvolve) { + this.candyToEvolve = candyToEvolve; + } + + public Double getKmBuddyDistance() { + return kmBuddyDistance; + } + + public void setKmBuddyDistance(Double kmBuddyDistance) { + this.kmBuddyDistance = kmBuddyDistance; + } + + public Double getModelHeight() { + return modelHeight; + } + + public void setModelHeight(Double modelHeight) { + this.modelHeight = modelHeight; + } + + public List getEvolutionBranch() { + return evolutionBranch; + } + + public void setEvolutionBranch(List evolutionBranch) { + this.evolutionBranch = evolutionBranch; + } + + public Double getModelScaleV2() { + return modelScaleV2; + } + + public void setModelScaleV2(Double modelScaleV2) { + this.modelScaleV2 = modelScaleV2; + } + + public List getBuddyOffsetMale() { + return buddyOffsetMale; + } + + public void setBuddyOffsetMale(List buddyOffsetMale) { + this.buddyOffsetMale = buddyOffsetMale; + } + + public List getBuddyOffsetFemale() { + return buddyOffsetFemale; + } + + public void setBuddyOffsetFemale(List buddyOffsetFemale) { + this.buddyOffsetFemale = buddyOffsetFemale; + } + + public Double getBuddyScale() { + return buddyScale; + } + + public void setBuddyScale(Double buddyScale) { + this.buddyScale = buddyScale; + } + + public List getBuddyPortraitOffset() { + return buddyPortraitOffset; + } + + public void setBuddyPortraitOffset(List buddyPortraitOffset) { + this.buddyPortraitOffset = buddyPortraitOffset; + } + + public Boolean getIsTransferable() { + return isTransferable; + } + + public void setIsTransferable(Boolean isTransferable) { + this.isTransferable = isTransferable; + } + + public Boolean getIsDeployable() { + return isDeployable; + } + + public void setIsDeployable(Boolean isDeployable) { + this.isDeployable = isDeployable; + } + + public String getRarity() { + return rarity; + } + + public void setRarity(String rarity) { + this.rarity = rarity; + } + + public String getForm() { + return form; + } + + public void setForm(String form) { + this.form = form; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java new file mode 100644 index 000000000..62b6b615a --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java @@ -0,0 +1,55 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class PokemonUpgrades { + + @SerializedName("upgradesPerLevel") + @Expose + private Integer upgradesPerLevel; + @SerializedName("allowedLevelsAbovePlayer") + @Expose + private Integer allowedLevelsAbovePlayer; + @SerializedName("candyCost") + @Expose + private List candyCost = null; + @SerializedName("stardustCost") + @Expose + private List stardustCost = null; + + public Integer getUpgradesPerLevel() { + return upgradesPerLevel; + } + + public void setUpgradesPerLevel(Integer upgradesPerLevel) { + this.upgradesPerLevel = upgradesPerLevel; + } + + public Integer getAllowedLevelsAbovePlayer() { + return allowedLevelsAbovePlayer; + } + + public void setAllowedLevelsAbovePlayer(Integer allowedLevelsAbovePlayer) { + this.allowedLevelsAbovePlayer = allowedLevelsAbovePlayer; + } + + public List getCandyCost() { + return candyCost; + } + + public void setCandyCost(List candyCost) { + this.candyCost = candyCost; + } + + public List getStardustCost() { + return stardustCost; + } + + public void setStardustCost(List stardustCost) { + this.stardustCost = stardustCost; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java new file mode 100644 index 000000000..c6e5099c7 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java @@ -0,0 +1,32 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class QuestSettings { + + @SerializedName("questType") + @Expose + private String questType; + @SerializedName("dailyQuest") + @Expose + private DailyQuest dailyQuest; + + public String getQuestType() { + return questType; + } + + public void setQuestType(String questType) { + this.questType = questType; + } + + public DailyQuest getDailyQuest() { + return dailyQuest; + } + + public void setDailyQuest(DailyQuest dailyQuest) { + this.dailyQuest = dailyQuest; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java new file mode 100644 index 000000000..7653185b0 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java @@ -0,0 +1,43 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Stats { + + @SerializedName("baseStamina") + @Expose + private Integer baseStamina; + @SerializedName("baseAttack") + @Expose + private Integer baseAttack; + @SerializedName("baseDefense") + @Expose + private Integer baseDefense; + + public Integer getBaseStamina() { + return baseStamina; + } + + public void setBaseStamina(Integer baseStamina) { + this.baseStamina = baseStamina; + } + + public Integer getBaseAttack() { + return baseAttack; + } + + public void setBaseAttack(Integer baseAttack) { + this.baseAttack = baseAttack; + } + + public Integer getBaseDefense() { + return baseDefense; + } + + public void setBaseDefense(Integer baseDefense) { + this.baseDefense = baseDefense; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java new file mode 100644 index 000000000..d3be5bf6a --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java @@ -0,0 +1,33 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class TypeEffective { + + @SerializedName("attackScalar") + @Expose + private List attackScalar = null; + @SerializedName("attackType") + @Expose + private String attackType; + + public List getAttackScalar() { + return attackScalar; + } + + public void setAttackScalar(List attackScalar) { + this.attackScalar = attackScalar; + } + + public String getAttackType() { + return attackType; + } + + public void setAttackType(String attackType) { + this.attackType = attackType; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java new file mode 100644 index 000000000..f100c46e5 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java @@ -0,0 +1,33 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class WeatherAffinities { + + @SerializedName("weatherCondition") + @Expose + private String weatherCondition; + @SerializedName("pokemonType") + @Expose + private List pokemonType = null; + + public String getWeatherCondition() { + return weatherCondition; + } + + public void setWeatherCondition(String weatherCondition) { + this.weatherCondition = weatherCondition; + } + + public List getPokemonType() { + return pokemonType; + } + + public void setPokemonType(List pokemonType) { + this.pokemonType = pokemonType; + } + +} diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java new file mode 100644 index 000000000..a6199ba94 --- /dev/null +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java @@ -0,0 +1,76 @@ + +package com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class WeatherBonusSettings { + + @SerializedName("cpBaseLevelBonus") + @Expose + private Integer cpBaseLevelBonus; + @SerializedName("guaranteedIndividualValues") + @Expose + private Integer guaranteedIndividualValues; + @SerializedName("stardustBonusMultiplier") + @Expose + private Double stardustBonusMultiplier; + @SerializedName("attackBonusMultiplier") + @Expose + private Double attackBonusMultiplier; + @SerializedName("raidEncounterCpBaseLevelBonus") + @Expose + private Integer raidEncounterCpBaseLevelBonus; + @SerializedName("raidEncounterGuaranteedIndividualValues") + @Expose + private Integer raidEncounterGuaranteedIndividualValues; + + public Integer getCpBaseLevelBonus() { + return cpBaseLevelBonus; + } + + public void setCpBaseLevelBonus(Integer cpBaseLevelBonus) { + this.cpBaseLevelBonus = cpBaseLevelBonus; + } + + public Integer getGuaranteedIndividualValues() { + return guaranteedIndividualValues; + } + + public void setGuaranteedIndividualValues(Integer guaranteedIndividualValues) { + this.guaranteedIndividualValues = guaranteedIndividualValues; + } + + public Double getStardustBonusMultiplier() { + return stardustBonusMultiplier; + } + + public void setStardustBonusMultiplier(Double stardustBonusMultiplier) { + this.stardustBonusMultiplier = stardustBonusMultiplier; + } + + public Double getAttackBonusMultiplier() { + return attackBonusMultiplier; + } + + public void setAttackBonusMultiplier(Double attackBonusMultiplier) { + this.attackBonusMultiplier = attackBonusMultiplier; + } + + public Integer getRaidEncounterCpBaseLevelBonus() { + return raidEncounterCpBaseLevelBonus; + } + + public void setRaidEncounterCpBaseLevelBonus(Integer raidEncounterCpBaseLevelBonus) { + this.raidEncounterCpBaseLevelBonus = raidEncounterCpBaseLevelBonus; + } + + public Integer getRaidEncounterGuaranteedIndividualValues() { + return raidEncounterGuaranteedIndividualValues; + } + + public void setRaidEncounterGuaranteedIndividualValues(Integer raidEncounterGuaranteedIndividualValues) { + this.raidEncounterGuaranteedIndividualValues = raidEncounterGuaranteedIndividualValues; + } + +} diff --git a/app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java b/app/src/main/java/com/kamron/pogoiv/devMethods/thirdparty/pokebattler/MovesetFetchUtil.java similarity index 98% rename from app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java rename to app/src/main/java/com/kamron/pogoiv/devMethods/thirdparty/pokebattler/MovesetFetchUtil.java index b8f51e008..594b7489f 100644 --- a/app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java +++ b/app/src/main/java/com/kamron/pogoiv/devMethods/thirdparty/pokebattler/MovesetFetchUtil.java @@ -1,4 +1,4 @@ -package com.kamron.pogoiv.thirdparty; +package com.kamron.pogoiv.devMethods.thirdparty.pokebattler; import com.kamron.pogoiv.scanlogic.MovesetData; import com.kamron.pogoiv.thirdparty.pokebattler.PokemonId; @@ -6,7 +6,6 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import org.junit.Test; import java.io.File; import java.io.FileWriter; @@ -46,8 +45,7 @@ public MovesetFetchUtil() { /** * This "test" generates a json of all pokemon move ratings by querying the pokebattler database. */ - @Test - public void buildFailsIfThisIsAMain() throws Exception { + public static void main(String[] args) throws Exception { // public static void main(String... args) throws Exception { // Timber.plant(new Timber.DebugTree()); This throws exceptions in unit tests diff --git a/app/src/main/java/com/kamron/pogoiv/thirdparty/pokebattler/PokemonId.java b/app/src/main/java/com/kamron/pogoiv/devMethods/thirdparty/pokebattler/PokemonId.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/thirdparty/pokebattler/PokemonId.java rename to app/src/main/java/com/kamron/pogoiv/devMethods/thirdparty/pokebattler/PokemonId.java diff --git a/app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java b/app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java deleted file mode 100644 index 28a3f262f..000000000 --- a/app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.kamron.pogoiv.utils; - -import android.graphics.Bitmap; -import android.os.Environment; - -import com.kamron.pogoiv.scanlogic.PokeInfoCalculator; -import com.kamron.pogoiv.scanlogic.Pokemon; - -import java.io.File; -import java.io.FileOutputStream; -import java.util.ArrayList; - -import timber.log.Timber; - -/** - * Created by Johan on 2016-08-27. - *

- * A class for methods which is only used during development - */ -public class DevMethods { - - - /** - * saveImage - * Used to save the image the screen capture is captuing, used for debugging. - * - * @param finalBitmap The bitmap to save - * @param name The name of the file to save it as - */ - public static void saveImage(Bitmap finalBitmap, String name) { - - String root = Environment.getExternalStorageDirectory().toString(); - File myDir = new File(root + "/saved_images"); - myDir.mkdirs(); - String fileName = "Image-" + name + ".jpg"; - File file = new File(myDir, fileName); - if (file.exists()) { - file.delete(); - } - try { - FileOutputStream out = new FileOutputStream(file); - finalBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); - out.flush(); - out.close(); - - } catch (Exception exception) { - Timber.e("Exception thrown in saveImage()"); - Timber.e(exception); - } - } - - /** - * Method used to generate the list for candy cost of evolution - * Since pokemons follow the following pattern (with a few exceptions): - * Pokemon with 3 evolutions will cost - * 25,100,- - * 2 evolutions - * 50, - - * Exceptions: Eevee:25, weedle:12 kakuna:50, caterpie:12 metapod:50, pidgey:12, magicarp:400 and rattatta:25, - * fix them manually. - */ - private void printOutEvolutionCandyCosts(PokeInfoCalculator pokeCalculator) { - //to create the evolutions - - int evolutionCost = -99999; - for (Pokemon poke : pokeCalculator.getPokedex()) { - ArrayList evoLine = pokeCalculator.getEvolutionLine(poke); - int numberInEvoLine = 1; - for (int i = 0; i < evoLine.size(); i++) { - System.out.println("poke:" + poke.name + " evoLine size: " + evoLine.size()); - if (poke.name.equals(evoLine.get(i).name)) { - numberInEvoLine = i; - } - } - if (evoLine.size() == 3) { - if (numberInEvoLine == 0) { - evolutionCost = 25; - } - if (numberInEvoLine == 1) { - evolutionCost = 100; - } - if (numberInEvoLine == 2) { - evolutionCost = -1; - } - } - if (evoLine.size() == 2) { - if (numberInEvoLine == 0) { - evolutionCost = 50; - } - if (numberInEvoLine == 1) { - evolutionCost = -1; - } - } - if (evoLine.size() == 1) { - evolutionCost = -1; - } - - - System.out.println( - "nahojjjen generating script: " + "" + evolutionCost + " "); - } - - } -} From e0566de275777ce2a7ece3174c51b95118769e8d Mon Sep 17 00:00:00 2001 From: udnp Date: Thu, 14 May 2020 12:18:40 +0900 Subject: [PATCH 02/51] [Rf] change line-brake code. --- .../pogoiv/thirdparty/MovesetFetchUtil.java | 442 +++++++++--------- 1 file changed, 221 insertions(+), 221 deletions(-) diff --git a/app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java b/app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java index 5b7cc398a..881dfb72f 100644 --- a/app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java +++ b/app/src/test/java/com/kamron/pogoiv/thirdparty/MovesetFetchUtil.java @@ -1,221 +1,221 @@ -package com.kamron.pogoiv.thirdparty; - -import com.kamron.pogoiv.scanlogic.MovesetData; -import com.kamron.pogoiv.thirdparty.pokebattler.PokemonId; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.junit.Ignore; -import org.junit.Test; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.concurrent.TimeUnit; - -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import timber.log.Timber; - - -/** - * A class for generating the moveset database json by querying pokebattler. - * Run the generateMovesetList test to update the json in - * app/src/main/assets/thirdparty/pokebattler//pokemonMovesetData.json. - */ -public class MovesetFetchUtil { - // private static final String BASE_URL = "https://fight.pokebattler.com"; -// private static final String BASE_URL = "http://localhost:8001"; - private static final String BASE_URL = "https://fight.pokebattler.com"; - OkHttpClient httpClient; - - public MovesetFetchUtil() { - httpClient = new OkHttpClient.Builder() - .connectTimeout(20, TimeUnit.SECONDS) - .writeTimeout(20, TimeUnit.SECONDS) - .readTimeout(60, TimeUnit.SECONDS) - .build(); - - } - - /** - * This "test" generates a json of all pokemon move ratings by querying the pokebattler database. - */ - @Ignore - @Test - public void buildFailsIfThisIsAMain() throws Exception { -// public static final void main(String... args) throws Exception { -// public static void main(String... args) throws Exception { - -// Timber.plant(new Timber.DebugTree()); This throws exceptions in unit tests - MovesetFetchUtil fetcher = new MovesetFetchUtil(); - Map> pokemon = fetcher.fetchAllPokemon(); - JSONObject toDump = new JSONObject(pokemon); - FileWriter writer = null; - try { - writer = new FileWriter(new File - ("app/src/main/assets/movesets/movesets.json")); - writer.write(toDump.toString(2)); - //System.out.println(toDump.toString(2)); - } catch (FileNotFoundException e) { - - System.out.println(toDump.toString(2)); - } - - - - } - - - - public String getAttackURL(String pokemon) { - return BASE_URL - + "/rankings/attackers/levels/30/defenders/levels/30/strategies/CINEMATIC_ATTACK_WHEN_POSSIBLE" - + "/DEFENSE_RANDOM_MC" - + "?sort=OVERALL&dodgeStrategy=DODGE_REACTION_TIME&weatherCondition=NO_WEATHER&filterType" - + "=TOP_DEFENDER&filterValue=" - + pokemon; - } - - public String getDefenseURL(String pokemon) { - return BASE_URL - + "/rankings/defenders/levels/30/attackers/levels/30/strategies/DEFENSE_RANDOM_MC" - + "/CINEMATIC_ATTACK_WHEN_POSSIBLE" - + "?sort=OVERALL&dodgeStrategy=DODGE_REACTION_TIME&weatherCondition=NO_WEATHER&filterType=POKEMON" - + "&filterValue=" - + pokemon; - } - - - /** - * Get a list of all attack and defence ratings for all movesets for all pokemon from an online database. - * - * @return A map, which has the pokemon names as keys, and a list of movesetdata as values. - */ - public Map> fetchAllPokemon() { - Map> allPokemon = new TreeMap<>(); - for (PokemonId pokemon : PokemonId.values()) { - if (pokemon == PokemonId.MISSINGNO || pokemon == PokemonId.UNRECOGNIZED || pokemon.name().endsWith - ("NORMAL_FORM")) { - continue; - } - - try { - allPokemon.put(pokemon.name(), fetchPokemonOnlineMovesets(pokemon.name())); - Timber.i("Finished fetching %s", pokemon.name()); - //FIXME: The above doesnt properly log in unit tests - System.out.println("Finished fetching " + pokemon.name()); - } catch (Exception e) { - Timber.e("Unexpected error with %s", pokemon.name()); - System.err.println("Unexpected error: " + e); - e.printStackTrace(System.err); - } - } - return allPokemon; - } - - /** - * Get the moveset evaluation from online for a specific pokemon. - * - * @param pokemon The pokemon to search for. - * @return A list of moveset data for that specific pokemon. - */ - public List fetchPokemonOnlineMovesets(String pokemon) { - if (pokemon.startsWith("UNOWN") && pokemon.endsWith("FORM")) { - // skip unown forms - return Collections.emptyList(); - } - TreeMap attackScores = fetchPokemonScoreMap(getAttackURL(pokemon)); - if (attackScores == null) { - System.err.println("Unexpected null attack scores for " + pokemon); - return Collections.emptyList(); - } - TreeMap defenseScores = fetchPokemonScoreMap(getDefenseURL(pokemon)); - if (defenseScores == null) { - System.err.println("Unexpected null defense scores for " + pokemon); - return Collections.emptyList(); - } - List retval = new ArrayList<>(attackScores.size()); - // add all the good attack scores first - for (Map.Entry attackScoreEntry : attackScores.entrySet()) { - MovesetData.Key key = attackScoreEntry.getKey(); - Double defenseScore = defenseScores.get(key); - //TODO merge with https://fight.pokebattler.com/pokemon and https://fight.pokebattler.com/moves - retval.add(new MovesetData(key.getQuick(), key.getCharge(), false, false, attackScoreEntry.getValue(), - defenseScore, "UNKNOWN", "UNKNOWN")); - } - // then add moves that are only good on defense - for (Map.Entry defenseScoreEntry : defenseScores.entrySet()) { - MovesetData.Key key = defenseScoreEntry.getKey(); - if (attackScores.containsKey(key)) { - continue; - } - retval.add(new MovesetData(key.getQuick(), key.getCharge(), false, false, null, - defenseScoreEntry.getValue(), "UNKNOWN", "UNKNOWN")); - } - return retval; - } - - /** - * Get the score for all movesets, in either defence or attack score from an online database. - * - * @param url Either the attackURL or defenceURL for a pokemon. - * @return A treemap containing all possible movesets as keys, and the moveset score as value. - */ - private TreeMap fetchPokemonScoreMap(String url) { - TreeMap scores; - Request request = new Request.Builder().url(url).build(); - try (Response response = httpClient.newCall(request).execute()) { - if (response.isSuccessful()) { - JSONObject pokemonInfo = new JSONObject(response.body().string()); - scores = parseMovesetJson(pokemonInfo); - } else { - scores = null; - } - } catch (Exception e) { - Timber.e("Could not fetch file"); - Timber.e(e); - // just die - throw new RuntimeException(e); - } - if (scores == null) { - throw new RuntimeException("Could not fetch url: " + url); - } - return scores; - } - - /** - * Interprets the json response from the Pokebattler server into a treemap where each key is a moveset - * combination, and the value is the score of the moveset. - * - * @param jsonResponse The json response from pokebattler. - * @return A treemap with moveset keys and score values. - * @throws IOException - */ - private TreeMap parseMovesetJson(JSONObject jsonResponse) throws IOException { - TreeMap scores = new TreeMap<>(); - try { - JSONArray moveRankings = jsonResponse.getJSONArray("attackers").getJSONObject(0).getJSONArray("byMove"); - double maxScore = moveRankings.getJSONObject(0).getJSONObject("total").getDouble("overallRating"); - for (int i = 0; i < moveRankings.length(); i++) { - JSONObject move = moveRankings.getJSONObject(i); - double score = move.getJSONObject("total").getDouble("overallRating") / maxScore; - MovesetData.Key key = new MovesetData.Key(move.getString("move1"), move.getString("move2")); - scores.put(key, score); - } - } catch (JSONException je) { - Timber.e("Exception thrown while checking for update"); - Timber.e(je); - } - return scores; - } - -} +package com.kamron.pogoiv.thirdparty; + +import com.kamron.pogoiv.scanlogic.MovesetData; +import com.kamron.pogoiv.thirdparty.pokebattler.PokemonId; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.Ignore; +import org.junit.Test; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import timber.log.Timber; + + +/** + * A class for generating the moveset database json by querying pokebattler. + * Run the generateMovesetList test to update the json in + * app/src/main/assets/thirdparty/pokebattler//pokemonMovesetData.json. + */ +public class MovesetFetchUtil { + // private static final String BASE_URL = "https://fight.pokebattler.com"; +// private static final String BASE_URL = "http://localhost:8001"; + private static final String BASE_URL = "https://fight.pokebattler.com"; + OkHttpClient httpClient; + + public MovesetFetchUtil() { + httpClient = new OkHttpClient.Builder() + .connectTimeout(20, TimeUnit.SECONDS) + .writeTimeout(20, TimeUnit.SECONDS) + .readTimeout(60, TimeUnit.SECONDS) + .build(); + + } + + /** + * This "test" generates a json of all pokemon move ratings by querying the pokebattler database. + */ + @Ignore + @Test + public void buildFailsIfThisIsAMain() throws Exception { +// public static final void main(String... args) throws Exception { +// public static void main(String... args) throws Exception { + +// Timber.plant(new Timber.DebugTree()); This throws exceptions in unit tests + MovesetFetchUtil fetcher = new MovesetFetchUtil(); + Map> pokemon = fetcher.fetchAllPokemon(); + JSONObject toDump = new JSONObject(pokemon); + FileWriter writer = null; + try { + writer = new FileWriter(new File + ("app/src/main/assets/movesets/movesets.json")); + writer.write(toDump.toString(2)); + //System.out.println(toDump.toString(2)); + } catch (FileNotFoundException e) { + + System.out.println(toDump.toString(2)); + } + + + + } + + + + public String getAttackURL(String pokemon) { + return BASE_URL + + "/rankings/attackers/levels/30/defenders/levels/30/strategies/CINEMATIC_ATTACK_WHEN_POSSIBLE" + + "/DEFENSE_RANDOM_MC" + + "?sort=OVERALL&dodgeStrategy=DODGE_REACTION_TIME&weatherCondition=NO_WEATHER&filterType" + + "=TOP_DEFENDER&filterValue=" + + pokemon; + } + + public String getDefenseURL(String pokemon) { + return BASE_URL + + "/rankings/defenders/levels/30/attackers/levels/30/strategies/DEFENSE_RANDOM_MC" + + "/CINEMATIC_ATTACK_WHEN_POSSIBLE" + + "?sort=OVERALL&dodgeStrategy=DODGE_REACTION_TIME&weatherCondition=NO_WEATHER&filterType=POKEMON" + + "&filterValue=" + + pokemon; + } + + + /** + * Get a list of all attack and defence ratings for all movesets for all pokemon from an online database. + * + * @return A map, which has the pokemon names as keys, and a list of movesetdata as values. + */ + public Map> fetchAllPokemon() { + Map> allPokemon = new TreeMap<>(); + for (PokemonId pokemon : PokemonId.values()) { + if (pokemon == PokemonId.MISSINGNO || pokemon == PokemonId.UNRECOGNIZED || pokemon.name().endsWith + ("NORMAL_FORM")) { + continue; + } + + try { + allPokemon.put(pokemon.name(), fetchPokemonOnlineMovesets(pokemon.name())); + Timber.i("Finished fetching %s", pokemon.name()); + //FIXME: The above doesnt properly log in unit tests + System.out.println("Finished fetching " + pokemon.name()); + } catch (Exception e) { + Timber.e("Unexpected error with %s", pokemon.name()); + System.err.println("Unexpected error: " + e); + e.printStackTrace(System.err); + } + } + return allPokemon; + } + + /** + * Get the moveset evaluation from online for a specific pokemon. + * + * @param pokemon The pokemon to search for. + * @return A list of moveset data for that specific pokemon. + */ + public List fetchPokemonOnlineMovesets(String pokemon) { + if (pokemon.startsWith("UNOWN") && pokemon.endsWith("FORM")) { + // skip unown forms + return Collections.emptyList(); + } + TreeMap attackScores = fetchPokemonScoreMap(getAttackURL(pokemon)); + if (attackScores == null) { + System.err.println("Unexpected null attack scores for " + pokemon); + return Collections.emptyList(); + } + TreeMap defenseScores = fetchPokemonScoreMap(getDefenseURL(pokemon)); + if (defenseScores == null) { + System.err.println("Unexpected null defense scores for " + pokemon); + return Collections.emptyList(); + } + List retval = new ArrayList<>(attackScores.size()); + // add all the good attack scores first + for (Map.Entry attackScoreEntry : attackScores.entrySet()) { + MovesetData.Key key = attackScoreEntry.getKey(); + Double defenseScore = defenseScores.get(key); + //TODO merge with https://fight.pokebattler.com/pokemon and https://fight.pokebattler.com/moves + retval.add(new MovesetData(key.getQuick(), key.getCharge(), false, false, attackScoreEntry.getValue(), + defenseScore, "UNKNOWN", "UNKNOWN")); + } + // then add moves that are only good on defense + for (Map.Entry defenseScoreEntry : defenseScores.entrySet()) { + MovesetData.Key key = defenseScoreEntry.getKey(); + if (attackScores.containsKey(key)) { + continue; + } + retval.add(new MovesetData(key.getQuick(), key.getCharge(), false, false, null, + defenseScoreEntry.getValue(), "UNKNOWN", "UNKNOWN")); + } + return retval; + } + + /** + * Get the score for all movesets, in either defence or attack score from an online database. + * + * @param url Either the attackURL or defenceURL for a pokemon. + * @return A treemap containing all possible movesets as keys, and the moveset score as value. + */ + private TreeMap fetchPokemonScoreMap(String url) { + TreeMap scores; + Request request = new Request.Builder().url(url).build(); + try (Response response = httpClient.newCall(request).execute()) { + if (response.isSuccessful()) { + JSONObject pokemonInfo = new JSONObject(response.body().string()); + scores = parseMovesetJson(pokemonInfo); + } else { + scores = null; + } + } catch (Exception e) { + Timber.e("Could not fetch file"); + Timber.e(e); + // just die + throw new RuntimeException(e); + } + if (scores == null) { + throw new RuntimeException("Could not fetch url: " + url); + } + return scores; + } + + /** + * Interprets the json response from the Pokebattler server into a treemap where each key is a moveset + * combination, and the value is the score of the moveset. + * + * @param jsonResponse The json response from pokebattler. + * @return A treemap with moveset keys and score values. + * @throws IOException + */ + private TreeMap parseMovesetJson(JSONObject jsonResponse) throws IOException { + TreeMap scores = new TreeMap<>(); + try { + JSONArray moveRankings = jsonResponse.getJSONArray("attackers").getJSONObject(0).getJSONArray("byMove"); + double maxScore = moveRankings.getJSONObject(0).getJSONObject("total").getDouble("overallRating"); + for (int i = 0; i < moveRankings.length(); i++) { + JSONObject move = moveRankings.getJSONObject(i); + double score = move.getJSONObject("total").getDouble("overallRating") / maxScore; + MovesetData.Key key = new MovesetData.Key(move.getString("move1"), move.getString("move2")); + scores.put(key, score); + } + } catch (JSONException je) { + Timber.e("Exception thrown while checking for update"); + Timber.e(je); + } + return scores; + } + +} From a7d655652549ec1f1cf1b509882579627b9f7fd8 Mon Sep 17 00:00:00 2001 From: udnp Date: Wed, 27 May 2020 16:15:56 +0900 Subject: [PATCH 03/51] provide Gradle task updateDatabase extended from the branch origin/moveAndUpdateDevMethods commit 0d0d74b10f03b7109be3b0bf1b91137b9f36b1a5. --- app/build.gradle | 6 +- .../com/kamron/pogoiv/utils/DevMethods.java | 0 app/src/main/res/values/forms.xml | 219 +++++++++++++----- app/src/main/res/values/integers.xml | 88 +++---- devMethods/.gitignore | 1 + devMethods/build.gradle | 33 +++ .../ApplicationDatabaseUpdater.java | 59 ++--- .../ApplicationDatabaseUpdaterPoke.java | 0 .../JsonStruct/AvatarCustomization.java | 0 .../JsonStruct/BadgeSettings.java | 0 .../gameMasterParser/JsonStruct/Camera.java | 0 .../gameMasterParser/JsonStruct/Camera_.java | 0 .../JsonStruct/DailyQuest.java | 0 .../JsonStruct/Encounter.java | 0 .../JsonStruct/EvolutionBranch.java | 0 .../gameMasterParser/JsonStruct/Food.java | 0 .../gameMasterParser/JsonStruct/Form.java | 0 .../JsonStruct/FormSettings.java | 0 .../FriendshipMilestoneSettings.java | 0 .../gameMasterParser/JsonStruct/Gender.java | 0 .../JsonStruct/GenderSettings.java | 0 .../JsonStruct/GymBadgeSettings.java | 0 .../gameMasterParser/JsonStruct/GymLevel.java | 0 .../JsonStruct/IapCategoryDisplay.java | 0 .../JsonStruct/IapItemDisplay.java | 0 .../JsonStruct/IapSettings.java | 0 .../JsonStruct/ItemSettings.java | 0 .../JsonStruct/ItemTemplate.java | 4 +- .../JsonStruct/LuckyPokemonSettings.java | 0 .../JsonStruct/MoveSequenceSettings.java | 0 .../JsonStruct/PlayerLevel.java | 0 .../gameMasterParser/JsonStruct/PogoJson.java | 2 +- .../JsonStruct/PokemonScaleSettings.java | 0 .../JsonStruct/PokemonSettings.java | 12 +- .../JsonStruct/PokemonUpgrades.java | 0 .../JsonStruct/QuestSettings.java | 0 .../gameMasterParser/JsonStruct/Stats.java | 0 .../JsonStruct/TypeEffective.java | 0 .../JsonStruct/WeatherAffinities.java | 0 .../JsonStruct/WeatherBonusSettings.java | 0 .../SpecificFormSettings.java | 40 ++++ settings.gradle | 1 + 42 files changed, 321 insertions(+), 144 deletions(-) delete mode 100644 app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java create mode 100644 devMethods/.gitignore create mode 100644 devMethods/build.gradle rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java (89%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java (98%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java (95%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java (97%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java (100%) rename {app => devMethods}/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java (100%) create mode 100644 devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/SpecificFormSettings.java diff --git a/app/build.gradle b/app/build.gradle index 0ac9b1536..68a43c062 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -204,6 +204,10 @@ dependencies { implementation 'com.android.support:palette-v7:27.1.1' implementation project(':openCVLibrary330') + /* for devMethods.thirdparty.pokebattler, temporally set for All Builds */ + implementation 'org.json:json:20160810' //used to generate moveset list + implementation 'com.squareup.okhttp3:okhttp:3.7.0'//used to generate moveset list + /** * Online Build Dependencies */ @@ -227,8 +231,6 @@ dependencies { testImplementation 'org.mockito:mockito-core:1.10.19' testImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test:runner:1.0.2' - testImplementation 'org.json:json:20160810' //used to generate moveset list - testImplementation 'com.squareup.okhttp3:okhttp:3.7.0'//used to generate moveset list } /** diff --git a/app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java b/app/src/main/java/com/kamron/pogoiv/utils/DevMethods.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/src/main/res/values/forms.xml b/app/src/main/res/values/forms.xml index 8b323985a..ab979dfcf 100644 --- a/app/src/main/res/values/forms.xml +++ b/app/src/main/res/values/forms.xml @@ -19,9 +19,12 @@ 2 2 2 + 2 2 28 - 9 + 2 + 2 + 20 4 4 3 @@ -37,6 +40,8 @@ 2 4 4 + 2 + 2 2 2 2 @@ -44,7 +49,7 @@ 2 2 5 - + Normal Form @@ -100,6 +105,9 @@ Normal Form Alola Form + + Normal Form + Galarian Form Normal Form Armored Form @@ -132,6 +140,12 @@ Z Form Exclamation Point Form Question Mark Form + + Normal Form + Galarian Form + + Normal Form + Galarian Form 00 Form 01 Form @@ -142,6 +156,17 @@ 06 Form 07 Form 08 Form + 09 Form + 10 Form + 11 Form + 12 Form + 13 Form + 14 Form + 15 Form + 16 Form + 17 Form + 18 Form + 19 Form Normal Form Sunny Form @@ -201,47 +226,53 @@ Dragon Form Dark Form Fairy Form - + Red Striped Form Blue Striped Form - + Standard Form Zen Form - + Spring Form Summer Form Autumn Form Winter Form - + Spring Form Summer Form Autumn Form Winter Form - + + Normal Form + Female Form + + Normal Form + Female Form + Incarnate Form Therian Form - + Incarnate Form Therian Form - + Incarnate Form Therian Form - + Normal Form - Black Form White Form - + Black Form + Ordinary Form Resolute Form - + Aria Form Pirouette Form - + Normal Form + Douse Form Shock Form Burn Form Chill Form - Douse Form @@ -298,6 +329,9 @@ 144 144 + + 174 + 174 300 182 @@ -330,6 +364,12 @@ 136 136 136 + + 58 + 58 + + 142 + 142 116 116 @@ -340,6 +380,17 @@ 116 116 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 139 139 @@ -399,48 +450,54 @@ 238 238 238 - + 189 189 - + 263 243 - + 115 115 115 115 - + 198 198 198 198 - + + 115 + 115 + + 159 + 159 + 266 238 - + 266 295 - + 261 289 - + 246 - 310 310 - + 310 + 260 260 - + 250 269 - + 252 + 252 252 252 252 - 252 - + 70 @@ -496,6 +553,9 @@ 186 186 + + 197 + 197 182 278 @@ -528,6 +588,12 @@ 91 91 91 + + 80 + 80 + + 128 + 128 116 116 @@ -538,6 +604,17 @@ 116 116 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 + 116 139 139 @@ -597,47 +674,53 @@ 238 238 238 - + 129 129 - + 114 202 - + 100 100 100 100 - + 146 146 146 146 - + + 134 + 134 + + 178 + 178 + 164 189 - + 164 161 - + 182 179 - + 170 - 183 183 - + 183 + 192 192 - + 225 188 - + 199 + 199 199 199 199 - 199 @@ -694,6 +777,9 @@ 155 155 + + 163 + 163 214 214 @@ -726,6 +812,12 @@ 134 134 134 + + 116 + 116 + + 186 + 186 155 155 @@ -736,6 +828,17 @@ 155 155 155 + 155 + 155 + 155 + 155 + 155 + 155 + 155 + 155 + 155 + 155 + 155 172 172 @@ -795,46 +898,52 @@ 237 237 237 - + 172 172 - + 233 233 - + 155 155 155 155 - + 190 190 190 190 - + + 146 + 146 + + 225 + 225 + 188 188 - + 188 188 - + 205 205 - + 245 - 245 245 - + 245 + 209 209 - + 225 225 - + 174 + 174 174 174 174 - 174 diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml index 17f268655..6c7ca877f 100644 --- a/app/src/main/res/values/integers.xml +++ b/app/src/main/res/values/integers.xml @@ -652,7 +652,7 @@ 252 118 226 - + 111 143 @@ -1305,7 +1305,7 @@ 199 99 190 - + 128 155 @@ -1958,7 +1958,7 @@ 174 130 264 - + -1 0 @@ -2545,7 +2545,7 @@ 581 582 -1 - 585 + 584 -1 -1 587 @@ -2611,7 +2611,7 @@ -1 -1 807 - + 25 100 @@ -3136,16 +3136,16 @@ -1 50 -1 - 25 - 100 + 50 + 200 -1 50 -1 50 -1 -1 - 25 - 100 + 50 + 200 -1 25 100 @@ -3197,10 +3197,10 @@ 25 100 -1 - 50 + -1 -1 -1 - 50 + 200 -1 50 -1 @@ -3228,7 +3228,7 @@ 50 -1 -1 - 50 + 200 -1 -1 50 @@ -3264,7 +3264,7 @@ -1 400 -1 - + 0 0 @@ -4028,7 +4028,7 @@ -1 -1 -1 - -1 + 18 -1 -1 -1 @@ -4068,7 +4068,7 @@ -1 -1 -1 - 18 + 19 -1 -1 -1 @@ -4119,7 +4119,7 @@ -1 -1 -1 - 19 + 20 -1 -1 -1 @@ -4181,8 +4181,8 @@ -1 -1 -1 - -1 - -1 + 21 + 22 -1 -1 -1 @@ -4245,7 +4245,7 @@ -1 -1 -1 - 20 + 23 -1 -1 -1 @@ -4269,7 +4269,7 @@ -1 -1 -1 - 21 + 24 -1 -1 -1 @@ -4304,7 +4304,7 @@ -1 -1 -1 - 22 + 25 -1 -1 -1 @@ -4330,8 +4330,8 @@ -1 -1 -1 - 23 - 24 + 26 + 27 -1 -1 -1 @@ -4339,9 +4339,9 @@ -1 -1 -1 - 25 - 26 - 27 + 28 + 29 + 30 -1 -1 -1 @@ -4397,7 +4397,7 @@ -1 -1 -1 - 28 + 31 -1 -1 -1 @@ -4405,13 +4405,13 @@ -1 -1 -1 - 29 + 32 -1 -1 -1 -1 - 30 - 31 + 33 + 34 -1 -1 -1 @@ -4468,12 +4468,12 @@ -1 -1 -1 - 32 + 35 -1 -1 -1 -1 - 33 + 36 -1 -1 -1 @@ -4503,15 +4503,15 @@ -1 -1 -1 - 34 - 35 + 37 + 38 -1 -1 -1 -1 -1 - -1 - -1 + 39 + 40 -1 -1 -1 @@ -4559,16 +4559,16 @@ -1 -1 -1 - 36 - 37 + 41 + 42 -1 -1 - 38 - 39 - 40 - 41 - 42 + 43 + 44 + 45 + 46 + 47 -1 -1 - + diff --git a/devMethods/.gitignore b/devMethods/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/devMethods/.gitignore @@ -0,0 +1 @@ +/build diff --git a/devMethods/build.gradle b/devMethods/build.gradle new file mode 100644 index 000000000..daa77833e --- /dev/null +++ b/devMethods/build.gradle @@ -0,0 +1,33 @@ +apply plugin: 'java' +apply plugin: 'application' + +repositories { + jcenter() +} + +dependencies { + // for ApplicationDatabaseUpdater + implementation 'com.google.code.gson:gson:2.8.2' +} + +task updateDatabase(type: JavaExec) { + group 'GoIV' + description 'update database with GAME_MASTER.json' + + main = "com.kamron.pogoiv.devMethods.gameMasterParser.ApplicationDatabaseUpdater" + classpath = sourceSets.main.runtimeClasspath + workingDir = projectDir + + doLast { + File formsXml = file('forms.xml', PathValidation.FILE) + File integersXml = file('integers.xml', PathValidation.FILE) + FileCollection databaseFiles = files(formsXml, integersXml) + File resDir = file(project(':app').projectDir.getPath() + '/src/main/res/values/', PathValidation.DIRECTORY) + copy { + from projectDir + into resDir + databaseFiles.getFiles().each {File file -> include file.getName()} + } + delete databaseFiles + } +} \ No newline at end of file diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java similarity index 89% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java index f76de4529..e9d55f9ef 100644 --- a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java +++ b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdater.java @@ -1,8 +1,5 @@ package com.kamron.pogoiv.devMethods.gameMasterParser; -import android.os.Build; -import android.support.annotation.RequiresApi; - import com.google.gson.Gson; import com.google.gson.stream.JsonReader; import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.Form; @@ -44,7 +41,7 @@ public static void main(String args[]) throws InvalidObjectException { formHash.put(poke.getForm(), poke); } if (item.getFormSettings() != null) { - FormSettings form = item.getFormSettings(); + FormSettings form = new SpecificFormSettings(item.getFormSettings()); Matcher m = pokedexRegex.matcher(item.getTemplateId()); if (m.matches()) { formsByPokedex.put(Integer.parseInt(m.group(1)), form); @@ -70,27 +67,23 @@ private static void printTypeDifferencesSuggestions(ArrayList poke HashMap formHash = pokemonFormsByName.get(formSetting.getPokemon()); HashMap typeCounter = new HashMap<>(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - formHash.forEach((s, pokemonSettings) -> - { - int count = typeCounter.containsKey(pokemonSettings.getType()) ? typeCounter.get(pokemonSettings.getType()) : 0; - typeCounter.put(pokemonSettings.getType(), count + 1); - int count2 = typeCounter.containsKey(pokemonSettings.getType2()) ? typeCounter.get(pokemonSettings.getType2()) : 0; - typeCounter.put(pokemonSettings.getType2(), count2 + 1); + formHash.forEach((s, pokemonSettings) -> + { + int count = typeCounter.containsKey(pokemonSettings.getType()) ? typeCounter.get(pokemonSettings.getType()) : 0; + typeCounter.put(pokemonSettings.getType(), count + 1); + int count2 = typeCounter.containsKey(pokemonSettings.getType2()) ? typeCounter.get(pokemonSettings.getType2()) : 0; + typeCounter.put(pokemonSettings.getType2(), count2 + 1); - } - ); - } + } + ); final boolean[] hasUnique = {false}; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - typeCounter.forEach((s, integer) -> { - if (integer == 1) { - System.out.println(s + " is unique for " + formSetting.getPokemon() + getDexIDOf(formSetting.getPokemon(), formsByPokedex)); - hasUnique[0] = true; - } - }); - } + typeCounter.forEach((s, integer) -> { + if (integer == 1) { + System.out.println(s + " is unique for " + formSetting.getPokemon() + getDexIDOf(formSetting.getPokemon(), formsByPokedex)); + hasUnique[0] = true; + } + }); if (hasUnique[0] == false) { System.out.println(formSetting.getPokemon() + " has no unique typing. :(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((("); } @@ -98,7 +91,7 @@ private static void printTypeDifferencesSuggestions(ArrayList poke } } - @RequiresApi(api = Build.VERSION_CODES.N) private static int getDexIDOf(String pokemon, HashMap formsByPokedex) { + private static int getDexIDOf(String pokemon, HashMap formsByPokedex) { final int[] returner = {-1}; formsByPokedex.forEach((integer, formSettings) -> @@ -322,7 +315,8 @@ private static void printFormsXml(ArrayList pokemonWithMultipleFor stringBuilder.append(" \n"); HashMap formHash = pokemonFormsByName.get(form.getPokemon()); for (Form subform : form.getForms()) { - PokemonSettings poke = formHash.get(subform.getForm()); + PokemonSettings poke = formHash.containsKey(subform.getForm()) ? formHash.get(subform.getForm()) + : formHash.get(null); int value = -1; // Default value should be ignored by GoIV since it won't yield a match if (poke != null) { value = poke.getStats().getBaseAttack(); @@ -340,7 +334,8 @@ private static void printFormsXml(ArrayList pokemonWithMultipleFor HashMap formHash = pokemonFormsByName.get(form.getPokemon()); for (Form subform : form.getForms()) { - PokemonSettings poke = formHash.get(subform.getForm()); + PokemonSettings poke = formHash.containsKey(subform.getForm()) ? formHash.get(subform.getForm()) + : formHash.get(null); int value = -1; // Default value should be ignored by GoIV since it won't yield a match if (poke != null) { value = poke.getStats().getBaseDefense(); @@ -359,7 +354,8 @@ private static void printFormsXml(ArrayList pokemonWithMultipleFor stringBuilder.append(" \n"); HashMap formHash = pokemonFormsByName.get(form.getPokemon()); for (Form subform : form.getForms()) { - PokemonSettings poke = formHash.get(subform.getForm()); + PokemonSettings poke = formHash.containsKey(subform.getForm()) ? formHash.get(subform.getForm()) + : formHash.get(null); int value = -1; // Default value should be ignored by GoIV since it won't yield a match if (poke != null) { value = poke.getStats().getBaseStamina(); @@ -384,11 +380,9 @@ private static void printFormsXml(ArrayList pokemonWithMultipleFor * @return */ private static String formName(String form, String pokemon) { + form = form.replaceFirst("MEWTWO_A", "MEWTWO_Armored"); String simpleName = form.substring(pokemon.length() + 1); // Skip past pokemon name and underscore - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - return titleCase(simpleName) + " Form"; - } - throw new Error("Run the generator with a higher java version"); + return titleCase(simpleName) + " Form"; } /** @@ -398,10 +392,7 @@ private static String formName(String form, String pokemon) { * @return */ private static String titleCase(String str) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - return Arrays.stream(str.toLowerCase().split("[ _]")).map(word -> Character.toTitleCase(word.charAt(0)) + word.substring(1)).collect(Collectors.joining(" ")); - } - throw new Error("Run the generator with a higher java version"); + return Arrays.stream(str.toLowerCase().split("[ _]")).map(word -> Character.toTitleCase(word.charAt(0)) + word.substring(1)).collect(Collectors.joining(" ")); } private static void writeFile(String fileName, String content) { diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/ApplicationDatabaseUpdaterPoke.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/AvatarCustomization.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/BadgeSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Camera_.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/DailyQuest.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Encounter.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/EvolutionBranch.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Food.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Form.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FormSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/FriendshipMilestoneSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Gender.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GenderSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymBadgeSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/GymLevel.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapCategoryDisplay.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapItemDisplay.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/IapSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java similarity index 98% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java index f2a126c44..6d6348896 100644 --- a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java +++ b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/ItemTemplate.java @@ -57,7 +57,7 @@ public class ItemTemplate { @SerializedName("genderSettings") @Expose private GenderSettings genderSettings; - @SerializedName("pokemonSettings") + @SerializedName("pokemon") @Expose private PokemonSettings pokemonSettings; @SerializedName("weatherAffinities") @@ -72,7 +72,7 @@ public class ItemTemplate { @SerializedName("camera") @Expose private Camera_ camera; - @SerializedName("moveSequenceSettings") + @SerializedName("moveSequence") @Expose private MoveSequenceSettings moveSequenceSettings; diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/LuckyPokemonSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/MoveSequenceSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PlayerLevel.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java similarity index 95% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java index db5a3bec6..b6a345360 100644 --- a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java +++ b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PogoJson.java @@ -7,7 +7,7 @@ public class PogoJson { - @SerializedName("itemTemplates") + @SerializedName("itemTemplate") @Expose private List itemTemplates = null; @SerializedName("timestampMs") diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonScaleSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java similarity index 97% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java index b68c50dd0..7f0cbe0ef 100644 --- a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java +++ b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonSettings.java @@ -17,13 +17,13 @@ public void setTemplateID(String templateID) { private String templateID; - @SerializedName("pokemonId") + @SerializedName("uniqueId") @Expose private String pokemonId; @SerializedName("modelScale") @Expose private Double modelScale; - @SerializedName("type") + @SerializedName("type1") @Expose private String type; @SerializedName("type2") @@ -44,10 +44,10 @@ public void setTemplateID(String templateID) { @SerializedName("cinematicMoves") @Expose private List cinematicMoves = null; - @SerializedName("animationTime") + @SerializedName("animTime") @Expose private List animationTime = null; - @SerializedName("evolutionIds") + @SerializedName("evolution") @Expose private List evolutionIds = null; @SerializedName("evolutionPips") @@ -101,7 +101,7 @@ public void setTemplateID(String templateID) { @SerializedName("isDeployable") @Expose private Boolean isDeployable; - @SerializedName("rarity") + @SerializedName("pokemonClass") @Expose private String rarity; @SerializedName("form") @@ -109,7 +109,7 @@ public void setTemplateID(String templateID) { private String form; - @SerializedName("parentPokemonId") + @SerializedName("parentId") @Expose private String parentPokemonId; diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/PokemonUpgrades.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/QuestSettings.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/Stats.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/TypeEffective.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherAffinities.java diff --git a/app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java similarity index 100% rename from app/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java rename to devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/JsonStruct/WeatherBonusSettings.java diff --git a/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/SpecificFormSettings.java b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/SpecificFormSettings.java new file mode 100644 index 000000000..a00e9e88a --- /dev/null +++ b/devMethods/src/main/java/com/kamron/pogoiv/devMethods/gameMasterParser/SpecificFormSettings.java @@ -0,0 +1,40 @@ +package com.kamron.pogoiv.devMethods.gameMasterParser; + +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.Form; +import com.kamron.pogoiv.devMethods.gameMasterParser.JsonStruct.FormSettings; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +public class SpecificFormSettings extends FormSettings { + static String NORMAL_FORM = "NORMAL"; + static String[] COMMON_FORMS = {"SHADOW", "PURIFIED", "FALL_2019", "COPY_2019", "VS_2019"}; + static String[] REGION_FORMS = {"ALOLA", "GALARIAN"}; + + private List forms = null; + + public SpecificFormSettings(FormSettings formSettings) { + setPokemon(formSettings.getPokemon()); + setForms(formSettings.getForms()); + } + + @Override public List getForms() { + List allForms = super.getForms(); + if (allForms == null) return null; + if (forms != null) return forms; + + forms = new ArrayList<>(); + Pattern pattern = Pattern.compile("^.*_(" + String.join("|", COMMON_FORMS) + ")$"); + for (Form form : allForms) { + if (!pattern.matcher(form.getForm()).matches()) { + forms.add(form); + } + } + if (forms.size() == 1 && forms.get(0).getForm().matches("^.*_(" + NORMAL_FORM + ")$")) { + forms.remove(0); + } + return forms; + } + +} diff --git a/settings.gradle b/settings.gradle index d8b0affbc..3d1d98eae 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,3 @@ include ':app' include ':openCVLibrary330' +include ':devMethods' From 4a3e78e7ef37b77eaf8587dc5a54b53a19781548 Mon Sep 17 00:00:00 2001 From: udnp Date: Mon, 22 Jun 2020 15:03:07 +0900 Subject: [PATCH 04/51] [C] revert to avoid conflicting with origin/master. --- app/src/main/res/values/forms.xml | 219 +++++++-------------------- app/src/main/res/values/integers.xml | 88 +++++------ 2 files changed, 99 insertions(+), 208 deletions(-) diff --git a/app/src/main/res/values/forms.xml b/app/src/main/res/values/forms.xml index ab979dfcf..8b323985a 100644 --- a/app/src/main/res/values/forms.xml +++ b/app/src/main/res/values/forms.xml @@ -19,12 +19,9 @@ 2 2 2 - 2 2 28 - 2 - 2 - 20 + 9 4 4 3 @@ -40,8 +37,6 @@ 2 4 4 - 2 - 2 2 2 2 @@ -49,7 +44,7 @@ 2 2 5 - + Normal Form @@ -105,9 +100,6 @@ Normal Form Alola Form - - Normal Form - Galarian Form Normal Form Armored Form @@ -140,12 +132,6 @@ Z Form Exclamation Point Form Question Mark Form - - Normal Form - Galarian Form - - Normal Form - Galarian Form 00 Form 01 Form @@ -156,17 +142,6 @@ 06 Form 07 Form 08 Form - 09 Form - 10 Form - 11 Form - 12 Form - 13 Form - 14 Form - 15 Form - 16 Form - 17 Form - 18 Form - 19 Form Normal Form Sunny Form @@ -226,53 +201,47 @@ Dragon Form Dark Form Fairy Form - + Red Striped Form Blue Striped Form - + Standard Form Zen Form - + Spring Form Summer Form Autumn Form Winter Form - + Spring Form Summer Form Autumn Form Winter Form - - Normal Form - Female Form - - Normal Form - Female Form - + Incarnate Form Therian Form - + Incarnate Form Therian Form - + Incarnate Form Therian Form - + Normal Form - White Form Black Form - + White Form + Ordinary Form Resolute Form - + Aria Form Pirouette Form - + Normal Form - Douse Form Shock Form Burn Form Chill Form + Douse Form @@ -329,9 +298,6 @@ 144 144 - - 174 - 174 300 182 @@ -364,12 +330,6 @@ 136 136 136 - - 58 - 58 - - 142 - 142 116 116 @@ -380,17 +340,6 @@ 116 116 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 139 139 @@ -450,54 +399,48 @@ 238 238 238 - + 189 189 - + 263 243 - + 115 115 115 115 - + 198 198 198 198 - - 115 - 115 - - 159 - 159 - + 266 238 - + 266 295 - + 261 289 - + 246 - 310 310 - + 310 + 260 260 - + 250 269 - + 252 - 252 252 252 252 - + 252 + 70 @@ -553,9 +496,6 @@ 186 186 - - 197 - 197 182 278 @@ -588,12 +528,6 @@ 91 91 91 - - 80 - 80 - - 128 - 128 116 116 @@ -604,17 +538,6 @@ 116 116 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 - 116 139 139 @@ -674,53 +597,47 @@ 238 238 238 - + 129 129 - + 114 202 - + 100 100 100 100 - + 146 146 146 146 - - 134 - 134 - - 178 - 178 - + 164 189 - + 164 161 - + 182 179 - + 170 - 183 183 - + 183 + 192 192 - + 225 188 - + 199 - 199 199 199 199 + 199 @@ -777,9 +694,6 @@ 155 155 - - 163 - 163 214 214 @@ -812,12 +726,6 @@ 134 134 134 - - 116 - 116 - - 186 - 186 155 155 @@ -828,17 +736,6 @@ 155 155 155 - 155 - 155 - 155 - 155 - 155 - 155 - 155 - 155 - 155 - 155 - 155 172 172 @@ -898,52 +795,46 @@ 237 237 237 - + 172 172 - + 233 233 - + 155 155 155 155 - + 190 190 190 190 - - 146 - 146 - - 225 - 225 - + 188 188 - + 188 188 - + 205 205 - + 245 - 245 245 - + 245 + 209 209 - + 225 225 - + 174 - 174 174 174 174 + 174 diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml index 6c7ca877f..17f268655 100644 --- a/app/src/main/res/values/integers.xml +++ b/app/src/main/res/values/integers.xml @@ -652,7 +652,7 @@ 252 118 226 - + 111 143 @@ -1305,7 +1305,7 @@ 199 99 190 - + 128 155 @@ -1958,7 +1958,7 @@ 174 130 264 - + -1 0 @@ -2545,7 +2545,7 @@ 581 582 -1 - 584 + 585 -1 -1 587 @@ -2611,7 +2611,7 @@ -1 -1 807 - + 25 100 @@ -3136,16 +3136,16 @@ -1 50 -1 - 50 - 200 + 25 + 100 -1 50 -1 50 -1 -1 - 50 - 200 + 25 + 100 -1 25 100 @@ -3197,10 +3197,10 @@ 25 100 -1 - -1 + 50 -1 -1 - 200 + 50 -1 50 -1 @@ -3228,7 +3228,7 @@ 50 -1 -1 - 200 + 50 -1 -1 50 @@ -3264,7 +3264,7 @@ -1 400 -1 - + 0 0 @@ -4028,7 +4028,7 @@ -1 -1 -1 - 18 + -1 -1 -1 -1 @@ -4068,7 +4068,7 @@ -1 -1 -1 - 19 + 18 -1 -1 -1 @@ -4119,7 +4119,7 @@ -1 -1 -1 - 20 + 19 -1 -1 -1 @@ -4181,8 +4181,8 @@ -1 -1 -1 - 21 - 22 + -1 + -1 -1 -1 -1 @@ -4245,7 +4245,7 @@ -1 -1 -1 - 23 + 20 -1 -1 -1 @@ -4269,7 +4269,7 @@ -1 -1 -1 - 24 + 21 -1 -1 -1 @@ -4304,7 +4304,7 @@ -1 -1 -1 - 25 + 22 -1 -1 -1 @@ -4330,8 +4330,8 @@ -1 -1 -1 - 26 - 27 + 23 + 24 -1 -1 -1 @@ -4339,9 +4339,9 @@ -1 -1 -1 - 28 - 29 - 30 + 25 + 26 + 27 -1 -1 -1 @@ -4397,7 +4397,7 @@ -1 -1 -1 - 31 + 28 -1 -1 -1 @@ -4405,13 +4405,13 @@ -1 -1 -1 - 32 + 29 -1 -1 -1 -1 - 33 - 34 + 30 + 31 -1 -1 -1 @@ -4468,12 +4468,12 @@ -1 -1 -1 - 35 + 32 -1 -1 -1 -1 - 36 + 33 -1 -1 -1 @@ -4503,15 +4503,15 @@ -1 -1 -1 - 37 - 38 + 34 + 35 -1 -1 -1 -1 -1 - 39 - 40 + -1 + -1 -1 -1 -1 @@ -4559,16 +4559,16 @@ -1 -1 -1 - 41 - 42 + 36 + 37 -1 -1 - 43 - 44 - 45 - 46 - 47 + 38 + 39 + 40 + 41 + 42 -1 -1 - + From d100cbb86b5a6d41a50cfc99d67a425a50e1f953 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Tue, 1 Dec 2020 21:24:31 +0100 Subject: [PATCH 05/51] First update for level 50 Adds CpM, Candy and Candy XL values for levels 40.5 to 50. Still needs an update to actually scan Candy XL and Mega Energy. --- .../ocrhelper/OcrHelper.java | 15 ++++-- .../com/kamron/pogoiv/scanlogic/Data.java | 46 ++++++++++++------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java index 5427b170c..9c30711aa 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java @@ -1231,22 +1231,27 @@ private LevelRange refineLevelEstimate(int trainerLevel, Optional pokem } int scannedPowerUpCost = pokemonPowerUpCandyCost.get(); - if (!Data.isValidPowerUpCandyCost(scannedPowerUpCost)) { + boolean matches = false; + for (int value : Data.POWER_UP_CANDY_VALUES) { + if (value == scannedPowerUpCost) { + matches = true; + break; + } + } + if (!matches) { return new LevelRange(estimatedPokemonLevel); // The scanned power up candy cost is invalid } // If scanned arc-level is maxed out, we need to consider that the pokemon might have an even higher level. double higherBound = estimatedPokemonLevel; for (double level = estimatedPokemonLevel + 0.5; level <= Data.MAXIMUM_WILD_POKEMON_LEVEL; level += 0.5) { - int powerUpCostForLevel = Data.POWER_UP_CANDY_COSTS[Data.maxPokeLevelToIndex(level)]; + // It either costs candy or candy xl only! + int powerUpCostForLevel = Data.POWER_UP_CANDY_VALUES[Data.maxPokeLevelToIndex(level)]; if (powerUpCostForLevel == scannedPowerUpCost) { if (higherBound < level) { // Found a higher level with the same candy power up cost higherBound = level; } - } else if (powerUpCostForLevel > scannedPowerUpCost) { - // Costs are ascending ordered. There won't be a cost equal to the input in the array. - break; } } diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java index 8a5b7f308..f409bb83e 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java @@ -8,10 +8,11 @@ public class Data { public static final int MINIMUM_TRAINER_LEVEL = 1; - public static final int MAXIMUM_TRAINER_LEVEL = 40; + public static final int MAXIMUM_TRAINER_LEVEL = 50; public static final int MINIMUM_POKEMON_LEVEL = 1; - public static final int MAXIMUM_POKEMON_LEVEL = 40; + public static final int MAXIMUM_POKEMON_LEVEL = 50; public static final int MAXIMUM_WILD_POKEMON_LEVEL = 35; + public static final int ADDITIONAL_POKEMON_LEVEL = 10; public static final float LEVEL_ARC_SQUISH_FACTOR = 0.95f; //The level arc is no longer a perfect half circle @@ -32,12 +33,36 @@ public class Data { 0.737769484519958f, 0.740785579737136f, 0.743789434432983f, 0.746781197247765f, 0.749761044979095f, 0.752729099732281f, 0.75568550825119f, 0.758630370209851f, 0.761563837528229f, 0.76448604959218f, 0.767397165298462f, 0.770297293677362f, 0.773186504840851f, 0.776064947064992f, 0.778932750225067f, - 0.781790050767666f, 0.784636974334717f, 0.787473608513275f, 0.790300011634827f}; + 0.781790050767666f, 0.784636974334717f, 0.787473608513275f, 0.790300011634827f + + // New values for levels 41 - 50 (from https://www.reddit.com/r/TheSilphRoad/comments/jwjbw4/level_4550_expected_cpms_based/) + ,0.792803950958807f ,0.795300006866455f ,0.797803921486970f ,0.800300002098083f ,0.802803892322847f + ,0.805299997329711f ,0.807803863460723f ,0.810299992561340f ,0.812803834895026f ,0.815299987792968f + ,0.817803806620319f ,0.820299983024597f ,0.822803778631297f ,0.825299978256225f ,0.827803750922782f + ,0.830299973487854f ,0.832803753381377f ,0.835300028324127f ,0.837803755931569f ,0.840300023555755f + }; public static final int[] POWER_UP_CANDY_COSTS = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, - 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15 }; + 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + + public static final int[] POWER_UP_CANDY_XL_COSTS = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 17, 17, 20, 20, 20, 20 + }; + + public static final int[] POWER_UP_CANDY_VALUES = new int[POWER_UP_CANDY_COSTS.length]; + + static { + for (int i = 0; i < POWER_UP_CANDY_COSTS.length; i++) { + POWER_UP_CANDY_VALUES[i] = Math.max(POWER_UP_CANDY_COSTS[i], POWER_UP_CANDY_XL_COSTS[i]); + } + } + public static int arcInitX; public static int arcInitY; public static int[] arcX; @@ -114,7 +139,7 @@ public static double getLevelCpM(double level) { * It used to be 1.5, but was changed around december 2017. */ public static double trainerLevelToMaxPokeLevel(int trainerLevel) { - return Math.min(trainerLevel + 2, 40); + return Math.min(trainerLevel + ADDITIONAL_POKEMON_LEVEL, MAXIMUM_POKEMON_LEVEL); } /* @@ -127,17 +152,6 @@ public static int trainerLevelToMaxPokeLevelIndex(int trainerLevel) { return maxPokeLevelToIndex(trainerLevelToMaxPokeLevel(trainerLevel)); } - public static boolean isValidPowerUpCandyCost(int powerUpCandyCost) { - for (int currentCost : POWER_UP_CANDY_COSTS) { - if (currentCost == powerUpCandyCost) { - return true; - } else if (currentCost > powerUpCandyCost) { - break; // Costs are ascending ordered. There won't be a cost equal to the input in the array. - } - } - return false; - } - // should be pretty fast https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Java public static int levenshteinDistance(CharSequence lhs, CharSequence rhs) { if (rhs == null) { From c90e2fe7703a84a903f9b369c9ac587bb285309c Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Sat, 5 Dec 2020 17:35:07 +0100 Subject: [PATCH 06/51] Fixed level 50 power up values --- app/src/main/java/com/kamron/pogoiv/Pokefly.java | 3 +-- .../fractions/InputFraction.java | 6 +++--- .../pokeflycomponents/ocrhelper/OcrHelper.java | 6 ++---- .../java/com/kamron/pogoiv/scanlogic/Data.java | 15 +++++++-------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/Pokefly.java b/app/src/main/java/com/kamron/pogoiv/Pokefly.java index b47b07c6a..ba5aa40cf 100644 --- a/app/src/main/java/com/kamron/pogoiv/Pokefly.java +++ b/app/src/main/java/com/kamron/pogoiv/Pokefly.java @@ -26,7 +26,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; -import android.view.animation.AnimationUtils; import android.view.inputmethod.InputMethodManager; import android.widget.FrameLayout; import android.widget.ImageView; @@ -475,7 +474,7 @@ private void createArcPointer() { */ public void setArcPointer(double pokeLevel) { - int index = Data.maxPokeLevelToIndex(pokeLevel); + int index = Data.levelToLevelIdx(pokeLevel); //If the pokemon is overleveled (Raid catch or weather modifier the arc indicator will be stuck at max) if (index >= Data.arcX.length) { diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/InputFraction.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/InputFraction.java index fa7e5803a..c92be2ec5 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/InputFraction.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/InputFraction.java @@ -254,7 +254,7 @@ private void resetToSpinner() { private void adjustArcPointerBar(double estimatedPokemonLevel) { pokefly.setArcPointer(estimatedPokemonLevel); - arcAdjustBar.setProgress(Data.maxPokeLevelToIndex(estimatedPokemonLevel)); + arcAdjustBar.setProgress(Data.levelToLevelIdx(estimatedPokemonLevel)); updateIVInputFractionPreview(); } @@ -306,7 +306,7 @@ public void decrementLevel() { @OnClick(R.id.btnIncrementLevel) public void incrementLevel() { - if (Data.maxPokeLevelToIndex(Pokefly.scanData.getEstimatedPokemonLevel().min) < arcAdjustBar.getMax()) { + if (Data.levelToLevelIdx(Pokefly.scanData.getEstimatedPokemonLevel().min) < arcAdjustBar.getMax()) { Pokefly.scanData.getEstimatedPokemonLevel().inc(); adjustArcPointerBar(Pokefly.scanData.getEstimatedPokemonLevel().min); } @@ -317,7 +317,7 @@ public void incrementLevel() { */ private void createArcAdjuster() { // The max seek bar value will be the maximum wild pokemon level or the trainer max capture level if higher - arcAdjustBar.setMax(Math.max(Data.maxPokeLevelToIndex(Data.MAXIMUM_WILD_POKEMON_LEVEL), + arcAdjustBar.setMax(Math.max(Data.levelToLevelIdx(Data.MAXIMUM_WILD_POKEMON_LEVEL), Data.trainerLevelToMaxPokeLevelIndex(pokefly.getTrainerLevel()))); arcAdjustBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java index 9c30711aa..83a7051d7 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java @@ -16,7 +16,6 @@ import com.kamron.pogoiv.GoIVSettings; import com.kamron.pogoiv.Pokefly; import com.kamron.pogoiv.scanlogic.Data; -import com.kamron.pogoiv.scanlogic.IVCombination; import com.kamron.pogoiv.scanlogic.PokeInfoCalculator; import com.kamron.pogoiv.scanlogic.Pokemon; import com.kamron.pogoiv.scanlogic.ScanData; @@ -27,7 +26,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; -import java.util.Map; import timber.log.Timber; @@ -169,7 +167,7 @@ private static double getPokemonLevelFromImg(@NonNull Bitmap pokemonImage, int t double previousEstPokemonLevel = estimatedPokemonLevel + 0.5; // Initial value out of range int previousLevelDistance = -1; // Initial value indicating no found white pixels for (double estPokemonLevel = estimatedPokemonLevel; estPokemonLevel >= 1.0; estPokemonLevel -= 0.5) { - int index = Data.maxPokeLevelToIndex(estPokemonLevel); + int index = Data.levelToLevelIdx(estPokemonLevel); int x = Data.arcX[index]; int y = Data.arcY[index]; int whiteLineDistance = getCardinalWhiteLineDistFromImg(pokemonImage, x, y); @@ -1246,7 +1244,7 @@ private LevelRange refineLevelEstimate(int trainerLevel, Optional pokem double higherBound = estimatedPokemonLevel; for (double level = estimatedPokemonLevel + 0.5; level <= Data.MAXIMUM_WILD_POKEMON_LEVEL; level += 0.5) { // It either costs candy or candy xl only! - int powerUpCostForLevel = Data.POWER_UP_CANDY_VALUES[Data.maxPokeLevelToIndex(level)]; + int powerUpCostForLevel = Data.POWER_UP_CANDY_VALUES[Data.levelToLevelIdx(level)]; if (powerUpCostForLevel == scannedPowerUpCost) { if (higherBound < level) { // Found a higher level with the same candy power up cost diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java index f409bb83e..b9ccb24cb 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java @@ -45,14 +45,14 @@ public class Data { public static final int[] POWER_UP_CANDY_COSTS = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, - 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; public static final int[] POWER_UP_CANDY_XL_COSTS = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 17, 17, 20, 20, 20, 20 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 17, 17, 17, 17, 20, 20, 20, 20 }; public static final int[] POWER_UP_CANDY_VALUES = new int[POWER_UP_CANDY_COSTS.length]; @@ -110,8 +110,7 @@ public static void setupArcPoints(ScanPoint arcInit, int arcRadius, int trainerL * This method adjusts a level to a level index (levelIdx), by doubling it * and subtracting 2. */ - public static int maxPokeLevelToIndex(double level) { - + public static int levelToLevelIdx(double level) { return (int) ((level - 1) * 2); } @@ -131,7 +130,7 @@ public static double levelIdxToLevel(int levelIdx) { * @return Associated CpM. */ public static double getLevelCpM(double level) { - return CpM[maxPokeLevelToIndex(level)]; + return CpM[levelToLevelIdx(level)]; } /** @@ -149,7 +148,7 @@ public static double trainerLevelToMaxPokeLevel(int trainerLevel) { */ public static int trainerLevelToMaxPokeLevelIndex(int trainerLevel) { // This is Math.min(2 * trainerLevel + 1, 79). - return maxPokeLevelToIndex(trainerLevelToMaxPokeLevel(trainerLevel)); + return levelToLevelIdx(trainerLevelToMaxPokeLevel(trainerLevel)); } // should be pretty fast https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Java From c339f08d2292ff069e6b7d6d884d98b565341687 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Sat, 5 Dec 2020 17:50:51 +0100 Subject: [PATCH 07/51] Add candy XL costs to the power up fraction It also redoes how it determines the costs. Instead of doing the candy costs again somewhere else, reuse the array from the Data class. It also stores all costs into the UpgradeCost class. --- .../fractions/PowerUpFraction.java | 4 + .../ocrhelper/OcrHelper.java | 6 +- .../com/kamron/pogoiv/scanlogic/Data.java | 27 ++++- .../pogoiv/scanlogic/PokeInfoCalculator.java | 52 ++------- .../kamron/pogoiv/scanlogic/UpgradeCost.java | 8 +- app/src/main/res/layout/fraction_power_up.xml | 103 ++++++++++++------ app/src/main/res/values/strings.xml | 1 + 7 files changed, 121 insertions(+), 80 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/PowerUpFraction.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/PowerUpFraction.java index 0bd04f28b..a1baf2d4a 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/PowerUpFraction.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/PowerUpFraction.java @@ -74,6 +74,8 @@ public class PowerUpFraction extends Fraction implements ReactiveColorListener { LinearLayout pokeSpamView; @BindView(R.id.exResCandy) TextView exResCandy; + @BindView(R.id.exResXlCandy) + TextView exResXlCandy; @@ -295,6 +297,8 @@ private void setEstimateCostTextboxes(ScanResult scanResult, double selectedLeve .getCandyCostForEvolution(scanResult.pokemon, selectedPokemon); String candyCostText = cost.candy + evolutionCandyCost + ""; exResCandy.setText(candyCostText); + String candyXlCostText = Integer.toString(cost.candyXl); + exResXlCandy.setText(candyXlCostText); DecimalFormat formater = new DecimalFormat(); exResStardust.setText(formater.format(cost.dust)); } diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java index 83a7051d7..d204ac1aa 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/ocrhelper/OcrHelper.java @@ -1230,8 +1230,8 @@ private LevelRange refineLevelEstimate(int trainerLevel, Optional pokem int scannedPowerUpCost = pokemonPowerUpCandyCost.get(); boolean matches = false; - for (int value : Data.POWER_UP_CANDY_VALUES) { - if (value == scannedPowerUpCost) { + for (double level = 1; level < Data.MAXIMUM_POKEMON_LEVEL; level += 0.5) { + if (Data.costForLevel(level).getAnyCandy() == scannedPowerUpCost) { matches = true; break; } @@ -1244,7 +1244,7 @@ private LevelRange refineLevelEstimate(int trainerLevel, Optional pokem double higherBound = estimatedPokemonLevel; for (double level = estimatedPokemonLevel + 0.5; level <= Data.MAXIMUM_WILD_POKEMON_LEVEL; level += 0.5) { // It either costs candy or candy xl only! - int powerUpCostForLevel = Data.POWER_UP_CANDY_VALUES[Data.levelToLevelIdx(level)]; + int powerUpCostForLevel = Data.costForLevel(level).getAnyCandy(); if (powerUpCostForLevel == scannedPowerUpCost) { if (higherBound < level) { // Found a higher level with the same candy power up cost diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java index b9ccb24cb..10880a607 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/Data.java @@ -42,24 +42,35 @@ public class Data { ,0.830299973487854f ,0.832803753381377f ,0.835300028324127f ,0.837803755931569f ,0.840300023555755f }; - public static final int[] POWER_UP_CANDY_COSTS = { + private static final int[] POWER_UP_CANDY_COSTS = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - public static final int[] POWER_UP_CANDY_XL_COSTS = { + private static final int[] POWER_UP_CANDY_XL_COSTS = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 17, 17, 17, 17, 20, 20, 20, 20 }; - public static final int[] POWER_UP_CANDY_VALUES = new int[POWER_UP_CANDY_COSTS.length]; + private static final int[] POWER_UP_STARDUST_COSTS = { + 200, 200, 200, 200, 400, 400, 400, 400, 600, 600, 600, 600, 800, 800, 800, 800, 1000, 1000, 1000, 1000, + 1300, 1300, 1300, 1300, 1600, 1600, 1600, 1600, 1900, 1900, 1900, 1900, 2200, 2200, 2200, 2200, + 2500, 2500, 2500, 2500, 3000, 3000, 3000, 3000, 3500, 3500, 3500, 3500, 4000, 4000, 4000, 4000, + 4500, 4500, 4500, 4500, 5000, 5000, 5000, 5000, 6000, 6000, 6000, 6000, 7000, 7000, 7000, 7000, + 8000, 8000, 8000, 8000, 9000, 9000, 9000, 9000, 10000, 10000, 10000, 10000, + 11000, 11000, 11000, 11000, 12000, 12000, 12000, 12000, 13000, 13000, 13000, 13000, + 14000, 14000, 14000, 14000, 15000, 15000 + }; + + private static final UpgradeCost[] POWER_UP_COSTS; static { + POWER_UP_COSTS = new UpgradeCost[POWER_UP_CANDY_COSTS.length]; for (int i = 0; i < POWER_UP_CANDY_COSTS.length; i++) { - POWER_UP_CANDY_VALUES[i] = Math.max(POWER_UP_CANDY_COSTS[i], POWER_UP_CANDY_XL_COSTS[i]); + POWER_UP_COSTS[i] = new UpgradeCost(POWER_UP_STARDUST_COSTS[i], POWER_UP_CANDY_COSTS[i], POWER_UP_CANDY_XL_COSTS[i]); } } @@ -101,6 +112,14 @@ public static void setupArcPoints(ScanPoint arcInit, int arcRadius, int trainerL } } + public static UpgradeCost costForLevel(double level) { + return costForIndex(levelToLevelIdx(level)); + } + + public static UpgradeCost costForIndex(int idx) { + return POWER_UP_COSTS[idx]; + } + /** * Convert a pokemon/trainer level to a level index (levelIdx in code). * The mapping is invertible, but level indexes can be used to index an array (like Data.CpM), or seekbars. diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/PokeInfoCalculator.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/PokeInfoCalculator.java index 797e7d7dc..4d427584d 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/PokeInfoCalculator.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/PokeInfoCalculator.java @@ -250,56 +250,26 @@ private void populatePokemon(@NonNull GoIVSettings settings, @NonNull Resources */ public UpgradeCost getUpgradeCost(double goalLevel, double estimatedPokemonLevel, boolean isLucky) { int neededCandy = 0; + int neededCandyXl = 0; int neededStarDust = 0; - while (estimatedPokemonLevel != goalLevel) { - int rank = 5; - if ((estimatedPokemonLevel % 10) >= 1 && (estimatedPokemonLevel % 10) <= 2.5) { - rank = 1; - } else if ((estimatedPokemonLevel % 10) > 2.5 && (estimatedPokemonLevel % 10) <= 4.5) { - rank = 2; - } else if ((estimatedPokemonLevel % 10) > 4.5 && (estimatedPokemonLevel % 10) <= 6.5) { - rank = 3; - } else if ((estimatedPokemonLevel % 10) > 6.5 && (estimatedPokemonLevel % 10) <= 8.5) { - rank = 4; - } - if (estimatedPokemonLevel <= 10.5) { - neededCandy++; - neededStarDust += rank * 200; - } else if (estimatedPokemonLevel > 10.5 && estimatedPokemonLevel <= 20.5) { - neededCandy += 2; - neededStarDust += 1000 + (rank * 300); - } else if (estimatedPokemonLevel > 20.5 && estimatedPokemonLevel <= 25.5) { - neededCandy += 3; - neededStarDust += 2500 + (rank * 500); - } else if (estimatedPokemonLevel > 25.5 && estimatedPokemonLevel <= 30.5) { - neededCandy += 4; - neededStarDust += 2500 + (rank * 500); - } else if (estimatedPokemonLevel > 30.5 && estimatedPokemonLevel <= 32.5) { - neededCandy += 6; - neededStarDust += 5000 + (rank * 1000); - } else if (estimatedPokemonLevel > 32.5 && estimatedPokemonLevel <= 34.5) { - neededCandy += 8; - neededStarDust += 5000 + (rank * 1000); - } else if (estimatedPokemonLevel > 34.5 && estimatedPokemonLevel <= 36.5) { - neededCandy += 10; - neededStarDust += 5000 + (rank * 1000); - } else if (estimatedPokemonLevel > 36.5 && estimatedPokemonLevel <= 38.5) { - neededCandy += 12; - neededStarDust += 5000 + (rank * 1000); - } else if (estimatedPokemonLevel > 38.5) { - neededCandy += 15; - neededStarDust += 5000 + (rank * 1000); - } + int currentLevelIdx = Data.levelToLevelIdx(estimatedPokemonLevel); + int goalLevelIdx = Data.levelToLevelIdx(goalLevel); + + while (currentLevelIdx < goalLevelIdx) { + UpgradeCost costs = Data.costForIndex(currentLevelIdx); + neededCandy += costs.candy; + neededCandyXl += costs.candyXl; + neededStarDust += costs.dust; - estimatedPokemonLevel += 0.5; + currentLevelIdx++; } if (isLucky) { neededStarDust /= 2; } - return new UpgradeCost(neededStarDust, neededCandy); + return new UpgradeCost(neededStarDust, neededCandy, neededCandyXl); } diff --git a/app/src/main/java/com/kamron/pogoiv/scanlogic/UpgradeCost.java b/app/src/main/java/com/kamron/pogoiv/scanlogic/UpgradeCost.java index 84d295af8..ea71935ec 100644 --- a/app/src/main/java/com/kamron/pogoiv/scanlogic/UpgradeCost.java +++ b/app/src/main/java/com/kamron/pogoiv/scanlogic/UpgradeCost.java @@ -6,9 +6,15 @@ public class UpgradeCost { public final int dust; public final int candy; + public final int candyXl; - public UpgradeCost(int dust, int candy) { + public UpgradeCost(int dust, int candy, int candyXl) { this.dust = dust; this.candy = candy; + this.candyXl = candyXl; + } + + public int getAnyCandy() { + return candy > 0 ? candy : candyXl; } } diff --git a/app/src/main/res/layout/fraction_power_up.xml b/app/src/main/res/layout/fraction_power_up.xml index dcd33a16c..de2b7b2d2 100644 --- a/app/src/main/res/layout/fraction_power_up.xml +++ b/app/src/main/res/layout/fraction_power_up.xml @@ -268,16 +268,16 @@ + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="4dp" + android:text="@string/hp_expanded_box" + android:textAllCaps="true" + android:textAppearance="?android:attr/textAppearanceSmall" + app:layout_constraintBaseline_toBaselineOf="@id/exResultCP" + app:layout_constraintEnd_toStartOf="@id/exResultHP" + tools:ignore="RtlHardcoded" + android:id="@+id/textView4" /> + android:id="@+id/candyContainer" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:orientation="horizontal" + app:layout_constraintTop_toBottomOf="@+id/textView2" + tools:ignore="UseCompoundDrawables" + app:layout_constraintStart_toStartOf="@+id/exResultCP" + app:layout_constraintEnd_toEndOf="@+id/exResultCP"> + android:layout_width="17dp" + android:layout_height="17dp" + android:layout_marginTop="5dp" + android:layout_marginEnd="6dp" + android:src="@drawable/candy_icon" + android:text="@string/candy" + android:textAllCaps="true" + android:textAppearance="?android:attr/textAppearanceSmall" + tools:ignore="ContentDescription,RtlHardcoded" /> + + + + + android:orientation="horizontal" + app:layout_constraintTop_toBottomOf="@+id/textView2" + tools:ignore="UseCompoundDrawables" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> + + + + @@ -359,7 +389,7 @@ android:orientation="horizontal" app:layout_constraintEnd_toEndOf="@+id/exResultHP" app:layout_constraintStart_toStartOf="@+id/exResultHP" - app:layout_constraintTop_toTopOf="@+id/candyContainer" + app:layout_constraintTop_toTopOf="@+id/candyXlContainer" tools:ignore="UseCompoundDrawables"> @@ -389,6 +419,17 @@ app:layout_constraintEnd_toEndOf="@id/stardustContainer" app:layout_constraintStart_toStartOf="@id/stardustContainer" app:layout_constraintTop_toBottomOf="@id/stardustContainer"/> + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0674fcd80..f225cfe2a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -324,4 +324,5 @@ fastCopyToClipboard Copy to clipboard on preview Unset + Candy XL From 386229e4d09b94189cfdd93b439e27f5bbe6c1dd Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Thu, 3 Oct 2019 14:21:29 +0200 Subject: [PATCH 08/51] Define Gastrodon devolution number --- app/src/main/res/values/integers.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml index d5212f5b6..2efc90c8d 100644 --- a/app/src/main/res/values/integers.xml +++ b/app/src/main/res/values/integers.xml @@ -2391,7 +2391,7 @@ -1 419 -1 - -1 + 421 189 -1 424 From 96f5816c5ab42e1ea08280e83c805fecf5acd930 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Tue, 1 Dec 2020 21:23:23 +0100 Subject: [PATCH 09/51] Add button to manually restart appraisal Sometimes it reads wrong values (especially 0, 0, 0) and in those cases it might be handy to manually restart appraisal scanning. --- .../pokeflycomponents/AppraisalManager.java | 29 +++++++-- .../fractions/AppraisalFraction.java | 20 ++++++ .../main/res/layout/fraction_appraisal.xml | 63 +++++++++++-------- 3 files changed, 81 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/AppraisalManager.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/AppraisalManager.java index 038a55960..4177fadab 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/AppraisalManager.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/AppraisalManager.java @@ -34,6 +34,8 @@ public class AppraisalManager { private int numTouches = 0; private boolean autoAppraisalDone = false; + private boolean running = false; + public int attack = 0; public boolean attackValid = false; public int defense = 0; @@ -68,12 +70,7 @@ public void screenTouched() { // of times without actually ever starting the appraisal process if ((numTouches > 2) && (!autoAppraisalDone)) { - // Signal to the user that we're now looking for the first appraisal phase. - for (OnAppraisalEventListener eventListener : eventListeners) { - eventListener.highlightActiveUserInterface(); - } - // Scan Appraisal text after the configured delay. - autoScreenScanner.post(); + start(); } } @@ -94,6 +91,25 @@ public void reset() { autoAppraisalDone = false; } + public boolean isRunning() { + return running; + } + + public void start() { + // Signal to the user that we're now looking for the first appraisal phase. + for (OnAppraisalEventListener eventListener : eventListeners) { + eventListener.highlightActiveUserInterface(); + } + // Scan Appraisal text after the configured delay. + autoScreenScanner.post(); + running = true; + } + + public void stop() { + handler.removeCallbacks(autoScreenScanner); + addStatScanResult(null); + } + private void addStatScanResult(@Nullable IVCombination combination) { if (combination != null) { attack = combination.att; @@ -104,6 +120,7 @@ private void addStatScanResult(@Nullable IVCombination combination) { staminaValid = true; autoAppraisalDone = true; } + running = false; // Refresh the selection for (OnAppraisalEventListener eventListener : eventListeners) { eventListener.refreshSelection(); diff --git a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/AppraisalFraction.java b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/AppraisalFraction.java index 033326900..fd69bad6b 100644 --- a/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/AppraisalFraction.java +++ b/app/src/main/java/com/kamron/pogoiv/pokeflycomponents/fractions/AppraisalFraction.java @@ -10,7 +10,9 @@ import android.widget.AdapterView; import android.widget.Button; import android.widget.CheckBox; +import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.ProgressBar; import android.widget.SeekBar; import android.widget.TextView; @@ -39,6 +41,10 @@ public class AppraisalFraction extends MovableFraction implements AppraisalManag Button btnCheckIv; @BindView(R.id.statsButton) Button statsButton; + @BindView(R.id.pbScanning) + ProgressBar pbScanning; + @BindView(R.id.btnRetry) + ImageView btnRetry; @BindView(R.id.headerAppraisal) LinearLayout headerAppraisal; @@ -131,6 +137,7 @@ public void onStopTrackingTouch(SeekBar seekBar) { // Listen for new appraisal info appraisalManager.addOnAppraisalEventListener(this); + btnRetry.setImageResource(R.drawable.ic_play_circle_outline_24px); GUIColorFromPokeType.getInstance().setListenTo(this); updateGuiColors(); @@ -158,6 +165,8 @@ public int getDefaultVerticalOffset(DisplayMetrics displayMetrics) { @Override public void highlightActiveUserInterface() { spinnerLayout.setBackgroundResource(R.drawable.highlight_rectangle); + pbScanning.setVisibility(View.VISIBLE); + btnRetry.setVisibility(View.INVISIBLE); } @@ -207,6 +216,8 @@ public void onEnabled() { public void refreshSelection() { setSpinnerSelection(); spinnerLayout.setBackground(null); + pbScanning.setVisibility(View.INVISIBLE); + btnRetry.setVisibility(View.VISIBLE); } /** @@ -254,6 +265,15 @@ void checkIv() { pokefly.computeIv(); } + @OnClick(R.id.btnRetry) + void onRetryClick() { + if (appraisalManager.isRunning()) { + appraisalManager.stop(); + } else { + appraisalManager.start(); + } + } + @Override public void updateGuiColors() { int c = GUIColorFromPokeType.getInstance().getColor(); diff --git a/app/src/main/res/layout/fraction_appraisal.xml b/app/src/main/res/layout/fraction_appraisal.xml index c6a32d49f..3bd6d9e3c 100644 --- a/app/src/main/res/layout/fraction_appraisal.xml +++ b/app/src/main/res/layout/fraction_appraisal.xml @@ -135,14 +135,13 @@ app:layout_constraintTop_toTopOf="@+id/defSeek" android:textAlignment="viewEnd" tools:text="0"/> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@+id/staEnabled" + android:text="@string/sta" + app:layout_constraintStart_toStartOf="@+id/defEnabled" + app:layout_constraintTop_toBottomOf="@+id/defEnabled" + /> - - - - - + +