Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

Evolve Pokemon #5

Closed
6 tasks
jabbink opened this issue Jul 20, 2016 · 10 comments
Closed
6 tasks

Evolve Pokemon #5

jabbink opened this issue Jul 20, 2016 · 10 comments

Comments

@jabbink
Copy link
Owner

jabbink commented Jul 20, 2016

General gameplay

  • Sort by Pokemon family
  • check if player has enough candy to evolve highest available Pokemon family member
  • if yes, evolve

For special occasions:

  • farm cheap pokemon
  • drop lucky egg
  • mass evolve
@mroge009
Copy link

Started working on evolutionary transfers.
Keeps just as many as you need to evolve.

pgo1

class Release : Task {
    override fun run(context: Context?) {
        val groupedPokemon = context!!.api.pokebank.pokemons.groupBy { it.pokemonId }
        groupedPokemon.forEach {
            val sorted = it.value.sortedByDescending { it.cp }
            for ((index, pokemon) in sorted.withIndex()) {
                when (pokemon.pokemonId.name) {
                    "RATTATA" -> if (index > pokemon.candy / 25) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 25} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "PIDGEY" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "WEEDLE" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "CATERPIE" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    else -> {
                        if (index > 0 && pokemon.cp < 50) {
                            println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp}")
                            pokemon.transferPokemon()
                        }
                    }
                }
            }
        }
    }
}

@bluebabyf1
Copy link

bluebabyf1 commented Jul 22, 2016

Hi mroge009, could you please tell me where do I add your code? I'm a bit noob on code aswell so your help would be grateful. Thanks

@mroge009
Copy link

mroge009 commented Jul 22, 2016

@bluebabyf1
Replace the code in your releasepokemon.kt with this if you want to use the same functionality.
It keeps Rattatas, pidgey, caterpies, and weedles but you can add others.

groupedPokemon.forEach {
            val sorted = it.value.sortedByDescending { it.cp }
            for ((index, pokemon) in sorted.withIndex()) {
                var IV = ((pokemon.individualStamina + pokemon.individualAttack + pokemon.individualDefense) * 100) / 45
                // never transfer highest rated Pokemon
                // never transfer > maxCP, unless set in obligatoryTransfer
                // stop releasing when pokemon is set in ignoredPokemon
                when (pokemon.pokemonId.name) {
                    "RATTATA" -> if (index > pokemon.candy / 25) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 25} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "PIDGEY", "WEEDLE", "CATERPIE" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    else -> {
                        if (index > 0 && (pokemon.cp < maxCP || obligatoryTransfer.contains(pokemon.pokemonId.name)) &&
                                (!ignoredPokemon.contains(pokemon.pokemonId.name)) && IV < 80) {
                            println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} and IV ${IV}")
                            pokemon.transferPokemon()
                        }
                    }
                }
            }
        }

In terms of an IDE I am using InteliJ IDEA and just pulled from the GIT repo

@pascalpfeil
Copy link

I think now is a good time to implement this, because the bot is kind of good now, and you get to level 20 easily. But from that onwards, progress is rather slow.
So a mode to fram 12 candy evolution pkmn & mass evolving in combination with a lucky egg would be really nice.

@Orabig
Copy link

Orabig commented Jul 23, 2016

I wrote an "auto evolve" feature in PR #163

@jabbink jabbink added this to the v0.4.0 milestone Jul 24, 2016
@Agronis
Copy link
Contributor

Agronis commented Jul 24, 2016

I might suggest the following parameters for "evolve_mode" if you would..

  • On connection, loop through inventory to determine possible / current evolutions.
    • Establish current_evolutions via:
    •   (((pokemon_candy / required_candy) + pokemon_candy) / required_candy) / pokemon_type_quantity
      
    • possible_evolutions are for each pokemon that has an excess of candy over quantity of pokemon.
  • Provide configuration for the following:
    • require_luckyEgg : Only evolve if lucky egg is active.
    • required_evolutions : Evolutions needed to begin evolving if require_luckyEgg is active.
      • This number should not exceed 60 to represent non-bot capabilities (avoid ban).
    • pokemon_to_evolve : Only these pokemon will be evolved.
    • build_pokedex : Evolve to higher tiers to add new pokedex registries as needed.
    • Evolved Pokemon should follow prior configuration requirements for IV/CP.

@Mixone-FinallyHere
Copy link

Mixed with the evolution multipliers could calculate if it is at best moment to evolve no?
Any progress on this yet?
I'd help but I'm not good enough with java 😢

@Orabig
Copy link

Orabig commented Aug 12, 2016

Well, @miguel, you can help by giving the formula for the computation and
explain the criteria. Someone will then use this to implement the
fonctionality...

2016-08-11 22:34 GMT+02:00 Miguel notifications@github.com:

Mixed with the evolution multipliers could calculate if it is at best
moment to evolve no?
Any progress on this yet?
I'd help but I'm not good enough with java 😢


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACFENxkZIavRT64Ekns1HeHl8TTKDwZLks5qe4dwgaJpZM4JQzeC
.

@Mixone-FinallyHere
Copy link

We would need an array then that contains floats with the multiplication value
it would be an expected value, the actual could be higher or lower but still

Then we have a table that contains the max cp of a certain pokemon at your level

If pokemons CP is at least 75% of its maximum possible (so if say Pikachu could have 1000 CP minimum CP to evolve will be 750) this can be set by user though

We then calculate what its expected CP will be from that array using the pokemons ID as an index in both tables, if that CP is higher than amount set up by user for auto transfer, and all limits existing like max amount etc... proceed to evolve if its IV was a desirable one

Also in the table having final evolutions with a value of 0 (not NULL) so that even if there is a bug trying to evolve them it wont since 0 CP is always unwanted

@Mixone-FinallyHere
Copy link

I only mention IV at the end because people might want to evolve pokemon even if they have low IV so IV check here will be in theory unrelated to unwanted IV check from captures for auto transfer

Another extra implement might be actually checking in the pokedex if they have the pokemon or not also so as to give it a certain priority

@jabbink jabbink closed this as completed Aug 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants