PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

Update needed for new Baby Pokémon

Open Wolfsblvt opened this issue 9 years ago • 19 comments

Description: We need an update here, with the new Pokémon added. Their data, their family ideas, the evolution info, etc.

I still have the problem that I do not understand how this could be added to this API here. Maybe it's time to plan ahead a bit and find a way for the other Pokémon coming soon?

Wolfsblvt avatar Dec 13 '16 10:12 Wolfsblvt

Somebody can help or advice? I think Pokémon will fail to load, because new Pokémon are not updated here.

sino123 avatar Dec 14 '16 09:12 sino123

Things like these always happen when things are just starting to roll.. :-( Please fix soon!! Thank you so very very much!

clangdev avatar Dec 14 '16 11:12 clangdev

tracked my problems down to accessing PokemonMetaRegistry.java for PICHU..

java.lang.NullPointerException at com.pokegoapi.api.pokemon.PokemonDetails.getPokemonFamily(PokemonDetails.java:98) at com.pokegoapi.api.pokemon.PokemonDetails.getCandy(PokemonDetails.java:94) at com.pokegoapi.api.pokemon.Pokemon.canPowerUp(Pokemon.java:178)

Next step.. find way to update PokemonMetaRegistry..

clangdev avatar Dec 14 '16 17:12 clangdev

So Evolutions.java, PokemonMetaRegistry.java and PokemonMoveMetaRegistry.java needs to be updated. I did an PR on Evolutions.java and added the baby Pokémon there...

@clangdev just open a copy of PokemonMetaRegistry.java and add the new 2. Gen. Baby Pokémon Meta and shoot a Pull Request

sino123 avatar Dec 14 '16 18:12 sino123

I would do that, but i don't know the right stats. I hoped/expected this MetaRegistry to be generated somehow.

Pretty sure all info is derived by POGOProtos (protobuf) https://github.com/AeonLucid/POGOProtos

clangdev avatar Dec 14 '16 19:12 clangdev

https://pokemongo.gamepress.gg/ this site has the latest stats

tommywuhaojie avatar Dec 14 '16 20:12 tommywuhaojie

@clangdev was ist possible to call getPokemonId(), getIvInPercentage() as well as the individuall values and getCP() of Pichu?

sino123 avatar Dec 15 '16 07:12 sino123

sry. currently at work and away from games. calling getPokemonId() is ok. name() and number() is set. Problems occur when I remember right if FamilyId is queried.

clangdev avatar Dec 15 '16 08:12 clangdev

@tommywuhaojie: thx, but missing info is by far more complex, like cinematic-move-animation-id.

clangdev avatar Dec 15 '16 08:12 clangdev

@clangdev dude could you do me a favour and check if I could get the current CP, IV (attack, stamina, defence) and IV in percent of a baby Pokémon? I do not have a baby Pokémon yet to test it :( ...

sino123 avatar Dec 15 '16 17:12 sino123

//CP, IV (attack, stamina, defence) and IV in percent
System.out.println(pokemon.getPokemonId().getNumber()+"# "+pokemon.getPokemonId().name()+ " CP: "+pokemon.getCp()+" IVA: "+pokemon.getIndividualAttack()+" IVS: "+pokemon.getIndividualStamina()+" IVD: "+pokemon.getIndividualDefense()+" IV%: "+pokemon.getIvInPercentage());

172# PICHU CP: 204 IVA: 14 IVS: 13 IVD: 12 IV%: 86.66

clangdev avatar Dec 15 '16 20:12 clangdev

This is not worth saying if POGOProtos has a new version, that counts it is the hash (ie the hash bypass of api) ... But its ... it is not obvious 0.49. 1 required

Furtif avatar Dec 15 '16 20:12 Furtif

Quick and dirty fix.. just to get rid of that NPE.. Evolutions.java needs to be updated otherwise and there may occur more NPEs like that with more new babies.

Values are basically quick copy and minimum customized based on Pikachu entry. Just c&p in class-body as static code.

{
		
		
		PokemonMeta metap;
		metap = new PokemonMeta();
		metap.setTemplateId(" V0172_POKEMON_PICHU");
		metap.setFamily(PokemonFamilyId.FAMILY_PIKACHU);
		metap.setPokemonClass(PokemonClass.COMMON);
		metap.setType2(PokemonType.NONE);
		metap.setPokedexHeightM(0.4);
		metap.setHeightStdDev(0.05);
		metap.setBaseStamina(70);
		metap.setCylRadiusM(0.37);
		metap.setBaseFleeRate(0.1);
		metap.setBaseAttack(112);
		metap.setDiskRadiusM(0.555);
		metap.setCollisionRadiusM(0.185);
		metap.setPokedexWeightKg(6);
		metap.setMovementType(MovementType.NORMAL);
		metap.setType1(PokemonType.ELECTRIC);
		metap.setCollisionHeadRadiusM(0.185);
		metap.setMovementTimerS(10);
		metap.setJumpTimeS(1);
		metap.setModelScale(1.48);
		metap.setUniqueId("V0172_POKEMON_PICHU");
		metap.setBaseDefense(101);
		metap.setAttackTimerS(29);
		metap.setWeightStdDev(0.75);
		metap.setCylHeightM(0.74);
		metap.setCandyToEvolve(50);
		metap.setCollisionHeightM(0.518);
		metap.setShoulderModeScale(0.5);
		metap.setBaseCaptureRate(0.16);
		metap.setParentId(PokemonId.UNRECOGNIZED);
		metap.setCylGroundM(0);
		metap.setQuickMoves(new PokemonMove[]{
				PokemonMove.QUICK_ATTACK_FAST,
				PokemonMove.THUNDER_SHOCK_FAST
		});
		metap.setCinematicMoves(new PokemonMove[]{
				PokemonMove.DISCHARGE,
				PokemonMove.THUNDER,
				PokemonMove.THUNDERBOLT
		});
		metap.setNumber(25);
		metap.setBuddyDistance(1.0);
		PokemonMetaRegistry.getMeta().put(PokemonId.PICHU, metap);
		PokemonMetaRegistry.getMeta().get(PokemonId.PIKACHU).setParentId(PokemonId.PICHU);;
		
		
		
		
	}

clangdev avatar Dec 15 '16 21:12 clangdev

@clangdev thank you sir. So in order to get the values that you queried (name, IV, and CP) I need to update manually PokeMetaRegistry and Evolutions in my own external library source?

sino123 avatar Dec 16 '16 07:12 sino123

Working on removing PokemonMetaRegistry and other registries and replacing them with server retrieved settings.

Gegy avatar Dec 16 '16 10:12 Gegy

@sino123: You do not need to change anything to get the values I posted for you.

My other posting just hotfixes NPE for querying Pichu FamilyId

clangdev avatar Dec 16 '16 10:12 clangdev

@gegy1000 make sense :)

sino123 avatar Dec 16 '16 10:12 sino123

@gegy1000 Really? That would be the best thing you could ever do! Love you.

Wolfsblvt avatar Dec 16 '16 12:12 Wolfsblvt

@clangdev how can I update the POGOProtos ? In my project I added gradle dependency compile 'com.pokegoapi:PokeGOAPI-library:0.4.1' but when I look into the POGOProtos ressources it does not have the new Pokemon in... Do I need to update/sync the library somehow?

P.S.: could not get the new Pokemon with your code, seems I have an old lib

sino123 avatar Dec 17 '16 16:12 sino123