forked from Ishadijcks/Ishadijcks.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevolution.js
19 lines (13 loc) · 791 Bytes
/
evolution.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var checkEvolution = function(){
for( var i = 0; i<player.caughtPokemonList.length; i++){ // For all pokemon that you have captured, do the following:
if(player.caughtPokemonList[i].evoLevel != null){ // If the pokemon can actually evolve
curPokemon = player.caughtPokemonList[i]; // Grab the pokemon we are currently evaluating
if( experienceToLevel(curPokemon.experience, curPokemon.levelType) >= curPokemon.evoLevel && !curPokemon.evolved){ // If this pokemons level is high enough, and not evolved yet.
oakExplainEvolution();
$.notify("Your "+curPokemon.name+" evolved into "+curPokemon.evolution+"!", 'success');
player.caughtPokemonList[i].evolved = 1; // Mark it as evolved.
capturePokemon(curPokemon.evolution); // Capture it's evolution
}
}
}
}